Return-Path: Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: (qmail 27646 invoked from network); 3 May 2010 17:46:07 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 May 2010 17:46:07 -0000 Received: (qmail 73379 invoked by uid 500); 3 May 2010 17:46:07 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 73324 invoked by uid 500); 3 May 2010 17:46:07 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 73317 invoked by uid 99); 3 May 2010 17:46:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 May 2010 17:46:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 May 2010 17:45:59 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9DE992388B75; Mon, 3 May 2010 17:44:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r940531 [7/7] - in /ant/core/branches/run-single-test-method: ./ docs/ docs/antlibs/ docs/manual/ docs/manual/CoreTasks/ docs/manual/CoreTypes/ docs/manual/OptionalTasks/ docs/webtest/gettest/ lib/ src/etc/ src/etc/poms/ src/etc/poms/ant-an... Date: Mon, 03 May 2010 17:44:28 -0000 To: notifications@ant.apache.org From: jglick@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100503174432.9DE992388B75@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java?rev=940531&r1=940530&r2=940531&view=diff ============================================================================== --- ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java (original) +++ ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java Mon May 3 17:44:21 2010 @@ -22,12 +22,8 @@ import org.apache.tools.ant.*; import org.apache.tools.ant.util.FileUtils; import java.io.File; -import java.io.FileReader; -import java.io.IOException; import java.util.GregorianCalendar; -import junit.framework.ComparisonFailure; - /** * Unit test for the <exec> task. */ @@ -38,7 +34,8 @@ public class ExecTaskTest extends BuildF /** maximum time allowed for the build in milliseconds */ private static final int MAX_BUILD_TIME = 4000; private static final int SECURITY_MARGIN = 2000; // wait 2 second extras - // the test failed with 100 ms of margin on cvs.apache.org on August 1st, 2003 + // the test failed with 100 ms of margin on cvs.apache.org on August 1st, + // 2003 /** Utilities used for file operations */ private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); @@ -46,6 +43,7 @@ public class ExecTaskTest extends BuildF private File logFile; private MonitoredBuild myBuild = null; volatile private boolean buildFinished = false; + public ExecTaskTest(String name) { super(name); } @@ -61,293 +59,13 @@ public class ExecTaskTest extends BuildF executeTarget("cleanup"); } - public void testNoRedirect() { - executeTarget("no-redirect"); - if (getProject().getProperty("test.can.run") == null) { - return; - } - assertEquals("unexpected log content", - getProject().getProperty("ant.file") + " out" - + getProject().getProperty("ant.file") + " err", getLog()); - } - - public void testRedirect1() throws IOException { - executeTarget("redirect1"); - if (getProject().getProperty("test.can.run") == null) { - return; - } - String expectedOut = getProject().getProperty("ant.file") + " out\n" - + getProject().getProperty("ant.file") + " err\n"; - - assertEquals("unexpected output", - expectedOut, getFileString("redirect.out")); - } - - public void testRedirect2() throws IOException { - executeTarget("redirect2"); - if (getProject().getProperty("test.can.run") == null) { - return; - } - - assertEquals("unexpected output", - getProject().getProperty("ant.file") + " out\n", - getFileString("redirect.out")); - assertEquals("unexpected error output", - getProject().getProperty("ant.file") + " err\n", - getFileString("redirect.err")); - } - - public void testRedirect3() throws IOException { - executeTarget("redirect3"); - if (getProject().getProperty("test.can.run") == null) { - return; - } - assertEquals("unexpected log content", - getProject().getProperty("ant.file") + " err", getLog()); - String expectedOut = getProject().getProperty("ant.file") + " out\n"; - - assertEquals("unexpected output", - expectedOut, getFileString("redirect.out")); - assertPropertyEquals("redirect.out", expectedOut.trim()); - } - - public void testRedirect4() throws IOException { - executeTarget("redirect4"); - if (getProject().getProperty("test.can.run") == null) { - return; - } - String expectedOut = getProject().getProperty("ant.file") + " out\n"; - String expectedErr = getProject().getProperty("ant.file") + " err\n"; - - assertEquals("unexpected output", - expectedOut, getFileString("redirect.out")); - assertPropertyEquals("redirect.out", expectedOut.trim()); - assertEquals("unexpected error output", - expectedErr, getFileString("redirect.err")); - assertPropertyEquals("redirect.err", expectedErr.trim()); - } - - public void testRedirect5() throws IOException { - testRedirect5or6("redirect5"); - } - - public void testRedirect6() throws IOException { - testRedirect5or6("redirect6"); - } - - public void testRedirect5or6(String target) throws IOException { - executeTarget(target); - if (getProject().getProperty("wc.can.run") == null) { - return; - } - - assertEquals("unexpected output", "3", getFileString("redirect.out").trim()); - assertEquals("property redirect.out", "3", - getProject().getProperty("redirect.out").trim()); - assertNull("unexpected error output", getFileString("redirect.err")); - assertPropertyEquals("redirect.err", ""); - } - - public void testRedirect7() throws IOException { - executeTarget("redirect7"); - if (getProject().getProperty("wc.can.run") == null) { - return; - } - - assertEquals("unexpected output", "3", getFileString("redirect.out").trim()); - assertEquals("property redirect.out", "3", - getProject().getProperty("redirect.out").trim()); - assertNull("unexpected error output", getFileString("redirect.err")); - } - - public void testRedirector1() { - executeTarget("init"); - if (getProject().getProperty("test.can.run") == null) { - return; - } - expectBuildException("redirector1", "cannot have > 1 nested s"); - } - - public void testRedirector2() throws IOException { - executeTarget("redirector2"); - if (getProject().getProperty("test.can.run") == null) { - return; - } - - assertEquals("unexpected output", - getProject().getProperty("ant.file") + " out\n" - + getProject().getProperty("ant.file") + " err\n", - getFileString("redirector.out")); - } - - public void testRedirector3() throws IOException { - executeTarget("redirector3"); - if (getProject().getProperty("test.can.run") == null) { - return; - } - - assertEquals("unexpected output", - getProject().getProperty("ant.file") + " out\n", - getFileString("redirector.out")); - assertEquals("unexpected error output", - getProject().getProperty("ant.file") + " err\n", - getFileString("redirector.err")); - } - - public void testRedirector4() throws IOException { - executeTarget("redirector4"); - if (getProject().getProperty("test.can.run") == null) { - return; - } - String expectedOut = getProject().getProperty("ant.file") + " out\n"; - - assertEquals("unexpected log content", - getProject().getProperty("ant.file") + " err", getLog()); - assertEquals("unexpected output", expectedOut, - getFileString("redirector.out")); - assertPropertyEquals("redirector.out", expectedOut.trim()); - } - - public void testRedirector5() throws IOException { - testRedirector5or6("redirector5"); - } - - public void testRedirector6() throws IOException { - testRedirector5or6("redirector6"); - } - - private void testRedirector5or6(String target) throws IOException { - executeTarget(target); - if (getProject().getProperty("test.can.run") == null) { - return; - } - String expectedOut = getProject().getProperty("ant.file") + " out\n"; - String expectedErr = getProject().getProperty("ant.file") + " err\n"; - - assertEquals("unexpected output", expectedOut, - getFileString("redirector.out")); - assertPropertyEquals("redirector.out", expectedOut.trim()); - assertEquals("unexpected error output", expectedErr, - getFileString("redirector.err")); - assertPropertyEquals("redirector.err", expectedErr.trim()); - } - - public void testRedirector7() throws IOException { - executeTarget("redirector7"); - if (getProject().getProperty("test.can.run") == null) { - return; - } - String expectedOut = getProject().getProperty("ant.file") + " out\n"; - String expectedErr = getProject().getProperty("ant.file") + " ERROR!!!\n"; - - assertEquals("unexpected output", expectedOut, - getFileString("redirector.out")); - assertPropertyEquals("redirector.out", expectedOut.trim()); - assertEquals("unexpected error output", expectedErr, - getFileString("redirector.err")); - assertPropertyEquals("redirector.err", expectedErr.trim()); - } - - public void testRedirector8() throws IOException { - executeTarget("redirector8"); - if (getProject().getProperty("wc.can.run") == null) { - return; - } - - assertEquals("unexpected output", "3", getFileString("redirector.out").trim()); - assertEquals("property redirector.out", "3", - getProject().getProperty("redirector.out").trim()); - assertNull("unexpected error output", getFileString("redirector.err")); - assertPropertyEquals("redirector.err", ""); - } - - public void testRedirector9() throws IOException { - testRedirector9Thru12("redirector9"); - } - - public void testRedirector10() throws IOException { - testRedirector9Thru12("redirector10"); - } - - public void testRedirector11() throws IOException { - testRedirector9Thru12("redirector11"); - } - - public void testRedirector12() throws IOException { - testRedirector9Thru12("redirector12"); - } - - private void testRedirector9Thru12(String target) throws IOException { - executeTarget(target); - if (getProject().getProperty("cat.can.run") == null) { - return; - } - String expectedOut = "blah after blah"; - - assertEquals("unexpected output", - expectedOut, getFileString("redirector.out").trim()); - assertPropertyEquals("redirector.out", expectedOut.trim()); - assertNull("unexpected error output", getFileString("redirector.err")); - assertPropertyEquals("redirector.err", ""); - } - - public void testRedirector13() { - executeTarget("redirector13"); - if (getProject().getProperty("test.can.run") == null) { - return; - } - String antfile = getProject().getProperty("ant.file"); - try { - //no point in setting a message - assertEquals(antfile + " OUTPUT???" + antfile + " ERROR!!!", getLog()); - } catch (ComparisonFailure cf) { - assertEquals("unexpected log content", - antfile + " ERROR!!!" + antfile + " OUTPUT???", getLog()); - } - } - - public void testRedirector14() { - executeTarget("redirector14"); - if (getProject().getProperty("cat.can.run") == null) { - return; - } - assertEquals("unexpected log output", "blah after blah", getLog()); - } - - public void testRedirector15() throws IOException { - executeTarget("redirector15"); - if (getProject().getProperty("cat.can.run") == null) { - return; - } - assertTrue("error with transcoding", - FILE_UTILS.contentEquals( - getProject().resolveFile("expected/utf-8"), - getProject().resolveFile("redirector.out"))); - } - - public void testRedirector16() { - executeTarget("redirector16"); - } - - public void testRedirector17() { - executeTarget("redirector17"); - } - - public void testRedirector18() { - if (getProject().getProperty("test.can.run") == null) { - return; - } - expectLog("redirector18", getProject().getProperty("ant.file") - + " out" + getProject().getProperty("ant.file") + " err"); - } - public void testspawn() { project.executeTarget("init"); if (project.getProperty("test.can.run") == null) { return; } myBuild = new MonitoredBuild(new File(System.getProperty("root"), BUILD_FILE), "spawn"); - logFile = FILE_UTILS.createTempFile("spawn","log", project.getBaseDir(), false, false); + logFile = FILE_UTILS.createTempFile("spawn", "log", project.getBaseDir(), false, false); // this is guaranteed by FileUtils#createTempFile assertTrue("log file not existing", !logFile.exists()); // make the spawned process run 4 seconds @@ -366,7 +84,9 @@ public class ExecTaskTest extends BuildF GregorianCalendar now = new GregorianCalendar(); // security if (now.getTime().getTime() - startwait.getTime().getTime() > MAX_BUILD_TIME) { - System.out.println("aborting wait, too long " + (now.getTime().getTime() - startwait.getTime().getTime()) + "milliseconds"); + System.out.println("aborting wait, too long " + + (now.getTime().getTime() - startwait.getTime().getTime()) + + "milliseconds"); break; } } @@ -378,24 +98,12 @@ public class ExecTaskTest extends BuildF } // time of the build in milli seconds long elapsed = myBuild.getTimeElapsed(); - assertTrue("we waited more than the process lasted", TIME_TO_WAIT * 1000 - + SECURITY_MARGIN > elapsed); + assertTrue("we waited more than the process lasted", + TIME_TO_WAIT * 1000 + SECURITY_MARGIN > elapsed); logFile = new File(logFile.getAbsolutePath()); assertTrue("log file found after spawn", logFile.exists()); } - public void testExecUnknownOS() { - executeTarget("testExecUnknownOS"); - } - - public void testExecOSFamily() { - executeTarget("testExecOSFamily"); - } - - public void testExecInconsistentSettings() { - executeTarget("testExecInconsistentSettings"); - } - private static class MonitoredBuild implements Runnable { private Thread worker; private File myBuildFile = null; @@ -419,15 +127,17 @@ public class ExecTaskTest extends BuildF public void addBuildListener(BuildListener bl) { project.addBuildListener(bl); } + public MonitoredBuild(File buildFile, String target) { myBuildFile = buildFile; this.target = target; - project=new Project(); + project = new Project(); project = new Project(); project.init(); - project.setUserProperty( "ant.file" , myBuildFile.getAbsolutePath() ); + project.setUserProperty("ant.file", myBuildFile.getAbsolutePath()); ProjectHelper.configureProject(project, myBuildFile); } + /** * * @return time in millis of the build @@ -435,19 +145,23 @@ public class ExecTaskTest extends BuildF public long getTimeElapsed() { return timeFinished.getTime().getTime() - timeStarted.getTime().getTime(); } + public void start() { worker = new Thread(this, myBuildFile.toString() + "/" + target); worker.start(); } + public void run() { startProject(); } + private void startProject() { timeStarted = new GregorianCalendar(); project.executeTarget(target); timeFinished = new GregorianCalendar(); } } + private class MonitoredBuildListener implements BuildListener { public void buildStarted(BuildEvent event) { } @@ -474,18 +188,4 @@ public class ExecTaskTest extends BuildF } } - //borrowed from TokenFilterTest - private String getFileString(String filename) throws IOException { - String result = null; - FileReader reader = null; - try { - reader = new FileReader(getProject().resolveFile(filename)); - result = FileUtils.readFully(reader); - } catch (IOException eyeOhEx) { - } finally { - FileUtils.close(reader); - } - return result; - } - } Modified: ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestClassPathTest.java URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestClassPathTest.java?rev=940531&r1=940530&r2=940531&view=diff ============================================================================== --- ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestClassPathTest.java (original) +++ ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestClassPathTest.java Mon May 3 17:44:21 2010 @@ -168,7 +168,7 @@ public class ManifestClassPathTest System.out.println("Test with drive letters only run on windows"); } else { try { - new java.io.File("D:/").getCanonicalPath(); + new java.io.File("D:/foo.txt").getCanonicalPath(); } catch (java.io.IOException e) { System.out.println("drive d: doesn't exist or is not ready," + " skipping test"); Modified: ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/UnzipTest.java URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/UnzipTest.java?rev=940531&r1=940530&r2=940531&view=diff ============================================================================== --- ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/UnzipTest.java (original) +++ ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/UnzipTest.java Mon May 3 17:44:21 2010 @@ -126,7 +126,9 @@ public class UnzipTest extends BuildFile /* * PR 16213 */ - public void testSelfExtractingArchive() { + public void XtestSelfExtractingArchive() { + // disabled because we lack a self extracting archive that we + // are allowed to distribute - see PR 49080 executeTarget("selfExtractingArchive"); } Modified: ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java?rev=940531&r1=940530&r2=940531&view=diff ============================================================================== --- ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java (original) +++ ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java Mon May 3 17:44:21 2010 @@ -51,6 +51,16 @@ public class TraXLiaisonTest extends Abs } public void testXalan2Redirect() throws Exception { + Class clazz = null; + try { + clazz = getClass().getClassLoader().loadClass("org.apache.xalan.lib.Redirect"); + } catch (Exception exc) { + // ignore + } + if (clazz == null) { + System.out.println("xalan redirect is not on the classpath"); + return; + } File xsl = getFile("/taskdefs/optional/xalan-redirect-in.xsl"); liaison.setStylesheet(xsl); File out = new File("xalan2-redirect-out-dummy.tmp"); Modified: ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XsltTest.java URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XsltTest.java?rev=940531&r1=940530&r2=940531&view=diff ============================================================================== --- ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XsltTest.java (original) +++ ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XsltTest.java Mon May 3 17:44:21 2010 @@ -65,7 +65,7 @@ public class XsltTest extends BuildFileT public void testCatchNoDtd() throws Exception { expectBuildExceptionContaining("testCatchNoDtd", "expected failure", - "Fatal error during transformation"); + /* actually: "chemical" */null); } /** @@ -79,6 +79,7 @@ public class XsltTest extends BuildFileT executeTarget("testOutputProperty"); } + /* Only runs if xalan.jar is in CP (not incl. Sun's JRE repackaging): public void testFactory() throws Exception { executeTarget("testFactory"); } @@ -86,6 +87,8 @@ public class XsltTest extends BuildFileT public void testAttribute() throws Exception { executeTarget("testAttribute"); } + */ + public void testXMLWithEntitiesInNonAsciiPath() throws Exception { executeTarget("testXMLWithEntitiesInNonAsciiPath"); } Modified: ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/optional/unix/SymlinkTest.java URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/optional/unix/SymlinkTest.java?rev=940531&r1=940530&r2=940531&view=diff ============================================================================== --- ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/optional/unix/SymlinkTest.java (original) +++ ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/taskdefs/optional/unix/SymlinkTest.java Mon May 3 17:44:21 2010 @@ -254,15 +254,18 @@ public class SymlinkTest extends BuildFi assertFalse(su.isDanglingSymbolicLink(f.getParentFile(), f.getName())); - //apparently OS X knows a symlink is a symlink even if the target is missing: - boolean mac = Os.isFamily(Os.FAMILY_MAC); - + // it is not possible to find out that symbolic links pointing + // to inexistent files or directories are symbolic links + // it used to be possible to detect this on Mac + // this is not true under Snow Leopard and JDK 1.5 + // Removing special handling of MacOS until someone shouts + // Antoine f = getProject().resolveFile("test-working/file.notthere"); assertFalse(f.exists()); assertFalse(f.isDirectory()); assertFalse(f.isFile()); - assertTrue(su.isSymbolicLink(f.getAbsolutePath()) == mac); - assertTrue(su.isSymbolicLink(f.getParentFile(), f.getName()) == mac); + assertTrue(su.isSymbolicLink(f.getAbsolutePath()) == false); + assertTrue(su.isSymbolicLink(f.getParentFile(), f.getName()) == false); assertTrue(su.isDanglingSymbolicLink(f.getAbsolutePath())); assertTrue(su.isDanglingSymbolicLink(f.getParentFile(), f.getName())); @@ -271,8 +274,8 @@ public class SymlinkTest extends BuildFi assertFalse(f.exists()); assertFalse(f.isDirectory()); assertFalse(f.isFile()); - assertTrue(su.isSymbolicLink(f.getAbsolutePath()) == mac); - assertTrue(su.isSymbolicLink(f.getParentFile(), f.getName()) == mac); + assertTrue(su.isSymbolicLink(f.getAbsolutePath()) == false); + assertTrue(su.isSymbolicLink(f.getParentFile(), f.getName()) == false); assertTrue(su.isDanglingSymbolicLink(f.getAbsolutePath())); assertTrue(su.isDanglingSymbolicLink(f.getParentFile(), f.getName())); Modified: ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/types/selectors/SizeSelectorTest.java URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/types/selectors/SizeSelectorTest.java?rev=940531&r1=940530&r2=940531&view=diff ============================================================================== --- ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/types/selectors/SizeSelectorTest.java (original) +++ ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/types/selectors/SizeSelectorTest.java Mon May 3 17:44:21 2010 @@ -18,6 +18,7 @@ package org.apache.tools.ant.types.selectors; +import java.util.Locale; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.types.Parameter; @@ -198,4 +199,45 @@ public class SizeSelectorTest extends Ba } + public void testParameterParsingLowerCase() { + testCaseInsensitiveParameterParsing("units"); + } + + public void testParameterParsingUpperCase() { + testCaseInsensitiveParameterParsing("UNITS"); + } + + public void testParameterParsingLowerCaseTurkish() { + Locale l = Locale.getDefault(); + try { + Locale.setDefault(new Locale("tr")); + testCaseInsensitiveParameterParsing("units"); + } finally { + Locale.setDefault(l); + } + } + + public void testParameterParsingUpperCaseTurkish() { + Locale l = Locale.getDefault(); + try { + Locale.setDefault(new Locale("tr")); + testCaseInsensitiveParameterParsing("UNITS"); + } finally { + Locale.setDefault(l); + } + } + + private void testCaseInsensitiveParameterParsing(String name) { + SizeSelector s = new SizeSelector(); + Parameter p = new Parameter(); + p.setName(name); + p.setValue("foo"); + try { + s.setParameters(new Parameter[] {p}); + fail("should have caused an exception"); + } catch (BuildException be) { + assertEquals("foo is not a legal value for this attribute", + be.getMessage()); + } + } } Modified: ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/util/VectorSetTest.java URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/util/VectorSetTest.java?rev=940531&r1=940530&r2=940531&view=diff ============================================================================== --- ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/util/VectorSetTest.java (original) +++ ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/ant/util/VectorSetTest.java Mon May 3 17:44:21 2010 @@ -109,6 +109,54 @@ public class VectorSetTest extends TestC assertFalse(v.remove(O)); } + public void testRemoveAtEndWhenSizeEqualsCapacity() { + v = new VectorSet(3, 1); + Object a = new Object(); + v.add(a); + Object b = new Object(); + v.add(b); + v.add(O); + assertEquals(3, v.size()); + assertEquals(3, v.capacity()); + assertTrue(v.remove(O)); + assertEquals(2, v.size()); + assertFalse(v.remove(O)); + assertSame(a, v.elementAt(0)); + assertSame(b, v.elementAt(1)); + } + + public void testRemoveAtFrontWhenSizeEqualsCapacity() { + v = new VectorSet(3, 1); + v.add(O); + Object a = new Object(); + v.add(a); + Object b = new Object(); + v.add(b); + assertEquals(3, v.size()); + assertEquals(3, v.capacity()); + assertTrue(v.remove(O)); + assertEquals(2, v.size()); + assertFalse(v.remove(O)); + assertSame(a, v.elementAt(0)); + assertSame(b, v.elementAt(1)); + } + + public void testRemoveInMiddleWhenSizeEqualsCapacity() { + v = new VectorSet(3, 1); + Object a = new Object(); + v.add(a); + v.add(O); + Object b = new Object(); + v.add(b); + assertEquals(3, v.size()); + assertEquals(3, v.capacity()); + assertTrue(v.remove(O)); + assertEquals(2, v.size()); + assertFalse(v.remove(O)); + assertSame(a, v.elementAt(0)); + assertSame(b, v.elementAt(1)); + } + public void testRemoveAll() { v.add(O); assertTrue(v.removeAll(Arrays.asList(new Object[] {O, O}))); Propchange: ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/zip/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon May 3 17:44:21 2010 @@ -1 +1,2 @@ +/ant/core/tags/ANT_181/src/tests/junit/org/apache/tools/zip:939905-940517 /commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip:749906-749907 Modified: ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/zip/ExtraFieldUtilsTest.java URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/zip/ExtraFieldUtilsTest.java?rev=940531&r1=940530&r2=940531&view=diff ============================================================================== --- ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/zip/ExtraFieldUtilsTest.java (original) +++ ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/zip/ExtraFieldUtilsTest.java Mon May 3 17:44:21 2010 @@ -18,6 +18,7 @@ package org.apache.tools.zip; +import java.util.Arrays; import junit.framework.TestCase; /** @@ -78,11 +79,65 @@ public class ExtraFieldUtilsTest extends fail("data should be invalid"); } catch (Exception e) { assertEquals("message", - "data starting at "+(4+aLocal.length)+" is in unknown format", + "bad extra field starting at "+(4 + aLocal.length) + + ". Block length of 1 bytes exceeds remaining data of 0 bytes.", e.getMessage()); } } + public void testParseWithRead() throws Exception { + ZipExtraField[] ze = + ExtraFieldUtils.parse(data, true, + ExtraFieldUtils.UnparseableExtraField.READ); + assertEquals("number of fields", 2, ze.length); + assertTrue("type field 1", ze[0] instanceof AsiExtraField); + assertEquals("mode field 1", 040755, + ((AsiExtraField) ze[0]).getMode()); + assertTrue("type field 2", ze[1] instanceof UnrecognizedExtraField); + assertEquals("data length field 2", 1, + ze[1].getLocalFileDataLength().getValue()); + + byte[] data2 = new byte[data.length-1]; + System.arraycopy(data, 0, data2, 0, data2.length); + ze = ExtraFieldUtils.parse(data2, true, + ExtraFieldUtils.UnparseableExtraField.READ); + assertEquals("number of fields", 2, ze.length); + assertTrue("type field 1", ze[0] instanceof AsiExtraField); + assertEquals("mode field 1", 040755, + ((AsiExtraField) ze[0]).getMode()); + assertTrue("type field 2", ze[1] instanceof UnparseableExtraFieldData); + assertEquals("data length field 2", 4, + ze[1].getLocalFileDataLength().getValue()); + byte[] expectedData = new byte[4]; + for (int i = 0; i < 4; i++) { + assertEquals("byte number " + i, + data2[data.length - 5 + i], + ze[1].getLocalFileDataData()[i]); + } + } + + public void testParseWithSkip() throws Exception { + ZipExtraField[] ze = + ExtraFieldUtils.parse(data, true, + ExtraFieldUtils.UnparseableExtraField.SKIP); + assertEquals("number of fields", 2, ze.length); + assertTrue("type field 1", ze[0] instanceof AsiExtraField); + assertEquals("mode field 1", 040755, + ((AsiExtraField) ze[0]).getMode()); + assertTrue("type field 2", ze[1] instanceof UnrecognizedExtraField); + assertEquals("data length field 2", 1, + ze[1].getLocalFileDataLength().getValue()); + + byte[] data2 = new byte[data.length-1]; + System.arraycopy(data, 0, data2, 0, data2.length); + ze = ExtraFieldUtils.parse(data2, true, + ExtraFieldUtils.UnparseableExtraField.SKIP); + assertEquals("number of fields", 1, ze.length); + assertTrue("type field 1", ze[0] instanceof AsiExtraField); + assertEquals("mode field 1", 040755, + ((AsiExtraField) ze[0]).getMode()); + } + /** * Test merge methods */ @@ -111,4 +166,30 @@ public class ExtraFieldUtilsTest extends } } + + public void testMergeWithUnparseableData() throws Exception { + ZipExtraField d = new UnparseableExtraFieldData(); + d.parseFromLocalFileData(new byte[] {1, 0, 1, 0}, 0, 4); + byte[] local = + ExtraFieldUtils.mergeLocalFileDataData(new ZipExtraField[] {a, d}); + assertEquals("local length", data.length - 1, local.length); + for (int i = 0; i < local.length; i++) { + assertEquals("local byte " + i, data[i], local[i]); + } + + byte[] dCentral = d.getCentralDirectoryData(); + byte[] data2 = new byte[4 + aLocal.length + dCentral.length]; + System.arraycopy(data, 0, data2, 0, 4 + aLocal.length + 2); + System.arraycopy(dCentral, 0, data2, + 4 + aLocal.length, dCentral.length); + + + byte[] central = + ExtraFieldUtils.mergeCentralDirectoryData(new ZipExtraField[] {a, d}); + assertEquals("central length", data2.length, central.length); + for (int i = 0; i < central.length; i++) { + assertEquals("central byte " + i, data2[i], central[i]); + } + + } } Propchange: ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/zip/ExtraFieldUtilsTest.java ------------------------------------------------------------------------------ --- svn:mergeinfo (added) +++ svn:mergeinfo Mon May 3 17:44:21 2010 @@ -0,0 +1,4 @@ +/ant/core/tags/ANT_181/src/tests/junit/org/apache/tools/zip/ExtraFieldUtilsTest.java:939905-940517 +/ant/core/trunk/src/tests/junit/org/apache/tools/zip/ExtraFieldUtilsTest.java:905481-939904 +/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTest.java:910483-910521 +/commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTest.java:749906-749907 Propchange: ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/zip/UTF8ZipFilesTest.java ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon May 3 17:44:21 2010 @@ -1 +1,2 @@ +/ant/core/tags/ANT_181/src/tests/junit/org/apache/tools/zip/UTF8ZipFilesTest.java:939905-940517 /commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java:749342-749344,749906-749907 Propchange: ant/core/branches/run-single-test-method/src/tests/junit/org/apache/tools/zip/ZipEntryTest.java ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon May 3 17:44:21 2010 @@ -1,2 +1,3 @@ +/ant/core/tags/ANT_181/src/tests/junit/org/apache/tools/zip/ZipEntryTest.java:939905-940517 /commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java:896818 /commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java:749603 Modified: ant/core/branches/run-single-test-method/xdocs/antlibs/proper.xml URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/xdocs/antlibs/proper.xml?rev=940531&r1=940530&r2=940531&view=diff ============================================================================== --- ant/core/branches/run-single-test-method/xdocs/antlibs/proper.xml (original) +++ ant/core/branches/run-single-test-method/xdocs/antlibs/proper.xml Mon May 3 17:44:21 2010 @@ -185,44 +185,6 @@ - - - -

