You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2009/07/07 11:24:12 UTC
svn commit: r791767 -
/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/InterfacesTest.java
Author: ningjiang
Date: Tue Jul 7 09:24:09 2009
New Revision: 791767
URL: http://svn.apache.org/viewvc?rev=791767&view=rev
Log:
Fixed the jetty InterfacesTest error on Mac OSX
Modified:
camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/InterfacesTest.java
Modified: camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/InterfacesTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/InterfacesTest.java?rev=791767&r1=791766&r2=791767&view=diff
==============================================================================
--- camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/InterfacesTest.java (original)
+++ camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/InterfacesTest.java Tue Jul 7 09:24:09 2009
@@ -28,7 +28,7 @@
import org.junit.Test;
public class InterfacesTest extends CamelTestSupport {
-
+ private static boolean isMacOS = System.getProperty("os.name").startsWith("Mac");
private String remoteInterfaceAddress;
@@ -61,14 +61,17 @@
URL localUrl = new URL("http://localhost:4567/testRoute");
String localResponse = context.getTypeConverter().convertTo(String.class, localUrl.openStream());
assertEquals("local", localResponse);
-
- // 127.0.0.1 is an alias of localhost so should work
- localUrl = new URL("http://127.0.0.1:4568/testRoute");
+
+ if (!isMacOS) {
+ localUrl = new URL("http://127.0.0.1:4568/testRoute");
+ } else {
+ localUrl = new URL("http://localhost:4568/testRoute");
+ }
localResponse = context.getTypeConverter().convertTo(String.class, localUrl.openStream());
assertEquals("local-differentPort", localResponse);
- if (remoteInterfaceAddress != null) {
- URL url = new URL("http://" + remoteInterfaceAddress + ":4567/testRoute");
+ if (remoteInterfaceAddress != null) {
+ URL url = new URL("http://" + remoteInterfaceAddress + ":4560/testRoute");
String remoteResponse = context.getTypeConverter().convertTo(String.class, url.openStream());
assertEquals("remote", remoteResponse);
}
@@ -109,7 +112,7 @@
.to("mock:endpoint");
if (remoteInterfaceAddress != null) {
- from("jetty:http://" + remoteInterfaceAddress + ":4567/testRoute")
+ from("jetty:http://" + remoteInterfaceAddress + ":4560/testRoute")
.setBody().constant("remote")
.to("mock:endpoint");
}