Package org.apache.ws.util.test

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


        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

        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

        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

        OperationalStatusDocument operationalStatusDoc = OperationalStatusDocument.Factory.newInstance();
        operationalStatusDoc.setOperationalStatus( OperationalStatusDocument.OperationalStatus.AVAILABLE );
        setSingleProperty( m_resource, operationalStatusDoc );

        m_resource.subscribe( s_consumerURL, new QName( MuwsConstants.NSURI_MUWS_PART2_TOPICS, OperationalStatusCapability.TOPIC_NAME, MuwsConstants.NSPREFIX_MUWS_PART2_TOPICS ) );
        PortListen notifListener = new PortListen( NOTIF_LISTENER_PORT, NOTIF_LISTENER_TIMEOUT );

        // change status to Unavailable
        operationalStatusDoc.setOperationalStatus( OperationalStatusDocument.OperationalStatus.UNAVAILABLE );
        setSingleProperty( m_resource, operationalStatusDoc );
View Full Code Here

        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

TOP

Related Classes of org.apache.ws.util.test.PortListen

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.