maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r925527 - in /maven/archetype/trunk/archetype-common/src/test/java/org/apache/maven/archetype: common/TestDefaultArchetypeFilesResolver.java generator/DefaultArchetypeGeneratorTest.java
Date Sat, 20 Mar 2010 02:08:33 GMT
Author: hboutemy
Date: Sat Mar 20 02:08:32 2010
New Revision: 925527

URL: http://svn.apache.org/viewvc?rev=925527&view=rev
Log:
moved DefaultArchetypeFilesResolver unit test to a separate JUnit class

Added:
    maven/archetype/trunk/archetype-common/src/test/java/org/apache/maven/archetype/common/TestDefaultArchetypeFilesResolver.java
  (with props)
Modified:
    maven/archetype/trunk/archetype-common/src/test/java/org/apache/maven/archetype/generator/DefaultArchetypeGeneratorTest.java

Added: maven/archetype/trunk/archetype-common/src/test/java/org/apache/maven/archetype/common/TestDefaultArchetypeFilesResolver.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-common/src/test/java/org/apache/maven/archetype/common/TestDefaultArchetypeFilesResolver.java?rev=925527&view=auto
==============================================================================
--- maven/archetype/trunk/archetype-common/src/test/java/org/apache/maven/archetype/common/TestDefaultArchetypeFilesResolver.java
(added)
+++ maven/archetype/trunk/archetype-common/src/test/java/org/apache/maven/archetype/common/TestDefaultArchetypeFilesResolver.java
Sat Mar 20 02:08:32 2010
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.maven.archetype.common;
+
+import junit.framework.TestCase;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.archetype.metadata.FileSet;
+
+public class TestDefaultArchetypeFilesResolver
+    extends TestCase
+{
+    public void testResourceFiltering()
+        throws Exception
+    {
+        FileSet fileSet = new FileSet();
+
+        fileSet.addInclude( "**/*.java" );
+
+        fileSet.setDirectory( "src/main/java" );
+        fileSet.setEncoding( "UTF-8" );
+        fileSet.setPackaged( true );
+        fileSet.setFiltered( true );
+
+        List archetypeResources = new ArrayList();
+
+        archetypeResources.add( "pom.xml" );
+        archetypeResources.add( "App.java" );
+        archetypeResources.add( "src/main/c/App.c" );
+        archetypeResources.add( "src/main/java/App.java" );
+        archetypeResources.add( "src/main/java/inner/package/App2.java" );
+        archetypeResources.add( "src/main/mdo/App.mdo" );
+        archetypeResources.add( "src/main/resources/App.properties" );
+        archetypeResources.add( "src/main/resources/inner/dir/App2.properties" );
+        archetypeResources.add( "src/test/c/AppTest.c" );
+        archetypeResources.add( "src/test/java/AppTest.java" );
+        archetypeResources.add( "src/test/mdo/AppTest.mdo" );
+        archetypeResources.add( "src/test/resources/AppTest.properties" );
+
+        System.out.println( "FileSet:" + fileSet );
+        System.out.println( "Resources:" + archetypeResources );
+
+        ArchetypeFilesResolver resolver = new DefaultArchetypeFilesResolver();
+
+        List fileSetResources = resolver.filterFiles( "", fileSet, archetypeResources );
+
+        System.out.println( "Result:" + fileSetResources );
+
+        assertEquals( 2, fileSetResources.size() );
+    }
+
+}

Propchange: maven/archetype/trunk/archetype-common/src/test/java/org/apache/maven/archetype/common/TestDefaultArchetypeFilesResolver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archetype/trunk/archetype-common/src/test/java/org/apache/maven/archetype/common/TestDefaultArchetypeFilesResolver.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/archetype/trunk/archetype-common/src/test/java/org/apache/maven/archetype/generator/DefaultArchetypeGeneratorTest.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-common/src/test/java/org/apache/maven/archetype/generator/DefaultArchetypeGeneratorTest.java?rev=925527&r1=925526&r2=925527&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-common/src/test/java/org/apache/maven/archetype/generator/DefaultArchetypeGeneratorTest.java
(original)
+++ maven/archetype/trunk/archetype-common/src/test/java/org/apache/maven/archetype/generator/DefaultArchetypeGeneratorTest.java
Sat Mar 20 02:08:32 2010
@@ -19,8 +19,6 @@
 
 package org.apache.maven.archetype.generator;
 
-import org.apache.maven.archetype.common.DefaultArchetypeFilesResolver;
-import org.apache.maven.archetype.metadata.FileSet;
 import org.apache.maven.archetype.ArchetypeGenerationRequest;
 import org.apache.maven.archetype.ArchetypeGenerationResult;
 import org.apache.maven.artifact.repository.ArtifactRepository;
@@ -42,8 +40,6 @@ import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
 import java.util.Properties;
 
 public class DefaultArchetypeGeneratorTest
@@ -777,43 +773,6 @@ public class DefaultArchetypeGeneratorTe
         }
     }
 
-    public void testResourceFiltering()
-        throws Exception
-    {
-        FileSet fileSet = new FileSet();
-
-        fileSet.addInclude( "**/*.java" );
-
-        fileSet.setDirectory( "src/main/java" );
-        fileSet.setEncoding( "UTF-8" );
-        fileSet.setPackaged( true );
-        fileSet.setFiltered( true );
-
-        List archetypeResources = new ArrayList();
-
-        archetypeResources.add( "pom.xml" );
-        archetypeResources.add( "App.java" );
-        archetypeResources.add( "src/main/c/App.c" );
-        archetypeResources.add( "src/main/java/App.java" );
-        archetypeResources.add( "src/main/java/inner/package/App2.java" );
-        archetypeResources.add( "src/main/mdo/App.mdo" );
-        archetypeResources.add( "src/main/resources/App.properties" );
-        archetypeResources.add( "src/main/resources/inner/dir/App2.properties" );
-        archetypeResources.add( "src/test/c/AppTest.c" );
-        archetypeResources.add( "src/test/java/AppTest.java" );
-        archetypeResources.add( "src/test/mdo/AppTest.mdo" );
-        archetypeResources.add( "src/test/resources/AppTest.properties" );
-
-        System.out.println( "FileSet:" + fileSet );
-        System.out.println( "Resources:" + archetypeResources );
-
-        DefaultArchetypeFilesResolver resolver = new DefaultArchetypeFilesResolver();
-
-        List fileSetResources = resolver.filterFiles( "", fileSet, archetypeResources );
-        System.out.println( "Result:" + fileSetResources );
-        assertEquals( 2, fileSetResources.size() );
-    }
-
     protected void tearDown()
         throws Exception
     {



Mime
View raw message