@Override public void destroy() { endpoint1.stop(); endpoint2.stop(); super.destroy(); }
@AfterClass public static void teardown() { if (endpoint != null) { endpoint.stop(); } if (ddlDrop) { runDdl(conn, DROP_OPTLOCK_TABLE, ddlDebug); } }
public static void main(final String[] args) { String url = (args.length > 0) ? args[0] : "http://localhost:4434/buecherservice"; System.out.println("url: " + url); Endpoint ep = Endpoint.publish(url, new BuecherServiceImpl()); System.out.println("published"); JOptionPane.showMessageDialog(null, "TestWsServer beenden"); ep.stop(); }
protected void tearDown() throws Exception { super.tearDown(); // Sleep to give endpoint some time to process the non-anonymous request // this is needed in case the object is exchanged between client and non-anonymous response // endpoint, // which leads to test tearDown(), yet the ack to non-anonymous response is not sent back to // server yet. Thread.sleep(5000); if (responseProcessor != null) responseProcessor.stop(); }
@Test public void testWSDLPublishWithCatalogs() throws Exception { Endpoint ep = Endpoint.publish("http://localhost:" + PORT + "/SoapContext/SoapPort", new GreeterImpl()); try { String result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort?" + "xsd=hello_world_schema2.xsd"); assertTrue(result, result.contains("xsd=hello_world_schema.xsd")); assertTrue(result, result.contains("xsd=hello_world_schema3.xsd")); assertTrue(result, result.contains("xsd=d/hello_world_schema4.xsd")); result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort?" + "xsd=hello_world_schema3.xsd"); assertTrue(result.length() > 0); result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort?" + "xsd=d/hello_world_schema4.xsd"); assertTrue(result, result.contains("xsd=d/d/hello_world_schema4.xsd")); result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort" + "?xsd=hello_world_schema.xsd"); assertTrue( result, result.contains("xsd=http://apache.org/hello_world/types2/hello_world_schema2.xsd")); result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort" + "?wsdl=hello_world_messages_catalog.wsdl"); assertTrue(result, result.contains("xsd=hello_world_schema.xsd")); } finally { ep.stop(); } }
@After public void done() throws Exception { if (mep == NO_RUN) { return; } if (callbackEndpoint != null) { callbackEndpoint.stop(); } if (server != null) { server.stop(); server.destroy(); } checkError(true); }
public void testEntity() throws Exception { int port = PortAllocator.getFreePort(); String address = "http://localhost:" + port + "/entity"; Endpoint endpoint = Endpoint.create(new MyEndpoint()); endpoint.publish(address); try { HTTPResponseInfo rInfo = sendEntity(address); String resp = rInfo.getResponseBody(); if (resp.contains("x1y1")) { fail("Entity is getting resolved"); } int code = rInfo.getResponseCode(); assertEquals(HttpURLConnection.HTTP_INTERNAL_ERROR, code); } finally { endpoint.stop(); } }
@After public void tearDown() throws Exception { if (endpoint != null) { endpoint.stop(); } }
public void tearDown() { ep.stop(); ep = null; }
public void stop() { if (endpoint != null) { endpoint.stop(); } }
/** * This is test case for https://issues.apache.org/jira/browse/CXF-6234 * * <p>It's using paths that will be rewritten by following catalog rule: * * <p><rewriteSystem systemIdStartString="http://apache.org/hello_world/types2/" * rewritePrefix="/wsdl/others/"/> */ @Test public void testWSDLPublishWithCatalogsRewritePaths() { Endpoint ep = Endpoint.publish("http://localhost:" + PORT + "/SoapContext/SoapPort", new GreeterImpl()); try { // schemas in the same directory as WSDL String result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort?" + "xsd=http://apache.org/hello_world/types2/hello_world_schema2.xsd"); assertTrue( result, result.contains("xsd=http://apache.org/hello_world/types2/hello_world_schema.xsd")); assertTrue( result, result.contains("xsd=http://apache.org/hello_world/types2/hello_world_schema3.xsd")); assertTrue( result, result.contains("xsd=http://apache.org/hello_world/types2/d/hello_world_schema4.xsd")); result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort?" + "xsd=http://apache.org/hello_world/types2/hello_world_schema.xsd"); assertTrue( result, result.contains("xsd=http://apache.org/hello_world/types2/hello_world_schema2.xsd")); result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort?" + "xsd=http://apache.org/hello_world/types2/hello_world_schema3.xsd"); assertTrue(result.length() > 0); result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort?" + "xsd=http://apache.org/hello_world/types2/d/hello_world_schema4.xsd"); assertTrue( result, result.contains("xsd=http://apache.org/hello_world/types2/d/d/hello_world_schema4.xsd")); result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort?" + "xsd=http://apache.org/hello_world/types2/d/d/hello_world_schema4.xsd"); assertFalse(result.contains("schemaLocation")); // schemas in separate directory which is not subdirectory of WSDL dir result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort?" + "wsdl=http://apache.org/hello_world/types2/hello_world_messages_catalog.wsdl"); assertTrue( result, result.contains("xsd=http://apache.org/hello_world/schemas-in-separate-dir/schema.xsd")); result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort?" + "xsd=http://apache.org/hello_world/schemas-in-separate-dir/schema.xsd"); assertTrue( result, result.contains( "xsd=http://apache.org/hello_world/schemas-in-separate-dir/d/included.xsd")); result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort?" + "xsd=http://apache.org/hello_world/schemas-in-separate-dir/d/included.xsd"); assertTrue( result, result.contains( "xsd=http://apache.org/hello_world/schemas-in-separate-dir/d/d/included.xsd")); result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort?" + "xsd=http://apache.org/hello_world/schemas-in-separate-dir/d/d/included.xsd"); assertFalse(result, result.contains("schemaLocation")); // rewrite rule that doesn't begin with 'classpath:' but contains only the path result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort?" + "xsd=http://apache.org/hello_world/schemas-in-separate-dir-non-cp/another-schema.xsd"); assertTrue( result, result.contains( "xsd=http://apache.org/hello_world/schemas-in-separate-dir-non-cp/d/" + "another-included.xsd")); result = readUrl( "http://localhost:" + PORT + "/SoapContext/SoapPort?" + "xsd=http://apache.org/hello_world/schemas-in-separate-dir-non-cp/d/another-included.xsd"); assertTrue( result, result.contains( "xsd=http://apache.org/hello_world/schemas-in-separate-dir-non-cp/d/d/" + "another-included.xsd")); } finally { ep.stop(); } }
@After public void tearDown() { endpoint.stop(); }
@After public void tearDown() throws Exception { endpoint.stop(); }
public void tearDown() { while (!eps.isEmpty()) { Endpoint ep = eps.remove(0); ep.stop(); } }
@Override public void stop(BundleContext context) throws Exception { endpoint.stop(); }