You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by mb...@apache.org on 2007/11/01 16:09:22 UTC
svn commit: r591042 -
/ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
Author: mbenson
Date: Thu Nov 1 08:09:20 2007
New Revision: 591042
URL: http://svn.apache.org/viewvc?rev=591042&view=rev
Log:
fmting
Modified:
ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java?rev=591042&r1=591041&r2=591042&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java Thu Nov 1 08:09:20 2007
@@ -15,24 +15,19 @@
* limitations under the License.
*
*/
-
package org.apache.tools.ant.launch;
import junit.framework.TestCase;
-import java.net.URISyntaxException;
import java.io.File;
-import org.apache.tools.ant.util.JavaEnvUtils;
import org.apache.tools.ant.taskdefs.condition.Os;
/** Test the locator in the ant-launch JAR */
-
public class LocatorTest extends TestCase {
private boolean windows;
private boolean unix;
-
/**
* No-arg constructor to enable serialization. This method is not intended to be used by mere mortals without calling
* setName().
@@ -45,7 +40,6 @@
super(name);
}
-
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
@@ -57,9 +51,9 @@
}
private String resolve(String uri) {
- String j14= Locator.fromURI(uri);
+ String j14 = Locator.fromURI(uri);
String j13 = Locator.fromURIJava13(uri);
- assertEquals("Different fromURI conversion.\nJava1.4="+j14+"\nJava1.3="+j13+"\n",
+ assertEquals("Different fromURI conversion.\nJava1.4=" + j14 + "\nJava1.3=" + j13 + "\n",
j14, j13);
return j14;
}
@@ -78,9 +72,9 @@
}
private void assertResolved(String uri, String expectedResult, String result, boolean condition) {
- if(condition && expectedResult!=null && expectedResult.length()>0) {
- assertEquals("Expected "+uri+" to resolve to \n"+expectedResult+"\n but got\n"+result+"\n",
- expectedResult,result);
+ if (condition && expectedResult != null && expectedResult.length() > 0) {
+ assertEquals("Expected " + uri + " to resolve to \n" + expectedResult + "\n but got\n"
+ + result + "\n", expectedResult, result);
}
}
@@ -92,8 +86,8 @@
private String assertResolves(String path) throws Exception {
String asuri = new File(path).toURI().toASCIIString();
String fullpath = System.getProperty("user.dir") + File.separator + path;
- String result=resolveTo(asuri, fullpath, fullpath);
- return result.substring(result.lastIndexOf(File.separatorChar)+1);
+ String result = resolveTo(asuri, fullpath, fullpath);
+ return result.substring(result.lastIndexOf(File.separatorChar) + 1);
}
@@ -102,8 +96,8 @@
* @throws Exception
*/
public void testNetworkURI() throws Exception {
- resolveTo("file:\\\\PC03\\jclasses\\lib\\ant-1.7.0.jar","" +
- "\\\\PC03\\jclasses\\lib\\ant-1.7.0.jar",
+ resolveTo("file:\\\\PC03\\jclasses\\lib\\ant-1.7.0.jar", ""
+ + "\\\\PC03\\jclasses\\lib\\ant-1.7.0.jar",
"\\\\PC03\\jclasses\\lib\\ant-1.7.0.jar");
}
@@ -139,22 +133,20 @@
Locator.fromURI(url);
} catch (IllegalArgumentException e) {
String message = e.getMessage();
- assertTrue(message,message.indexOf(Locator.ERROR_NOT_FILE_URI)>=0);
+ assertTrue(message, message.indexOf(Locator.ERROR_NOT_FILE_URI) >= 0);
assertTrue(message, message.indexOf(url) >= 0);
}
}
-
public void testInternationalURI() throws Exception {
- String result=assertResolves("L\u00f6wenbrau.aus.M\u00fcnchen");
+ String result = assertResolves("L\u00f6wenbrau.aus.M\u00fcnchen");
char umlauted = result.charAt(1);
- assertEquals("expected 0xf6 (\u00f6), but got "+Integer.toHexString(umlauted)+" '"+umlauted+"'",
- 0xf6, umlauted);
+ assertEquals("expected 0xf6 (\u00f6), but got " + Integer.toHexString(umlauted) + " '"
+ + umlauted + "'", 0xf6, umlauted);
}
public void testOddLowAsciiURI() throws Exception {
assertResolves("hash# and percent%");
}
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org