Author: veithen
Date: Sat Jan 14 23:27:48 2017
New Revision: 1778862
URL: http://svn.apache.org/viewvc?rev=1778862&view=rev
Log:
Make the location of axis2.xml configurable.
Added:
axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/TestConstants.java
(with props)
Modified:
axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/JettyServer.java
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
Modified:
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=1778862&r1=1778861&r2=1778862&view=diff
==============================================================================
---
axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/JettyServer.java
(original)
+++
axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/JettyServer.java
Sat Jan 14 23:27:48 2017
@@ -62,11 +62,6 @@ public class JettyServer extends Externa
private static final String CERT_ALIAS = "server";
/**
- * Axis2 configuration file to use: {@value}
- */
- private static final String AXIS2_XML =
"src/test/resources/conf/axis2.xml";
-
- /**
* Webapp resource base directory to use: {@value}
*/
private static final String WEBAPP_DIR = "target" + File.separator +
"webapp";
@@ -74,6 +69,7 @@ public class JettyServer extends Externa
private static final Logger logger =
LoggerFactory.getLogger(JettyServer.class);
private final String repository;
+ private final String axis2xml;
private final boolean secure;
private File keyStoreFile;
private File trustStoreFile;
@@ -91,11 +87,12 @@ public class JettyServer extends Externa
* @param secure
* Whether to enable HTTPS.
*/
- public JettyServer(String repository, boolean secure) {
+ public JettyServer(String repository, String axis2xml, boolean secure) {
if (repository == null || repository.trim().length() == 0) {
throw new IllegalArgumentException("Axis2 repository must not be
null or empty");
}
this.repository = repository;
+ this.axis2xml = axis2xml;
this.secure = secure;
}
@@ -190,7 +187,7 @@ public class JettyServer extends Externa
context.setThrowUnavailableOnStartupException(true);
final ConfigurationContext configurationContext =
-
ConfigurationContextFactory.createConfigurationContextFromFileSystem(repository,
AXIS2_XML);
+
ConfigurationContextFactory.createConfigurationContextFromFileSystem(repository,
axis2xml);
@SuppressWarnings("serial")
ServletHolder servlet = new ServletHolder(new AxisServlet() {
@Override
Added:
axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/TestConstants.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/TestConstants.java?rev=1778862&view=auto
==============================================================================
---
axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/TestConstants.java
(added)
+++
axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/TestConstants.java
Sat Jan 14 23:27:48 2017
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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;
+
+public final class TestConstants {
+ public static final String TESTING_PATH = "target/test-resources/";
+ public static final String AXIS2_XML = "src/test/resources/conf/axis2.xml";
+
+ private TestConstants() {}
+}
Propchange:
axis/axis2/java/rampart/trunk/modules/rampart-integration/src/main/java/org/apache/axis2/integration/TestConstants.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=1778862&r1=1778861&r2=1778862&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
Sat Jan 14 23:27:48 2017
@@ -16,6 +16,9 @@
package org.apache.rahas;
+import static org.apache.axis2.integration.TestConstants.AXIS2_XML;
+import static org.apache.axis2.integration.TestConstants.TESTING_PATH;
+
import java.io.FileInputStream;
import java.io.InputStream;
@@ -39,14 +42,14 @@ import org.junit.Test;
public abstract class TestClient {
@Rule
- public final JettyServer server = new JettyServer(Constants.TESTING_PATH +
getServiceRepo(), false);
+ public final JettyServer server = new JettyServer(TESTING_PATH +
getServiceRepo(), AXIS2_XML, false);
/**
*/
@Test
public void testRequest() throws Exception {
// Get the repository location from the args
- String repo = Constants.TESTING_PATH + "rahas_client_repo";
+ String repo = TESTING_PATH + "rahas_client_repo";
ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(repo,
null);
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=1778862&r1=1778861&r2=1778862&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
Sat Jan 14 23:27:48 2017
@@ -16,6 +16,8 @@
package org.apache.rampart;
+import static org.apache.axis2.integration.TestConstants.AXIS2_XML;
+import static org.apache.axis2.integration.TestConstants.TESTING_PATH;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
@@ -46,10 +48,10 @@ public class RampartTest {
private static ResourceBundle resources;
@Rule
- public final JettyServer server = new JettyServer(Constants.TESTING_PATH +
"rampart_service_repo", false);
+ public final JettyServer server = new JettyServer(TESTING_PATH +
"rampart_service_repo", AXIS2_XML, false);
@Rule
- public final JettyServer secureServer = new
JettyServer(Constants.TESTING_PATH + "rampart_service_repo", true);
+ public final JettyServer secureServer = new JettyServer(TESTING_PATH +
"rampart_service_repo", AXIS2_XML, true);
static {
try {
@@ -61,7 +63,7 @@ public class RampartTest {
private ServiceClient getServiceClientInstance() throws AxisFault {
- String repository = Constants.TESTING_PATH + "rampart_client_repo";
+ String repository = TESTING_PATH + "rampart_client_repo";
ConfigurationContext configContext = ConfigurationContextFactory.
createConfigurationContextFromFileSystem(repository, null);