Package org.apache.axis2.transport.testkit

Examples of org.apache.axis2.transport.testkit.ManagedTestSuite


* TransportListenerTestTemplate implementation for the VFS transport.
*/
public class VFSTransportTest extends TestCase {
    public static TestSuite suite() throws Exception {
        // TODO: the VFS listener doesn't like reuseResources == true...
        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");
       
View Full Code Here


import org.apache.axis2.transport.testkit.axis2.TransportDescriptionFactory;
import org.apache.axis2.transport.testkit.http.HttpTransportTestSuiteBuilder;

public class HttpCoreNIOListenerTest extends TestCase {
    public static TestSuite suite() throws Exception {
        ManagedTestSuite suite = new ManagedTestSuite(HttpCoreNIOListenerTest.class);
       
        // These tests don't work because of a problem similar to SYNAPSE-418
        suite.addExclude("(test=EchoXML)");
       
        TransportDescriptionFactory tdfNIO =
                new SimpleTransportDescriptionFactory("http", HttpCoreNIOListener.class,
                HttpCoreNIOSender.class);
        HttpTransportTestSuiteBuilder builder = new HttpTransportTestSuiteBuilder(suite, tdfNIO);
View Full Code Here

import org.apache.axis2.transport.testkit.axis2.TransportDescriptionFactory;
import org.apache.axis2.transport.testkit.http.HttpTransportTestSuiteBuilder;

public class HttpCoreNIOListenerTest extends TestCase {
    public static TestSuite suite() throws Exception {
        ManagedTestSuite suite = new ManagedTestSuite(HttpCoreNIOListenerTest.class);
       
        // These tests don't work because of a problem similar to SYNAPSE-418
        suite.addExclude("(test=EchoXML)");
       
        TransportDescriptionFactory tdfNIO = new HttpTransportDescriptionFactory();
       
        HttpTransportTestSuiteBuilder builder = new HttpTransportTestSuiteBuilder(suite, tdfNIO);
       
View Full Code Here

import org.apache.axis2.transport.testkit.axis2.endpoint.AxisEchoEndpoint;
import org.apache.axis2.transport.testkit.tests.misc.MinConcurrencyTest;

public class MailTransportTest extends TestCase {
    public static TestSuite suite() throws Exception {
        ManagedTestSuite suite = new ManagedTestSuite(MailTransportTest.class);
       
        // SwA doesn't work with the mock client because attachments are sent with
        // "Content-Transfer-Encoding: binary" and mail servers don't like that.
        suite.addExclude("(&(test=AsyncSwA)(client=javamail))");
        // There seems to be a problem with Sun's IMAP client or GreenMail's IMAP server
        // 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

import org.apache.axis2.transport.testkit.axis2.TransportDescriptionFactory;
import org.apache.axis2.transport.testkit.http.HttpTransportTestSuiteBuilder;

public class SimpleHTTPServerTest extends TestCase {
    public static TestSuite suite() throws Exception {
        ManagedTestSuite suite = new ManagedTestSuite(SimpleHTTPServerTest.class);
       
        TransportDescriptionFactory tdf = new HttpTransportDescriptionFactory(8280);
       
        new HttpTransportTestSuiteBuilder(suite, tdf).build();
       
View Full Code Here

import org.apache.axis2.transport.testkit.channel.AsyncChannel;
import org.apache.axis2.transport.testkit.tests.misc.MinConcurrencyTest;

public class JMSTransportTest extends TestCase {
    public static TestSuite suite() throws Exception {
        ManagedTestSuite suite = new ManagedTestSuite(JMSTransportTest.class);
       
        // SwA doesn't make sense with text messages
        suite.addExclude("(&(test=AsyncSwA)(client=jms)(jmsType=text))");
       
        // Don't execute all possible test combinations:
        //  * Use a single setup to execute tests with all message types.
        //  * Only use a small set of message types for the other setups.
        suite.addExclude("(!(|(&(broker=qpid)(singleCF=false)(cfOnSender=false)(!(|(destType=topic)(replyDestType=topic))))" +
                         "(&(test=AsyncXML)(messageType=SOAP11)(data=ASCII))" +
                         "(&(test=EchoXML)(messageType=POX)(data=ASCII))" +
                         "(test=MinConcurrency)))");
       
        // SYNAPSE-436:
        suite.addExclude("(&(test=EchoXML)(replyDestType=topic)(endpoint=axis))");

        // 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)));
        }
       
View Full Code Here

import org.apache.axis2.transport.testkit.axis2.TransportDescriptionFactory;
import org.apache.axis2.transport.testkit.http.HttpTransportTestSuiteBuilder;

public class SimpleHTTPServerTest extends TestCase {
    public static TestSuite suite() throws Exception {
        ManagedTestSuite suite = new ManagedTestSuite(SimpleHTTPServerTest.class);
       
        TransportDescriptionFactory tdf = new HttpTransportDescriptionFactory();
       
        new HttpTransportTestSuiteBuilder(suite, tdf).build();
       
View Full Code Here

import org.apache.axis2.transport.testkit.axis2.endpoint.AxisAsyncEndpoint;
import org.apache.axis2.transport.testkit.axis2.endpoint.AxisEchoEndpoint;

public class UDPTransportTest extends TestCase {
    public static TestSuite suite() throws Exception {
        ManagedTestSuite suite = new ManagedTestSuite(UDPTransportTest.class);
       
        // For the moment, we can only do SOAP 1.1 (see TODO item on UDPChannel)
        suite.addExclude("(|(messageType=SOAP12)(messageType=POX)(test=AsyncTextPlain)(test=AsyncBinary))");
       
        // Who would want to do SwA over UDP?
        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));
View Full Code Here

import org.apache.axis2.transport.testkit.axis2.endpoint.AxisEchoEndpoint;
import org.apache.axis2.transport.testkit.tests.misc.MinConcurrencyTest;

public class MailTransportTest extends TestCase {
    public static TestSuite suite() throws Exception {
        ManagedTestSuite suite = new ManagedTestSuite(MailTransportTest.class);
       
        // SwA doesn't work with the mock client because attachments are sent with
        // "Content-Transfer-Encoding: binary" and mail servers don't like that.
        suite.addExclude("(&(test=AsyncSwA)(client=javamail))");
        // There seems to be a problem with Sun's IMAP client or GreenMail's IMAP server
        // 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

import org.apache.axis2.transport.testkit.channel.AsyncChannel;
import org.apache.axis2.transport.testkit.tests.misc.MinConcurrencyTest;

public class JMSTransportTest extends TestCase {
    public static TestSuite suite() throws Exception {
        ManagedTestSuite suite = new ManagedTestSuite(JMSTransportTest.class);
       
        // SwA doesn't make sense with text messages
        suite.addExclude("(&(test=AsyncSwA)(client=jms)(jmsType=text))");
       
        // Don't execute all possible test combinations:
        //  * Use a single setup to execute tests with all message types.
        //  * Only use a small set of message types for the other setups.
        suite.addExclude("(!(|(&(broker=ActiveMQ)(singleCF=false)(cfOnSender=false)(!(|(destType=topic)(replyDestType=topic))))" +
                         "(&(test=AsyncXML)(messageType=SOAP11)(data=ASCII))" +
                         "(&(test=EchoXML)(messageType=POX)(data=ASCII))" +
                         "(test=MinConcurrency)))");
       
        // SYNAPSE-436:
        suite.addExclude("(&(test=EchoXML)(replyDestType=topic)(endpoint=axis))");
       
        // Although Qpid is compiled for Java 1.5, it uses classes only present in 1.6.
        if (System.getProperty("java.version").startsWith("1.5.")) {
            System.out.println("Excluding Qpid tests; please run the build with Java 1.6 to include them");
            suite.addExclude("(broker=qpid)");
        }

        // 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)));
        }
       
View Full Code Here

TOP

Related Classes of org.apache.axis2.transport.testkit.ManagedTestSuite

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.