Package org.apache.axis2.transport.testkit

Examples of org.apache.axis2.transport.testkit.TransportTestSuiteBuilder$ResourceList


            String charSetEncoding = BuilderUtil.getCharSetEncoding(contentTypeStr);
            msgContext.setProperty(
                    Constants.Configuration.CHARACTER_SET_ENCODING, charSetEncoding);
            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);
                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    if (HTTPTransportUtils.isRESTRequest(contentTypeStr)) {
                        RESTUtil.processPOSTRequest(msgContext, is, os,
                                request.getRequestLine().getUri(), contentType, builder, isRestDispatching);
                    } else {
View Full Code Here


            String contentTypeStr = contentType != null ?
                    contentType.getValue() : inferContentType();

            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);

                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    RESTUtil.processGetAndDeleteRequest(
                            msgContext, os, request.getRequestLine().getUri(),
                            request.getFirstHeader(HTTP.CONTENT_TYPE), builder,
                            method, isRestDispatching);
                }
View Full Code Here

        params = getListenerParameters();


        param = transportIn.getParameter(NhttpConstants.ENDPOINTS_CONFIGURATION);
        if (param != null && param.getValue() != null) {
            endpoints = new URLEndpointsConfigurationFactory().create(param.getValue().toString());
        }
    }
View Full Code Here

        ManagedTestSuite suite = new ManagedTestSuite(VFSTransportTest.class, false);
       
        // Since VFS has no Content-Type header, SwA is not supported.
        suite.addExclude("(test=AsyncSwA)");
       
        TransportTestSuiteBuilder builder = new TransportTestSuiteBuilder(suite);
       
        ContentTypeServiceConfigurator cfgtr = new ContentTypeServiceConfigurator("transport.vfs.ContentType");
       
        builder.addEnvironment(new VFSTestEnvironment(new File("target/vfs3")),
                new VFSTransportDescriptionFactory());
       
        builder.addAsyncChannel(new VFSAsyncFileChannel("req/in"));
       
        builder.addAxisAsyncTestClient(new AxisAsyncTestClient());
        builder.addByteArrayAsyncTestClient(new VFSAsyncClient());
       
        builder.addAxisAsyncEndpoint(new AxisAsyncEndpoint(), cfgtr);
        builder.addByteArrayAsyncEndpoint(new VFSMockAsyncEndpoint());
       
        builder.addRequestResponseChannel(new VFSRequestResponseFileChannel("req/in", "req/out"));
       
        builder.addByteArrayRequestResponseTestClient(new VFSRequestResponseClient());
       
        builder.addEchoEndpoint(new AxisEchoEndpoint(), cfgtr);
       
        builder.build();
       
//        suite.addTest(new MinConcurrencyTest(server, new AsyncChannel[] { new VFSFileChannel("req/in1"), new VFSFileChannel("req/in2") }, 1, true, env, tdf));
        return suite;
    }
View Full Code Here

        // in this particular case:
        suite.addExclude("(&(protocol=imap)(|(test=AsyncSwA)(&(test=EchoXML)(messageType=SOAP12))))");
        // SYNAPSE-434
        suite.addExclude("(test=MinConcurrency)");
       
        TransportTestSuiteBuilder builder = new TransportTestSuiteBuilder(suite);
       
        builder.addEnvironment(new GreenMailTestEnvironment("pop3"), MailMessageContextValidator.INSTANCE);
        builder.addEnvironment(new GreenMailTestEnvironment("imap"), MailMessageContextValidator.INSTANCE);
       
        MailChannel channel = new MailChannel();
       
        builder.addAsyncChannel(channel);
       
        builder.addAxisAsyncTestClient(new AxisAsyncTestClient(), new MailAxisTestClientConfigurator(MailConstants.TRANSPORT_FORMAT_TEXT));
        builder.addAxisAsyncTestClient(new AxisAsyncTestClient(), new MailAxisTestClientConfigurator(MailConstants.TRANSPORT_FORMAT_MP));
        builder.addByteArrayAsyncTestClient(new MailAsyncClient(new FlatLayout()));
        builder.addByteArrayAsyncTestClient(new MailAsyncClient(new MultipartLayout()));
       
        builder.addAxisAsyncEndpoint(new AxisAsyncEndpoint());
       
        builder.addRequestResponseChannel(channel);
       
        builder.addAxisRequestResponseTestClient(new AxisRequestResponseTestClient(), new ResponseListenerConfigurator());
        builder.addByteArrayRequestResponseTestClient(new MailRequestResponseClient(new FlatLayout()));
        builder.addByteArrayRequestResponseTestClient(new MailRequestResponseClient(new MultipartLayout()));
       
        builder.addEchoEndpoint(new AxisEchoEndpoint());
       
        builder.build();
       
        suite.addTest(new MinConcurrencyTest(new MailChannel[] { new MailChannel(), new MailChannel() }, 2, true, new GreenMailTestEnvironment("pop3")));
        return suite;
    }
