Search in sources :

Example 1 with PutLastTradedPricePortType

use of org.apache.hello_world_doc_lit_bare.PutLastTradedPricePortType 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 2 with PutLastTradedPricePortType

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

the class DOCBareClientServerTest method testAnnotation.

@Test
public void testAnnotation() throws Exception {
    Class<PutLastTradedPricePortType> claz = PutLastTradedPricePortType.class;
    TradePriceData priceData = new TradePriceData();
    Holder<TradePriceData> holder = new Holder<TradePriceData>(priceData);
    Method method = claz.getMethod("sayHi", holder.getClass());
    assertNotNull("Can not find SayHi method in generated class ", method);
    Annotation ann = method.getAnnotation(WebMethod.class);
    WebMethod webMethod = (WebMethod) ann;
    assertEquals(webMethod.operationName(), "SayHi");
    Annotation[][] paraAnns = method.getParameterAnnotations();
    for (Annotation[] paraType : paraAnns) {
        for (Annotation an : paraType) {
            if (an.annotationType() == WebParam.class) {
                WebParam webParam = (WebParam) an;
                assertNotSame("", webParam.targetNamespace());
            }
        }
    }
}
Also used : WebMethod(javax.jws.WebMethod) WebParam(javax.jws.WebParam) Holder(javax.xml.ws.Holder) TradePriceData(org.apache.hello_world_doc_lit_bare.types.TradePriceData) WebMethod(javax.jws.WebMethod) Method(java.lang.reflect.Method) PutLastTradedPricePortType(org.apache.hello_world_doc_lit_bare.PutLastTradedPricePortType) Annotation(java.lang.annotation.Annotation) Test(org.junit.Test)

Example 3 with PutLastTradedPricePortType

use of org.apache.hello_world_doc_lit_bare.PutLastTradedPricePortType 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 4 with PutLastTradedPricePortType

use of org.apache.hello_world_doc_lit_bare.PutLastTradedPricePortType 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

PutLastTradedPricePortType (org.apache.hello_world_doc_lit_bare.PutLastTradedPricePortType)4 Test (org.junit.Test)4 URL (java.net.URL)3 SOAPService (org.apache.hello_world_doc_lit_bare.SOAPService)3 TradePriceData (org.apache.hello_world_doc_lit_bare.types.TradePriceData)3 Holder (javax.xml.ws.Holder)2 Annotation (java.lang.annotation.Annotation)1 Method (java.lang.reflect.Method)1 WebMethod (javax.jws.WebMethod)1 WebParam (javax.jws.WebParam)1