You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/04/16 18:53:25 UTC

[GitHub] [maven-archetype] elharo commented on a change in pull request #35: ARCHETYPE-584 fix indention in root pom.xml

elharo commented on a change in pull request #35: ARCHETYPE-584 fix indention in root pom.xml
URL: https://github.com/apache/maven-archetype/pull/35#discussion_r409776830
 
 

 ##########
 File path: archetype-common/src/test/java/org/apache/maven/archetype/old/ArchetypeTest.java
 ##########
 @@ -239,93 +250,118 @@ private ClassLoader getContextClassloader( Artifact archetypeArtifact, ArtifactR
         return archetypeJarLoader;
     }
 
-    public void testAddModuleToParentPOM()
-        throws Exception
+    public void testAddModuleToParentBasic()
+            throws Exception
     {
-        String pom = "<project>\n"
-            + "  <packaging>pom</packaging>\n"
-            + "</project>";
+        String pom = PROJECT_ELEMENT
+                + PACKAGING
+                + PROJECT_ELEMENT_END;
 
         StringWriter out = new StringWriter();
         assertTrue( DefaultOldArchetype.addModuleToParentPom( "myArtifactId1", new StringReader( pom ), out ) );
 
-        assertThat( out.toString(), isIdenticalTo( "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
-                + "<project>\n"
-                + "  <packaging>pom</packaging>\n"
+        assertThat( out.toString(), isIdenticalTo( XML_VERSION_1_0
+                + PROJECT_ELEMENT
+                + PACKAGING
                 + "  <modules>\n"
                 + "    <module>myArtifactId1</module>\n"
                 + "  </modules>\n"
-                + "</project>" ).normalizeWhitespace() );
+                + PROJECT_ELEMENT_END ) );
+    }
 
-        pom = "<project>\n"
-            + "  <modelVersion>4.0.0</modelVersion>\n"
-            + "  <packaging>pom</packaging>\n"
-            + "</project>";
+    public void testAddModuleToParentWithModelVersion()
+            throws Exception
+    {
+        String pom = PROJECT_ELEMENT
+                + MODEL_VERSION
+                + PACKAGING
+                + PROJECT_ELEMENT_END;
 
-        out = new StringWriter();
+        StringWriter out = new StringWriter();
 
 Review comment:
   Looks like this could be a field that doesn't need to be initialized in each method.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services