Package org.jboss.test.ws.interop.nov2007.wsaSoap12

Examples of org.jboss.test.ws.interop.nov2007.wsaSoap12.Notify


   {
      String text = "Hello!";
      ObjectFactory factory = new ObjectFactory();
      DataSet dataSet = new DataSet();
      dataSet.setAny(factory.createAnyType(text));
      Request request = new Request();
      request.setAny(factory.createDataSet(dataSet));
      EchoDataSetResult echoDataSetResult = port.echoDataSet(request);
      assertNotNull(echoDataSetResult);
      assertEquals(text, ((JAXBElement)((JAXBElement<DataSet>)echoDataSetResult.getAny()).getValue().getAny()).getValue());
   }
View Full Code Here


      ObjectFactory factory = new ObjectFactory();
      DataSet dataSet = new DataSet();
      dataSet.setAny(factory.createAnyType(text));
      Request request = new Request();
      request.setAny(factory.createDataSet(dataSet));
      EchoDataSetResult echoDataSetResult = port.echoDataSet(request);
      assertNotNull(echoDataSetResult);
      assertEquals(text, ((JAXBElement)((JAXBElement<DataSet>)echoDataSetResult.getAny()).getValue().getAny()).getValue());
   }
View Full Code Here

   @SuppressWarnings("unchecked")
   public EchoDataSetResult echoDataSet(Request request)
   {
      System.out.println("echoDataSet, request=" + request);
      EchoDataSetResult result = new EchoDataSetResult();
      if (request != null)
      {
         Object any = request.getAny();
         System.out.println("echoDataSet, request.getAny()="+any);
         if (any != null)
         {
            try
            {
               JAXBElement<DataSet> jaxbEl = (JAXBElement<DataSet>)any;
               JAXBElement inner = (JAXBElement)(jaxbEl.getValue().getAny());
               System.out.println("echoDataSet, DataSet inner value=" + inner.getValue());
            } catch (Exception e) {}
         }
         result.setAny(request.getAny());
      }
      return result;
   }
View Full Code Here

   {
      String text = "Hello!";
      ObjectFactory factory = new ObjectFactory();
      org.jboss.test.ws.interop.nov2007.wsse.EchoXml.Request request = new org.jboss.test.ws.interop.nov2007.wsse.EchoXml.Request();
      request.setAny(factory.createAnyType(text));
      EchoXmlResult result = port.echoXml(request);
      assertNotNull(result);
      assertEquals(text, ((JAXBElement)result.getAny()).getValue());
   }
View Full Code Here

   @SuppressWarnings("unchecked")
   public EchoXmlResult echoXml(org.jboss.test.ws.interop.nov2007.wsse.EchoXml.Request request)
   {
      System.out.println("echoXml, request=" + request);
      EchoXmlResult result = new EchoXmlResult();
      if (request != null)
      {
         Object any = request.getAny();
         System.out.println("echoXml, request.getAny()=" + any);
         if (any != null)
         {
            try
            {
               System.out.println("echoXml, inner value=" + ((JAXBElement)any).getValue());
            } catch (Exception e) {}
         }
         result.setAny(request.getAny());        
      }
      return result;
   }
View Full Code Here

    @Override
    protected synchronized void store(NotificationMessageHolderType messageHolder) {
        try {
            initSession();
            Notify notify = new Notify();
            notify.getNotificationMessage().add(messageHolder);
            StringWriter writer = new StringWriter();
            jaxbContext.createMarshaller().marshal(notify, writer);
            Message message = session.createTextMessage(writer.toString());
            producer.send(message);
        } catch (JMSException e) {
View Full Code Here

                if (msg == null) {
                    break;
                }
                TextMessage txtMsg = (TextMessage) msg;
                StringReader reader = new StringReader(txtMsg.getText());
                Notify notify = (Notify) jaxbContext.createUnmarshaller().unmarshal(reader);
                messages.addAll(notify.getNotificationMessage());
            }
            return messages;
        } catch (JMSException e) {
            log.info("Error retrieving messages", e);
            if (jmsSession != null) {
View Full Code Here

        // START SNIPPET: sub
        PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();
        Subscription subscription = wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);
        // END SNIPPET: sub

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(1, pullPoint.getMessages(0).size());

        subscription.unsubscribe();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(0, pullPoint.getMessages(0).size());
View Full Code Here

    public void testPauseResume() throws Exception {
        PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();
        Subscription subscription = wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(1, pullPoint.getMessages(0).size());

        subscription.pause();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(0, pullPoint.getMessages(0).size());

        subscription.resume();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(1, pullPoint.getMessages(0).size());
View Full Code Here

    public void testPull() throws Exception {
        PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();
        wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        List<NotificationMessageHolderType> msgs = pullPoint.getMessages(0);
        assertNotNull(msgs);
View Full Code Here

TOP

Related Classes of org.jboss.test.ws.interop.nov2007.wsaSoap12.Notify

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.