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 2014/07/20 12:56:51 UTC

svn commit: r1612073 - in /axis/axis2/java/rampart/trunk: ./ modules/rampart-integration/ modules/rampart-integration/src/main/java/org/apache/axis2/integration/ modules/rampart-integration/src/main/java/org/apache/rahas/ modules/rampart-integration/sr...

Author: veithen
Date: Sun Jul 20 10:56:50 2014
New Revision: 1612073

URL: http://svn.apache.org/r1612073
Log:
RAMPART-416: Applied Detelin Yordanov's patch to enable Rampart transport binding integration tests.

Added:
    axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/JettyServer.java   (with props)
Removed:
    axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/UtilServer.java
    axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/UtilServerBasedTestCase.java
Modified:
    axis/axis2/java/rampart/trunk/modules/rampart-integration/pom.xml
    axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/rahas/TestClient.java
    axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java
    axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/resources/conf/axis2.xml
    axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/resources/log4j.properties
    axis/axis2/java/rampart/trunk/pom.xml

Modified: axis/axis2/java/rampart/trunk/modules/rampart-integration/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk/modules/rampart-integration/pom.xml?rev=1612073&r1=1612072&r2=1612073&view=diff
==============================================================================
--- axis/axis2/java/rampart/trunk/modules/rampart-integration/pom.xml (original)
+++ axis/axis2/java/rampart/trunk/modules/rampart-integration/pom.xml Sun Jul 20 10:56:50 2014
@@ -376,6 +376,83 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <artifactId>maven-clean-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <!-- Need to clean the keystore because keytool-maven-plugin is not idempotent and fails
+                             when executing mvn install twice in a row. Note that keytool-maven-plugin also has
+                             a "clean" goal but we don't use it because it generates a warning if the keystore
+                             doesn't exist. -->
+                        <phase>generate-test-resources</phase>
+                        <goals>
+                            <goal>clean</goal>
+                        </goals>
+                        <configuration>
+                            <excludeDefaultDirectories>true</excludeDefaultDirectories>
+                            <filesets>
+                                <fileset>
+                                    <directory>${project.build.directory}/test-resources/jetty</directory>
+                                    <includes>
+                                        <include>server.jks</include>
+                                        <include>server.cer</include>
+                                        <include>client.jks</include>
+                                    </includes>
+                                </fileset>
+                            </filesets>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>keytool-maven-plugin</artifactId>
+                <version>1.5</version>
+                <executions>
+                    <execution>
+                        <id>generate-key-pair</id>
+                        <phase>generate-test-resources</phase>
+                        <goals>
+                            <goal>generateKeyPair</goal>
+                        </goals>
+                        <configuration>
+                            <alias>server</alias>
+                            <dname>cn=localhost,o=OASIS</dname>
+                            <keyalg>RSA</keyalg>
+                            <keypass>password</keypass>
+                            <keystore>${project.build.directory}/test-resources/jetty/server.jks</keystore>
+                            <storepass>password</storepass>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>export-certificate</id>
+                        <phase>generate-test-resources</phase>
+                        <goals>
+                            <goal>exportCertificate</goal>
+                        </goals>
+                        <configuration>
+                            <alias>server</alias>
+                            <file>${project.build.directory}/test-resources/jetty/server.cer</file>
+                            <keystore>${project.build.directory}/test-resources/jetty/server.jks</keystore>
+                            <storepass>password</storepass>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>import-certificate</id>
+                        <phase>generate-test-resources</phase>
+                        <goals>
+                            <goal>importCertificate</goal>
+                        </goals>
+                        <configuration>
+                            <alias>server</alias>
+                            <file>${project.build.directory}/test-resources/jetty/server.cer</file>
+                            <keystore>${project.build.directory}/test-resources/jetty/client.jks</keystore>
+                            <storepass>password</storepass>
+                            <noprompt>true</noprompt>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
             <!--plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>build-helper-maven-plugin</artifactId>
@@ -415,16 +492,37 @@
             <groupId>org.apache.rampart</groupId>
             <artifactId>rampart-policy</artifactId>
             <version>${project.version}</version>
+            <!--  Use Jetty's servlet api (2.5) -->
+            <exclusions>
+                <exclusion>
+                    <groupId>javax.servlet</groupId>
+                    <artifactId>servlet-api</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.apache.rampart</groupId>
             <artifactId>rampart-trust</artifactId>
             <version>${project.version}</version>
