You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2011/07/27 19:50:17 UTC
svn commit: r1151558 - in /cxf/trunk:
rt/javascript/src/test/java/org/apache/cxf/javascript/
rt/javascript/src/test/resources/
rt/javascript/src/test/resources/org/apache/cxf/javascript/
tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws...
Author: dkulp
Date: Wed Jul 27 17:50:16 2011
New Revision: 1151558
URL: http://svn.apache.org/viewvc?rev=1151558&view=rev
Log:
Flip another couple tests to use dynamic ports.
Modified:
cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsHttpRequestTest.java
cxf/trunk/rt/javascript/src/test/resources/XMLHttpRequestTestBeans.xml
cxf/trunk/rt/javascript/src/test/resources/org/apache/cxf/javascript/XMLHttpRequestTests.js
cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/remote-hello_world_binding.xsd
Modified: cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsHttpRequestTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsHttpRequestTest.java?rev=1151558&r1=1151557&r2=1151558&view=diff
==============================================================================
--- cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsHttpRequestTest.java (original)
+++ cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/JsHttpRequestTest.java Wed Jul 27 17:50:16 2011
@@ -35,6 +35,7 @@ import org.apache.cxf.javascript.Javascr
import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.test.AbstractCXFSpringTest;
import org.apache.cxf.test.XPathAssert;
+import org.apache.cxf.testutil.common.TestUtil;
import org.junit.Before;
import org.junit.Test;
@@ -67,6 +68,7 @@ public class JsHttpRequestTest extends A
@Override
protected String[] getConfigLocations() {
+ TestUtil.getPortNumber(JsHttpRequestTest.class);
return new String[] {"classpath:XMLHttpRequestTestBeans.xml"};
}
Modified: cxf/trunk/rt/javascript/src/test/resources/XMLHttpRequestTestBeans.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/javascript/src/test/resources/XMLHttpRequestTestBeans.xml?rev=1151558&r1=1151557&r2=1151558&view=diff
==============================================================================
--- cxf/trunk/rt/javascript/src/test/resources/XMLHttpRequestTestBeans.xml (original)
+++ cxf/trunk/rt/javascript/src/test/resources/XMLHttpRequestTestBeans.xml Wed Jul 27 17:50:16 2011
@@ -31,10 +31,12 @@
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+
<import resource="classpath:META-INF/cxf/cxf.xml" />
<httpj:engine-factory bus="cxf">
- <httpj:engine port="8808">
+ <httpj:engine port="${testutil.ports.JsHttpRequestTest}">
<httpj:handlers>
<bean class="org.eclipse.jetty.server.handler.ContextHandler">
<property name="contextPath" value="/" />
@@ -64,7 +66,7 @@
<jaxws:endpoint id="greeter-service-endpoint"
implementor="org.apache.hello_world_xml_http.wrapped.GreeterImpl"
- address="http://localhost:8808/Greeter">
+ address="http://localhost:${testutil.ports.JsHttpRequestTest}/Greeter">
</jaxws:endpoint>
</beans>
\ No newline at end of file
Modified: cxf/trunk/rt/javascript/src/test/resources/org/apache/cxf/javascript/XMLHttpRequestTests.js
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/javascript/src/test/resources/org/apache/cxf/javascript/XMLHttpRequestTests.js?rev=1151558&r1=1151557&r2=1151558&view=diff
==============================================================================
--- cxf/trunk/rt/javascript/src/test/resources/org/apache/cxf/javascript/XMLHttpRequestTests.js (original)
+++ cxf/trunk/rt/javascript/src/test/resources/org/apache/cxf/javascript/XMLHttpRequestTests.js Wed Jul 27 17:50:16 2011
@@ -50,7 +50,8 @@ function testSyncHttpFetch() {
var r = new XMLHttpRequest();
- r.open("GET", "http://localhost:8808/test.html", false);
+ var port = java.lang.System.getProperty("testutil.ports.JsHttpRequestTest");
+ r.open("GET", "http://localhost:" + port + "/test.html", false);
if (r.readyState != r.OPENED) {
assertionFailed("state not OPENED after OPEN");
}
@@ -71,8 +72,9 @@ function testStateNotificationSync() {
// create closure.
r.onreadystatechange = function() {
globalState = r.readyState;
- }
- r.open("GET", "http://localhost:8808/test.html", false);
+ }
+ var port = java.lang.System.getProperty("testutil.ports.JsHttpRequestTest");
+ r.open("GET", "http://localhost:" + port + "/test.html", false);
if (r.readyState != r.OPENED) {
assertionFailed("state not OPENED after OPEN");
}
@@ -138,7 +140,8 @@ function testAsyncHttpFetch1() {
}
}
- r.open("GET", "http://localhost:8808/test.html", true);
+ var port = java.lang.System.getProperty("testutil.ports.JsHttpRequestTest");
+ r.open("GET", "http://localhost:" + port + "/test.html", true);
if (r.readyState != r.OPENED) {
assertionFailed("state not OPENED after OPEN");
}
Modified: cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java?rev=1151558&r1=1151557&r2=1151558&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java (original)
+++ cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java Wed Jul 27 17:50:16 2011
@@ -24,6 +24,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
+import java.net.ServerSocket;
import java.util.Arrays;
import java.util.List;
@@ -50,14 +51,11 @@ import org.eclipse.jetty.server.handler.
import org.junit.Test;
-
-
public class CodeGenBugTest extends AbstractCodeGenTest {
@Test
public void testCXF2944() throws Exception {
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/cxf2944/cxf2944.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf2944/cxf2944.wsdl"));
env.put(ToolConstants.CFG_ALLOW_ELEMENT_REFS, "true");
processor.setContext(env);
processor.execute();
@@ -69,8 +67,7 @@ public class CodeGenBugTest extends Abst
@Test
public void testCXF2935() throws Exception {
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/cxf2935/webservice.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf2935/webservice.wsdl"));
env.put(ToolConstants.CFG_ALLOW_ELEMENT_REFS, "true");
processor.setContext(env);
processor.execute();
@@ -81,8 +78,7 @@ public class CodeGenBugTest extends Abst
@Test
public void testCXF1969() throws Exception {
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/cxf1969/report_incident.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf1969/report_incident.wsdl"));
processor.setContext(env);
try {
@@ -131,7 +127,7 @@ public class CodeGenBugTest extends Abst
WebService webServiceAnn = AnnotationUtil.getPrivClassAnnotation(clz, WebService.class);
assertTrue("Impl class should note generate name property value in webService annotation",
- webServiceAnn.name().equals(""));
+ webServiceAnn.name().equals(""));
assertFalse("Impl class should generate portName property value in webService annotation",
webServiceAnn.portName().equals(""));
assertFalse("Impl class should generate serviceName property value in webService annotation",
@@ -238,8 +234,8 @@ public class CodeGenBugTest extends Abst
String[] args = new String[] {"-d", output.getCanonicalPath(), "-nexclude",
"http://apache.org/test/types=com.iona", "-nexclude",
- "http://apache.org/Invoice", "-compile",
- "-classdir", output.getCanonicalPath() + "/classes",
+ "http://apache.org/Invoice", "-compile", "-classdir",
+ output.getCanonicalPath() + "/classes",
getLocation("/wsdl2java_wsdl/hello_world_exclude.wsdl")};
WSDLToJava.main(args);
@@ -260,7 +256,6 @@ public class CodeGenBugTest extends Abst
}
-
@Test
public void testExcludeNSWithoutPackageName() throws Exception {
@@ -289,8 +284,7 @@ public class CodeGenBugTest extends Abst
@Test
public void testDefaultLoadNSMappingOFF() throws Exception {
- String[] args = new String[] {"-dns", "false",
- "-d", output.getCanonicalPath(), "-noAddressBinding",
+ String[] args = new String[] {"-dns", "false", "-d", output.getCanonicalPath(), "-noAddressBinding",
getLocation("/wsdl2java_wsdl/basic_callback.wsdl")};
WSDLToJava.main(args);
@@ -425,7 +419,7 @@ public class CodeGenBugTest extends Abst
bout.write(buffer, 0, size);
index = bout.toString()
.indexOf("new QName(\"http://cxf.apache.org/w2j/hello_world_soap_http/service\","
- + " \"SOAPService_Test1\")");
+ + " \"SOAPService_Test1\")");
if (index > 0) {
break;
}
@@ -464,7 +458,6 @@ public class CodeGenBugTest extends Abst
assertTrue(address.exists());
}
-
@Test
public void testDefatultNsMapExclude() throws Exception {
env.put(ToolConstants.CFG_ALL, ToolConstants.CFG_ALL);
@@ -487,15 +480,21 @@ public class CodeGenBugTest extends Abst
@Test
public void testHelloWorldExternalBindingFile() throws Exception {
- Server server = new Server(8585);
+ ServerSocket sock = new ServerSocket(0);
+ int port = sock.getLocalPort();
+ Server server = new Server(port);
+ sock.close();
ResourceHandler reshandler = new ResourceHandler();
reshandler.setResourceBase(getLocation("/wsdl2java_wsdl/"));
- // this is the only handler we're supposed to need, so we don't need to 'add' it.
+ // this is the only handler we're supposed to need, so we don't need to
+ // 'add' it.
server.setHandler(reshandler);
server.start();
- env.put(ToolConstants.CFG_WSDLURL, "http://localhost:8585/hello_world.wsdl");
- env.put(ToolConstants.CFG_BINDING, "http://localhost:8585/remote-hello_world_binding.xsd");
+ env.put(ToolConstants.CFG_WSDLURL, "http://localhost:"
+ + port + "/hello_world.wsdl");
+ env.put(ToolConstants.CFG_BINDING, "http://localhost:"
+ + port + "/remote-hello_world_binding.xsd");
processor.setContext(env);
processor.execute();
try {
@@ -507,7 +506,6 @@ public class CodeGenBugTest extends Abst
}
-
@Test
public void testDefaultNSWithPkg() throws Exception {
String[] args = new String[] {"-d", output.getCanonicalPath(), "-p", "org.cxf", "-noAddressBinding",
@@ -539,8 +537,7 @@ public class CodeGenBugTest extends Abst
@Test
public void testCXF677() throws Exception {
- String[] args = new String[] {"-d", output.getCanonicalPath(),
- "-b",
+ String[] args = new String[] {"-d", output.getCanonicalPath(), "-b",
getLocation("/wsdl2java_wsdl/hello-mime-binding.xml"),
getLocation("/wsdl2java_wsdl/hello-mime.wsdl")};
@@ -552,7 +549,7 @@ public class CodeGenBugTest extends Abst
String str4 = "http://cxf.apache.org/w2j/hello_world_mime/types";
String file = getStringFromFile(new File(output.getCanonicalPath()
- + "/org/apache/cxf/w2j/hello_world_mime/Hello.java"));
+ + "/org/apache/cxf/w2j/hello_world_mime/Hello.java"));
assertTrue(file.contains(str1));
assertTrue(file.contains(str2));
@@ -568,7 +565,7 @@ public class CodeGenBugTest extends Abst
processor.execute();
String results = FileUtils.getStringFromFile(new File(output.getCanonicalPath(),
- "org/apache/sayhi/SayHi.java"));
+ "org/apache/sayhi/SayHi.java"));
assertTrue(results.trim().length() > 0);
assertTrue(results.indexOf("@WebResult(name = \"return\", "
@@ -576,7 +573,6 @@ public class CodeGenBugTest extends Abst
assertTrue(results.indexOf("@WebResult(name = \"return\", targetNamespace = \"\")") != -1);
}
-
@Test
public void testCXF627() throws Exception {
@@ -586,10 +582,9 @@ public class CodeGenBugTest extends Abst
try {
processor.execute();
} catch (Exception ex) {
- //ignore
+ // ignore
}
-
Class clz = classLoader.loadClass("org.apache.cxf.w2j.hello_world_soap_http.Greeter");
assertEquals(3, clz.getDeclaredMethods().length);
@@ -677,7 +672,6 @@ public class CodeGenBugTest extends Abst
}
-
@Test
public void testAntFile() throws Exception {
env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
@@ -697,8 +691,7 @@ public class CodeGenBugTest extends Abst
@Test
public void testNonUniqueBody() throws Exception {
try {
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/cxf939/bug.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf939/bug.wsdl"));
// env.put(ToolConstants.CFG_VALIDATE_WSDL,
// ToolConstants.CFG_VALIDATE_WSDL);
processor.setContext(env);
@@ -719,8 +712,7 @@ public class CodeGenBugTest extends Abst
@Test
public void testWrapperStyleNameCollision() throws Exception {
try {
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/cxf918/bug.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf918/bug.wsdl"));
processor.setContext(env);
processor.execute();
} catch (Exception e) {
@@ -730,16 +722,16 @@ public class CodeGenBugTest extends Abst
QName stringName = new QName(ns2, "string");
QName intName = new QName(ns2, "int");
- Message msg = new Message("WRAPPER_STYLE_NAME_COLLISION", UniqueBodyValidator.LOG,
- elementName, stringName, intName);
+ Message msg = new Message("WRAPPER_STYLE_NAME_COLLISION", UniqueBodyValidator.LOG, elementName,
+ stringName, intName);
assertEquals(msg.toString().trim(), e.getMessage().trim());
}
}
+
@Test
public void testNonWrapperStyleNameCollision() throws Exception {
try {
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/cxf918/bug2.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf918/bug2.wsdl"));
processor.setContext(env);
processor.execute();
fail("The cxf918/bug2.wsdl should not have generated code");
@@ -751,8 +743,7 @@ public class CodeGenBugTest extends Abst
@Test
public void testParameterOrderNoOutputMessage() throws Exception {
try {
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/bug967.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/bug967.wsdl"));
processor.setContext(env);
processor.execute();
} catch (Exception e) {
@@ -763,13 +754,12 @@ public class CodeGenBugTest extends Abst
@Test
public void testParameterOrderDifferentNS() throws Exception {
try {
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/bug978/bug.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/bug978/bug.wsdl"));
processor.setContext(env);
processor.execute();
String results = FileUtils.getStringFromFile(new File(output.getCanonicalPath(),
- "org/tempuri/GreeterRPCLit.java"));
+ "org/tempuri/GreeterRPCLit.java"));
assertTrue(results.indexOf("@WebParam(partName = \"inInt\", name = \"inInt\")") != -1);
assertTrue(results.indexOf("Style.RPC") != -1);
@@ -803,8 +793,9 @@ public class CodeGenBugTest extends Abst
processor.setContext(env);
processor.execute();
- String results = FileUtils.getStringFromFile(new File(output.getCanonicalPath(),
- "soapinterface/ems/esendex/com/AccountServiceSoap.java"));
+ String results = FileUtils
+ .getStringFromFile(new File(output.getCanonicalPath(),
+ "soapinterface/ems/esendex/com/AccountServiceSoap.java"));
assertTrue(results.indexOf("public int getMessageLimit") != -1);
assertTrue(results.indexOf("name = \"MessengerHeader") != -1);
assertTrue(results.indexOf("header = true") != -1);
@@ -812,26 +803,22 @@ public class CodeGenBugTest extends Abst
@Test
public void testBindingForImportWSDL() throws Exception {
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/cxf1095/hello_world_services.wsdl"));
- env.put(ToolConstants.CFG_BINDING,
- new String[] {getLocation("/wsdl2java_wsdl/cxf1095/binding.xml")
- , getLocation("/wsdl2java_wsdl/cxf1095/binding1.xml")});
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf1095/hello_world_services.wsdl"));
+ env.put(ToolConstants.CFG_BINDING,
+ new String[] {getLocation("/wsdl2java_wsdl/cxf1095/binding.xml"),
+ getLocation("/wsdl2java_wsdl/cxf1095/binding1.xml")});
processor.setContext(env);
processor.execute();
- Class clz = classLoader
- .loadClass("org.apache.cxf.w2j.hello_world.messages.CustomizedFault");
+ Class clz = classLoader.loadClass("org.apache.cxf.w2j.hello_world.messages.CustomizedFault");
assertNotNull("Customization Fault Class is not generated", clz);
- Class serviceClz = classLoader
- .loadClass("org.apache.cxf.w2j.hello_world.services.CustomizedService");
+ Class serviceClz = classLoader.loadClass("org.apache.cxf.w2j.hello_world.services.CustomizedService");
assertNotNull("Customization Fault Class is not generated", serviceClz);
}
@Test
public void testReuseJaxwsBindingFile() throws Exception {
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/cxf1094/hello_world.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf1094/hello_world.wsdl"));
env.put(ToolConstants.CFG_BINDING, getLocation("/wsdl2java_wsdl/cxf1094/async_binding.xml"));
processor.setContext(env);
processor.execute();
@@ -843,8 +830,7 @@ public class CodeGenBugTest extends Abst
assertNotNull("jaxws binding file does not take effect for hello_world.wsdl", method1);
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/cxf1094/echo_date.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf1094/echo_date.wsdl"));
env.put(ToolConstants.CFG_BINDING, getLocation("/wsdl2java_wsdl/cxf1094/async_binding.xml"));
processor.setContext(env);
processor.execute();
@@ -860,38 +846,33 @@ public class CodeGenBugTest extends Abst
// See CXF-2135
@Test
public void testReuseJaxbBindingFile1() throws Exception {
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/cxf1094/hello_world.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf1094/hello_world.wsdl"));
env.put(ToolConstants.CFG_BINDING, getLocation("/wsdl2java_wsdl/cxf1094/jaxbbinding.xml"));
processor.setContext(env);
processor.execute();
Class clz = classLoader
.loadClass("org.apache.cxf.w2j.hello_world_soap_http.types.CreateProcess$MyProcess");
- assertNotNull("Failed to generate customized class for hello_world.wsdl" , clz);
+ assertNotNull("Failed to generate customized class for hello_world.wsdl", clz);
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/cxf1094/hello_world_oneway.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf1094/hello_world_oneway.wsdl"));
env.put(ToolConstants.CFG_BINDING, getLocation("/wsdl2java_wsdl/cxf1094/jaxbbinding.xml"));
processor.setContext(env);
processor.execute();
Class customizedClz = classLoader.loadClass("org.apache.oneway.types.CreateProcess$MyProcess");
- assertNotNull("Failed to generate customized class for hello_world_oneway.wsdl",
- customizedClz);
+ assertNotNull("Failed to generate customized class for hello_world_oneway.wsdl", customizedClz);
}
@Test
public void testBindingXPath() throws Exception {
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
env.put(ToolConstants.CFG_BINDING, getLocation("/wsdl2java_wsdl/cxf1106/binding.xml"));
processor.setContext(env);
processor.execute();
- Class clz = classLoader
- .loadClass("org.apache.cxf.w2j.hello_world_soap_http.Greeter");
+ Class clz = classLoader.loadClass("org.apache.cxf.w2j.hello_world_soap_http.Greeter");
assertNotNull("Failed to generate SEI class", clz);
Method[] methods = clz.getMethods();
- assertEquals("jaxws binding file parse error, number of generated method is not expected"
- , 14, methods.length);
+ assertEquals("jaxws binding file parse error, number of generated method is not expected", 14,
+ methods.length);
boolean existSayHiAsyn = false;
for (Method m : methods) {
@@ -902,7 +883,6 @@ public class CodeGenBugTest extends Abst
assertFalse("sayHiAsyn method should not be generated", existSayHiAsyn);
}
-
@Test
public void testJaxbCatalog() throws Exception {
env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf1112/myservice.wsdl"));
@@ -914,7 +894,6 @@ public class CodeGenBugTest extends Abst
assertNotNull("Customization types class should be generated", clz);
}
-
@Test
public void testCatalog2() throws Exception {
env.put(ToolConstants.CFG_WSDLURL, "http://example.org/wsdl");
@@ -945,6 +924,7 @@ public class CodeGenBugTest extends Abst
assertEquals(13, file.list().length);
}
+
@Test
public void testCxf1137() {
try {
@@ -974,8 +954,6 @@ public class CodeGenBugTest extends Abst
assertNotNull("Customized method 'myGreetMe' in MyGreeter.class is not found", customizedMethod);
}
-
-
@Test
public void testJaxwsBindingJavaDoc() throws Exception {
env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
@@ -984,14 +962,14 @@ public class CodeGenBugTest extends Abst
processor.execute();
List<String> results1 = FileUtils.readLines(new File(output.getCanonicalPath(),
- "org/mypkg/MyGreeter.java"));
+ "org/mypkg/MyGreeter.java"));
assertTrue(results1.contains(" * this is package javadoc"));
assertTrue(results1.contains(" * this is class javadoc"));
assertTrue(results1.contains(" * this is method javadoc"));
List<String> results2 = FileUtils.readLines(new File(output.getCanonicalPath(),
- "org/mypkg/SOAPServiceTest1.java"));
+ "org/mypkg/SOAPServiceTest1.java"));
boolean match1 = false;
boolean match2 = false;
@@ -1010,16 +988,14 @@ public class CodeGenBugTest extends Abst
@Test
public void testWSAActionAnno() throws Exception {
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/cxf1209/hello_world_fault.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf1209/hello_world_fault.wsdl"));
processor.setContext(env);
processor.execute();
}
@Test
public void testCXF964() throws Exception {
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/cxf964/hello_world_fault.wsdl"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf964/hello_world_fault.wsdl"));
processor.setContext(env);
processor.execute();
Class<?> clz = classLoader.loadClass("org.apache.intfault.BadRecordLitFault");
@@ -1029,10 +1005,8 @@ public class CodeGenBugTest extends Abst
@Test
public void testCXF1620() throws Exception {
- env.put(ToolConstants.CFG_WSDLURL,
- getLocation("/wsdl2java_wsdl/jaxb_custom_extensors.wsdl"));
- env.put(ToolConstants.CFG_BINDING,
- getLocation("/wsdl2java_wsdl/jaxb_custom_extensors.xjb"));
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/jaxb_custom_extensors.wsdl"));
+ env.put(ToolConstants.CFG_BINDING, getLocation("/wsdl2java_wsdl/jaxb_custom_extensors.xjb"));
processor.setContext(env);
processor.execute();
@@ -1044,7 +1018,6 @@ public class CodeGenBugTest extends Abst
assertEquals(1, clz.getDeclaredFields().length);
}
-
@Test
public void testCXF1048() throws Exception {
@@ -1063,7 +1036,6 @@ public class CodeGenBugTest extends Abst
assertEquals("PingSoapPort", webServiceAnn.portName());
}
-
@Test
public void testCXF1694() throws Exception {
@@ -1079,18 +1051,17 @@ public class CodeGenBugTest extends Abst
@Test
public void testCXF1662() throws Exception {
String[] args = new String[] {"-d", output.getCanonicalPath(), "-p", "org.cxf",
- getLocation("/wsdl2java_wsdl/cxf1662/test.wsdl")};
+ getLocation("/wsdl2java_wsdl/cxf1662/test.wsdl")};
try {
WSDLToJava.main(args);
} catch (ToolException tex) {
assertTrue(tex.getMessage().contains(" -p option cannot be used when "
- + "wsdl contains mutiple schemas"));
+ + "wsdl contains mutiple schemas"));
}
-
String[] args2 = new String[] {"-d", output.getCanonicalPath(), "-p", "org.cxf",
- getLocation("/wsdl2java_wsdl/cxf1662/test2.wsdl")};
+ getLocation("/wsdl2java_wsdl/cxf1662/test2.wsdl")};
try {
WSDLToJava.main(args2);
} catch (ToolException tex) {
@@ -1105,9 +1076,7 @@ public class CodeGenBugTest extends Abst
@Test
public void testMultiXjcArgs() throws Exception {
- String[] args = new String[] {"-d", output.getCanonicalPath(),
- "-xjc-Xlocator",
- "-xjc-Xsync-methods",
+ String[] args = new String[] {"-d", output.getCanonicalPath(), "-xjc-Xlocator", "-xjc-Xsync-methods",
getLocation("/wsdl2java_wsdl/hello_world.wsdl")};
WSDLToJava.main(args);
File file = new File(output, "org/apache/cxf/w2j/hello_world_soap_http/types/SayHi.java");
@@ -1120,9 +1089,9 @@ public class CodeGenBugTest extends Abst
@Test
public void testCXF1939() throws Exception {
- String[] args = new String[] {"-d", output.getCanonicalPath(),
- "-impl", "-server", "-client", "-autoNameResolution",
- getLocation("/wsdl2java_wsdl/cxf1939/hello_world.wsdl")};
+ String[] args = new String[] {"-d", output.getCanonicalPath(), "-impl", "-server", "-client",
+ "-autoNameResolution",
+ getLocation("/wsdl2java_wsdl/cxf1939/hello_world.wsdl")};
WSDLToJava.main(args);
assertNotNull(output);
@@ -1130,17 +1099,15 @@ public class CodeGenBugTest extends Abst
assertTrue(new File(output, "org/apache/cxf/w2j/hello_world_soap_http/GreeterImpl1.java").exists());
assertTrue(new File(output,
"org/apache/cxf/w2j/hello_world_soap_http/TestServiceName.java").exists());
- assertTrue(new File(output,
- "org/apache/cxf/w2j/hello_world_soap_http/TestServiceName1.java").exists());
+ assertTrue(new File(output, "org/apache/cxf/w2j/hello_world_soap_http/TestServiceName1.java")
+ .exists());
}
-
@Test
public void testCXF3105() throws Exception {
- String[] args = new String[] {"-d", output.getCanonicalPath(),
- "-impl", "-server", "-client",
- "-b", getLocation("/wsdl2java_wsdl/cxf3105/ws-binding.xml"),
- getLocation("/wsdl2java_wsdl/cxf3105/cxf3105.wsdl")};
+ String[] args = new String[] {"-d", output.getCanonicalPath(), "-impl", "-server", "-client", "-b",
+ getLocation("/wsdl2java_wsdl/cxf3105/ws-binding.xml"),
+ getLocation("/wsdl2java_wsdl/cxf3105/cxf3105.wsdl")};
WSDLToJava.main(args);
assertNotNull(output);
@@ -1154,13 +1121,14 @@ public class CodeGenBugTest extends Abst
@Test
public void testOverloadWithAction() throws Exception {
String[] args = new String[] {"-d", output.getCanonicalPath(),
- getLocation("/wsdl2java_wsdl/hello_world_overload.wsdl")};
+ getLocation("/wsdl2java_wsdl/hello_world_overload.wsdl")};
WSDLToJava.main(args);
-
+
assertNotNull(output);
File f = new File(output, "org/apache/cxf/w2j/hello_world_soap_http/SayHi.java");
assertTrue(f.exists());
}
+
@Test
public void testCXF3290() throws Exception {
env.put(ToolConstants.CFG_COMPILE, "compile");
@@ -1169,13 +1137,13 @@ public class CodeGenBugTest extends Abst
env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf-3290/bug.wsdl"));
processor.setContext(env);
processor.execute();
-
+
Class<?> cls = classLoader.loadClass("org.apache.cxf.bugs3290.services.bug1.MyBugService");
Method m = cls.getMethod("getMyBug1");
assertEquals(classLoader.loadClass("org.apache.cxf.bugs3290.services.bug2.MyBugService"),
m.getReturnType());
}
-
+
@Test
public void testCXF3353andCXF3491() throws Exception {
try {
Modified: cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/remote-hello_world_binding.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/remote-hello_world_binding.xsd?rev=1151558&r1=1151557&r2=1151558&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/remote-hello_world_binding.xsd (original)
+++ cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/remote-hello_world_binding.xsd Wed Jul 27 17:50:16 2011
@@ -19,7 +19,7 @@
<bindings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- wsdlLocation="http://localhost:8585/hello_world.wsdl"
+ wsdlLocation="hello_world.wsdl"
xmlns="http://java.sun.com/xml/ns/jaxws">
<bindings node="wsdl:definitions">
<enableAsyncMapping>true</enableAsyncMapping>