Search in sources :

Example 1 with SOAPService

use of org.apache.hello_world_doc_lit_bare.SOAPService in project cxf by apache.

the class OOBHeaderTest method testBasicConnection.

@Test
public void testBasicConnection() throws Exception {
    URL wsdl = getClass().getResource("/wsdl/doc_lit_bare.wsdl");
    assertNotNull("WSDL is null", wsdl);
    SOAPService service = new SOAPService(wsdl, serviceName);
    assertNotNull("Service is null", service);
    PutLastTradedPricePortType putLastTradedPrice = service.getPort(portName, PutLastTradedPricePortType.class);
    updateAddressPort(putLastTradedPrice, PORT);
    TradePriceData priceData = new TradePriceData();
    priceData.setTickerPrice(1.0f);
    priceData.setTickerSymbol("CELTIX");
    assertFalse(check(0, putLastTradedPrice, false, true, priceData));
    assertFalse(check(1, putLastTradedPrice, false, true, priceData));
    assertTrue(check(2, putLastTradedPrice, false, true, priceData));
    assertTrue(check(3, putLastTradedPrice, false, true, priceData));
    assertFalse(check(0, putLastTradedPrice, true, true, priceData));
    assertFalse(check(1, putLastTradedPrice, true, true, priceData));
    assertFalse(check(2, putLastTradedPrice, true, true, priceData));
    assertFalse(check(3, putLastTradedPrice, true, true, priceData));
    assertTrue(check(0, putLastTradedPrice, false, false, priceData));
    assertTrue(check(1, putLastTradedPrice, false, false, priceData));
    assertTrue(check(2, putLastTradedPrice, false, false, priceData));
    assertTrue(check(4, putLastTradedPrice, false, false, priceData));
    assertTrue(check(0, putLastTradedPrice, true, false, priceData));
    assertTrue(check(1, putLastTradedPrice, true, false, priceData));
    assertTrue(check(2, putLastTradedPrice, true, false, priceData));
    assertTrue(check(4, putLastTradedPrice, true, false, priceData));
}
Also used : SOAPService(org.apache.hello_world_doc_lit_bare.SOAPService) TradePriceData(org.apache.hello_world_doc_lit_bare.types.TradePriceData) PutLastTradedPricePortType(org.apache.hello_world_doc_lit_bare.PutLastTradedPricePortType) URL(java.net.URL) Test(org.junit.Test)

Example 2 with SOAPService

use of org.apache.hello_world_doc_lit_bare.SOAPService in project cxf by apache.

the class DOCBareClientServerTest method testNillableParameter.

@Test
public void testNillableParameter() throws Exception {
    URL wsdl = getClass().getResource("/wsdl/doc_lit_bare.wsdl");
    assertNotNull("WSDL is null", wsdl);
    SOAPService service = new SOAPService(wsdl, serviceName);
    assertNotNull("Service is null", service);
    PutLastTradedPricePortType port = service.getPort(portName, PutLastTradedPricePortType.class);
    updateAddressPort(port, PORT);
    String result = port.nillableParameter(null);
    assertNull(result);
}
Also used : SOAPService(org.apache.hello_world_doc_lit_bare.SOAPService) PutLastTradedPricePortType(org.apache.hello_world_doc_lit_bare.PutLastTradedPricePortType) URL(java.net.URL) Test(org.junit.Test)

Example 3 with SOAPService

use of org.apache.hello_world_doc_lit_bare.SOAPService in project cxf by apache.

the class DOCBareClientServerTest method testBasicConnection.

@Test
public void testBasicConnection() throws Exception {
    URL wsdl = getClass().getResource("/wsdl/doc_lit_bare.wsdl");
    assertNotNull("WSDL is null", wsdl);
    SOAPService service = new SOAPService(wsdl, serviceName);
    assertNotNull("Service is null", service);
    PutLastTradedPricePortType putLastTradedPrice = service.getPort(portName, PutLastTradedPricePortType.class);
    updateAddressPort(putLastTradedPrice, PORT);
    String response = putLastTradedPrice.bareNoParam();
    assertEquals("testResponse", response);
    TradePriceData priceData = new TradePriceData();
    priceData.setTickerPrice(1.0f);
    priceData.setTickerSymbol("CELTIX");
    Holder<TradePriceData> holder = new Holder<TradePriceData>(priceData);
    for (int i = 0; i < 5; i++) {
        putLastTradedPrice.sayHi(holder);
        assertEquals(4.5f, holder.value.getTickerPrice(), 0.01);
        assertEquals("APACHE", holder.value.getTickerSymbol());
        putLastTradedPrice.putLastTradedPrice(priceData);
    }
}
Also used : SOAPService(org.apache.hello_world_doc_lit_bare.SOAPService) Holder(javax.xml.ws.Holder) TradePriceData(org.apache.hello_world_doc_lit_bare.types.TradePriceData) PutLastTradedPricePortType(org.apache.hello_world_doc_lit_bare.PutLastTradedPricePortType) URL(java.net.URL) Test(org.junit.Test)

Aggregations

URL (java.net.URL)3 PutLastTradedPricePortType (org.apache.hello_world_doc_lit_bare.PutLastTradedPricePortType)3 SOAPService (org.apache.hello_world_doc_lit_bare.SOAPService)3 Test (org.junit.Test)3 TradePriceData (org.apache.hello_world_doc_lit_bare.types.TradePriceData)2 Holder (javax.xml.ws.Holder)1