axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ow...@apache.org
Subject cvs commit: xml-axis-wsif/java/test/wsdl ClassLoaderTest.java ClassloaderTest.jar
Date Mon, 08 Jul 2002 15:17:12 GMT
owenb       2002/07/08 08:17:12

  Modified:    java/test/wsdl ClassLoaderTest.java ClassloaderTest.jar
  Log:
  - Added tests for import locations starting with '..' when using ClassLoaders
  
  Revision  Changes    Path
  1.6       +47 -9     xml-axis-wsif/java/test/wsdl/ClassLoaderTest.java
  
  Index: ClassLoaderTest.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/wsdl/ClassLoaderTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ClassLoaderTest.java	5 Jul 2002 10:04:14 -0000	1.5
  +++ ClassLoaderTest.java	8 Jul 2002 15:17:12 -0000	1.6
  @@ -89,9 +89,12 @@
       String wsdlLocation2 = "test/ImportingTest2.wsdl";
       String wsdlLocation3 = "test/ImportingTest3.wsdl";
       String wsdlLocation4 = "ImportingTest4.wsdl";
  -    String wsdlLocation5 =
  +    String wsdlLocation5 = "test/subtest/ImportingTest5.wsdl";
  +    String wsdlLocation6 = "test/subtest/subtest2/ImportingTest6.wsdl";         
  +    String wsdlLocation7 =
           TestUtilities.getWsdlPath("java\\test\\addressbook")
               + "ImportingAddressBook.wsdl";
  +    String wsdlLocationError = "test/subtest/subtest2/ImportingTestError.wsdl";       
  
   
       public ClassLoaderTest(String name) {
           super(name);
  @@ -112,40 +115,58 @@
       // wsdl location	= test/ImportingTest.wsdl
       // import location	= AddressBookTest.wsdl
       public void test() {
  -        doit(wsdlLocation);
  +        doIt(wsdlLocation);
       }
   
       // wsdl location	= test/ImportingTest2.wsdl
       // import location	= /test/subtest/subtest2/AddressBookTest2.wsdl
       public void test2() {
  -        doit(wsdlLocation2);
  +        doIt(wsdlLocation2);
       }
   
       // wsdl location	= test/ImportingTest3.wsdl
       // import location	= subtest/subtest2/AddressBookTest3.wsdl
       public void test3() {
  -        doit(wsdlLocation3);
  +        doIt(wsdlLocation3);
       }
   
       // wsdl location	= ImportingTest4.wsdl
       // import location	= test/subtest/subtest2/AddressBookTest4.wsdl
       public void test4() {
  -        doit(wsdlLocation4);
  +        doIt(wsdlLocation4);
  +    }
  +
  +    // wsdl location	= test/subtest/ImportingTest5.wsdl
  +    // import location	= ../AddressBookTest.wsdl
  +    public void test5() {
  +        doIt(wsdlLocation5);
  +    }
  +
  +    // wsdl location	= test/subtest/subtest2/ImportingTest6.wsdl
  +    // import location	= ../../AddressBookTest.wsdl
  +    public void test6() {
  +        doIt(wsdlLocation6);
       }
   
       // wsdl location	= <wsdlPath>/java/test/addressbook/ImportingAddressBook.wsdl
       // import location	= http://localhost:8080/wsdl/AddressBook.wsdl
  -    public void test5() {
  +    public void test7() {
           if (TestUtilities.areWeTesting("remotewsdl")) {
  -            doit(wsdlLocation5);
  +            doIt(wsdlLocation7);
           }
       }
       
  -    public void test6() {
  +    public void test8() {
       	doItWithReader(wsdlLocation2);
       }
   
  -    private void doit(String wsdlLoc) {
  +    // wsdl location	= test/subtest/subtest2/ImportingTestError.wsdl
  +    // import location	= ../../../../AddressBookTest.wsdl
  +    public void testError() {
  +    	doItError(wsdlLocationError);
  +    }
  +
  +    private void doIt(String wsdlLoc) {
           try {
               WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
               WSIFService service =
  @@ -160,6 +181,23 @@
                   "ClassLoaderTest(" + wsdlLoc + ") caught exception " + e);
               e.printStackTrace();
               assertTrue(false);
  +        }
  +    }
  +
  +    private void doItError(String wsdlLoc) {
  +        try {
  +            WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
  +            WSIFService service =
  +                factory
  +                    .getService(wsdlLoc, this.getClass().getClassLoader(), null,
  +                                // serviceNS
  +                                null, // serviceName
  +                               "http://wsifservice.addressbook/", // portTypeNS
  +                               "AddressBook"); // portTypeName
  +    		assertTrue("Import location of '../../../../AddressBook.wsdl'" +
  +    					"should have caused an error", false);
  +        } catch (Exception e) {
  +        	// Excpected so ignore
           }
       }
   
  
  
  
  1.2       +14 -13    xml-axis-wsif/java/test/wsdl/ClassloaderTest.jar
  
  	<<Binary file>>
  
  

Mime
View raw message