View Full Code Here

        // Example to run a few use cases.. please leave these commented out - asankha
        //suite.addExclude("(|(test=AsyncXML)(test=MinConcurrency)(destType=topic)(broker=qpid)(destType=topic)(replyDestType=topic)(client=jms)(endpoint=mock)(cfOnSender=true))");
        //suite.addExclude("(|(test=EchoXML)(destType=queue)(broker=qpid)(cfOnSender=true)(singleCF=false)(destType=queue)(client=jms)(endpoint=mock))");
        //suite.addExclude("(|(test=EchoXML)(test=AsyncXML)(test=AsyncSwA)(test=AsyncTextPlain)(test=AsyncBinary)(test=AsyncSOAPLarge)(broker=qpid))");

        TransportTestSuiteBuilder builder = new TransportTestSuiteBuilder(suite);

        JMSTestEnvironment[] environments = new JMSTestEnvironment[] { new QpidTestEnvironment(), new ActiveMQTestEnvironment() };
        for (boolean singleCF : new boolean[] { false, true }) {
            for (boolean cfOnSender : new boolean[] { false, true }) {
                for (JMSTestEnvironment env : environments) {
                    builder.addEnvironment(env, new JMSTransportDescriptionFactory(singleCF, cfOnSender, 1));
                }
            }
        }
       
        builder.addAsyncChannel(new JMSAsyncChannel(JMSConstants.DESTINATION_TYPE_QUEUE, ContentTypeMode.TRANSPORT));
        builder.addAsyncChannel(new JMSAsyncChannel(JMSConstants.DESTINATION_TYPE_TOPIC, ContentTypeMode.TRANSPORT));
       
        builder.addAxisAsyncTestClient(new AxisAsyncTestClient());
        builder.addAxisAsyncTestClient(new AxisAsyncTestClient(), new JMSAxisTestClientConfigurator(JMSConstants.JMS_BYTE_MESSAGE));
        builder.addAxisAsyncTestClient(new AxisAsyncTestClient(), new JMSAxisTestClientConfigurator(JMSConstants.JMS_TEXT_MESSAGE));
        builder.addByteArrayAsyncTestClient(new JMSAsyncClient<byte[]>(JMSBytesMessageFactory.INSTANCE));
        builder.addStringAsyncTestClient(new JMSAsyncClient<String>(JMSTextMessageFactory.INSTANCE));
       
        builder.addAxisAsyncEndpoint(new AxisAsyncEndpoint());
       
        builder.addRequestResponseChannel(new JMSRequestResponseChannel(JMSConstants.DESTINATION_TYPE_QUEUE, JMSConstants.DESTINATION_TYPE_QUEUE, ContentTypeMode.TRANSPORT));
       
        AxisTestClientConfigurator timeoutConfigurator = new AxisTestClientConfigurator() {
            public void setupRequestMessageContext(MessageContext msgContext) throws AxisFault {
                msgContext.setProperty(JMSConstants.JMS_WAIT_REPLY, "5000");
            }
        };
       
        builder.addAxisRequestResponseTestClient(new AxisRequestResponseTestClient(), timeoutConfigurator);
        builder.addStringRequestResponseTestClient(new JMSRequestResponseClient<String>(JMSTextMessageFactory.INSTANCE));
       
        builder.addEchoEndpoint(new MockEchoEndpoint());
        builder.addEchoEndpoint(new AxisEchoEndpoint());

        for (JMSTestEnvironment env : new JMSTestEnvironment[] { new QpidTestEnvironment(), new ActiveMQTestEnvironment() }) {
            suite.addTest(new MinConcurrencyTest(new AsyncChannel[] {
                    new JMSAsyncChannel("endpoint1", JMSConstants.DESTINATION_TYPE_QUEUE, ContentTypeMode.TRANSPORT),
                    new JMSAsyncChannel("endpoint2", JMSConstants.DESTINATION_TYPE_QUEUE, ContentTypeMode.TRANSPORT) },
                    2, false, env, new JMSTransportDescriptionFactory(false, false, 2)));
        }
       
       
        builder.build();
       
        return suite;
    }
