ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r592845 - in /ant/core/trunk/src/tests/junit/org/apache/tools/ant/types: AbstractFileSetTest.java FileListTest.java MapperTest.java PathTest.java PatternSetTest.java TarFileSetTest.java XMLCatalogTest.java ZipFileSetTest.java
Date Wed, 07 Nov 2007 18:26:08 GMT
Author: jhm
Date: Wed Nov  7 10:26:07 2007
New Revision: 592845

URL: http://svn.apache.org/viewvc?rev=592845&view=rev
Log:
Remove use of deprecated constructor calls: Reference(String) and Reference()

Modified:
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/AbstractFileSetTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/FileListTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/MapperTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/PathTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/PatternSetTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/TarFileSetTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/ZipFileSetTest.java

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/AbstractFileSetTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/AbstractFileSetTest.java?rev=592845&r1=592844&r2=592845&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/AbstractFileSetTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/AbstractFileSetTest.java Wed
Nov  7 10:26:07 2007
@@ -55,7 +55,7 @@
         AbstractFileSet f = getInstance();
         f.setIncludes("**/*.java");
         try {
-            f.setRefid(new Reference("dummyref"));
+            f.setRefid(new Reference(getProject(), "dummyref"));
             fail("Can add reference to "
                  + f.getDataTypeName()
                  + " with elements from setIncludes");
@@ -67,7 +67,7 @@
         f = getInstance();
         f.createPatternSet();
         try {
-            f.setRefid(new Reference("dummyref"));
+            f.setRefid(new Reference(getProject(), "dummyref"));
             fail("Can add reference to "
                  + f.getDataTypeName()
                  + " with nested patternset element.");
@@ -79,7 +79,7 @@
         f = getInstance();
         f.createInclude();
         try {
-            f.setRefid(new Reference("dummyref"));
+            f.setRefid(new Reference(getProject(), "dummyref"));
             fail("Can add reference to "
                  + f.getDataTypeName()
                  + " with nested include element.");
@@ -89,7 +89,7 @@
         }
 
         f = getInstance();
-        f.setRefid(new Reference("dummyref"));
+        f.setRefid(new Reference(getProject(), "dummyref"));
         try {
             f.setIncludes("**/*.java");
             fail("Can set includes in "
@@ -185,7 +185,7 @@
     public void testCircularReferenceCheck() {
         AbstractFileSet f = getInstance();
         project.addReference("dummy", f);
-        f.setRefid(new Reference("dummy"));
+        f.setRefid(new Reference(getProject(), "dummy"));
         try {
             f.getDir(project);
             fail("Can make " + f.getDataTypeName()
@@ -206,13 +206,13 @@
         // dummy1 --> dummy2 --> dummy3 --> dummy1
         AbstractFileSet f1 = getInstance();
         project.addReference("dummy1", f1);
-        f1.setRefid(new Reference("dummy2"));
+        f1.setRefid(new Reference(getProject(), "dummy2"));
         AbstractFileSet f2 = getInstance();
         project.addReference("dummy2", f2);
-        f2.setRefid(new Reference("dummy3"));
+        f2.setRefid(new Reference(getProject(), "dummy3"));
         AbstractFileSet f3 = getInstance();
         project.addReference("dummy3", f3);
-        f3.setRefid(new Reference("dummy1"));
+        f3.setRefid(new Reference(getProject(), "dummy1"));
         try {
             f1.getDir(project);
             fail("Can make circular reference.");
@@ -232,10 +232,10 @@
         // (which has the Project's basedir as root).
         f1 = getInstance();
         project.addReference("dummy1", f1);
-        f1.setRefid(new Reference("dummy2"));
+        f1.setRefid(new Reference(getProject(), "dummy2"));
         f2 = getInstance();
         project.addReference("dummy2", f2);
-        f2.setRefid(new Reference("dummy3"));
+        f2.setRefid(new Reference(getProject(), "dummy3"));
         f3 = getInstance();
         project.addReference("dummy3", f3);
         f3.setDir(project.resolveFile("."));

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/FileListTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/FileListTest.java?rev=592845&r1=592844&r2=592845&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/FileListTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/FileListTest.java Wed Nov  7
10:26:07 2007
@@ -41,7 +41,7 @@
         FileList f = new FileList();
         f.setDir(project.resolveFile("."));
         try {
-            f.setRefid(new Reference("dummyref"));
+            f.setRefid(new Reference(getProject(), "dummyref"));
             fail("Can add reference to FileList with directory attribute set.");
         } catch (BuildException be) {
             assertEquals("You must not specify more than one attribute when using refid",
@@ -51,7 +51,7 @@
         f = new FileList();
         f.setFiles("foo.xml,c/d/bar.xml");
         try {
-            f.setRefid(new Reference("dummyref"));
+            f.setRefid(new Reference(getProject(), "dummyref"));
             fail("Can add reference to FileList with file attribute set.");
         } catch (BuildException be) {
             assertEquals("You must not specify more than one attribute when using refid",
@@ -59,7 +59,7 @@
         }
 
         f = new FileList();
-        f.setRefid(new Reference("dummyref"));
+        f.setRefid(new Reference(getProject(), "dummyref"));
         try {
             f.setFiles("a/b/foo.java");
             fail("Can set files in FileList that is a reference.");
@@ -79,7 +79,7 @@
     public void testCircularReferenceCheck() {
         FileList f = new FileList();
         project.addReference("dummy", f);
-        f.setRefid(new Reference("dummy"));
+        f.setRefid(new Reference(getProject(), "dummy"));
         try {
             f.getDir(project);
             fail("Can make FileList a Reference to itself.");
@@ -98,13 +98,13 @@
         // dummy1 --> dummy2 --> dummy3 --> dummy1
         FileList f1 = new FileList();
         project.addReference("dummy1", f1);
-        f1.setRefid(new Reference("dummy2"));
+        f1.setRefid(new Reference(getProject(), "dummy2"));
         FileList f2 = new FileList();
         project.addReference("dummy2", f2);
-        f2.setRefid(new Reference("dummy3"));
+        f2.setRefid(new Reference(getProject(), "dummy3"));
         FileList f3 = new FileList();
         project.addReference("dummy3", f3);
-        f3.setRefid(new Reference("dummy1"));
+        f3.setRefid(new Reference(getProject(), "dummy1"));
         try {
             f1.getDir(project);
             fail("Can make circular reference.");
@@ -124,10 +124,10 @@
         // (which has the Project's basedir as root).
         f1 = new FileList();
         project.addReference("dummy1", f1);
-        f1.setRefid(new Reference("dummy2"));
+        f1.setRefid(new Reference(getProject(), "dummy2"));
         f2 = new FileList();
         project.addReference("dummy2", f2);
-        f2.setRefid(new Reference("dummy3"));
+        f2.setRefid(new Reference(getProject(), "dummy3"));
         f3 = new FileList();
         project.addReference("dummy3", f3);
         f3.setDir(project.resolveFile("."));

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/MapperTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/MapperTest.java?rev=592845&r1=592844&r2=592845&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/MapperTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/MapperTest.java Wed Nov  7 10:26:07
2007
@@ -54,7 +54,7 @@
         Mapper m = new Mapper(project);
         m.setFrom("*.java");
         try {
-            m.setRefid(new Reference("dummyref"));
+            m.setRefid(new Reference(project, "dummyref"));
             fail("Can add reference to Mapper with from attribute set");
         } catch (BuildException be) {
             assertEquals("You must not specify more than one attribute when using refid",
@@ -62,7 +62,7 @@
         }
 
         m = new Mapper(project);
-        m.setRefid(new Reference("dummyref"));
+        m.setRefid(new Reference(project, "dummyref"));
         try {
             m.setFrom("*.java");
             fail("Can set from in Mapper that is a reference.");
@@ -72,7 +72,7 @@
         }
 
         m = new Mapper(project);
-        m.setRefid(new Reference("dummyref"));
+        m.setRefid(new Reference(project, "dummyref"));
         try {
             m.setTo("*.java");
             fail("Can set to in Mapper that is a reference.");
@@ -94,7 +94,7 @@
     public void testCircularReferenceCheck() {
         Mapper m = new Mapper(project);
         project.addReference("dummy", m);
-        m.setRefid(new Reference("dummy"));
+        m.setRefid(new Reference(project, "dummy"));
         try {
             m.getImplementation();
             fail("Can make Mapper a Reference to itself.");
@@ -106,13 +106,13 @@
         // dummy1 --> dummy2 --> dummy3 --> dummy1
         Mapper m1 = new Mapper(project);
         project.addReference("dummy1", m1);
-        m1.setRefid(new Reference("dummy2"));
+        m1.setRefid(new Reference(project, "dummy2"));
         Mapper m2 = new Mapper(project);
         project.addReference("dummy2", m2);
-        m2.setRefid(new Reference("dummy3"));
+        m2.setRefid(new Reference(project, "dummy3"));
         Mapper m3 = new Mapper(project);
         project.addReference("dummy3", m3);
-        m3.setRefid(new Reference("dummy1"));
+        m3.setRefid(new Reference(project, "dummy1"));
         try {
             m1.getImplementation();
             fail("Can make circular reference.");
@@ -125,10 +125,10 @@
         // (which holds a glob mapper from "*.java" to "*.class"
         m1 = new Mapper(project);
         project.addReference("dummy1", m1);
-        m1.setRefid(new Reference("dummy2"));
+        m1.setRefid(new Reference(project, "dummy2"));
         m2 = new Mapper(project);
         project.addReference("dummy2", m2);
-        m2.setRefid(new Reference("dummy3"));
+        m2.setRefid(new Reference(project, "dummy3"));
         m3 = new Mapper(project);
         project.addReference("dummy3", m3);
         Mapper.MapperType mt = new Mapper.MapperType();

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/PathTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/PathTest.java?rev=592845&r1=592844&r2=592845&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/PathTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/PathTest.java Wed Nov  7 10:26:07
2007
@@ -387,7 +387,7 @@
     public void testEmptyElementIfIsReference() {
         Path p = new Path(project, "/a:/a");
         try {
-            p.setRefid(new Reference("dummyref"));
+            p.setRefid(new Reference(project, "dummyref"));
             fail("Can add reference to Path with elements from constructor");
         } catch (BuildException be) {
             assertEquals("You must not specify more than one attribute when using refid",
@@ -397,7 +397,7 @@
         p = new Path(project);
         p.setLocation(new File("/a"));
         try {
-            p.setRefid(new Reference("dummyref"));
+            p.setRefid(new Reference(project, "dummyref"));
             fail("Can add reference to Path with elements from setLocation");
         } catch (BuildException be) {
             assertEquals("You must not specify more than one attribute when using refid",
@@ -407,7 +407,7 @@
         Path another = new Path(project, "/a:/a");
         project.addReference("dummyref", another);
         p = new Path(project);
-        p.setRefid(new Reference("dummyref"));
+        p.setRefid(new Reference(project, "dummyref"));
         try {
             p.setLocation(new File("/a"));
             fail("Can set location in Path that is a reference.");
@@ -468,7 +468,7 @@
     public void testCircularReferenceCheck() {
         Path p = new Path(project);
         project.addReference("dummy", p);
-        p.setRefid(new Reference("dummy"));
+        p.setRefid(new Reference(project, "dummy"));
         try {
             p.list();
             fail("Can make Path a Reference to itself.");
@@ -484,7 +484,7 @@
         project.addReference("dummy2", p2);
         Path p3 = p2.createPath();
         project.addReference("dummy3", p3);
-        p3.setRefid(new Reference("dummy1"));
+        p3.setRefid(new Reference(project, "dummy1"));
         try {
             p1.list();
             fail("Can make circular reference.");

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/PatternSetTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/PatternSetTest.java?rev=592845&r1=592844&r2=592845&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/PatternSetTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/PatternSetTest.java Wed Nov
 7 10:26:07 2007
@@ -49,7 +49,7 @@
         PatternSet p = new PatternSet();
         p.setIncludes("**/*.java");
         try {
-            p.setRefid(new Reference("dummyref"));
+            p.setRefid(new Reference(project, "dummyref"));
             fail("Can add reference to PatternSet with elements from setIncludes");
         } catch (BuildException be) {
             assertEquals("You must not specify more than one attribute when using refid",
@@ -57,7 +57,7 @@
         }
 
         p = new PatternSet();
-        p.setRefid(new Reference("dummyref"));
+        p.setRefid(new Reference(project, "dummyref"));
         try {
             p.setIncludes("**/*.java");
             fail("Can set includes in PatternSet that is a reference.");
@@ -67,7 +67,7 @@
         }
 
         p = new PatternSet();
-        p.setRefid(new Reference("dummyref"));
+        p.setRefid(new Reference(project, "dummyref"));
         try {
             p.setIncludesfile(new File("/a"));
             fail("Can set includesfile in PatternSet that is a reference.");
@@ -122,7 +122,7 @@
     public void testCircularReferenceCheck() {
         PatternSet p = new PatternSet();
         project.addReference("dummy", p);
-        p.setRefid(new Reference("dummy"));
+        p.setRefid(new Reference(project, "dummy"));
         try {
             p.getIncludePatterns(project);
             fail("Can make PatternSet a Reference to itself.");
@@ -141,13 +141,13 @@
         // dummy1 --> dummy2 --> dummy3 --> dummy1
         PatternSet p1 = new PatternSet();
         project.addReference("dummy1", p1);
-        p1.setRefid(new Reference("dummy2"));
+        p1.setRefid(new Reference(project, "dummy2"));
         PatternSet p2 = new PatternSet();
         project.addReference("dummy2", p2);
-        p2.setRefid(new Reference("dummy3"));
+        p2.setRefid(new Reference(project, "dummy3"));
         PatternSet p3 = new PatternSet();
         project.addReference("dummy3", p3);
-        p3.setRefid(new Reference("dummy1"));
+        p3.setRefid(new Reference(project, "dummy1"));
         try {
             p1.getIncludePatterns(project);
             fail("Can make circular reference.");
@@ -167,10 +167,10 @@
         // (which holds patterns "include" and "exclude")
         p1 = new PatternSet();
         project.addReference("dummy1", p1);
-        p1.setRefid(new Reference("dummy2"));
+        p1.setRefid(new Reference(project, "dummy2"));
         p2 = new PatternSet();
         project.addReference("dummy2", p2);
-        p2.setRefid(new Reference("dummy3"));
+        p2.setRefid(new Reference(project, "dummy3"));
         p3 = new PatternSet();
         project.addReference("dummy3", p3);
         p3.setIncludes("include");

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/TarFileSetTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/TarFileSetTest.java?rev=592845&r1=592844&r2=592845&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/TarFileSetTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/TarFileSetTest.java Wed Nov
 7 10:26:07 2007
@@ -86,7 +86,7 @@
         }
         // check that reference tarfilesets cannot have specific attributes
         f = (TarFileSet)getInstance();
-        f.setRefid(new Reference("test"));
+        f.setRefid(new Reference(getProject(), "test"));
         try {
             f.setSrc(new File("example.tar"));
             fail("Can add src to "
@@ -104,7 +104,7 @@
         f.setDirMode("530");
         getProject().addReference("test",f);
         TarFileSet zid=(TarFileSet)getInstance();
-        zid.setRefid(new Reference("test"));
+        zid.setRefid(new Reference(getProject(), "test"));
         assertTrue("src attribute copied by copy constructor",zid.getSrc(getProject()).equals(f.getSrc(getProject())));
         assertTrue("prefix attribute copied by copy constructor",f.getPrefix(getProject()).equals(zid.getPrefix(getProject())));
         assertTrue("file mode attribute copied by copy constructor",f.getFileMode(getProject())==zid.getFileMode(getProject()));

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java?rev=592845&r1=592844&r2=592845&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java Wed Nov
 7 10:26:07 2007
@@ -136,7 +136,7 @@
         project.addReference("catalog", catalog);
 
         try {
-            catalog.setRefid(new Reference("dummyref"));
+            catalog.setRefid(new Reference(project, "dummyref"));
             fail("Can add reference to nonexistent XMLCatalog");
         } catch (BuildException be) {
             assertEquals("You must not specify more than one "
@@ -144,7 +144,7 @@
         }
 
         XMLCatalog catalog2 = newCatalog();
-        catalog2.setRefid(new Reference("catalog"));
+        catalog2.setRefid(new Reference(project, "catalog"));
 
         try {
             catalog2.addConfiguredXMLCatalog(catalog);
@@ -159,7 +159,7 @@
 
         // catalog <--> catalog
         project.addReference("catalog", catalog);
-        catalog.setRefid(new Reference("catalog"));
+        catalog.setRefid(new Reference(project, "catalog"));
 
         try {
             InputSource result = catalog.resolveEntity("PUBLIC ID ONE",
@@ -180,9 +180,9 @@
         XMLCatalog catalog3 = newCatalog();
         project.addReference("catalog3", catalog3);
 
-        catalog3.setRefid(new Reference("catalog1"));
-        catalog2.setRefid(new Reference("catalog3"));
-        catalog1.setRefid(new Reference("catalog2"));
+        catalog3.setRefid(new Reference(project, "catalog1"));
+        catalog2.setRefid(new Reference(project, "catalog3"));
+        catalog1.setRefid(new Reference(project, "catalog2"));
 
         try {
             InputSource result = catalog1.resolveEntity("PUBLIC ID ONE",
@@ -267,8 +267,8 @@
         XMLCatalog catalog2 = newCatalog();
         project.addReference("catalog2", catalog1);
 
-        catalog1.setRefid(new Reference("catalog"));
-        catalog2.setRefid(new Reference("catalog1"));
+        catalog1.setRefid(new Reference(project, "catalog"));
+        catalog2.setRefid(new Reference(project, "catalog1"));
 
         try {
             InputSource result = catalog2.resolveEntity(publicId,

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/ZipFileSetTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/ZipFileSetTest.java?rev=592845&r1=592844&r2=592845&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/ZipFileSetTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/ZipFileSetTest.java Wed Nov
 7 10:26:07 2007
@@ -86,7 +86,7 @@
         }
         // check that reference zipfilesets cannot have specific attributes
         f = (ZipFileSet)getInstance();
-        f.setRefid(new Reference("test"));
+        f.setRefid(new Reference(getProject(), "test"));
         try {
             f.setSrc(new File("example.zip"));
             fail("Can add src to "
@@ -104,7 +104,7 @@
         f.setDirMode("530");
         getProject().addReference("test",f);
         ZipFileSet zid=(ZipFileSet)getInstance();
-        zid.setRefid(new Reference("test"));
+        zid.setRefid(new Reference(getProject(), "test"));
         assertTrue("src attribute copied by copy constructor",zid.getSrc(getProject()).equals(f.getSrc(getProject())));
         assertTrue("prefix attribute copied by copy constructor",f.getPrefix(getProject()).equals(zid.getPrefix(getProject())));
         assertTrue("file mode attribute copied by copy constructor",f.getFileMode(getProject())==zid.getFileMode(getProject()));



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


Mime
View raw message