Maven-helper-plugin-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
November 2009
- 1 participants
- 19 discussions
Author: tchemit
Date: 2009-11-02 00:49:10 +0100 (Mon, 02 Nov 2009)
New Revision: 628
Modified:
trunk/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-11-01 23:49:07 UTC (rev 627)
+++ trunk/pom.xml 2009-11-01 23:49:10 UTC (rev 628)
@@ -10,7 +10,7 @@
<groupId>org.nuiton</groupId>
<artifactId>maven-helper-plugin</artifactId>
- <version>1.1.0</version>
+ <version>1.1.1-SNAPSHOT</version>
<dependencies>
@@ -277,9 +277,9 @@
</mailingLists>
<scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/maven-helper-plugin/tags/maven-helper-plu…</connection>
- <developerConnection>scm:svn:http://svn.nuiton.org/svn/maven-helper-plugin/tags/maven-helper-plu…</developerConnection>
- <url>http://www.nuiton.org/repositories/browse/maven-helper-plugin/tags/maven-he…</url>
+ <connection>scm:svn:http://svn.nuiton.org/svn/maven-helper-plugin/trunk</connection>
+ <developerConnection>scm:svn:http://svn.nuiton.org/svn/maven-helper-plugin/trunk</developerConnection>
+ <url>http://www.nuiton.org/repositories/browse/maven-helper-plugin/trunk</url>
</scm>
<issueManagement>
1
0
Author: tchemit
Date: 2009-11-02 00:49:07 +0100 (Mon, 02 Nov 2009)
New Revision: 627
Added:
tags/maven-helper-plugin-1.1.0/
Log:
[maven-scm] copy for tag maven-helper-plugin-1.1.0
Property changes on: tags/maven-helper-plugin-1.1.0
___________________________________________________________________
Added: svn:ignore
+ target
*.iml
Added: svn:mergeinfo
+
1
0
Author: tchemit
Date: 2009-11-02 00:49:01 +0100 (Mon, 02 Nov 2009)
New Revision: 626
Modified:
trunk/pom.xml
Log:
[maven-release-plugin] prepare release maven-helper-plugin-1.1.0
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-11-01 23:18:31 UTC (rev 625)
+++ trunk/pom.xml 2009-11-01 23:49:01 UTC (rev 626)
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -11,7 +10,7 @@
<groupId>org.nuiton</groupId>
<artifactId>maven-helper-plugin</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.0</version>
<dependencies>
@@ -278,9 +277,9 @@
</mailingLists>
<scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/maven-helper-plugin/trunk</connection>
- <developerConnection>scm:svn:http://svn.nuiton.org/svn/maven-helper-plugin/trunk</developerConnection>
- <url>http://www.nuiton.org/repositories/browse/maven-helper-plugin/trunk</url>
+ <connection>scm:svn:http://svn.nuiton.org/svn/maven-helper-plugin/tags/maven-helper-plu…</connection>
+ <developerConnection>scm:svn:http://svn.nuiton.org/svn/maven-helper-plugin/tags/maven-helper-plu…</developerConnection>
+ <url>http://www.nuiton.org/repositories/browse/maven-helper-plugin/tags/maven-he…</url>
</scm>
<issueManagement>
@@ -316,6 +315,9 @@
<properties>
+ <platform>nuiton.org</platform>
+ <listId>maven-helper-plugin</listId>
+
<license.version>2.0.0</license.version>
<jredmine.version>1.0.0-rc-2</jredmine.version>
<maven.version>2.2.1</maven.version>
@@ -340,7 +342,6 @@
<repository.home.url>http://maven.nuiton.org/release</repository.home.url>
<!-- redmine configuration -->
- <platform>nuiton.org</platform>
<redmine.safe>false</redmine.safe>
<redmine.url>http://www.${platform}</redmine.url>
<redmine.projectId>maven-helper-plugin</redmine.projectId>
@@ -1097,7 +1098,7 @@
</goals>
<phase>install</phase>
<configuration>
- <extraFiles/>
+ <extraFiles />
<descriptionFile>${redmine.collectedFiles}</descriptionFile>
</configuration>
</execution>
1
0
Author: tchemit
Date: 2009-11-02 00:18:31 +0100 (Mon, 02 Nov 2009)
New Revision: 625
Modified:
trunk/pom.xml
Log:
remove eric :)
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-11-01 22:47:27 UTC (rev 624)
+++ trunk/pom.xml 2009-11-01 23:18:31 UTC (rev 625)
@@ -235,19 +235,7 @@
</licenses>
<developers>
-
<developer>
- <name>Eric Chatellier</name>
- <id>echatellier</id>
- <email>chatellier(a)codelutin.com</email>
- <organization>CodeLutin</organization>
- <timezone>+2</timezone>
- <roles>
- <role>Développeur</role>
- </roles>
- </developer>
-
- <developer>
<name>Tony Chemit</name>
<id>tchemit</id>
<email>chemit(a)codelutin.com</email>
1
0
r624 - in trunk/src: main/java/org/nuiton/io/xpp3 test/java/org/nuiton/io/xpp3 test/resources/org/nuiton/io/xpp3
by tchemit@users.nuiton.org 01 Nov '09
by tchemit@users.nuiton.org 01 Nov '09
01 Nov '09
Author: tchemit
Date: 2009-11-01 23:47:27 +0100 (Sun, 01 Nov 2009)
New Revision: 624
Added:
trunk/src/test/resources/org/nuiton/io/xpp3/identities2.xml
Modified:
trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Helper.java
trunk/src/test/java/org/nuiton/io/xpp3/IdentityXpp3Reader.java
trunk/src/test/java/org/nuiton/io/xpp3/Xpp3HelperTest.java
trunk/src/test/java/org/nuiton/io/xpp3/Xpp3ReaderTest.java
Log:
continue tests
Modified: trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Helper.java
===================================================================
--- trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Helper.java 2009-11-01 20:05:46 UTC (rev 623)
+++ trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Helper.java 2009-11-01 22:47:27 UTC (rev 624)
@@ -24,6 +24,7 @@
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
+
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
@@ -37,6 +38,7 @@
import java.util.Iterator;
import java.util.Map;
import java.util.ServiceLoader;
+
import org.apache.commons.lang.StringUtils;
import org.codehaus.plexus.util.xml.pull.XmlPullParser;
import org.nuiton.io.xpp3.PropertyMapper.AttributeValueToProperty;
@@ -44,34 +46,48 @@
/**
* A Helper to read some data stored in xml with a {@link Xpp3Reader}.
- *
+ * <p/>
* In this class, there is some methods to obtain a discovered {@link Xpp3Reader}
* registred by a {@link ServiceLoader} mecanism.
- *
+ *
* @author chemit
+ * @see Xpp3Reader
* @since 1.0.3
- * @see Xpp3Reader
*/
public class Xpp3Helper {
/**
- * les readers enregistres via un {@link ServiceLoader}
+ * les readers enregistres via un {@link ServiceLoader}
* sur le contrat {@link Xpp3Reader}.
*/
protected static Map<Class<?>, Xpp3Reader<?>> readers;
/**
* Read a single object from a xml stream.
- *
- * @param <O> the type of object to read
- * @param klass the type of object to read
+ *
+ * @param <O> the type of object to read
+ * @param klass the type of object to read
* @param reader the reader where to parse the xml
* @return the loaded object
- * @throws IOException if any io pb
+ * @throws IOException if any io pb
* @throws XmlPullParserException if any parsing pb
*/
public static <O> O readObject(Class<O> klass, Reader reader) throws IOException, XmlPullParserException {
+ if (klass == null) {
+ throw new NullPointerException("klass parameter can not be null");
+ }
+
+ if (reader == null) {
+ throw new NullPointerException("reader parameter can not be null");
+ }
+
+ Xpp3Reader<O> modelReader = getReader(klass);
+
+ if (modelReader == null) {
+ throw new IllegalArgumentException("could not find xpp3Reader for type " + klass);
+ }
+
O result = null;
try {
@@ -84,8 +100,6 @@
StringReader sReader = new StringReader(rawInput);
- Xpp3Reader<O> modelReader = getReader(klass);
-
result = modelReader.read(sReader);
} finally {
@@ -98,15 +112,29 @@
/**
* Read an array of objects from a xml stream.
*
- * @param <O> the type of objects to return
- * @param klass the type of object to read
+ * @param <O> the type of objects to return
+ * @param klass the type of object to read
* @param reader the reader where to parse the xml
* @return the loaded objects
- * @throws IOException if any io pb
+ * @throws IOException if any io pb
* @throws XmlPullParserException if any parsing pb
*/
public static <O> O[] readObjects(Class<O> klass, Reader reader) throws IOException, XmlPullParserException {
+ if (klass == null) {
+ throw new NullPointerException("klass parameter can not be null");
+ }
+
+ if (reader == null) {
+ throw new NullPointerException("reader parameter can not be null");
+ }
+
+ Xpp3Reader<O> modelReader = getReader(klass);
+
+ if (modelReader == null) {
+ throw new IllegalArgumentException("could not find xpp3Reader for type " + klass);
+ }
+
O[] result = null;
try {
@@ -119,11 +147,6 @@
StringReader sReader = new StringReader(rawInput);
- Xpp3Reader<O> modelReader = getReader(klass);
-
- if (modelReader == null) {
- throw new IllegalArgumentException("could not find xpp3Reader for type " + klass);
- }
result = modelReader.readArray(sReader);
} finally {
@@ -134,7 +157,6 @@
}
/**
- *
* @return an iterator on all registred {@link Xpp3Reader}.
*/
public static Iterator<Xpp3Reader<?>> getReaderItetator() {
@@ -144,8 +166,8 @@
/**
* Obtain the loaded reader which match his {@link Xpp3Reader#getType()} whith
* the given type.
- *
- * @param <T> the type of the data which should be parsed by the researched parser
+ *
+ * @param <T> the type of the data which should be parsed by the researched parser
* @param klass the type of the data which should be parsed by the researched parser
* @return the parser for the given type
*/
@@ -156,9 +178,8 @@
/**
* Clean all the registred readers.
- *
+ * <p/>
* To reload them, just call a {@link #getReader(java.lang.Class)}.
- *
*/
public static void clearReaders() {
if (readers != null) {
@@ -176,6 +197,7 @@
* <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent</li>
* <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent</li>
* </ul>
+ *
* @param parser the parser to configure
* @throws XmlPullParserException if any pb
*/
@@ -490,22 +512,20 @@
}
/**
- * Load (if {@link #readers} is {@code null} the readers via a
+ * Load (if {@link #readers} is {@code null} the readers via a
* {@link ServiceLoader} of contract {@link Xpp3Reader} and returns
* the dictionnary of discovered associated to their type
* ({@link Xpp3Reader#getType()}).
*
- *
* @return all the {@link Xpp3Reader} registred via a {@link ServiceLoader}
- * on the contract {@link Xpp3Reader} associated to their type
- * ({@link Xpp3Reader#getType()}).
- *
+ * on the contract {@link Xpp3Reader} associated to their type
+ * ({@link Xpp3Reader#getType()}).
*/
protected static Map<Class<?>, Xpp3Reader<?>> getReaders() {
if (readers == null) {
readers = new HashMap<Class<?>, Xpp3Reader<?>>();
- for (Xpp3Reader<?> r : ServiceLoader.load(Xpp3Reader.class,Xpp3Helper.class.getClassLoader())) {
-
+ for (Xpp3Reader<?> r : ServiceLoader.load(Xpp3Reader.class, Xpp3Helper.class.getClassLoader())) {
+
readers.put(r.getType(), r);
}
}
Modified: trunk/src/test/java/org/nuiton/io/xpp3/IdentityXpp3Reader.java
===================================================================
--- trunk/src/test/java/org/nuiton/io/xpp3/IdentityXpp3Reader.java 2009-11-01 20:05:46 UTC (rev 623)
+++ trunk/src/test/java/org/nuiton/io/xpp3/IdentityXpp3Reader.java 2009-11-01 22:47:27 UTC (rev 624)
@@ -8,10 +8,15 @@
* Time: 20:37:56
*/
public class IdentityXpp3Reader extends AbstractXpp3Reader<Identity> {
+
public IdentityXpp3Reader() {
- super(Identity.class, "identities", "identity");
+ this("identities");
}
+ public IdentityXpp3Reader(String root) {
+ super(Identity.class, root, "identity");
+ }
+
@Override
protected void initMappers() throws IntrospectionException {
Modified: trunk/src/test/java/org/nuiton/io/xpp3/Xpp3HelperTest.java
===================================================================
--- trunk/src/test/java/org/nuiton/io/xpp3/Xpp3HelperTest.java 2009-11-01 20:05:46 UTC (rev 623)
+++ trunk/src/test/java/org/nuiton/io/xpp3/Xpp3HelperTest.java 2009-11-01 22:47:27 UTC (rev 624)
@@ -1,16 +1,13 @@
package org.nuiton.io.xpp3;
import org.junit.Assert;
+import org.junit.BeforeClass;
import org.junit.Test;
-import org.nuiton.plugin.TestHelper;
import java.io.File;
import java.io.FileReader;
import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Iterator;
-import java.util.List;
/**
* User: chemit
@@ -19,6 +16,12 @@
*/
public class Xpp3HelperTest {
+
+ @BeforeClass
+ public static void beforeClass() {
+ Xpp3ReaderTest.beforeClass();
+ }
+
@Test
public void testGetReader() throws Exception {
Xpp3Reader<Identity> r = Xpp3Helper.getReader(Identity.class);
@@ -34,63 +37,93 @@
Assert.assertNotNull(reader);
}
+ @Test(expected = NullPointerException.class)
+ public void testReadObjectFailed() throws Exception {
+
+ Xpp3Helper.readObject(String.class, null);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testReadObjectFailed2() throws Exception {
+
+ File file = new File(Xpp3ReaderTest.dir, "identity.xml");
+ Assert.assertTrue(file.exists());
+
+ Reader input = new FileReader(file);
+ Assert.assertNotNull(input);
+
+ Xpp3Helper.readObject(null, input);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testReadObjectFailed3() throws Exception {
+
+ File file = new File(Xpp3ReaderTest.dir, "identity.xml");
+ Assert.assertTrue(file.exists());
+
+ Reader input = new FileReader(file);
+ Assert.assertNotNull(input);
+
+ Xpp3Helper.readObject(String.class, input);
+ }
+
@Test
public void testReadObject() throws Exception {
- List<String> paths = new ArrayList<String>();
- paths.add("target");
- paths.add("test-classes");
- paths.addAll(Arrays.asList(getClass().getPackage().getName().split("\\.")));
- File file = TestHelper.getFile(TestHelper.getBasedir(), paths.toArray(new String[paths.size()]));
- file = new File(file, "identity.xml");
+
+ File file = new File(Xpp3ReaderTest.dir, "identity.xml");
+ Assert.assertTrue(file.exists());
+
Reader input = new FileReader(file);
+ Assert.assertNotNull(input);
Identity result = Xpp3Helper.readObject(Identity.class, input);
- Assert.assertNotNull(result);
- Identity expected = new Identity();
- expected.setFirstName("first name");
- expected.setLastName("last name");
- expected.setEmail("noway(a)bishop.uk");
- expected.setAge(29);
+ Xpp3ReaderTest.assertEqualsSimpleIdentity(result);
+ }
- Xpp3ReaderTest.assertEqualsIdentity(result, expected);
+ @Test(expected = NullPointerException.class)
+ public void testReadObjectsFailed() throws Exception {
+ Xpp3Helper.readObjects(String.class, null);
}
- @Test
- public void testReadObjects() throws Exception {
- List<String> paths = new ArrayList<String>();
- paths.add("target");
- paths.add("test-classes");
- paths.addAll(Arrays.asList(getClass().getPackage().getName().split("\\.")));
- File file = TestHelper.getFile(TestHelper.getBasedir(), paths.toArray(new String[paths.size()]));
- file = new File(file, "identities.xml");
+
+ @Test(expected = NullPointerException.class)
+ public void testReadObjectsFailed2() throws Exception {
+
+ File file = new File(Xpp3ReaderTest.dir, "identity.xml");
+ Assert.assertTrue(file.exists());
+
Reader input = new FileReader(file);
Assert.assertNotNull(input);
- Identity[] result = Xpp3Helper.readObjects(Identity.class, input);
- Assert.assertNotNull(result);
- Assert.assertEquals(2, result.length);
- Identity expected = new Identity();
- expected.setFirstName("first name");
- expected.setLastName("last name");
- expected.setEmail("noway(a)bishop.uk");
- expected.setAge(29);
- Xpp3ReaderTest.assertEqualsIdentity(result[0], expected);
+ Xpp3Helper.readObjects(null, input);
+ }
- expected = new Identity();
- expected.setFirstName("first name2");
- expected.setLastName("last name2");
- expected.setEmail("noway2(a)bishop.uk");
- expected.setAge(31);
+ @Test(expected = IllegalArgumentException.class)
+ public void testReadObjectsFailed3() throws Exception {
- Xpp3ReaderTest.assertEqualsIdentity(result[1], expected);
+ File file = new File(Xpp3ReaderTest.dir, "identity.xml");
+ Assert.assertTrue(file.exists());
+ Reader input = new FileReader(file);
+ Assert.assertNotNull(input);
+ Xpp3Helper.readObjects(String.class, input);
}
@Test
+ public void testReadObjects() throws Exception {
+
+ File file = new File(Xpp3ReaderTest.dir, "identities.xml");
+ Reader input = new FileReader(file);
+ Assert.assertNotNull(input);
+ Identity[] result = Xpp3Helper.readObjects(Identity.class, input);
+ Xpp3ReaderTest.assertEqualsIdentities(result);
+ }
+
+ @Test
public void testCleanReaders() throws Exception {
Xpp3Helper.clearReaders();
Assert.assertNull(Xpp3Helper.readers);
Modified: trunk/src/test/java/org/nuiton/io/xpp3/Xpp3ReaderTest.java
===================================================================
--- trunk/src/test/java/org/nuiton/io/xpp3/Xpp3ReaderTest.java 2009-11-01 20:05:46 UTC (rev 623)
+++ trunk/src/test/java/org/nuiton/io/xpp3/Xpp3ReaderTest.java 2009-11-01 22:47:27 UTC (rev 624)
@@ -1,6 +1,7 @@
package org.nuiton.io.xpp3;
import org.junit.Assert;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.nuiton.plugin.TestHelper;
@@ -18,17 +19,27 @@
*/
public class Xpp3ReaderTest {
- protected Xpp3Reader<Identity> r = new IdentityXpp3Reader();
- @Test
- public void testRead() throws Exception {
+ protected static File dir;
+ protected Xpp3Reader<Identity> r = new IdentityXpp3Reader("identities");
+
+
+ @BeforeClass
+ public static void beforeClass() {
+
List<String> paths = new ArrayList<String>();
paths.add("target");
paths.add("test-classes");
- paths.addAll(Arrays.asList(getClass().getPackage().getName().split("\\.")));
- File file = TestHelper.getFile(TestHelper.getBasedir(), paths.toArray(new String[paths.size()]));
- file = new File(file, "identity.xml");
+ paths.addAll(Arrays.asList(Xpp3HelperTest.class.getPackage().getName().split("\\.")));
+ dir = TestHelper.getFile(TestHelper.getBasedir(), paths.toArray(new String[paths.size()]));
+ }
+
+ @Test
+ public void testRead() throws Exception {
+
+ File file = new File(dir, "identity.xml");
+
Reader input = new FileReader(file);
Assert.assertNotNull(input);
Identity result = r.read(input);
@@ -40,23 +51,74 @@
expected.setAge(29);
assertEqualsIdentity(result, expected);
-
}
@Test
public void testReadArray() throws Exception {
- List<String> paths = new ArrayList<String>();
- paths.add("target");
- paths.add("test-classes");
- paths.addAll(Arrays.asList(getClass().getPackage().getName().split("\\.")));
- File file = TestHelper.getFile(TestHelper.getBasedir(), paths.toArray(new String[paths.size()]));
- file = new File(file, "identities.xml");
+ File file = new File(dir, "identities.xml");
Reader input = new FileReader(file);
Assert.assertNotNull(input);
Identity[] result = r.readArray(input);
+ assertEqualsIdentities(result);
+ }
+
+
+ @Test
+ public void testReadArray2() throws Exception {
+
+ r = new IdentityXpp3Reader("identity");
+
+ File file = new File(dir, "identities2.xml");
+
+ Assert.assertTrue(file.exists());
+ Reader input = new FileReader(file);
+ Assert.assertNotNull(input);
+ Identity[] result = r.readArray(input);
+ assertEqualsIdentities(result);
+
+ r.setAddDefaultEntities(false);
+ result = r.readArray(new FileReader(file));
+
+ assertEqualsIdentities(result);
+
+ r.setAddDefaultEntities(true);
+ result = r.readArray(new FileReader(file));
+
+ assertEqualsIdentities(result);
+
+
+ r.setParentRootTagName("identities");
+
+ input = new FileReader(new File(dir, "identities.xml"));
+ Assert.assertNotNull(input);
+ result = r.readArray(input);
+
+ assertEqualsIdentities(result);
+ }
+
+ protected static void assertEqualsIdentity(Identity result, Identity expected) {
+ Assert.assertEquals(expected.getFirstName(), result.getFirstName());
+ Assert.assertEquals(expected.getLastName(), result.getLastName());
+ Assert.assertEquals(expected.getEmail(), result.getEmail());
+ Assert.assertEquals(expected.getAge(), result.getAge());
+ }
+
+
+ protected static void assertEqualsSimpleIdentity(Identity result) {
Assert.assertNotNull(result);
+ Identity expected = new Identity();
+ expected.setFirstName("first name");
+ expected.setLastName("last name");
+ expected.setEmail("noway(a)bishop.uk");
+ expected.setAge(29);
+
+ assertEqualsIdentity(result, expected);
+ }
+
+ protected static void assertEqualsIdentities(Identity[] result) {
+ Assert.assertNotNull(result);
Assert.assertEquals(2, result.length);
Identity expected = new Identity();
expected.setFirstName("first name");
@@ -75,11 +137,4 @@
assertEqualsIdentity(result[1], expected);
}
- protected static void assertEqualsIdentity(Identity result, Identity expected) {
- Assert.assertEquals(expected.getFirstName(), result.getFirstName());
- Assert.assertEquals(expected.getLastName(), result.getLastName());
- Assert.assertEquals(expected.getEmail(), result.getEmail());
- Assert.assertEquals(expected.getAge(), result.getAge());
- }
-
}
Added: trunk/src/test/resources/org/nuiton/io/xpp3/identities2.xml
===================================================================
--- trunk/src/test/resources/org/nuiton/io/xpp3/identities2.xml (rev 0)
+++ trunk/src/test/resources/org/nuiton/io/xpp3/identities2.xml 2009-11-01 22:47:27 UTC (rev 624)
@@ -0,0 +1,14 @@
+<identity>
+ <identity>
+ <firstName>first name</firstName>
+ <lastName>last name</lastName>
+ <email>noway(a)bishop.uk</email>
+ <age>29</age>
+ </identity>
+ <identity>
+ <firstName>first name2</firstName>
+ <lastName>last name2</lastName>
+ <email>noway2(a)bishop.uk</email>
+ <age>31</age>
+ </identity>
+</identity>
\ No newline at end of file
1
0
Author: tchemit
Date: 2009-11-01 21:05:46 +0100 (Sun, 01 Nov 2009)
New Revision: 623
Modified:
trunk/src/test/java/org/nuiton/io/xpp3/Xpp3HelperTest.java
Log:
continue tests
Modified: trunk/src/test/java/org/nuiton/io/xpp3/Xpp3HelperTest.java
===================================================================
--- trunk/src/test/java/org/nuiton/io/xpp3/Xpp3HelperTest.java 2009-11-01 19:59:23 UTC (rev 622)
+++ trunk/src/test/java/org/nuiton/io/xpp3/Xpp3HelperTest.java 2009-11-01 20:05:46 UTC (rev 623)
@@ -89,4 +89,10 @@
}
+
+ @Test
+ public void testCleanReaders() throws Exception {
+ Xpp3Helper.clearReaders();
+ Assert.assertNull(Xpp3Helper.readers);
+ }
}
1
0
r622 - in trunk: . src/main/java/org/nuiton/io/xpp3 src/test/java/org/nuiton/io src/test/java/org/nuiton/io/xpp3 src/test/java/org/nuiton/plugin src/test/resources src/test/resources/META-INF src/test/resources/META-INF/services src/test/resources/org/nuiton/io src/test/resources/org/nuiton/io/xpp3
by tchemit@users.nuiton.org 01 Nov '09
by tchemit@users.nuiton.org 01 Nov '09
01 Nov '09
Author: tchemit
Date: 2009-11-01 20:59:23 +0100 (Sun, 01 Nov 2009)
New Revision: 622
Added:
trunk/src/main/java/org/nuiton/io/xpp3/DefaultDataConverter.java
trunk/src/test/java/org/nuiton/io/xpp3/
trunk/src/test/java/org/nuiton/io/xpp3/Identity.java
trunk/src/test/java/org/nuiton/io/xpp3/IdentityXpp3Reader.java
trunk/src/test/java/org/nuiton/io/xpp3/Xpp3HelperTest.java
trunk/src/test/java/org/nuiton/io/xpp3/Xpp3ReaderTest.java
trunk/src/test/resources/META-INF/
trunk/src/test/resources/META-INF/services/
trunk/src/test/resources/META-INF/services/org.nuiton.io.xpp3.Xpp3Reader
trunk/src/test/resources/org/nuiton/io/xpp3/
trunk/src/test/resources/org/nuiton/io/xpp3/identities.xml
trunk/src/test/resources/org/nuiton/io/xpp3/identity.xml
Modified:
trunk/pom.xml
trunk/src/main/java/org/nuiton/io/xpp3/AbstractXpp3Reader.java
trunk/src/main/java/org/nuiton/io/xpp3/PropertyMapper.java
trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Reader.java
trunk/src/test/java/org/nuiton/plugin/TestHelper.java
Log:
- integrate jredmine (for releases)
- add tests for org.nuiton.io.xpp3 package
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-11-01 17:01:34 UTC (rev 621)
+++ trunk/pom.xml 2009-11-01 19:59:23 UTC (rev 622)
@@ -329,6 +329,7 @@
<properties>
<license.version>2.0.0</license.version>
+ <jredmine.version>1.0.0-rc-2</jredmine.version>
<maven.version>2.2.1</maven.version>
<plexusMailSender.version>1.0-alpha-2</plexusMailSender.version>
<javadoc.version>2.6</javadoc.version>
@@ -350,6 +351,15 @@
<repository.home.url>http://maven.nuiton.org/release</repository.home.url>
+ <!-- redmine configuration -->
+ <platform>nuiton.org</platform>
+ <redmine.safe>false</redmine.safe>
+ <redmine.url>http://www.${platform}</redmine.url>
+ <redmine.projectId>maven-helper-plugin</redmine.projectId>
+ <redmine.xmlPath>${basedir}/target/generated-sources/changes/changes.xml</redmine.xmlPath>
+ <redmine.issueLinkTemplate>${redmine.url}/issues/show/%ISSUE%</redmine.issueLinkTemplate>
+ <redmine.versionLinkTemplate>${redmine.url}/versions/show/%VERSION%</redmine.versionLinkTemplate>
+ <redmine.collectedFiles>target/collect.properties</redmine.collectedFiles>
</properties>
<build>
@@ -651,6 +661,12 @@
<version>${license.version}</version>
</plugin>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>maven-jredmine-plugin</artifactId>
+ <version>${jredmine.version}</version>
+ </plugin>
+
</plugins>
</pluginManagement>
</build>
@@ -894,6 +910,12 @@
<plugin>
<artifactId>maven-changes-plugin</artifactId>
<version>2.1</version>
+ <configuration>
+ <issueLinkTemplatePerSystem>
+ <redmine>${redmine.issueLinkTemplate}</redmine>
+ </issueLinkTemplatePerSystem>
+ <xmlPath>${redmine.xmlPath}</xmlPath>
+ </configuration>
<reportSets>
<reportSet>
<reports>
@@ -1008,6 +1030,239 @@
</build>
</profile>
+ <!-- perform only on a release stage when using the maven-release-plugin -->
+ <profile>
+ <id>redmine-pre-release-profile</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <properties>
+ <redmine.safe>true</redmine.safe>
+ </properties>
+
+ <reporting>
+ <plugins>
+
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>maven-jredmine-plugin</artifactId>
+ <version>${jredmine.version}</version>
+ <configuration>
+ <columnNames>key,summary,status,assignee,tracker,priority,version,category,createdOn
+ </columnNames>
+ </configuration>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>issues-report</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+
+ </plugins>
+ </reporting>
+ <build>
+
+ <plugins>
+
+ <!--
+ - obtain redmine login
+ - collect files for jredmine release
+ -->
+ <plugin>
+ <groupId>org.nuiton</groupId>
+ <artifactId>maven-helper-plugin</artifactId>
+ <version>1.0.3</version>
+ <executions>
+ <execution>
+ <id>get-redmine-login</id>
+ <goals>
+ <goal>share-server-secret</goal>
+ </goals>
+ <phase>initialize</phase>
+ <configuration>
+ <serverId>redmine-${platform}</serverId>
+ <passwordOut>redmine.password</passwordOut>
+ <usernameOut>redmine.username</usernameOut>
+ </configuration>
+ </execution>
+ <execution>
+ <id>get-redmine-login-site</id>
+ <goals>
+ <goal>share-server-secret</goal>
+ </goals>
+ <phase>pre-site</phase>
+ <configuration>
+ <serverId>redmine-${platform}</serverId>
+ <passwordOut>redmine.password</passwordOut>
+ <usernameOut>redmine.username</usernameOut>
+ </configuration>
+ </execution>
+ <execution>
+ <id>collect-files</id>
+ <goals>
+ <goal>collect-files</goal>
+ </goals>
+ <phase>install</phase>
+ <configuration>
+ <extraFiles/>
+ <descriptionFile>${redmine.collectedFiles}</descriptionFile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- generate the changes.xml from redmine -->
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>maven-jredmine-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>jredmine-generate</id>
+ <goals>
+ <goal>generate-changes</goal>
+ <goal>generate-news-announcement</goal>
+ <goal>generate-email-announcement</goal>
+ </goals>
+ <phase>process-classes</phase>
+ </execution>
+ </executions>
+ <configuration>
+
+ <!-- generate-changes -->
+ <generateOnce>true</generateOnce>
+ <actionMapping>fix:1, add:2</actionMapping>
+ <statusIds>3,4,5</statusIds>
+
+ <!-- generate announcements -->
+ <urlDownload>${redmine.url}/projects/list_files/maven-helper-plugin</urlDownload>
+
+ <!--<changesTitle>Release note of Maven pom project</changesTitle>-->
+ <!--<releaseDescription>Description of first release</releaseDescription>-->
+ <!--<verbose>true</verbose>-->
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ </build>
+ </profile>
+
+ <!-- perform a redmine release after a successfull release -->
+ <profile>
+ <id>redmine-release-profile</id>
+ <activation>
+ <property>
+ <name>performRedmineRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+
+ <properties>
+ <dryRun>true</dryRun>
+ <redmine.dryRun>${dryRun}</redmine.dryRun>
+ </properties>
+ <build>
+
+ <plugins>
+
+ <!--
+ - obtain redmine login
+ - send release email
+ -->
+ <plugin>
+ <groupId>org.nuiton</groupId>
+ <artifactId>maven-helper-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>get-redmine-login</id>
+ <goals>
+ <goal>share-server-secret</goal>
+ </goals>
+ <phase>initialize</phase>
+ <configuration>
+ <serverId>redmine-${platform}</serverId>
+ <passwordOut>redmine.password</passwordOut>
+ <usernameOut>redmine.username</usernameOut>
+ </configuration>
+ </execution>
+ <execution>
+ <id>send-release-email</id>
+ <goals>
+ <goal>send-email</goal>
+ </goals>
+ <phase>validate</phase>
+ </execution>
+ </executions>
+ <configuration>
+
+ <!-- for a multi-module just run on root project -->
+ <runOnce>true</runOnce>
+
+ <emailTitle>[ANNOUNCEMENT] - ${project.name} ${project.version} released</emailTitle>
+ <emailContentFile>target/generated-sources/announcement/release-email-announcement.vm
+ </emailContentFile>
+ <mailSender>
+ <name>${platform} Release Notification</name>
+ <email>noreply@${platform}</email>
+ </mailSender>
+ <toAddresses>
+ <item>${listId}-users(a)list.${platform}</item>
+ <item>${listId}-devel(a)list.${platform}</item>
+ <item>dev(a)codelutin.com</item>
+ </toAddresses>
+ <smtpHost>smtp</smtpHost>
+ </configuration>
+ </plugin>
+
+ <!--
+ - update version in redmine
+ - publish release files to redmine
+ - publish a release news in redmine
+ -->
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>maven-jredmine-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>jredmine-release</id>
+ <goals>
+ <goal>update-version</goal>
+ <goal>publish-attachments</goal>
+ <goal>publish-news</goal>
+ </goals>
+ <phase>validate</phase>
+ </execution>
+ </executions>
+ <configuration>
+
+ <!-- for a multi-module just run on root project -->
+ <runOnce>true</runOnce>
+
+ <!-- update-version -->
+ <closeVersion>true</closeVersion>
+
+ <!-- publish-attachments -->
+ <filesFromProperties>${redmine.collectedFiles}</filesFromProperties>
+
+ <!-- publish-news -->
+ <newsContentFile>target/generated-sources/announcement/release-news-announcement.vm
+ </newsContentFile>
+ <newsSummary>${project.description}</newsSummary>
+ <newsTitle>${project.name} ${project.version} released</newsTitle>
+
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ </build>
+ </profile>
+
<!-- do not execute tests (generaly a bad idea...) -->
<profile>
<id>notests</id>
Modified: trunk/src/main/java/org/nuiton/io/xpp3/AbstractXpp3Reader.java
===================================================================
--- trunk/src/main/java/org/nuiton/io/xpp3/AbstractXpp3Reader.java 2009-11-01 17:01:34 UTC (rev 621)
+++ trunk/src/main/java/org/nuiton/io/xpp3/AbstractXpp3Reader.java 2009-11-01 19:59:23 UTC (rev 622)
@@ -20,44 +20,40 @@
*/
package org.nuiton.io.xpp3;
+import org.codehaus.plexus.util.xml.pull.MXParser;
+import org.codehaus.plexus.util.xml.pull.XmlPullParser;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
import java.beans.IntrospectionException;
import java.io.IOException;
import java.io.Reader;
import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import java.util.Map.Entry;
-import java.util.Set;
-import java.util.TreeMap;
-import org.codehaus.plexus.util.xml.pull.MXParser;
-import org.codehaus.plexus.util.xml.pull.XmlPullParser;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
/**
* An abstract xpp3Reader based on {@link PropertyMapper} to set properties of
* the objects to build.
- *
+ * <p/>
* To implements a new parser, just implements method {@link #initMappers()} to
* see authorized mapping from tag to pojo properties.
- *
+ * <p/>
* The logic of setting properties from xml (tag and attributes) is done in
- *
+ * <p/>
* <ul>
* <li>{@link #read(String, Class, org.codehaus.plexus.util.xml.pull.XmlPullParser, boolean)} </li>
* <li>{@link #readArray(String, String, Class, org.codehaus.plexus.util.xml.pull.XmlPullParser, boolean)}</li>
* </ul>
- *
+ * <p/>
* The default implementation is to map tag text to a pojo's property.
- *
+ * <p/>
* If you want to do something more complex, override these methods.
- *
- * @param <O> the type of object to be build by the reader
- *
+ *
* @author chemit
- * @since 1.0.0
+ * @param <O> the type of object to be build by the reader
* @see PropertyMapper
* @see Xpp3Reader
+ * @since 1.0.0
*/
public abstract class AbstractXpp3Reader<O> implements Xpp3Reader<O> {
@@ -78,7 +74,6 @@
protected final Class<O> type;
/**
* the root tag of an object to retreave from xml streams.
- *
*/
protected String rootTagName;
/**
@@ -87,10 +82,10 @@
protected String arrayRootTagName;
/**
* the univers of mappers availables, initialized in {@link #initMappers()}.
- *
+ * <p/>
* Each mapper of the dictionary is associated to the fully qualified name
* of the target class # the tag name or attribute name.
- *
+ * <p/>
* Example :
* <pre>
* org.nuiton.util.MyPojo#my-tag
@@ -101,9 +96,9 @@
protected abstract void initMappers() throws IntrospectionException;
- protected AbstractXpp3Reader(Class<O> type) {
- this(type, null, null);
- }
+// protected AbstractXpp3Reader(Class<O> type) {
+// this(type, null, null);
+// }
protected AbstractXpp3Reader(Class<O> type, String rootTagName) {
this(type, null, rootTagName);
@@ -218,9 +213,9 @@
/**
* Obtain all mappers for a given type.
- *
+ * <p/>
* In the result, the keys are now the tag-name of attribute-name.
- *
+ * <p/>
* Example :
* <pre>
* my-tag
@@ -243,15 +238,15 @@
/**
* Parse the xml stream from the given parser and a build the associated object.
- *
+ * <p/>
* This default implementation just match a tag text content to a pojo property.
- *
+ * <p/>
* No work is done on attribute values here.
- *
+ * <p/>
* Note: The parser must accept as a next open tag the required one .
- *
+ * <p/>
* the next node name is given by <code>getRootTagName()</code>
- *
+ * <p/>
* Example :
* <pre>
* ...
@@ -260,13 +255,13 @@
* </my-pojo>
* </pre>
*
- * @param <T> the type of object to build
+ * @param <T> the type of object to build
* @param rootTagName the name of the root tag matching the object to build
- * @param type the type of object to build
- * @param parser the xpp3 parser
- * @param strict flag to indicate if should fail if a unknown tag (or attribute ?) is scanned
+ * @param type the type of object to build
+ * @param parser the xpp3 parser
+ * @param strict flag to indicate if should fail if a unknown tag (or attribute ?) is scanned
* @return the single object build from the xml stream.
- * @throws IOException if any io pb
+ * @throws IOException if any io pb
* @throws XmlPullParserException if any parsing pb
*/
protected <T> T read(String rootTagName, Class<T> type, XmlPullParser parser, boolean strict) throws XmlPullParserException, IOException {
@@ -324,14 +319,14 @@
/**
* Parse the xml stream from the given parser and a build an array of associated object.
- *
+ * <p/>
* This default implementation just match a tag text content to a pojo property.
- *
+ * <p/>
* No work is done on attribute values here.
- *
+ * <p/>
* Note: The next node of the parser must be the one given by
* {@code parentRootTagName} and sub nodes with names {@code rootTagName}.
- *
+ * <p/>
* Example :
* <pre>
* ...
@@ -345,14 +340,14 @@
* </my-pojos>
* </pre>
*
- * @param <T> the type of objects to build
+ * @param <T> the type of objects to build
* @param parentRootTagName the tag's name of the array container
- * @param rootTagName the tag's name of each object to build
- * @param type the type of objects to build
- * @param parser the xpp3 parser
- * @param strict flag to indicate if should fail if a unknown tag (or attribute ?) is scanned
+ * @param rootTagName the tag's name of each object to build
+ * @param type the type of objects to build
+ * @param parser the xpp3 parser
+ * @param strict flag to indicate if should fail if a unknown tag (or attribute ?) is scanned
* @return the single object build from the xml stream.
- * @throws IOException if any io pb
+ * @throws IOException if any io pb
* @throws XmlPullParserException if any parsing pb
*/
protected <T> T[] readArray(String parentRootTagName, String rootTagName, Class<T> type, XmlPullParser parser, boolean strict) throws XmlPullParserException, IOException {
@@ -436,7 +431,7 @@
/**
* Checks that a given parser is not at the end of the xml document.
*
- * @param parser the parser to check
+ * @param parser the parser to check
* @param tagName the endign tag's name
* @throws XmlPullParserException if the parser is at the end of the xml stream, instead of the {@code tagName} ending tag
*/
@@ -449,7 +444,7 @@
/**
* Checks that a given parser is at the end of the xml document.
- *
+ *
* @param parser the parser to check
* @throws XmlPullParserException if the parser is not at the end of the xml stream.
*/
Added: trunk/src/main/java/org/nuiton/io/xpp3/DefaultDataConverter.java
===================================================================
--- trunk/src/main/java/org/nuiton/io/xpp3/DefaultDataConverter.java (rev 0)
+++ trunk/src/main/java/org/nuiton/io/xpp3/DefaultDataConverter.java 2009-11-01 19:59:23 UTC (rev 622)
@@ -0,0 +1,81 @@
+/*
+ * *##%
+ * JRedmine client
+ * Copyright (C) 2009 CodeLutin
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * ##%*
+ */
+package org.nuiton.io.xpp3;
+
+/**
+ * A enumaration to convert some data from a string representation.
+ * <p/>
+ *
+ * @author chemit
+ * @since 1.0.0
+ */
+public enum DefaultDataConverter implements DataConverter {
+
+ Boolean {
+
+ @Override
+ public Object convert(String t) throws Exception {
+ Object r = java.lang.Boolean.valueOf(t);
+ return r;
+ }
+ }, Short {
+
+ @Override
+ public Object convert(String t) throws Exception {
+ Object r = java.lang.Short.valueOf(t);
+ return r;
+ }
+ }, Integer {
+
+ @Override
+ public Object convert(String t) throws Exception {
+ Object r = java.lang.Integer.valueOf(t);
+ return r;
+ }
+ }, Long {
+
+ @Override
+ public Object convert(String t) throws Exception {
+ Object r = java.lang.Long.valueOf(t);
+ return r;
+ }
+ }, Float {
+
+ @Override
+ public Object convert(String t) throws Exception {
+ Object r = java.lang.Float.valueOf(t);
+ return r;
+ }
+ }, Double {
+
+ @Override
+ public Object convert(String t) throws Exception {
+ Object r = java.lang.Double.valueOf(t);
+ return r;
+ }
+ }, Text {
+
+ @Override
+ public Object convert(String t) throws Exception {
+ return t;
+ }
+ };
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/org/nuiton/io/xpp3/DefaultDataConverter.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Modified: trunk/src/main/java/org/nuiton/io/xpp3/PropertyMapper.java
===================================================================
--- trunk/src/main/java/org/nuiton/io/xpp3/PropertyMapper.java 2009-11-01 17:01:34 UTC (rev 621)
+++ trunk/src/main/java/org/nuiton/io/xpp3/PropertyMapper.java 2009-11-01 19:59:23 UTC (rev 622)
@@ -20,31 +20,32 @@
*/
package org.nuiton.io.xpp3;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.codehaus.plexus.util.xml.pull.XmlPullParser;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
import java.beans.PropertyDescriptor;
import java.io.IOException;
import java.text.ParseException;
import java.util.Set;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.codehaus.plexus.util.xml.pull.XmlPullParser;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
/**
* A abstract object to map an xml value (tag or attribute, or esle?) to a pojo property.
- *
+ * <p/>
* Two implementations are given :
- *
+ * <p/>
* <ul>
* <li>{@link TagTextContentToProperty} to map the text content of a tag to a pojo's property</li>
* <li>{@link AttributeValueToProperty} to map the text content of a tag to a pojo's property</li>
* </ul>
- *
+ * <p/>
* There is two convinient factory methods in {@link Xpp3Helper} to add some new mappers into a given
* dictionnary of mappers.
* <ul>
- * <li> {@link Xpp3Helper#addTagTextContentMappers(Class, org.nuiton.io.xpp3.DataConverter, boolean, java.util.Map, String[])}</li>
- * <li>{@link Xpp3Helper#addAttributeValueMappers(Class, org.nuiton.io.xpp3.DataConverter, boolean, java.util.Map, String[])}</li>
+ * <li> {@link Xpp3Helper#addTagTextContentMappers(Class, org.nuiton.io.xpp3.DataConverter, boolean, java.util.Map, String...)}</li>
+ * <li>{@link Xpp3Helper#addAttributeValueMappers(Class, org.nuiton.io.xpp3.DataConverter, boolean, java.util.Map, String...)}</li>
* </ul>
- *
+ *
* @author chemit
* @since 1.0.3
*/
@@ -74,7 +75,7 @@
}
@Override
- protected Object getDataFromXml(XmlPullParser parser) throws XmlPullParserException, Exception {
+ protected Object getDataFromXml(XmlPullParser parser) throws Exception {
String t = parser.getAttributeValue("", name);
Object result = null;
if (t != null && !(t = t.trim()).isEmpty()) {
@@ -83,6 +84,7 @@
return result;
}
}
+
/**
* name of tag (or attribute to deal with)
*/
@@ -120,7 +122,7 @@
protected abstract Object getDataFromXml(XmlPullParser parser) throws XmlPullParserException, Exception;
- public void setProperty(Object src, XmlPullParser parser, Set<String> parsed, boolean strict) throws XmlPullParserException, IOException, IOException {
+ public void setProperty(Object src, XmlPullParser parser, Set<String> parsed, boolean strict) throws XmlPullParserException, IOException {
if (onlyOne && parsed.contains(name)) {
throw new XmlPullParserException("Duplicated tag: \'" + parser.getName() + "\'", parser, null);
}
Modified: trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Reader.java
===================================================================
--- trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Reader.java 2009-11-01 17:01:34 UTC (rev 621)
+++ trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Reader.java 2009-11-01 19:59:23 UTC (rev 622)
@@ -20,47 +20,45 @@
*/
package org.nuiton.io.xpp3;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
import java.io.IOException;
import java.io.Reader;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
/**
* A simple contract to mark all xpp readers.
- *
+ * <p/>
* a such reader is associated to a {@link #getType()}.
- *
+ * <p/>
* The implementations of such readers must be register in a file
* <pre>
* META-INF/services.org.nuiton.io.xpp3.Xpp3Reader
* </pre>
- *
+ * <p/>
* to make possible auto-discovering of availables reader at runtime.
- *
- * See {@link Xpp3Helper#getReader(java.lang.Class)} and
+ * <p/>
+ * See {@link Xpp3Helper#getReader(java.lang.Class)} and
* {@link Xpp3Helper#getReaders()}.
*
- *
- * @param <O> the type of object to be build by the reader.
- *
* @author chemit
+ * @param <O> the type of object to be build by the reader.
* @since 1.0.3
*/
public interface Xpp3Reader<O> {
/**
- *
- * @return the type of main object to read
+ * @return the type of main object to read
*/
Class<O> getType();
/**
* Read a single instance of the typed object and return it.
- *
+ * <p/>
* Note : this is a convinient method to call
* {@link #read(java.io.Reader, boolean)} in strict mode.
- *
+ * <p/>
* In the xml stream, the root tag must be the {@link #getRootTagName()}.
- *
+ * <p/>
* Example :
* <pre>
* <issue>:
@@ -68,18 +66,18 @@
* </issue>:
* </pre>
*
- * @param reader
- * @throws IOException
- * @throws XmlPullParserException
+ * @param reader the xml input reader
* @return Settings
+ * @throws IOException if any io pb
+ * @throws XmlPullParserException if parsing error
*/
O read(Reader reader) throws IOException, XmlPullParserException;
/**
* Read a single instance of the typed object and return it.
- *
+ * <p/>
* In the xml stream, the root tag must be the {@link #getRootTagName()}.
- *
+ * <p/>
* Example :
* <pre>
* <issue>:
@@ -89,20 +87,20 @@
*
* @param reader the xml input reader
* @param strict flag to be strict while parsing
- * @throws IOException if any io pb
+ * @return the read object
+ * @throws IOException if any io pb
* @throws XmlPullParserException if any parsing pb
- * @return the
*/
O read(Reader reader, boolean strict) throws IOException, XmlPullParserException;
/**
* Read some instances of the typed object and return it.
- *
+ * <p/>
* In the xml stream, the root tag must be the {@link #getArrayRootTagName()}.
- *
+ * <p/>
* Note : this is a convinient method to call :
* {@link #readArray(java.io.Reader, boolean)} in stritc mode.
- *
+ * <p/>
* Example :
* <pre>
* <issues>:
@@ -113,17 +111,17 @@
* </pre>
*
* @param reader the xml input reader
- * @throws IOException if any io pb
- * @throws XmlPullParserException if any parsing pb
* @return the array of read objects.
+ * @throws IOException if any io pb
+ * @throws XmlPullParserException if any parsing pb
*/
O[] readArray(Reader reader) throws IOException, XmlPullParserException;
/**
* Read some instances of the typed object and return it.
- *
+ * <p/>
* In the xml stream, the root tag must be the {@link #getArrayRootTagName()}.
- *
+ * <p/>
* Example :
* <pre>
* <issues>:
@@ -135,14 +133,13 @@
*
* @param reader the xml input reader
* @param strict flag to be strict while parsing
- * @throws IOException if any io pb
- * @throws XmlPullParserException if any parsing pb
* @return the array of read objects.
+ * @throws IOException if any io pb
+ * @throws XmlPullParserException if any parsing pb
*/
O[] readArray(Reader reader, boolean strict) throws IOException, XmlPullParserException;
/**
- *
* @return the name of the root tag of a object to read
*/
String getRootTagName();
@@ -155,21 +152,20 @@
void setRootTagName(String rootTagName);
/**
- *
* @return the name of the root tag of an array of objets to read
*/
String getArrayRootTagName();
/**
* Set the name of the root tag for an array of object to read.
- *
+ *
* @param parentRootTagName the name of the tag
*/
void setParentRootTagName(String parentRootTagName);
/**
* @return <code>true</code> if parser will load the default entities,
- * <code>false</code> otherwise.
+ * <code>false</code> otherwise.
*/
boolean isAddDefaultEntities();
Added: trunk/src/test/java/org/nuiton/io/xpp3/Identity.java
===================================================================
--- trunk/src/test/java/org/nuiton/io/xpp3/Identity.java (rev 0)
+++ trunk/src/test/java/org/nuiton/io/xpp3/Identity.java 2009-11-01 19:59:23 UTC (rev 622)
@@ -0,0 +1,85 @@
+package org.nuiton.io.xpp3;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+
+/**
+ * User: chemit
+ * Date: 1 nov. 2009
+ * Time: 19:49:59
+ */
+public class Identity {
+
+
+ protected String firstName = "";
+
+ protected String lastName = "";
+
+ protected String email = "dummy(a)codelutin.com";
+
+ protected int age = 51;
+
+
+ PropertyChangeSupport p;
+
+ public Identity() {
+ p = new PropertyChangeSupport(this);
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ p.addPropertyChangeListener(listener);
+ }
+
+ public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+ p.addPropertyChangeListener(propertyName, listener);
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ p.removePropertyChangeListener(listener);
+ }
+
+ public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+ p.removePropertyChangeListener(propertyName, listener);
+ }
+
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setFirstName(String firstName) {
+ String oldFirstName = this.firstName;
+ this.firstName = firstName;
+ p.firePropertyChange("firstName", oldFirstName, firstName);
+ }
+
+ public void setLastName(String lastName) {
+ String oldLastName = this.lastName;
+ this.lastName = lastName;
+ p.firePropertyChange("lastName", oldLastName, lastName);
+ }
+
+ public void setEmail(String email) {
+ String oldEmail = this.email;
+ this.email = email;
+ p.firePropertyChange("email", oldEmail, email);
+ }
+
+ public void setAge(int age) {
+ int oldAge = this.age;
+ this.age = age;
+ p.firePropertyChange("age", oldAge, age);
+ }
+}
Property changes on: trunk/src/test/java/org/nuiton/io/xpp3/Identity.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/test/java/org/nuiton/io/xpp3/IdentityXpp3Reader.java
===================================================================
--- trunk/src/test/java/org/nuiton/io/xpp3/IdentityXpp3Reader.java (rev 0)
+++ trunk/src/test/java/org/nuiton/io/xpp3/IdentityXpp3Reader.java 2009-11-01 19:59:23 UTC (rev 622)
@@ -0,0 +1,27 @@
+package org.nuiton.io.xpp3;
+
+import java.beans.IntrospectionException;
+
+/**
+ * User: chemit
+ * Date: 1 nov. 2009
+ * Time: 20:37:56
+ */
+public class IdentityXpp3Reader extends AbstractXpp3Reader<Identity> {
+ public IdentityXpp3Reader() {
+ super(Identity.class, "identities", "identity");
+ }
+
+ @Override
+ protected void initMappers() throws IntrospectionException {
+
+ org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers(Identity.class, DefaultDataConverter.Text, true, allMappers,
+ "firstName",
+ "lastName",
+ "email");
+
+ org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers(Identity.class, DefaultDataConverter.Integer, true, allMappers,
+ "age");
+
+ }
+}
Property changes on: trunk/src/test/java/org/nuiton/io/xpp3/IdentityXpp3Reader.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/test/java/org/nuiton/io/xpp3/Xpp3HelperTest.java
===================================================================
--- trunk/src/test/java/org/nuiton/io/xpp3/Xpp3HelperTest.java (rev 0)
+++ trunk/src/test/java/org/nuiton/io/xpp3/Xpp3HelperTest.java 2009-11-01 19:59:23 UTC (rev 622)
@@ -0,0 +1,92 @@
+package org.nuiton.io.xpp3;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.nuiton.plugin.TestHelper;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * User: chemit
+ * Date: 1 nov. 2009
+ * Time: 20:34:34
+ */
+public class Xpp3HelperTest {
+
+ @Test
+ public void testGetReader() throws Exception {
+ Xpp3Reader<Identity> r = Xpp3Helper.getReader(Identity.class);
+ Assert.assertNotNull(r);
+ }
+
+ @Test
+ public void testGetReaderIterator() throws Exception {
+ Iterator<Xpp3Reader<?>> r = Xpp3Helper.getReaderItetator();
+ Assert.assertNotNull(r);
+ Assert.assertTrue(r.hasNext());
+ Xpp3Reader<?> reader = r.next();
+ Assert.assertNotNull(reader);
+ }
+
+ @Test
+ public void testReadObject() throws Exception {
+ List<String> paths = new ArrayList<String>();
+ paths.add("target");
+ paths.add("test-classes");
+ paths.addAll(Arrays.asList(getClass().getPackage().getName().split("\\.")));
+ File file = TestHelper.getFile(TestHelper.getBasedir(), paths.toArray(new String[paths.size()]));
+ file = new File(file, "identity.xml");
+ Reader input = new FileReader(file);
+
+ Identity result = Xpp3Helper.readObject(Identity.class, input);
+
+ Assert.assertNotNull(result);
+ Identity expected = new Identity();
+ expected.setFirstName("first name");
+ expected.setLastName("last name");
+ expected.setEmail("noway(a)bishop.uk");
+ expected.setAge(29);
+
+ Xpp3ReaderTest.assertEqualsIdentity(result, expected);
+
+
+ }
+
+ @Test
+ public void testReadObjects() throws Exception {
+ List<String> paths = new ArrayList<String>();
+ paths.add("target");
+ paths.add("test-classes");
+ paths.addAll(Arrays.asList(getClass().getPackage().getName().split("\\.")));
+ File file = TestHelper.getFile(TestHelper.getBasedir(), paths.toArray(new String[paths.size()]));
+ file = new File(file, "identities.xml");
+ Reader input = new FileReader(file);
+ Assert.assertNotNull(input);
+ Identity[] result = Xpp3Helper.readObjects(Identity.class, input);
+ Assert.assertNotNull(result);
+ Assert.assertEquals(2, result.length);
+ Identity expected = new Identity();
+ expected.setFirstName("first name");
+ expected.setLastName("last name");
+ expected.setEmail("noway(a)bishop.uk");
+ expected.setAge(29);
+
+ Xpp3ReaderTest.assertEqualsIdentity(result[0], expected);
+
+ expected = new Identity();
+ expected.setFirstName("first name2");
+ expected.setLastName("last name2");
+ expected.setEmail("noway2(a)bishop.uk");
+ expected.setAge(31);
+
+ Xpp3ReaderTest.assertEqualsIdentity(result[1], expected);
+
+
+ }
+}
Property changes on: trunk/src/test/java/org/nuiton/io/xpp3/Xpp3HelperTest.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/test/java/org/nuiton/io/xpp3/Xpp3ReaderTest.java
===================================================================
--- trunk/src/test/java/org/nuiton/io/xpp3/Xpp3ReaderTest.java (rev 0)
+++ trunk/src/test/java/org/nuiton/io/xpp3/Xpp3ReaderTest.java 2009-11-01 19:59:23 UTC (rev 622)
@@ -0,0 +1,85 @@
+package org.nuiton.io.xpp3;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.nuiton.plugin.TestHelper;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * User: chemit
+ * Date: 1 nov. 2009
+ * Time: 19:50:39
+ */
+public class Xpp3ReaderTest {
+
+ protected Xpp3Reader<Identity> r = new IdentityXpp3Reader();
+
+ @Test
+ public void testRead() throws Exception {
+
+ List<String> paths = new ArrayList<String>();
+ paths.add("target");
+ paths.add("test-classes");
+ paths.addAll(Arrays.asList(getClass().getPackage().getName().split("\\.")));
+ File file = TestHelper.getFile(TestHelper.getBasedir(), paths.toArray(new String[paths.size()]));
+ file = new File(file, "identity.xml");
+ Reader input = new FileReader(file);
+ Assert.assertNotNull(input);
+ Identity result = r.read(input);
+ Assert.assertNotNull(result);
+ Identity expected = new Identity();
+ expected.setFirstName("first name");
+ expected.setLastName("last name");
+ expected.setEmail("noway(a)bishop.uk");
+ expected.setAge(29);
+
+ assertEqualsIdentity(result, expected);
+
+ }
+
+
+ @Test
+ public void testReadArray() throws Exception {
+
+ List<String> paths = new ArrayList<String>();
+ paths.add("target");
+ paths.add("test-classes");
+ paths.addAll(Arrays.asList(getClass().getPackage().getName().split("\\.")));
+ File file = TestHelper.getFile(TestHelper.getBasedir(), paths.toArray(new String[paths.size()]));
+ file = new File(file, "identities.xml");
+ Reader input = new FileReader(file);
+ Assert.assertNotNull(input);
+ Identity[] result = r.readArray(input);
+ Assert.assertNotNull(result);
+ Assert.assertEquals(2, result.length);
+ Identity expected = new Identity();
+ expected.setFirstName("first name");
+ expected.setLastName("last name");
+ expected.setEmail("noway(a)bishop.uk");
+ expected.setAge(29);
+
+ assertEqualsIdentity(result[0], expected);
+
+ expected = new Identity();
+ expected.setFirstName("first name2");
+ expected.setLastName("last name2");
+ expected.setEmail("noway2(a)bishop.uk");
+ expected.setAge(31);
+
+ assertEqualsIdentity(result[1], expected);
+ }
+
+ protected static void assertEqualsIdentity(Identity result, Identity expected) {
+ Assert.assertEquals(expected.getFirstName(), result.getFirstName());
+ Assert.assertEquals(expected.getLastName(), result.getLastName());
+ Assert.assertEquals(expected.getEmail(), result.getEmail());
+ Assert.assertEquals(expected.getAge(), result.getAge());
+ }
+
+}
Property changes on: trunk/src/test/java/org/nuiton/io/xpp3/Xpp3ReaderTest.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Modified: trunk/src/test/java/org/nuiton/plugin/TestHelper.java
===================================================================
--- trunk/src/test/java/org/nuiton/plugin/TestHelper.java 2009-11-01 17:01:34 UTC (rev 621)
+++ trunk/src/test/java/org/nuiton/plugin/TestHelper.java 2009-11-01 19:59:23 UTC (rev 622)
@@ -24,11 +24,12 @@
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.PlexusTestCase;
-import java.io.File;
import org.junit.Assert;
+import org.junit.Ignore;
+import java.io.File;
+
/**
- *
* @author chemit
* @since 1.0.3
*/
@@ -39,7 +40,6 @@
protected static DelegateMojoTestCase delegateMojoTest;
/**
- *
* @return the basedir for all tests
* @see PlexusTestCase#getBasedir()
*/
@@ -94,6 +94,7 @@
TestHelper.delegateMojoTest = delegateMojoTest;
}
+ @Ignore
public static class DelegateMojoTestCase extends AbstractMojoTestCase {
@Override
Added: trunk/src/test/resources/META-INF/services/org.nuiton.io.xpp3.Xpp3Reader
===================================================================
--- trunk/src/test/resources/META-INF/services/org.nuiton.io.xpp3.Xpp3Reader (rev 0)
+++ trunk/src/test/resources/META-INF/services/org.nuiton.io.xpp3.Xpp3Reader 2009-11-01 19:59:23 UTC (rev 622)
@@ -0,0 +1 @@
+org.nuiton.io.xpp3.IdentityXpp3Reader
\ No newline at end of file
Added: trunk/src/test/resources/org/nuiton/io/xpp3/identities.xml
===================================================================
--- trunk/src/test/resources/org/nuiton/io/xpp3/identities.xml (rev 0)
+++ trunk/src/test/resources/org/nuiton/io/xpp3/identities.xml 2009-11-01 19:59:23 UTC (rev 622)
@@ -0,0 +1,14 @@
+<identities>
+ <identity>
+ <firstName>first name</firstName>
+ <lastName>last name</lastName>
+ <email>noway(a)bishop.uk</email>
+ <age>29</age>
+ </identity>
+ <identity>
+ <firstName>first name2</firstName>
+ <lastName>last name2</lastName>
+ <email>noway2(a)bishop.uk</email>
+ <age>31</age>
+ </identity>
+</identities>
\ No newline at end of file
Added: trunk/src/test/resources/org/nuiton/io/xpp3/identity.xml
===================================================================
--- trunk/src/test/resources/org/nuiton/io/xpp3/identity.xml (rev 0)
+++ trunk/src/test/resources/org/nuiton/io/xpp3/identity.xml 2009-11-01 19:59:23 UTC (rev 622)
@@ -0,0 +1,6 @@
+<identity>
+ <firstName>first name</firstName>
+ <lastName>last name</lastName>
+ <email>noway(a)bishop.uk</email>
+ <age>29</age>
+</identity>
\ No newline at end of file
1
0
Author: tchemit
Date: 2009-11-01 18:01:34 +0100 (Sun, 01 Nov 2009)
New Revision: 621
Modified:
trunk/src/site/apt/mojo-testFramework.apt
Log:
update doc
Modified: trunk/src/site/apt/mojo-testFramework.apt
===================================================================
--- trunk/src/site/apt/mojo-testFramework.apt 2009-11-01 16:18:50 UTC (rev 620)
+++ trunk/src/site/apt/mojo-testFramework.apt 2009-11-01 17:01:34 UTC (rev 621)
@@ -92,7 +92,7 @@
and writes two pom files names <firstTest.xml> and <secondTest.xml> in directory
--------------------------------------------------------------------------------
-src/test/resources/org/nuiton/test/plugin/MyMojoTest
+src/test/resources/org/nuiton/test/plugin/myMojoTest
--------------------------------------------------------------------------------
Finally, the next directory tree is what you should have for the example project :
@@ -120,7 +120,7 @@
`-- nuiton
`-- test
`-- plugin
- `-- MyMojoTest
+ `-- myMojoTest
|-- firstTest.xml
`-- secondTest.xml
--------------------------------------------------------------------------------
1
0
r620 - in trunk: . src/main/java/org/nuiton/helper/plugin src/test/java/org/nuiton/plugin src/test/resources/org/nuiton/mail/plugin src/test/resources/org/nuiton/mail/plugin/sendEmailMojoTest
by tchemit@users.nuiton.org 01 Nov '09
by tchemit@users.nuiton.org 01 Nov '09
01 Nov '09
Author: tchemit
Date: 2009-11-01 17:18:50 +0100 (Sun, 01 Nov 2009)
New Revision: 620
Added:
trunk/src/test/resources/org/nuiton/mail/plugin/sendEmailMojoTest/
Removed:
trunk/src/main/java/org/nuiton/helper/plugin/CheckProjectFilesPlugin.java
trunk/src/test/resources/org/nuiton/mail/plugin/SendEmailMojoTest/
Modified:
trunk/changelog.txt
trunk/pom.xml
trunk/src/test/java/org/nuiton/plugin/AbstractMojoTest.java
trunk/src/test/resources/org/nuiton/mail/plugin/sendEmailMojoTest/sendEmail.xml
trunk/src/test/resources/org/nuiton/mail/plugin/sendEmailMojoTest/skipSendEmail.xml
Log:
change test dir (use a decapitalize package name to avoid class name collision)
prepare next release
Modified: trunk/changelog.txt
===================================================================
--- trunk/changelog.txt 2009-10-30 20:37:39 UTC (rev 619)
+++ trunk/changelog.txt 2009-11-01 16:18:50 UTC (rev 620)
@@ -1,3 +1,22 @@
+maven-helper-plugin (1.1.0) stable; urgency=high
+
+ * [FIX #60] rendre le plugin compatible maven 2.2.x
+ * [FIX #85] le client rest doit avoir un encoding
+ * [FEATURE #45] utiliser des generics dans le framework de test de mojos
+ * [FEATURE #46] ajout d'un contrat pour faire des parseurs xpp3
+ * [FEATURE #50] utilisation Junit 4.7 et amélioration du framework de test des Mojos
+ * [FEATURE #51] Rethink to AbstractPlugin api
+ * [FEATURE #52] ajout d'un goal neutre d'envoie de mail
+ * [FEATURE #53] ajout d'un goal pour collecter des donnees
+ * [FEATURE #54] ajout d'un client rest basique
+ * [FEATURE #61] ajout des tests d'intégration
+ * [FEATURE #65] reorganisation des packages
+ * [FEATURE #66] documentation des frameworks mojo et test mojo
+ * [FEATURE #69] ajout d'un goal pour exposer des secrets du serveur
+ * [FEATURE #86] Déplacement du paquetage license vers maven-license-plugin
+
+ -- chemit -- Sun, 01 Nov 2009 15:50:59 +0100
+
maven-helper-plugin (1.0.3) stable; urgency=high
* [FEATURE #46] ajout d'un contrat pour faire des parseurs xpp3
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-10-30 20:37:39 UTC (rev 619)
+++ trunk/pom.xml 2009-11-01 16:18:50 UTC (rev 620)
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- ************************************************************* -->
<!-- *** POM Relationships *************************************** -->
<!-- ************************************************************* -->
-
+
<groupId>org.nuiton</groupId>
<artifactId>maven-helper-plugin</artifactId>
@@ -28,13 +29,13 @@
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>
-
+
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
-
+
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
@@ -54,7 +55,7 @@
</dependency>
<!-- plexus -->
-
+
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
@@ -72,13 +73,13 @@
<artifactId>plexus-cipher</artifactId>
<version>1.5</version>
</dependency>
-
+
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>1.0-alpha-9-stable-1</version>
</dependency>
-
+
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-mail-sender-api</artifactId>
@@ -114,7 +115,7 @@
</exclusion>
</exclusions>
</dependency>
-
+
<!-- provided dependencies -->
<dependency>
@@ -135,7 +136,7 @@
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>
-
+
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
@@ -149,16 +150,16 @@
<scope>provided</scope>
</dependency>
- <!-- forces use of javamail 1.4 since it's the only version available in the repo. We should remove this as soon
- as the dependency in plexus-mail-sender-javamail will be updated
- -->
+ <!-- forces use of javamail 1.4 since it's the only version available in the repo. We should remove this as soon
+ as the dependency in plexus-mail-sender-javamail will be updated
+ -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</dependency>
-
+
<!-- tests dependencies -->
<dependency>
@@ -192,7 +193,7 @@
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
</exclusion>
-
+
</exclusions>
</dependency>
@@ -234,7 +235,7 @@
</licenses>
<developers>
-
+
<developer>
<name>Eric Chatellier</name>
<id>echatellier</id>
@@ -326,7 +327,7 @@
<packaging>maven-plugin</packaging>
<properties>
-
+
<license.version>2.0.0</license.version>
<maven.version>2.2.1</maven.version>
<plexusMailSender.version>1.0-alpha-2</plexusMailSender.version>
@@ -338,14 +339,15 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-
+
<maven.test.skip>false</maven.test.skip>
+ <maven.javadoc.skip>false</maven.javadoc.skip>
<!-- to activate generation of reports and javadoc when doing a site -->
<maven.reports.generate>true</maven.reports.generate>
<license.licenseName>lgpl_v3</license.licenseName>
-
+
<repository.home.url>http://maven.nuiton.org/release</repository.home.url>
</properties>
@@ -367,7 +369,7 @@
</testResources>
<plugins>
-
+
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<executions>
@@ -435,11 +437,11 @@
<encoding>${project.reporting.outputEncoding}</encoding>
<charset>${project.reporting.outputEncoding}</charset>
<quiet>true</quiet>
- <!-- uniquement a partir de javadoc 2.5 -->
- <!--skip>${maven.javadoc.skip}</skip-->
+ <skip>${maven.javadoc.skip}</skip>
<taglets>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoAggregatorTypeTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoAggregatorTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -447,7 +449,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoComponentFieldTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoComponentFieldTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -455,7 +458,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoConfiguratorTypeTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoConfiguratorTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -471,7 +475,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecutionStrategyTypeTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecutionStrategyTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -487,7 +492,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInheritByDefaultTypeTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInheritByDefaultTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -495,7 +501,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInstantiationStrategyTypeTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInstantiationStrategyTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -503,7 +510,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoParameterFieldTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoParameterFieldTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -535,7 +543,9 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDependencyResolutionTypeTaglet</tagletClass>
+ <tagletClass>
+ org.apache.maven.tools.plugin.javadoc.MojoRequiresDependencyResolutionTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -543,7 +553,9 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDirectInvocationTypeTaglet</tagletClass>
+ <tagletClass>
+ org.apache.maven.tools.plugin.javadoc.MojoRequiresDirectInvocationTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -551,7 +563,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresOnLineTypeTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresOnLineTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -559,7 +572,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresProjectTypeTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresProjectTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -567,7 +581,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresReportsTypeTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresReportsTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -629,7 +644,7 @@
<artifactId>maven-invoker-plugin</artifactId>
<version>1.3</version>
</plugin>
-
+
<plugin>
<groupId>org.nuiton</groupId>
<artifactId>maven-license-plugin</artifactId>
@@ -650,6 +665,28 @@
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.1.2</version>
+ <configuration>
+ <dependencyDetailsEnabled>${maven.reports.dependencyDetailsEnabled}</dependencyDetailsEnabled>
+ <dependencyLocationsEnabled>${maven.reports.dependencyLocationsEnabled}</dependencyLocationsEnabled>
+ </configuration>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>project-team</report>
+ <report>mailing-list</report>
+ <report>cim</report>
+ <report>issue-tracking</report>
+ <report>license</report>
+ <report>scm</report>
+ <report>dependencies</report>
+ <report>dependency-convergence</report>
+ <report>plugin-management</report>
+ <report>plugins</report>
+ <report>dependency-management</report>
+ <report>summary</report>
+ </reports>
+ </reportSet>
+ </reportSets>
</plugin>
<plugin>
@@ -657,7 +694,7 @@
<version>${javadoc.version}</version>
<configuration>
<quiet>true</quiet>
- <!--<skip>true</skip>-->
+ <skip>${maven.javadoc.skip}</skip>
<docencoding>${project.build.sourceEncoding}</docencoding>
<encoding>${project.build.sourceEncoding}</encoding>
<charset>${project.reporting.outputEncoding}</charset>
@@ -696,7 +733,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecutionStrategyTypeTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecutionStrategyTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -712,7 +750,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInheritByDefaultTypeTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInheritByDefaultTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -720,7 +759,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInstantiationStrategyTypeTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInstantiationStrategyTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -760,7 +800,9 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDependencyResolutionTypeTaglet</tagletClass>
+ <tagletClass>
+ org.apache.maven.tools.plugin.javadoc.MojoRequiresDependencyResolutionTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -768,7 +810,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDirectInvocationTypeTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDirectInvocationTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -776,7 +819,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresOnLineTypeTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresOnLineTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -784,7 +828,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresProjectTypeTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresProjectTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -792,7 +837,8 @@
</tagletArtifact>
</taglet>
<taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresReportsTypeTaglet</tagletClass>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresReportsTypeTaglet
+ </tagletClass>
<tagletArtifact>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-javadoc</artifactId>
@@ -843,7 +889,7 @@
<artifactId>maven-changelog-plugin</artifactId>
<version>2.1</version>
</plugin>
-
+
<!-- Implicit add of reportSet to not generate jira reports -->
<plugin>
<artifactId>maven-changes-plugin</artifactId>
@@ -900,7 +946,7 @@
</plugins>
</reporting>
-
+
<profiles>
<!-- perform only on a release stage when using the maven-release-plugin -->
<profile>
@@ -911,7 +957,7 @@
<value>true</value>
</property>
</activation>
-
+
<build>
<plugins>
@@ -982,7 +1028,7 @@
<maven.reports.generate>false</maven.reports.generate>
</properties>
</profile>
- <!-- do not build dependencies detail in maven-project-info-report (speedup site generation in dev) -->
+ <!-- do not build dependencies detail in maven-project-info-report (speedup site generation in dev) -->
<profile>
<id>nodepdetails</id>
<activation>
Deleted: trunk/src/main/java/org/nuiton/helper/plugin/CheckProjectFilesPlugin.java
===================================================================
--- trunk/src/main/java/org/nuiton/helper/plugin/CheckProjectFilesPlugin.java 2009-10-30 20:37:39 UTC (rev 619)
+++ trunk/src/main/java/org/nuiton/helper/plugin/CheckProjectFilesPlugin.java 2009-11-01 16:18:50 UTC (rev 620)
@@ -1,129 +0,0 @@
-/*
- * *##%
- * Maven helper plugin
- * Copyright (C) 2009 CodeLutin
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/lgpl-3.0.html>.
- * ##%*
- */
-package org.nuiton.helper.plugin;
-
-import org.nuiton.plugin.*;
-import java.io.File;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.project.MavenProject;
-
-/**
- * Check that :
- *
- * 1) the changelog exists on standalone module or root module of a
- * multi-module project.
- * 2) any project module has a README.txt and LICENSE.txt file
- *
- * @goal check-project-files
- * @requiresProject true
- * @phase validate
- * @author chemit
- * @since 1.0.2
- * @deprecated since 1.0.3, reuse just a enforcer plugin to check those files. (removed in 1.1.0)
- */
-@Deprecated
-public class CheckProjectFilesPlugin extends AbstractPlugin {
-
- /**
- * Dependance du projet.
- *
- * @parameter default-value="${project}"
- * @required
- * @since 1.0.2
- */
- protected MavenProject project;
- /**
- * Un flag pour activer le mode verbeux.
- *
- * @parameter expression="${helper.verbose}" default-value="${maven.verbose}"
- * @since 1.0.2
- */
- protected boolean verbose;
-
- @Override
- public MavenProject getProject() {
- return project;
- }
-
- @Override
- public void setProject(MavenProject project) {
- this.project = project;
- }
-
- @Override
- public boolean isVerbose() {
- return verbose;
- }
-
- @Override
- public void setVerbose(boolean verbose) {
- this.verbose = verbose;
- }
-
- @Override
- protected boolean init() throws Exception {
- return true;
- }
-
- @Override
- protected void doAction() throws Exception {
- checkChangelogFile();
- checkReadmeFile();
- checkLicenseFile();
- }
-
- protected void checkChangelogFile() throws MojoExecutionException {
- if (project.isExecutionRoot()) {
- File f = new File(project.getBasedir(), "changelog.txt");
- if (!f.exists()) {
- throw new MojoExecutionException("the module " + project.getName() + " requires the file " + f.getAbsolutePath());
- } else {
- if (verbose) {
- getLog().info("changelog file dectected : " + f.getAbsolutePath());
- }
- }
- } else {
- getLog().info("changelog.txt is not required for module " + project.getName() + " (not a root module)");
- }
- }
-
- protected void checkReadmeFile() throws MojoExecutionException {
- File f = new File(project.getBasedir(), "README.txt");
- if (!f.exists()) {
- throw new MojoExecutionException("the module " + project.getName() + " requires the file " + f.getAbsolutePath());
- } else {
- if (verbose) {
- getLog().info("readme file dectected : " + f.getAbsolutePath());
- }
- }
- }
-
- protected void checkLicenseFile() throws MojoExecutionException {
- File f = new File(project.getBasedir(), "LICENSE.txt");
- if (!f.exists()) {
- throw new MojoExecutionException("the module " + project.getName() + " requires the file " + f.getAbsolutePath());
- } else {
- if (verbose) {
- getLog().info("license file dectected : " + f.getAbsolutePath());
- }
- }
- }
-}
Modified: trunk/src/test/java/org/nuiton/plugin/AbstractMojoTest.java
===================================================================
--- trunk/src/test/java/org/nuiton/plugin/AbstractMojoTest.java 2009-10-30 20:37:39 UTC (rev 619)
+++ trunk/src/test/java/org/nuiton/plugin/AbstractMojoTest.java 2009-11-01 16:18:50 UTC (rev 620)
@@ -20,7 +20,9 @@
*/
package org.nuiton.plugin;
+import java.beans.Introspector;
import java.io.File;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.maven.plugin.Mojo;
@@ -35,12 +37,12 @@
/**
* Base test class for a mojo.
- *
+ * <p/>
* <b>Note:</b> replace the previous class
* {@code org.nuiton.util.BasePluginTestCase}.
* <p/>
* Inside each test method, we can use the following objects :
- *
+ * <p/>
* <ul>
* <li>{@link #getTestDir()} : location of mojo resources (where the pom file for example)</li>
* <li>{@link #getPomFile()} : location of the pom file</li>
@@ -57,9 +59,9 @@
* <li>{@link #createMojo(java.io.File, java.lang.String)}</li>
* <li>{@link #setUpMojo(org.nuiton.plugin.Plugin, java.io.File)}</li>
* </ul>
- *
+ *
+ * @author chemit
* @param <P> type of goal to test
- * @author chemit
* @since 1.0.3
*/
public abstract class AbstractMojoTest<P extends Plugin> {
@@ -117,9 +119,8 @@
* <p/>
* By convention, we should consider that a test class use always the same
* goal's name.
- *
+ *
* @param methodName the name of the next test to execute.
- *
* @return the name of the goal to test for the given method test name.
*/
protected abstract String getGoalName(String methodName);
@@ -130,16 +131,17 @@
* <p/>
* By convention, will be the package named by the test class name from the
* {@link #getTestBasedir()}.
- *
+ *
* @param methodName the method of the next test to execute
- * @param goalName the common goal name to use
+ * @param goalName the common goal name to use
* @return the directory where to find resources for the test
*/
protected File getTestDir(String methodName, String goalName) {
- String rep = getClass().getName();
+ //TC-20091101 use a decipatilize simple name to avoid conflict of package with
+ // existing class name.
+ String rep = getClass().getPackage().getName() + "." + Introspector.decapitalize(getClass().getSimpleName());
rep = rep.replaceAll("\\.", File.separator);
-
File testDir = new File(getTestBasedir(), rep);
if (isVerbose()) {
log.info("test dir = " + getRelativePathFromBasedir(testDir));
@@ -155,11 +157,11 @@
* <p/>
* By default, the pom file is the file with name {@code methodName+".xml"}
* in the {@code testDir}.
- *
- * @param testDir the location of resources for the next test (is the result
- * of the method {@link #getTestDir(java.lang.String, java.lang.String)}.
+ *
+ * @param testDir the location of resources for the next test (is the result
+ * of the method {@link #getTestDir(java.lang.String, java.lang.String)}.
* @param methodName the name of the next test
- * @param goalName the name of the common goal
+ * @param goalName the name of the common goal
* @return the location of the pom file for the next mojo test.
*/
protected File getPomFile(File testDir, String methodName, String goalName) {
@@ -178,7 +180,7 @@
* Create the mojo base on the given {@code pomFile} for the
* given {@code goalName}.
*
- * @param pomFile the location of the pom file
+ * @param pomFile the location of the pom file
* @param goalName the name of the goal to lookup
* @return the instanciated mojo
* @throws Exception if any problem while creating the mojo
@@ -193,7 +195,7 @@
/**
* Initialize the given mojo.
*
- * @param mojo the instanciate mojo
+ * @param mojo the instanciate mojo
* @param pomFile the pom file used to instanciate the mojo
* @throws Exception if any pb
*/
@@ -238,7 +240,7 @@
/**
* To offer inside each test method (annotated by a {@link org.junit.Test}) the
* following properties :
- *
+ * <p/>
* <ul>
* <li>{@link #testDir} : location where to find resources for the test</li>
* <li>{@link #pomFile} : location of the pom file to use to build the mojo</li>
Modified: trunk/src/test/resources/org/nuiton/mail/plugin/sendEmailMojoTest/sendEmail.xml
===================================================================
--- trunk/src/test/resources/org/nuiton/mail/plugin/SendEmailMojoTest/sendEmail.xml 2009-10-30 20:37:39 UTC (rev 619)
+++ trunk/src/test/resources/org/nuiton/mail/plugin/sendEmailMojoTest/sendEmail.xml 2009-11-01 16:18:50 UTC (rev 620)
@@ -15,7 +15,7 @@
<groupId>org.nuiton</groupId>
<artifactId>maven-helper-plugin</artifactId>
<configuration>
- <emailContentFile>target/test-classes/org/nuiton/mail/plugin/SendEmailMojoTest/mailContentFile.txt</emailContentFile>
+ <emailContentFile>target/test-classes/org/nuiton/mail/plugin/sendEmailMojoTest/mailContentFile.txt</emailContentFile>
<emailTitle>[ANNOUNCEMENT] - One 1.0.0 released</emailTitle>
<encoding>UTF-8</encoding>
<skipSendEmail>false</skipSendEmail>
Modified: trunk/src/test/resources/org/nuiton/mail/plugin/sendEmailMojoTest/skipSendEmail.xml
===================================================================
--- trunk/src/test/resources/org/nuiton/mail/plugin/SendEmailMojoTest/skipSendEmail.xml 2009-10-30 20:37:39 UTC (rev 619)
+++ trunk/src/test/resources/org/nuiton/mail/plugin/sendEmailMojoTest/skipSendEmail.xml 2009-11-01 16:18:50 UTC (rev 620)
@@ -15,7 +15,7 @@
<groupId>org.nuiton</groupId>
<artifactId>maven-helper-plugin</artifactId>
<configuration>
- <emailContentFile>target/test-classes/org/nuiton/smail/plugin/SendEmailMojoTest/mailContentFile.txt</emailContentFile>
+ <emailContentFile>target/test-classes/org/nuiton/smail/plugin/sendEmailMojoTest/mailContentFile.txt</emailContentFile>
<emailTitle>[ANNOUNCEMENT] - One 1.0.0 released</emailTitle>
<encoding>UTF-8</encoding>
<skipSendEmail>true</skipSendEmail>
1
0