+            <!--  Use Jetty's servlet api (2.5) -->
+            <exclusions>
+                <exclusion>
+                    <groupId>javax.servlet</groupId>
+                    <artifactId>servlet-api</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.apache.rampart</groupId>
             <artifactId>rampart-core</artifactId>
             <version>${project.version}</version>
+            <!--  Use Jetty's servlet api (2.5) -->
+            <exclusions>
+                <exclusion>
+                    <groupId>javax.servlet</groupId>
+                    <artifactId>servlet-api</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.apache.axis2</groupId>
@@ -481,5 +579,20 @@
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-util</artifactId>
+            <version>${jetty.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-webapp</artifactId>
+            <version>${jetty.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-testutils</artifactId>
+            <version>${axis2.version}</version>
+        </dependency>
     </dependencies>
 </project>

Added: axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/JettyServer.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/JettyServer.java?rev=1612073&view=auto
==============================================================================
--- axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/JettyServer.java (added)
+++ axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/JettyServer.java Sun Jul 20 10:56:50 2014
@@ -0,0 +1,265 @@
+/*
+ * Copyright 2004 - 2014 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.integration;
+
+import java.io.File;
+
+import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.nio.SelectChannelConnector;
+import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
+import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.eclipse.jetty.webapp.WebAppContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.axis2.testutils.PortAllocator;
+import org.apache.axis2.transport.http.AxisServlet;
+
+/**
+ * Support for running an embedded Jetty server
+ */
+public class JettyServer {
+
+    /**
+     * Keystore to configure for Jetty's ssl context factory: {@value}
+     */
+    public static final String KEYSTORE = "target/test-resources/jetty/server.jks";
+    
+    /**
+     * Keymanager password to configure for Jetty's ssl context factory: {@value
+     */
+    public static final String KEYMAN_PASSWORD = "password";
+    
+    /**
+     * Keystore password to configure for Jetty's ssl context factory: {@value} 
+     */
+    public static final String KEYSTORE_PASSWORD = "password";
+    
+    /**
+     * The alias of the certificate to configure for Jetty's ssl context factory: {@value}
+     */
+    public static final String CERT_ALIAS = "server";
+    
+    /**
+     * Client keystore containing Jetty's server certificate as trusted certificate entry: : {@value}
+     */
+    public static final String CLIENT_KEYSTORE = "target/test-resources/jetty/client.jks";
+                    
+    /**
+     * Axis2 configuration file to use: {@value}
+     */
+    public static final String AXIS2_XML = "src/test/resources/conf/axis2.xml";
+    
+    /**
+     * Webapp resource base directory to use: {@value}
+     */
+    public static final String WEBAPP_DIR = "target" + File.separator + "webapp";
+    
+    private static final Logger logger = LoggerFactory.getLogger(JettyServer.class);
+    
+    private static Server server;
+    
+    private JettyServer() {
+        
+    }
+    
+    /**
+     * Starts the embedded Jetty server using dynamic port allocation with both http and https connectors enabled.
+     * 
+     * @param repository The path to the Axis2 repository to use. Must not be null or empty.
+     * 
+     * @throws Exception
+     */
+    public static synchronized void start(String repository) throws Exception {
+        start(repository, true, true);
+    }
+    
+    /**
+     * Starts the embedded Jetty server using dynamic port allocation.
+     * 
+     * @param repository The path to the Axis2 repository to use. Must not be null or empty.
+     * @param enableHttp Specifies whether to enable http connector.
+     * @param enableHttps Specifies whether to enable https connector.
+     * 
+     * @throws Exception
+     */
+    public static synchronized void start(String repository, boolean enableHttp, boolean enableHttps) throws Exception {
+        int httpPort = enableHttp ? PortAllocator.allocatePort() : -1;
+        int httpsPort = enableHttps ? PortAllocator.allocatePort() : -1;
+        
+        start(repository, httpPort, httpsPort);
+    }
+    
+    /**
+     * Starts the embedded Jetty server.
+     * 
+     * @param repository The path to the Axis2 repository to use. Must not be null or empty.
+     * @param httpPort The http port to use. Set to <code>-1</code> to disable http connector.
+     * @param httpsPort The https port to use. Set to <code>-1</code> to disable https connector.
+     * 
+     * @throws Exception
+     * @throws IllegalArgumentException If both ports are set to <code>-1</code>
+     */
+    public static synchronized void start(String repository, int httpPort, int httpsPort) throws Exception {
+        if (repository == null || repository.trim().length() == 0) {
+            throw new IllegalArgumentException("Axis2 repository must not be null or empty");
+        }
+        else if (httpPort == -1 && httpsPort == -1) {
+            throw new IllegalArgumentException("At least one port must be specified.");
+        }
+    
+        server = new Server();
+        
+        SelectChannelConnector connector = null;
+        if (httpPort == -1) {
+            logger.debug("Http connector is disabled");
+        }
+        else {
+            logger.info("Starting http connector on port: " + httpPort);
+            
+            connector = new SelectChannelConnector();
+            connector.setPort(httpPort);
+            server.addConnector(connector);
+        }
+        
+        if (httpsPort == -1) {
+            logger.debug("Https connector is disabled");
+        }
+        else {
+            SslContextFactory sslContextFactory = new SslContextFactory();
+            sslContextFactory.setKeyStorePath(KEYSTORE);
+            sslContextFactory.setKeyStorePassword(KEYSTORE_PASSWORD);
+            sslContextFactory.setKeyManagerPassword(KEYMAN_PASSWORD);
+            sslContextFactory.setTrustStore(KEYSTORE);
+            sslContextFactory.setTrustStorePassword(KEYSTORE_PASSWORD);
+            sslContextFactory.setCertAlias(CERT_ALIAS);
+            SslSelectChannelConnector sslConnector = new SslSelectChannelConnector(sslContextFactory);
+            
+            logger.info("Starting https connector on port: " + httpsPort);
+            
+            sslConnector.setPort(httpsPort);
+            server.addConnector(sslConnector);
+            
+            if (connector != null) {
+                connector.setConfidentialPort(httpsPort);
+            }
+        }
+        
+        WebAppContext context = new WebAppContext();
+        File webappDir = new File(WEBAPP_DIR);
+        if (!webappDir.exists() && !webappDir.mkdirs()) {
+            logger.error("Failed to create Axis2 webapp directory: " + webappDir.getAbsolutePath());
+        }
+        
+        context.setResourceBase(webappDir.getAbsolutePath());
+        context.setContextPath("/axis2");
+        context.setParentLoaderPriority(true);
+        context.setThrowUnavailableOnStartupException(true);
+        
+        ServletHolder servlet = new ServletHolder();
+        servlet.setClassName(AxisServlet.class.getName());
+        servlet.setInitParameter("axis2.repository.path", repository);
+        servlet.setInitParameter("axis2.xml.path", AXIS2_XML);
+        
+        //load on startup to trigger Axis2 initialization and service deployment
+        //this is for backward compatibility with the SimpleHttpServer which initializes Axis2 on startup
+        servlet.setInitOrder(0);
+        
+        context.addServlet(servlet, "/services/*");
+        
+        server.setHandler(context);
+        
+        try {
+            server.start();
+        }
+        catch (SecurityException e) {
+            if (e.getMessage().equals("class \"javax.servlet.ServletRequestListener\"'s signer information does not match signer information of other classes in the same package")) {
+                logger.error(
+                 "It is likely your test classpath contains multiple different versions of servlet api.\n" +
+                 "If you are running this test in an IDE, please configure it to exclude Rampart's core module servlet api dependency.");
+                throw e;
+            }
+        }
+    }
+    
+    /**
+     * Stops the embedded Jetty server.
+     * 
+     * @throws Exception
+     */
+    public static synchronized void stop() throws Exception {
+        if (server != null) {
+            logger.info("Stop called");
+            server.stop();
+            server = null;
+        }
+    }
+
+    /**
+     * @return Jetty's http connector port. 
+     * @throws IllegalStateException If Jetty is not running or the http connector cannot be found.
+     */
+    public static synchronized int getHttpPort() throws IllegalStateException {
+        assertStarted();
+        
+        Connector[] connectors = server.getConnectors();
+        if (connectors.length == 0) {
+            throw new IllegalStateException("Jetty server is not configured with any connectors");
+        }
+        
+        for (Connector connector : connectors) {
+            if ((connector instanceof SelectChannelConnector) &&
+                !(connector instanceof SslSelectChannelConnector)) {
+                //must be the http connector
+                return connector.getPort();
+            }
+        }
+        
+        throw new IllegalStateException("Could not find Jetty http connector");
+    }
+    
+    /**
+     * @return Jetty's ssl connector port. 
+     * @throws IllegalStateException If Jetty is not running or the ssl connector cannot be found.
+     */
+    public static synchronized int getHttpsPort() throws IllegalStateException {
+        assertStarted();
+        
+        Connector[] connectors = server.getConnectors();
+        if (connectors.length == 0) {
+            throw new IllegalStateException("Jetty server is not configured with any connectors");
+        }
+        
+        for (Connector connector : connectors) {
+            if (connector instanceof SslSelectChannelConnector) {
+                //must be the https connector
+                return connector.getPort();
+            }
+        }
+        
+        throw new IllegalStateException("Could not find Jetty https connector");
+    }
+    
+    private static void assertStarted() throws IllegalStateException {
+        if (server == null) {
+            throw new IllegalStateException("Jetty server is not initialized");
+        }
+        else if (!server.isStarted()) {
+            throw new IllegalStateException("Jetty server is not started");
+        }
+    }
+}

Propchange: axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/JettyServer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/rahas/TestClient.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/rahas/TestClient.java?rev=1612073&r1=1612072&r2=1612073&view=diff
==============================================================================
--- axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/rahas/TestClient.java (original)
+++ axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/rahas/TestClient.java Sun Jul 20 10:56:50 2014
@@ -28,7 +28,7 @@ import org.apache.axis2.client.ServiceCl
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.ConfigurationContextFactory;
 import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.integration.UtilServer;
+import org.apache.axis2.integration.JettyServer;
 import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyEngine;
 import org.apache.rampart.RampartMessageData;
@@ -37,18 +37,18 @@ import junit.framework.TestCase;
 
 public abstract class TestClient extends TestCase {
 
-    protected int port = UtilServer.TESTING_PORT;
+    protected int port = 5555;
 
     public TestClient(String name) {
         super(name);
     }
 
     protected void setUp() throws Exception {
-        UtilServer.start(Constants.TESTING_PATH + getServiceRepo(), null);
+        JettyServer.start(Constants.TESTING_PATH + getServiceRepo(), port, -1);
     }
 
     protected void tearDown() throws Exception {
-        UtilServer.stop();
+        JettyServer.stop();
     }
 
     /**

Modified: axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java?rev=1612073&r1=1612072&r2=1612073&view=diff
==============================================================================
--- axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java (original)
+++ axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java Sun Jul 20 10:56:50 2014
@@ -16,6 +16,11 @@
 
 package org.apache.rampart;
 
+import static org.apache.axis2.integration.JettyServer.getHttpPort;
+import static org.apache.axis2.integration.JettyServer.getHttpsPort;
+import static org.apache.axis2.integration.JettyServer.CLIENT_KEYSTORE;
+import static org.apache.axis2.integration.JettyServer.KEYSTORE_PASSWORD;
+
 import junit.framework.TestCase;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
@@ -31,7 +36,7 @@ import org.apache.axis2.client.ServiceCl
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.ConfigurationContextFactory;
 import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.integration.UtilServer;
+import org.apache.axis2.integration.JettyServer;
 import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyEngine;
 
@@ -41,10 +46,11 @@ import java.util.ResourceBundle;
 
 public class RampartTest extends TestCase {
 
-    public final static int PORT = UtilServer.TESTING_PORT;
-
     private static ResourceBundle resources;
-
+    private String trustStore;
+    private String trustStorePassword;
+    private String trustStoreType;
+    
     static {
         try {
             resources = ResourceBundle.getBundle("org.apache.rampart.errors");
@@ -58,12 +64,45 @@ public class RampartTest extends TestCas
     }
 
     protected void setUp() throws Exception {
-        UtilServer.start(Constants.TESTING_PATH + "rampart_service_repo" ,null);
+        trustStore = System.getProperty("javax.net.ssl.trustStore");
+        System.setProperty("javax.net.ssl.trustStore", CLIENT_KEYSTORE);
+        
+        trustStorePassword = System.getProperty("javax.net.ssl.trustStorePassword");
+        System.setProperty("javax.net.ssl.trustStorePassword", KEYSTORE_PASSWORD);
+        
+        trustStoreType = System.getProperty("javax.net.ssl.trustStoreType");
+        System.setProperty("javax.net.ssl.trustStoreType", "JKS");
+             
+        JettyServer.start(Constants.TESTING_PATH + "rampart_service_repo");
     }
     
 
     protected void tearDown() throws Exception {
-        UtilServer.stop();
+        try {
+            JettyServer.stop();
+        }
+        finally {
+            if (trustStore != null) {
+                System.setProperty("javax.net.ssl.trustStore", trustStore);
+            }
+            else {
+                System.clearProperty("javax.net.ssl.trustStore");
+            }
+            
+            if (trustStorePassword != null) {
+                System.setProperty("javax.net.ssl.trustStorePassword", trustStorePassword);    
+            }
+            else {
+                System.clearProperty("javax.net.ssl.trustStorePassword");
+            }
+            
+            if (trustStoreType != null) {
+                System.setProperty("javax.net.ssl.trustStoreType", trustStoreType);
+            }
+            else {
+                System.clearProperty("javax.net.ssl.trustStoreType");
+            }
+        }
     }
 
     private ServiceClient getServiceClientInstance() throws AxisFault {
@@ -109,18 +148,22 @@ public class RampartTest extends TestCas
                 Options options = new Options();
                 
                 if( i == 13 ) {
-                    continue; // Can't test Transport binding with Simple HTTP Server
+                    options.setTo(new EndpointReference("https://127.0.0.1:" +
+                                    getHttpsPort() +  
+                                    "/axis2/services/SecureService" + i));
                     //Username token created with user/pass from options
-                    //options.setUserName("alice");
-                    //options.setPassword("password");
+                    options.setUserName("alice");
+                    options.setPassword("password");
+                }
+                else {
+                    options.setTo(new EndpointReference("http://127.0.0.1:" +
+                                    getHttpPort() +  
+                                    "/axis2/services/SecureService" + i));
                 }
                 
                 System.out.println("Testing WS-Sec: custom scenario " + i);
                 options.setAction("urn:echo");
-                options.setTo(new EndpointReference("http://127.0.0.1:" +
-                                        PORT +  
-                                        "/axis2/services/SecureService" + i));
-                
+
                 ServiceContext context = serviceClient.getServiceContext();
                 context.setProperty(RampartMessageData.KEY_RAMPART_POLICY, 
                         loadPolicy("/rampart/policy/" + i + ".xml"));
@@ -181,14 +224,20 @@ public class RampartTest extends TestCas
                 Options options = new Options();
 
                 if (i == 13) {
-                    continue;
+                    options.setTo(new EndpointReference("https://127.0.0.1:" +
+                                    getHttpsPort() +
+                                    "/axis2/services/SecureService" + i));
+                    //Username token created with user/pass from options
+                    options.setUserName("alice");
+                    options.setPassword("password");
+                }
+                else {
+                    options.setTo(new EndpointReference("http://127.0.0.1:" +
+                                    getHttpPort() +
+                                    "/axis2/services/SecureService" + i));
                 }
-
                 System.out.println("Testing WS-Sec: negative scenario " + i);
                 options.setAction("urn:returnError");
-                options.setTo(new EndpointReference("http://127.0.0.1:" +
-                        PORT +
-                        "/axis2/services/SecureService" + i));
 
                 ServiceContext context = serviceClient.getServiceContext();
                 context.setProperty(RampartMessageData.KEY_RAMPART_POLICY,
@@ -207,15 +256,17 @@ public class RampartTest extends TestCas
 
             
             for (int i = 1; i <= 6; i++) { //<-The number of tests we have
+                Options options = new Options();
                 
                 if (i == 3 || i == 6) {
-                    continue; // Can't test Transport binding scenarios with Simple HTTP Server
+                    options.setTo(new EndpointReference("https://127.0.0.1:" + getHttpsPort() + "/axis2/services/SecureServiceSC" + i));
+                }
+                else {
+                    options.setTo(new EndpointReference("http://127.0.0.1:" + getHttpPort() + "/axis2/services/SecureServiceSC" + i));
                 }
 
-                Options options = new Options();
                 System.out.println("Testing WS-SecConv: custom scenario " + i);
                 options.setAction("urn:echo");
-                options.setTo(new EndpointReference("http://127.0.0.1:" + PORT + "/axis2/services/SecureServiceSC" + i));
 
                 //Create a new service client instance for each secure conversation scenario
                 serviceClient = getServiceClientInstance();

Modified: axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/resources/conf/axis2.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/resources/conf/axis2.xml?rev=1612073&r1=1612072&r2=1612073&view=diff
==============================================================================
--- axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/resources/conf/axis2.xml (original)
+++ axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/resources/conf/axis2.xml Sun Jul 20 10:56:50 2014
@@ -91,32 +91,16 @@
     <!-- ================================================= -->
     <!-- Transport Ins -->
     <!-- ================================================= -->
+    <!-- The default configuration assumes that AxisServlet only receives requests
+         through HTTP. To allow HTTPS as well, configure a second AxisServletListener
+         with name="https" and specify the port parameter on both receivers.
+         For more information, please have a look at the servlet transport documentation:
+         http://axis.apache.org/axis2/java/core/docs/servlet-transport.html -->
     <transportReceiver name="http"
-                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
-        <parameter name="port" locked="false">6060</parameter>
-        <!-- Here is the complete list of supported parameters (see example settings further below):
-            port: the port to listen on (default 6060)
-            hostname:  if non-null, url prefix used in reply-to endpoint references                                 (default null)
-            originServer:  value of http Server header in outgoing messages                                         (default "Simple-Server/1.1")
-            requestTimeout:  value in millis of time that requests can wait for data                                (default 20000)
-            requestTcpNoDelay:  true to maximize performance and minimize latency                                   (default true)
-                                false to minimize bandwidth consumption by combining segments
-            requestCoreThreadPoolSize:  number of threads available for request processing (unless queue fills up)  (default 25)
-            requestMaxThreadPoolSize:  number of threads available for request processing if queue fills us         (default 150)
-                                       note that default queue never fills up:  see HttpFactory
-            threadKeepAliveTime:  time to keep threads in excess of core size alive while inactive                  (default 180)
-                                  note that no such threads can exist with default unbounded request queue
-            threadKeepAliveTimeUnit:  TimeUnit of value in threadKeepAliveTime (default SECONDS)                    (default SECONDS)
-        -->
-        <!-- <parameter name="hostname"                  locked="false">http://www.myApp.com/ws</parameter> -->
-        <!-- <parameter name="originServer"              locked="false">My-Server/1.1</parameter>           -->
-        <!-- <parameter name="requestTimeout"            locked="false">10000</parameter>                   -->
-        <!-- <parameter name="requestTcpNoDelay"         locked="false">false</parameter>                   -->
-        <!-- <parameter name="requestCoreThreadPoolSize" locked="false">50</parameter>                      -->
-        <!-- <parameter name="RequestMaxThreadPoolSize"  locked="false">100</parameter>                     -->
-        <!-- <parameter name="threadKeepAliveTime"       locked="false">240000</parameter>                  -->
-        <!-- <parameter name="threadKeepAliveTimeUnit"   locked="false">MILLISECONDS</parameter>            -->
-    </transportReceiver>
+                       class="org.apache.axis2.transport.http.AxisServletListener"/>
+                       
+    <transportReceiver name="https"
+                       class="org.apache.axis2.transport.http.AxisServletListener"/>
     
     <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
     <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
@@ -179,9 +163,10 @@
     <!-- ================================================= -->
     <!-- Global Modules  -->
     <!-- ================================================= -->
-    <!-- Comment this to disable Addressing -->
+    <!-- Comment this to disable Addressing 
     <module ref="addressing"/>
-
+    -->
+    
     <!--Configuring module , providing parameters for modules whether they refer or not-->
     <moduleConfig name="addressing">
         <parameter name="includeOptionalHeaders" locked="false">true</parameter>

Modified: axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/resources/log4j.properties?rev=1612073&r1=1612072&r2=1612073&view=diff
==============================================================================
--- axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/resources/log4j.properties (original)
+++ axis/axis2/java/rampart/trunk/modules/rampart-integration/src/test/resources/log4j.properties Sun Jul 20 10:56:50 2014
@@ -23,3 +23,9 @@ log4j.appender.CONSOLE=org.apache.log4j.
 log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
 log4j.appender.CONSOLE.layout.ConversionPattern=%d %-5p %c - %m%n
 
+log4j.appender.JETTY=org.apache.log4j.ConsoleAppender
+log4j.appender.JETTY.layout=org.apache.log4j.PatternLayout
+log4j.appender.JETTY.layout.ConversionPattern=[%C{1}] - %m%n
+
+log4j.category.org.apache.axis2.integration.JettyServer=INFO, JETTY
+log4j.additivity.org.apache.axis2.integration.JettyServer = false

Modified: axis/axis2/java/rampart/trunk/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk/pom.xml?rev=1612073&r1=1612072&r2=1612073&view=diff
==============================================================================
--- axis/axis2/java/rampart/trunk/pom.xml (original)
+++ axis/axis2/java/rampart/trunk/pom.xml Sun Jul 20 10:56:50 2014
@@ -539,6 +539,8 @@
         <failIfNoTests>false</failIfNoTests>
 
         <jacoco.version>0.6.1.201212231917</jacoco.version>
+        
+        <jetty.version>7.6.15.v20140411</jetty.version>
     </properties>
 
     <pluginRepositories>