Examples of PortListen


Examples of org.apache.ws.notification.PortListen

      EndpointReferenceType subRef = sub_response.getSubscriptionReference(  );
      assertNotNull( subRef );
      assertTrue( AxisGenTypesUtils.getResourceId( subRef ).length(  ) != 0 );

      //test as a listener for events
      PortListen notificationListener = new PortListen( NOTIFICATION_LISTENER_PORT, LISTENER_TIMEOUT );

      // destroy the resource - a notification should get emitted!
      m_stub.destroy( new Destroy(  ) );

      // wait for that termination notification
      String incomingMessage = notificationListener.waitForIncomingMessage(  );

      //validate the incoming notification is really in there!
      validateNotificationMessage( incomingMessage );

      // simple test just to verify the termination notification was in the notification
View Full Code Here

Examples of org.apache.ws.notification.PortListen

    */
   public void testDestroySubscription(  )
   throws Exception
   {
      //test as a listener for events
      PortListen         notificationListener = new PortListen( NOTIFICATION_LISTENER_PORT, LISTENER_TIMEOUT );

      SubscribeResponse sub_response =
         subscribe( ExampleConstants.RESOURCE_PROP_QNAME_BLOCK_SIZE,
                    "http://127.0.0.1:" + NOTIFICATION_LISTENER_PORT );

      testDiskPortSetResourcePropertiesUpdate(  );
      String incomingMessage = notificationListener.waitForIncomingMessage(  );
      assertFalse( "Incoming Message started with an Error.",
                   incomingMessage.startsWith( "ERROR" ) );

      EndpointReferenceType              subscriptionReference = sub_response.getSubscriptionReference(  );
      SubscriptionManagerHttpBindingStub subMgrBinding = getSubMgrBinding(  );
      assertNotNull( subMgrBinding );

      subMgrBinding.setResourceId( AxisGenTypesUtils.getResourceId( subscriptionReference ) );

      subMgrBinding.destroy( null );

      notificationListener = new PortListen( NOTIFICATION_LISTENER_PORT, 5000 );

      testDiskPortSetResourcePropertiesUpdate(  );
      String response = notificationListener.waitForIncomingMessage(  );
      assertTrue( "Incoming Message did not start with an Error.",
                  response.startsWith( "ERROR" ) );
   }
View Full Code Here

Examples of org.apache.ws.notification.PortListen

      EndpointReferenceType subRef = sub_response.getSubscriptionReference(  );

      assertNotNull( subRef );

      //test as a listener for events
      PortListen notificationListener = new PortListen( NOTIFICATION_LISTENER_PORT, LISTENER_TIMEOUT );
      assertTrue( AxisGenTypesUtils.getResourceId( subRef ).length(  ) != 0 );

      String incomingMessage = notificationListener.waitForIncomingMessage(  );

      //validate the incoming notification is really in there!
      validateNotificationMessage( incomingMessage );

      // Call GetCurrentMessage to assure that the BadSector message is available.
View Full Code Here

Examples of org.apache.ws.notification.PortListen

      // The two subscription references should be equal except for the ResourceID property
      assertTrue( rsSubRef.getAddress(  ).toString(  ).compareTo( bsSubRef.getAddress(  ).toString(  ) ) == 0 );
      assertTrue( rsSubRef.getPortType(  ).toString(  ).compareTo( bsSubRef.getPortType(  ).toString(  ) ) == 0 );

      //test as a listener for events
      PortListen notificationListener = new PortListen( NOTIFICATION_LISTENER_PORT, LISTENER_TIMEOUT );
      assertTrue( AxisGenTypesUtils.getResourceId( rsSubRef ).compareTo( AxisGenTypesUtils.getResourceId( bsSubRef ) ) != 0 );

      // Update the BlockSize to initiate the Notification
      testDiskPortSetResourcePropertiesUpdate(  );

      String incomingMessage = notificationListener.waitForIncomingMessage(  );

      //validate the incoming notification is really in there!
      validateNotificationMessage( incomingMessage );

      // Call GetCurrentMessage to assure that the BlockSize message is available.
View Full Code Here

Examples of org.apache.ws.notification.PortListen

   public void testPauseResumeSubscription(  )
   throws Exception,
          RemoteException
   {
      //test as a listener for events
      PortListen         notificationListener = new PortListen( NOTIFICATION_LISTENER_PORT, 5000 );

      SubscribeResponse sub_response =
         subscribe( ExampleConstants.RESOURCE_PROP_QNAME_BLOCK_SIZE,
                    "http://127.0.0.1:" + NOTIFICATION_LISTENER_PORT );

      EndpointReferenceType              subscriptionReference = sub_response.getSubscriptionReference(  );

      SubscriptionManagerHttpBindingStub subMgrBinding = getSubMgrBinding(  );
      assertNotNull( subMgrBinding );

      subMgrBinding.setResourceId( AxisGenTypesUtils.getResourceId( subscriptionReference ) );
      subMgrBinding.pauseSubcription( null );

      testDiskPortSetResourcePropertiesUpdate(  );

      String incomingMessage = notificationListener.waitForIncomingMessage(  );
      assertTrue( incomingMessage.startsWith( "ERROR:java.net.SocketTimeoutException: Accept timed out" ) );
      notificationListener = new PortListen( NOTIFICATION_LISTENER_PORT, 5000 );
      subMgrBinding.resumeSubscription( null );

      testDiskPortSetResourcePropertiesUpdate(  );
      String response = notificationListener.waitForIncomingMessage(  );
      assertFalse( response.startsWith( "ERROR" ) );
   }
View Full Code Here