View Full Code Here

        suite.addExclude("(test=AsyncSwA)");

        // Obviously, UDP will not support large SOAP messages
        suite.addExclude("(test=AsyncSOAPLarge)");

        TransportTestSuiteBuilder builder = new TransportTestSuiteBuilder(suite);
        builder.addAsyncChannel(new UDPChannel());
        builder.addRequestResponseChannel(new UDPChannel());
        builder.addEnvironment(new SimpleTransportDescriptionFactory("udp", UDPListener.class, UDPSender.class));
        builder.addAxisAsyncTestClient(new AxisAsyncTestClient());
        builder.addAxisAsyncEndpoint(new AxisAsyncEndpoint());
        builder.addAxisRequestResponseTestClient(new AxisRequestResponseTestClient());
        builder.addEchoEndpoint(new AxisEchoEndpoint());
        builder.build();
       
        return suite;
    }
View Full Code Here

        // in this particular case:
        suite.addExclude("(&(protocol=imap)(test=AsyncSwA))");
        // SYNAPSE-434
        suite.addExclude("(test=MinConcurrency)");
       
        TransportTestSuiteBuilder builder = new TransportTestSuiteBuilder(suite);
       
        builder.addEnvironment(new GreenMailTestEnvironment("pop3"), MailMessageContextValidator.INSTANCE);
        builder.addEnvironment(new GreenMailTestEnvironment("imap"), MailMessageContextValidator.INSTANCE);
       
        MailChannel channel = new MailChannel();
       
        builder.addAsyncChannel(channel);
       
        builder.addAxisAsyncTestClient(new AxisAsyncTestClient(), new MailAxisTestClientConfigurator(MailConstants.TRANSPORT_FORMAT_TEXT));
        builder.addAxisAsyncTestClient(new AxisAsyncTestClient(), new MailAxisTestClientConfigurator(MailConstants.TRANSPORT_FORMAT_MP));
        builder.addByteArrayAsyncTestClient(new MailAsyncClient(new FlatLayout()));
        builder.addByteArrayAsyncTestClient(new MailAsyncClient(new MultipartLayout()));
       
        builder.addAxisAsyncEndpoint(new AxisAsyncEndpoint());
       
        builder.addRequestResponseChannel(channel);
       
        // TODO: this doesn't work because of WSCOMMONS-544
//        builder.addAxisRequestResponseTestClient(new AxisRequestResponseTestClient(), new ResponseListenerConfigurator());
        builder.addByteArrayRequestResponseTestClient(new MailRequestResponseClient(new FlatLayout()));
        builder.addByteArrayRequestResponseTestClient(new MailRequestResponseClient(new MultipartLayout()));
       
        builder.addEchoEndpoint(new AxisEchoEndpoint());
       
        builder.build();
       
        suite.addTest(new MinConcurrencyTest(new MailChannel[] { new MailChannel(), new MailChannel() }, 2, true, new GreenMailTestEnvironment("pop3")));
        return suite;
    }
