You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2017/01/14 18:00:52 UTC

svn commit: r1778813 - in /axis/axis2/java/rampart/branches/RAMPART-433/modules/rampart-integration/src/test/java/org/apache/rampart: AbstractRampartTest.java RampartKerberosTest.java

Author: veithen
Date: Sat Jan 14 18:00:51 2017
New Revision: 1778813

URL: http://svn.apache.org/viewvc?rev=1778813&view=rev
Log:
Some code cleanup.

Modified:
    axis/axis2/java/rampart/branches/RAMPART-433/modules/rampart-integration/src/test/java/org/apache/rampart/AbstractRampartTest.java
    axis/axis2/java/rampart/branches/RAMPART-433/modules/rampart-integration/src/test/java/org/apache/rampart/RampartKerberosTest.java

Modified: axis/axis2/java/rampart/branches/RAMPART-433/modules/rampart-integration/src/test/java/org/apache/rampart/AbstractRampartTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-433/modules/rampart-integration/src/test/java/org/apache/rampart/AbstractRampartTest.java?rev=1778813&r1=1778812&r2=1778813&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-433/modules/rampart-integration/src/test/java/org/apache/rampart/AbstractRampartTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-433/modules/rampart-integration/src/test/java/org/apache/rampart/AbstractRampartTest.java Sat Jan 14 18:00:51 2017
@@ -17,8 +17,6 @@
 package org.apache.rampart;
 
 import java.net.URL;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
 
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
@@ -32,7 +30,6 @@ import org.apache.axis2.integration.Jett
 import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyEngine;
-import org.junit.Rule;
 
 /**
  * Base test class for integration tests that require Axis2 web application running in a web container.
@@ -47,22 +44,6 @@ public abstract class AbstractRampartTes
     
     protected static final String RAMPART_CLIENT_REPO_PATH = "target/test-resources/rampart_client_repo";
     
-    protected static final String RAMPART_SERVICE_REPO_PATH = "target/test-resources/rampart_service_repo";
-    
-    protected static ResourceBundle resources;
-    
-    @Rule
-    public final JettyServer server = new JettyServer(
-            RAMPART_SERVICE_REPO_PATH, isEnableHttp() ? 0 : -1, isEnableHttps() ? 0 : -1);
-    
-    static {
-        try {
-            resources = ResourceBundle.getBundle("org.apache.rampart.errors");
-        } catch (MissingResourceException e) {
-            throw new RuntimeException(e.getMessage());
-        }
-    }
-
     protected ServiceClient getServiceClientInstance() throws AxisFault {
         return getServiceClientInstance(null);
     }
@@ -136,14 +117,4 @@ public abstract class AbstractRampartTes
     protected Policy loadPolicy(String xmlPath) {
         return PolicyEngine.getPolicy(this.getClass().getResourceAsStream(xmlPath));
     }
-    
-    /**
-     * @return Implementations must return <code>true</code> to enable startup of web container's http connector or false otherwise.
-     */
-    protected abstract boolean isEnableHttp();
-    
-    /**
-     * @return Implementations must return <code>true</code> to enable startup of web container's https connector or false otherwise.
-     */
-    protected abstract boolean isEnableHttps();
 }

Modified: axis/axis2/java/rampart/branches/RAMPART-433/modules/rampart-integration/src/test/java/org/apache/rampart/RampartKerberosTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-433/modules/rampart-integration/src/test/java/org/apache/rampart/RampartKerberosTest.java?rev=1778813&r1=1778812&r2=1778813&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-433/modules/rampart-integration/src/test/java/org/apache/rampart/RampartKerberosTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-433/modules/rampart-integration/src/test/java/org/apache/rampart/RampartKerberosTest.java Sat Jan 14 18:00:51 2017
@@ -11,6 +11,7 @@ import javax.xml.stream.XMLStreamExcepti
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.integration.JettyServer;
 import org.apache.commons.io.IOUtils;
 import org.apache.neethi.Policy;
 import org.apache.rampart.policy.model.KerberosConfig;
@@ -19,6 +20,7 @@ import org.apache.rampart.util.KerberosS
 import org.custommonkey.xmlunit.XMLAssert;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.xml.sax.SAXException;
 
@@ -62,6 +64,9 @@ public class RampartKerberosTest extends
      */
     public static final String KERBEROS_CONF_KDC_PORT_TOKEN = "KDC_PORT";
     
+    @Rule
+    public final JettyServer server = new JettyServer("target/test-resources/rampart_service_repo", -1, 0);
+    
     /**
      * Stores any original JAAS configuration set via {@link #JAAS_CONF_SYS_PROP} property to restore it after test execution.
      */
@@ -244,21 +249,4 @@ public class RampartKerberosTest extends
         
         return krb5Conf;
     }
-
-    /* (non-Javadoc)
-     * @see org.apache.rampart.AbstractRampartTest#isEnableHttp()
-     */
-    @Override
-    protected boolean isEnableHttp() {
-        //Kerberos test does not use http
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.rampart.AbstractRampartTest#isEnableHttps()
-     */
-    @Override
-    protected boolean isEnableHttps() {
-        return true;
-    }
 }