Contains tasks that correspond to Ant's <cvs>, - <cvschangelog> and <cvstagdiff> tasks. Requires - Subversion's command line client.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Homepage:http://ant.apache.org/antlibs/svn/
SVN URL:https://svn.apache.org/repos/asf/ant/antlibs/svn/trunk/
ViewSVN:http://svn.apache.org/viewcvs.cgi/ant/antlibs/svn/trunk/
Ant compatibility:Ant 1.7.x
Added to sandbox:2005-04-15
Promoted from sandbox:2005-11-22
Latest Release:None
-
Modified: ant/core/branches/run-single-test-method/xdocs/antnews.xml URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/xdocs/antnews.xml?rev=940531&r1=940530&r2=940531&view=diff ============================================================================== --- ant/core/branches/run-single-test-method/xdocs/antnews.xml (original) +++ ant/core/branches/run-single-test-method/xdocs/antnews.xml Mon May 3 17:44:21 2010 @@ -26,12 +26,23 @@ -
-

Februrary 8th, 2010 - Ant 1.8.0 Released

-

Apache Ant 1.8.0 is now available for download as source or binary (with and without +

+

May 6th, 2010 - Ant 1.8.1 Released

+

Apache Ant 1.8.1 is now available for download as source or binary (with and without dependencies) from http://ant.apache.org/bindownload.cgi.

+

Key features of the 1.8.1 release are

+
    +
  • new task augment allows to add attributes or nested elements to previously defined references
  • +
  • numerous bug fixes and improvements as documented in Bugzilla + and in WHATSNEW
  • +
+ +
+ +
+

Februrary 8th, 2010 - Ant 1.8.0 Released

Key features of the 1.8.0 release are

  • Lexically scoped local properties, i.e. properties that are only defined inside a target, Modified: ant/core/branches/run-single-test-method/xdocs/bindownload.xml URL: http://svn.apache.org/viewvc/ant/core/branches/run-single-test-method/xdocs/bindownload.xml?rev=940531&r1=940530&r2=940531&view=diff ============================================================================== --- ant/core/branches/run-single-test-method/xdocs/bindownload.xml (original) +++ ant/core/branches/run-single-test-method/xdocs/bindownload.xml Mon May 3 17:44:21 2010 @@ -75,12 +75,12 @@ Other mirrors:
    -

    Currently, Apache Ant 1.8.0 is the best available version, see the +

    Currently, Apache Ant 1.8.1 is the best available version, see the release notes.

    Note
    -
    Ant 1.8.0 was released on 8-Feb-2010 and +
    Ant 1.8.1 was released on 6-May-2010 and may not be available on all mirrors for a few days.


    @@ -89,22 +89,22 @@ may not be available on all mirrors for
    @@ -136,17 +136,17 @@ using

    % pgpk -a KEYS
    -% pgpv apache-ant-1.8.0-src.tar.gz.asc
    +% pgpv apache-ant-1.8.1-src.tar.gz.asc
    or
    % pgp -ka KEYS
    -% pgp apache-ant-1.8.0-src.tar.gz.asc
    +% pgp apache-ant-1.8.1-src.tar.gz.asc
    or
    % gpg --import KEYS
    -% gpg --verify apache-ant-1.8.0-src.tar.gz.asc +% gpg --verify apache-ant-1.8.1-src.tar.gz.asc

    Alternatively, you can verify the checksums on the files. Unix