You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Jeremy Boynes <jb...@apache.org> on 2006/08/04 16:49:29 UTC
URL escaping, was: svn commit: r428730 - in /incubator/tuscany/java: samples/sca/helloworldws/src/main/webapp/META-INF/sca/ sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/ sca/bindings/binding.axis2/src/main/resources/META-INF/sca/ sca/core/src...
Rick
Not sure if you meant to commit this as part of this change - it
wasn't mentioned in the commit message at all.
Jervis,
Another way to handle spaces in the URL which might be a little
simpler is:
Index: core/src/test/java/org/apache/tuscany/core/services/artifact/
LocalMavenRepositoryTestCase.java
===================================================================
--- core/src/test/java/org/apache/tuscany/core/services/artifact/
LocalMavenRepositoryTestCase.java (revision 428735)
+++ core/src/test/java/org/apache/tuscany/core/services/artifact/
LocalMavenRepositoryTestCase.java (working copy)
@@ -17,7 +17,6 @@
package org.apache.tuscany.core.services.artifact;
import java.io.File;
-import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
@@ -27,7 +26,7 @@
/**
* This testcase assumes that there is a maven repo in the default
location.
- *
+ *
* @version $Rev$ $Date$
*/
public class LocalMavenRepositoryTestCase extends TestCase {
@@ -43,11 +42,11 @@
assertEquals("org/apache/tuscany/spi/1.0-SNAPSHOT/spi-1.0-
SNAPSHOT-x86.jar", repo.getPath(artifact));
}
- public void testArtifactFoundInRepo() throws
MalformedURLException, UnsupportedEncodingException {
+ public void testArtifactFoundInRepo() throws
MalformedURLException {
String home = System.getProperty("user.home");
File file = new File(home, ".m2/repository/org/apache/
tuscany/spi/1.0-SNAPSHOT/spi-1.0-SNAPSHOT.jar");
repo.resolve(artifact);
- assertEquals(file.toURL().toString(),
java.net.URLDecoder.decode(artifact.getUrl().toString(), "UTF-8"));
+ assertEquals(file.toURI().toURL(), artifact.getUrl());
}
public void testArtifactNotFoundInRepo() throws
MalformedURLException {
--
Jeremy
On Aug 4, 2006, at 7:07 AM, rineholt@apache.org wrote:
> Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/
> tuscany/core/services/artifact/LocalMavenRepositoryTestCase.java
> URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/
> src/test/java/org/apache/tuscany/core/services/artifact/
> LocalMavenRepositoryTestCase.java?
> rev=428730&r1=428729&r2=428730&view=diff
> ======================================================================
> ========
> --- incubator/tuscany/java/sca/core/src/test/java/org/apache/
> tuscany/core/services/artifact/LocalMavenRepositoryTestCase.java
> (original)
> +++ incubator/tuscany/java/sca/core/src/test/java/org/apache/
> tuscany/core/services/artifact/LocalMavenRepositoryTestCase.java
> Fri Aug 4 07:07:08 2006
> @@ -17,6 +17,7 @@
> package org.apache.tuscany.core.services.artifact;
>
> import java.io.File;
> +import java.io.UnsupportedEncodingException;
> import java.net.MalformedURLException;
> import java.net.URL;
>
> @@ -42,11 +43,11 @@
> assertEquals("org/apache/tuscany/spi/1.0-SNAPSHOT/spi-1.0-
> SNAPSHOT-x86.jar", repo.getPath(artifact));
> }
>
> - public void testArtifactFoundInRepo() throws
> MalformedURLException {
> + public void testArtifactFoundInRepo() throws
> MalformedURLException, UnsupportedEncodingException {
> String home = System.getProperty("user.home");
> File file = new File(home, ".m2/repository/org/apache/
> tuscany/spi/1.0-SNAPSHOT/spi-1.0-SNAPSHOT.jar");
> repo.resolve(artifact);
> - assertEquals(file.toURL(), artifact.getUrl());
> + assertEquals(file.toURL().toString(),
> java.net.URLDecoder.decode(artifact.getUrl().toString(), "UTF-8"));
> }
>
> public void testArtifactNotFoundInRepo() throws
> MalformedURLException {
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org