axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdani...@apache.org
Subject cvs commit: xml-axis/java/test/wsdd PackageTests.java TestGlobalConfiguration.java
Date Fri, 09 Nov 2001 18:44:23 GMT
gdaniels    01/11/09 10:44:23

  Modified:    java/src/org/apache/axis AxisEngine.java
               java/src/org/apache/axis/deployment/wsdd WSDDDeployment.java
  Added:       java/test/wsdd PackageTests.java
                        TestGlobalConfiguration.java
  Log:
  Connect WSDD global configuration to engine options, and add
  unit test for same.
  
  Revision  Changes    Path
  1.47      +4 -0      xml-axis/java/src/org/apache/axis/AxisEngine.java
  
  Index: AxisEngine.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/AxisEngine.java,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- AxisEngine.java	2001/11/07 23:19:24	1.46
  +++ AxisEngine.java	2001/11/09 18:44:23	1.47
  @@ -74,6 +74,7 @@
   import org.apache.log4j.Category;
   
   import javax.xml.rpc.namespace.QName;
  +import java.util.Hashtable;
   
   /**
    * An <code>AxisEngine</code> is the base class for AxisClient and
  @@ -324,6 +325,9 @@
       public void deployWSDD(WSDDDocument doc) throws DeploymentException
       {
           myRegistry.deploy(doc);
  +        WSDDGlobalConfiguration global = myRegistry.getGlobalConfiguration();
  +        if (global != null)
  +            this.setOptions(global.getParametersTable());
       }
       
       /**
  
  
  
  1.12      +1 -1      xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDDeployment.java
  
  Index: WSDDDeployment.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDDeployment.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- WSDDDeployment.java	2001/11/09 18:35:36	1.11
  +++ WSDDDeployment.java	2001/11/09 18:44:23	1.12
  @@ -151,7 +151,7 @@
               addTypeMapping(mapping);
           }
           
  -        Element el = getChildElement(e, "globalConfig");
  +        Element el = getChildElement(e, "globalConfiguration");
           if (el != null)
               globalConfig = new WSDDGlobalConfiguration(el);
       }
  
  
  
  1.1                  xml-axis/java/test/wsdd/PackageTests.java
  
  Index: PackageTests.java
  ===================================================================
  package test.wsdd;
  
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  
  /**
   * Session tests
   */
  public class PackageTests extends TestCase {
  
      public PackageTests(String name) {
          super(name);
      }
  
      public static Test suite() throws Exception {
          TestSuite suite = new TestSuite();
  
          suite.addTestSuite(TestGlobalConfiguration.class);
          
          return suite;
      }
  }
  
  
  
  1.1                  xml-axis/java/test/wsdd/TestGlobalConfiguration.java
  
  Index: TestGlobalConfiguration.java
  ===================================================================
  package test.wsdd;
  
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  import org.apache.axis.deployment.wsdd.WSDDDocument;
  import org.apache.axis.deployment.wsdd.WSDDDeployment;
  import org.apache.axis.deployment.wsdd.WSDDHandler;
  import org.apache.axis.configuration.XMLStringProvider;
  import org.apache.axis.server.AxisServer;
  
  public class TestGlobalConfiguration extends TestCase
  {
      static final String PARAM_NAME = "testParam";
      static final String PARAM_VAL  = "testValue";
      
      String doc = 
              "<deployment xmlns=\"http://xml.apache.org/axis/wsdd/\">\n" +
              " <globalConfiguration>\n" +
              "  <parameter name=\"" + PARAM_NAME +
                            "\" value=\"" + PARAM_VAL + "\"/>\n" +
              " </globalConfiguration>\n" +
              "</deployment>";
  
      public TestGlobalConfiguration (String name) {
          super(name);
      }
  
      public static Test suite() {
          return new TestSuite(TestGlobalConfiguration.class);
      }
  
      protected void setup() {
      }
  
      public void testEngineProperties() throws Exception
      {
          XMLStringProvider provider = new XMLStringProvider(doc);
          AxisServer server = new AxisServer(provider);
          
          Object optVal = server.getOption(PARAM_NAME);
          assertNotNull("Option value was null!", optVal);
          assertEquals("Option was not expected value", optVal, PARAM_VAL);
          
          optVal = server.getOption("someOptionWhichIsntSet");
          assertNull("Got value for bad option!", optVal);
      }
      
      public static void main(String[] args) throws Exception {
          TestGlobalConfiguration tester = new TestGlobalConfiguration("foo");
          tester.testEngineProperties();
      }
  }
  
  
  

Mime
View raw message