ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/etc/testcases/taskdefs/optional/depend/src1 E.java
Date Fri, 20 Dec 2002 13:57:12 GMT
conor       2002/12/20 05:57:12

  Modified:    src/etc/testcases/taskdefs/optional/depend depend.xml
               src/testcases/org/apache/tools/ant/types/optional/depend
                        ClassFileSetTest.java
  Added:       src/etc/testcases/taskdefs/optional/depend/src1 E.java
  Log:
  Add test cases for class fileset to pick up new dependency types
  
  PR: 13273
  Obtained from: Jesse
  
  Revision  Changes    Path
  1.9       +4 -0      jakarta-ant/src/etc/testcases/taskdefs/optional/depend/depend.xml
  
  Index: depend.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/optional/depend/depend.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -u -r1.8 -r1.9
  --- depend.xml	9 Apr 2002 13:20:08 -0000	1.8
  +++ depend.xml	20 Dec 2002 13:57:12 -0000	1.9
  @@ -97,6 +97,10 @@
       </jar>
     </target>
     
  +  <target name="testmethodparam" depends="src1setup, compile">
  +    <classfileset id="result" dir="${classes.dir}" rootclass="E"/>
  +  </target>
  +  
     <target name="testinner" depends="src2setup, compile">
       <sleep seconds="3"/>
       <delete file="${tempsrc.dir}/B.java"/>
  
  
  
  1.2       +27 -0     jakarta-ant/src/testcases/org/apache/tools/ant/types/optional/depend/ClassFileSetTest.java
  
  Index: ClassFileSetTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/types/optional/depend/ClassFileSetTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -u -r1.1 -r1.2
  --- ClassFileSetTest.java	4 Apr 2002 14:12:19 -0000	1.1
  +++ ClassFileSetTest.java	20 Dec 2002 13:57:12 -0000	1.2
  @@ -158,4 +158,31 @@
       public void testByReference() {
           executeTarget("testbyreference");
       }
  +    
  +    /**
  +     * Test that classes included in a method "System.out.println(MyClass.class)" are included.
  +     */
  +    public void testMethodParam() {
  +        Project project = getProject();
  +        executeTarget("testmethodparam");
  +        FileSet resultFileSet = (FileSet)project.getReference(RESULT_FILESET);
  +        DirectoryScanner scanner = resultFileSet.getDirectoryScanner(project);
  +        String[] scannedFiles = scanner.getIncludedFiles();
  +        Hashtable files = new Hashtable();
  +        for (int i = 0; i < scannedFiles.length; ++i) {
  +            files.put(scannedFiles[i], scannedFiles[i]);
  +        }
  +        assertEquals("Classfileset did not pick up expected number of "
  +            + "class files", 5, files.size());
  +        assertTrue("Result did not contain A.class",
  +            files.containsKey("A.class"));
  +        assertTrue("Result did not contain B.class",
  +            files.containsKey("B.class"));
  +        assertTrue("Result did not contain C.class",
  +            files.containsKey("C.class"));
  +        assertTrue("Result did not contain D.class",
  +            files.containsKey("D.class"));
  +        assertTrue("Result did not contain E.class",
  +            files.containsKey("E.class"));
  +    }    
   }
  
  
  
  1.1                  jakarta-ant/src/etc/testcases/taskdefs/optional/depend/src1/E.java
  
  Index: E.java
  ===================================================================
  public class E {
      E() {
          System.out.println(A.class);
      }
  }
  
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message