You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by si...@apache.org on 2009/02/09 23:00:52 UTC
svn commit: r742760 -
/maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java
Author: sisbell
Date: Mon Feb 9 22:00:52 2009
New Revision: 742760
URL: http://svn.apache.org/viewvc?rev=742760&view=rev
Log:
Fixed path problem on unit test.
Modified:
maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java
Modified: maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java?rev=742760&r1=742759&r2=742760&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java (original)
+++ maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java Mon Feb 9 22:00:52 2009
@@ -213,10 +213,11 @@
{
PomTestWrapper pom = buildPomFromMavenProject( "reporting-interpolation", null );
pom = new PomTestWrapper(pom.getMavenProject());
- assertEquals( System.getProperty("user.dir")
- + "/src/test/resources-project-builder/reporting-interpolation/target/site",
+ assertEquals( createPath(Arrays.asList(System.getProperty("user.dir"),
+ "src", "test", "resources-project-builder", "reporting-interpolation", "target", "site")),
pom.getValue( "reporting/outputDirectory" ) );
- }
+ }
+
public void testPluginOrder()
throws Exception
@@ -396,7 +397,7 @@
assertEquals( "<?xml version='1.0'?>Tom&Jerry", pom.getValue( "properties/xmlTest" ) );
}
- /* FIXME: cf. MNG-3925
+ /* FIXME: cf. MNG-3925
public void testOrderOfMergedPluginExecutionsWithoutPluginManagement()
throws Exception
{
@@ -918,4 +919,14 @@
artifact.setFile( artifacts.get( id ) );
}
}
+
+ private static String createPath(List<String> elements)
+ {
+ StringBuffer buffer = new StringBuffer();
+ for(String s : elements)
+ {
+ buffer.append(s).append(File.separator);
+ }
+ return buffer.toString().substring(0, buffer.toString().length() - 1);
+ }
}
Re: svn commit: r742760 - /maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java
Posted by Benjamin Bentmann <be...@udo.edu>.
Hi Shane,
> Author: sisbell
> Date: Mon Feb 9 22:00:52 2009
> New Revision: 742760
>
> URL: http://svn.apache.org/viewvc?rev=742760&view=rev
> Log:
> Fixed path problem on unit test.
>
> Modified:
> maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java
>
> + private static String createPath(List<String> elements)
> + {
> + StringBuffer buffer = new StringBuffer();
> + for(String s : elements)
> + {
> + buffer.append(s).append(File.separator);
> + }
> + return buffer.toString().substring(0, buffer.toString().length() - 1);
> + }
> }
When targetting Java 1.5+, consider to use StringBuilder instead of
StringBuffer in places where thread synchronization is not required. For
the test method above, it doesn't really matter, this is just a general
tip to keep in mind for the production code.
Benjamin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org