Examples of org.apache.ws.notification.PortListen

    */
   public void testSetTerminationTimeSubscription(  )
   throws Exception
   {
      //test as a listener for events
      PortListen         notificationListener = new PortListen( NOTIFICATION_LISTENER_PORT, 15000 );

      SubscribeResponse sub_response =
         subscribe( ExampleConstants.RESOURCE_PROP_QNAME_BLOCK_SIZE,
                    "http://127.0.0.1:" + NOTIFICATION_LISTENER_PORT );

      testDiskPortSetResourcePropertiesUpdate(  );
      String incomingMessage = notificationListener.waitForIncomingMessage(  );
      assertFalse( incomingMessage.startsWith( "ERROR" ) );

      EndpointReferenceType              subscriptionReference = sub_response.getSubscriptionReference(  );
      SubscriptionManagerHttpBindingStub subMgrBinding = getSubMgrBinding(  );
      assertNotNull( subMgrBinding );

      subMgrBinding.setResourceId( AxisGenTypesUtils.getResourceId( subscriptionReference ) );

      SetTerminationTime termTime = new SetTerminationTime(  );
      Calendar            calendar = Calendar.getInstance(  );

      //set to the start of time ;-) ..its already expired
      calendar.setTimeInMillis( 0 );
      termTime.setRequestedTerminationTime( calendar );
      subMgrBinding.setTerminationTime( termTime );

      notificationListener = new PortListen( NOTIFICATION_LISTENER_PORT, 5000 );

      testDiskPortSetResourcePropertiesUpdate(  );
      String response = notificationListener.waitForIncomingMessage(  );
      assertTrue( response.startsWith( "ERROR" ) );
   }
View Full Code Here

Examples of org.apache.ws.util.test.PortListen

        //subscribe for the events
        EndpointReference subscriptionEPR = subscribeForOperationalStatusChangeEvents(consumerUrl, m_resource);

        //setup port listener
        m_listener = new PortListen(80, 600000);

        //call recalibrate (after noticing erratic behavior) on webservice to trigger the status change evennt
        sendRecalibrateRequest(xepr);

        //listen for operational change notif    ...this will actually capture any message that comes in...
        String messageText = m_listener.waitForIncomingMessage();

        //upon notification.......dump to standard out for debugging
        System.out.println(messageText);

        try
        {
            //parse out the managementevent
            ManagementEventTypeImpl manEvt = parseManagementEvent(messageText);

            //here is the epr and the address of the source of the event....this is the weatherstation which caused the event.
            EndpointReferenceType sourceEpr = parseSourceEpr(manEvt);
            String sourceAddress = sourceEpr.getAddress().getStringValue();

            //get the current operational status.....
            String currentOperationalStatus = parseCurrentOperationalStatus(manEvt);

            //try again to get the available message ...this was to debug their end....
            m_listener = new PortListen(80, 600000);
            String messageText2 = m_listener.waitForIncomingMessage();
        }
        catch (Exception e)
        {
            e.printStackTrace();
View Full Code Here

Examples of org.apache.ws.util.test.PortListen

        XmlObject[] capabilityElems = m_resource.getResourceProperty( ManageabilityCharacteristicsCapability.PROP_NAME_MANAGEABILITY_CAPABILITY );
        assertContainsURI( capabilityElems, RequestProcessingStateCapability.URI );

        m_resource.subscribe( s_consumerURL, new QName( MowsConstants.NSURI_MOWS_TOPICS, "RequestProcessingObservations", MowsConstants.NSPREFIX_MOWS_TOPICS ) );

        PortListen notifListener = new PortListen( NOTIF_LISTENER_PORT, NOTIF_LISTENER_TIMEOUT );

        m_service.getCurrentTemperature();

        ManagementEventType mgmtEvent = waitForManagementEvent( notifListener );
        if ( DEBUG ) { System.out.println( "Received ManagementEvent:\n" + mgmtEvent.xmlText( new XmlOptions().setSaveOuter().setSavePrettyPrint() ) ); }
View Full Code Here

Examples of org.apache.ws.util.test.PortListen

        XmlObject[] capabilityElems = m_resource.getResourceProperty( ManageabilityCharacteristicsCapability.PROP_NAME_MANAGEABILITY_CAPABILITY );
        assertContainsURI( capabilityElems, MetricsCapability.URI );

        m_resource.subscribe( s_consumerURL, new QName( MuwsConstants.NSURI_MUWS_PART2_TOPICS, MetricsCapability.TOPIC_NAME, MuwsConstants.NSPREFIX_MUWS_PART2_TOPICS ) );

        PortListen notifListener = new PortListen( NOTIF_LISTENER_PORT, NOTIF_LISTENER_TIMEOUT );

        TotalCodeModuleSizeDocument totalCodeModuleSizeDocument = TotalCodeModuleSizeDocument.Factory.newInstance();
        totalCodeModuleSizeDocument.setTotalCodeModuleSize( 1111 );
        setSingleProperty( m_resource, totalCodeModuleSizeDocument );
View Full Code Here

Examples of org.apache.ws.util.test.PortListen

        XmlObject[] capabilityElems = m_resource.getResourceProperty( ManageabilityCharacteristicsCapability.PROP_NAME_MANAGEABILITY_CAPABILITY );
        assertContainsURI( capabilityElems, MetricsCapability.URI );

        m_resource.subscribe( s_consumerURL, new QName( NSURI_BLACKBERRY, "CodeModuleSize", NSPREFIX_BLACKBERRY ) );

        PortListen notifListener = new PortListen( NOTIF_LISTENER_PORT, NOTIF_LISTENER_TIMEOUT );

        TotalCodeModuleSizeDocument totalCodeModuleSizeDocument = TotalCodeModuleSizeDocument.Factory.newInstance();
        totalCodeModuleSizeDocument.setTotalCodeModuleSize( 9999 );
        setSingleProperty( m_resource, totalCodeModuleSizeDocument );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.