FileDocCategorySizeDatePackage
TestMessageSample.javaAPI DocApache Axis 1.42714Sat Apr 22 18:57:26 BST 2006test.functional

TestMessageSample

public class TestMessageSample extends TestCase
Test the message sample code.

Fields Summary
static Log
log
Constructors Summary
public TestMessageSample(String name)


       
        super(name);
    
Methods Summary
public voiddoTestDeploy()

        String[] args = { "samples/message/deploy.wsdd" };
        AdminClient.main(args);
    
public voiddoTestMessage()

        String[] args = { };
        String res = (new TestMsg()).doit(args);
        String expected="Res elem[0]=<ns1:e1 xmlns:ns1=\"urn:foo\">Hello</ns1:e1>" 
                        +"Res elem[1]=<ns2:e1 xmlns:ns2=\"urn:foo\">World</ns2:e1>"
                        +"Res elem[2]=<ns3:e3 xmlns:ns3=\"urn:foo\">"
                        +"<![CDATA["
                        +"Text with\n\tImportant  <b>  whitespace </b> and tags! "
                        +"]]>"
                        +"</ns3:e3>";
        assertEquals("test result elements", expected, res);
    
public voiddoTestUndeploy()

        String[] args = { "samples/message/undeploy.wsdd" };
        AdminClient.main(args);
    
public static voidmain(java.lang.String[] args)

        TestMessageSample tester = new TestMessageSample("tester");
        tester.testMessageService();
    
public voidtestMessageService()

        try {
            log.info("Testing message sample.");
            log.info("Testing deployment...");
            doTestDeploy();
            log.info("Testing service...");
            doTestMessage();
            doTestUndeploy();
            log.info("Test complete.");
        }
        catch( Exception e ) {
            e.printStackTrace();
            throw new Exception("Fault returned from test: "+e);
        }