View Full Code Here

        // Example to run a few use cases.. please leave these commented out - asankha
        //suite.addExclude("(|(test=AsyncXML)(test=MinConcurrency)(destType=topic)(broker=qpid)(destType=topic)(replyDestType=topic)(client=jms)(endpoint=mock)(cfOnSender=true))");
        //suite.addExclude("(|(test=EchoXML)(destType=queue)(broker=qpid)(cfOnSender=true)(singleCF=false)(destType=queue)(client=jms)(endpoint=mock))");
        //suite.addExclude("(|(test=EchoXML)(test=AsyncXML)(test=AsyncSwA)(test=AsyncTextPlain)(test=AsyncBinary)(test=AsyncSOAPLarge)(broker=qpid))");

        TransportTestSuiteBuilder builder = new TransportTestSuiteBuilder(suite);

        JMSTestEnvironment[] environments = new JMSTestEnvironment[] { new QpidTestEnvironment(), new ActiveMQTestEnvironment() };
        for (boolean singleCF : new boolean[] { false, true }) {
            for (boolean cfOnSender : new boolean[] { false, true }) {
                for (JMSTestEnvironment env : environments) {
                    builder.addEnvironment(env, new JMSTransportDescriptionFactory(singleCF, cfOnSender, 1));
                }
            }
        }
       
        builder.addAsyncChannel(new JMSAsyncChannel(JMSConstants.DESTINATION_TYPE_QUEUE, ContentTypeMode.TRANSPORT));
        builder.addAsyncChannel(new JMSAsyncChannel(JMSConstants.DESTINATION_TYPE_TOPIC, ContentTypeMode.TRANSPORT));
       
        builder.addAxisAsyncTestClient(new AxisAsyncTestClient());
        builder.addAxisAsyncTestClient(new AxisAsyncTestClient(), new JMSAxisTestClientConfigurator(JMSConstants.JMS_BYTE_MESSAGE));
        builder.addAxisAsyncTestClient(new AxisAsyncTestClient(), new JMSAxisTestClientConfigurator(JMSConstants.JMS_TEXT_MESSAGE));
        builder.addByteArrayAsyncTestClient(new JMSAsyncClient<byte[]>(JMSBytesMessageFactory.INSTANCE));
        builder.addStringAsyncTestClient(new JMSAsyncClient<String>(JMSTextMessageFactory.INSTANCE));
       
        builder.addAxisAsyncEndpoint(new AxisAsyncEndpoint());
       
        builder.addRequestResponseChannel(new JMSRequestResponseChannel(JMSConstants.DESTINATION_TYPE_QUEUE, JMSConstants.DESTINATION_TYPE_QUEUE, ContentTypeMode.TRANSPORT));
       
        AxisTestClientConfigurator timeoutConfigurator = new AxisTestClientConfigurator() {
            public void setupRequestMessageContext(MessageContext msgContext) throws AxisFault {
                msgContext.setProperty(JMSConstants.JMS_WAIT_REPLY, "5000");
            }
        };
       
        builder.addAxisRequestResponseTestClient(new AxisRequestResponseTestClient(), timeoutConfigurator);
        builder.addStringRequestResponseTestClient(new JMSRequestResponseClient<String>(JMSTextMessageFactory.INSTANCE));
       
        builder.addEchoEndpoint(new MockEchoEndpoint());
        builder.addEchoEndpoint(new AxisEchoEndpoint());

        for (JMSTestEnvironment env : new JMSTestEnvironment[] { new QpidTestEnvironment(), new ActiveMQTestEnvironment() }) {
            suite.addTest(new MinConcurrencyTest(new AsyncChannel[] {
                    new JMSAsyncChannel("endpoint1", JMSConstants.DESTINATION_TYPE_QUEUE, ContentTypeMode.TRANSPORT),
                    new JMSAsyncChannel("endpoint2", JMSConstants.DESTINATION_TYPE_QUEUE, ContentTypeMode.TRANSPORT) },
                    2, false, env, new JMSTransportDescriptionFactory(false, false, 2)));
        }
       
       
        builder.build();
       
        return suite;
    }
View Full Code Here

    public void addAxisTestClientConfigurator(AxisTestClientConfigurator configurator) {
        axisTestClientConfigurators.add(configurator);
    }
   
    public void build() {
        TransportTestSuiteBuilder builder = new TransportTestSuiteBuilder(suite);
       
        builder.addEnvironment(tdf);
       
        HttpChannel channel = new HttpChannel();
       
        builder.addAsyncChannel(channel);
       
        builder.addByteArrayAsyncTestClient(new JavaNetClient());
        if (axisTestClientConfigurators.isEmpty()) {
            builder.addAxisAsyncTestClient(new AxisAsyncTestClient());
        } else {
            for (AxisTestClientConfigurator configurator : axisTestClientConfigurators) {
                builder.addAxisAsyncTestClient(new AxisAsyncTestClient(), configurator);
            }
        }
        builder.addRESTAsyncTestClient(new JavaNetRESTClient());
       
        builder.addAxisAsyncEndpoint(new AxisAsyncEndpoint());
        builder.addByteArrayAsyncEndpoint(new JettyByteArrayAsyncEndpoint());
        builder.addRESTAsyncEndpoint(new JettyRESTAsyncEndpoint());
       
        builder.addRequestResponseChannel(channel);
       
        builder.addAxisRequestResponseTestClient(new AxisRequestResponseTestClient());
       
        builder.addEchoEndpoint(new AxisEchoEndpoint());
        builder.addEchoEndpoint(new JettyEchoEndpoint());
       
        builder.build();
       
        suite.addTest(new MinConcurrencyTest(new AsyncChannel[] { new HttpChannel(), new HttpChannel() }, 2, false, tdf));
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.transport.testkit.TransportTestSuiteBuilder$ResourceList

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.