You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2006/03/09 13:33:34 UTC
svn commit: r384499 - in /webservices/axis2/trunk/java/modules:
core/src/org/apache/axis2/deployment/repository/util/
core/src/org/apache/axis2/description/ core/src/org/apache/axis2/engine/
core/test/org/apache/axis2/deployment/ integration/test/org/a...
Author: deepal
Date: Thu Mar 9 04:33:32 2006
New Revision: 384499
URL: http://svn.apache.org/viewcvs?rev=384499&view=rev
Log:
- I tryie fix the JIRA 379 , then all the test cases were faling due to static AxisService in stub . To solve the problem I have to split security test cases, so I removed one test cases from InteropTestBase and added that into new class called InteropTestBaseWithDynamicConfig and added set of classes extend from that .I have not remove any test cases.
- Removed unnecessary methods
Ruchith please check whther I have done any mistake
Added:
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/AddressingMTOMSecurityWithDynamicConfigTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBaseWithDynamicConfig.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/MTOMOptimizedSecurityWithDynamicConfigTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario1WithDynamicConfigTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario2ayWithDynamicConfigTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario2yWithDynamicConfigTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario3yWithDynamicConfigTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario4WithDynamicConfigTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario5WithDynamicConfigTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario6WithDynamicConfigTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario7WithDynamicConfigTest.java
Removed:
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/deployment/InvalidServiceTest.java
Modified:
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisServiceGroup.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLOnTwoChannelsSyncTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLOnTwoChannelsTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsTCPServer.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBase.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/tcp/TCPTwoChannelEchoRawXMLTest.java
webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/security/InteropScenarioClient.java
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java?rev=384499&r1=384498&r2=384499&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java Thu Mar 9 04:33:32 2006
@@ -35,7 +35,6 @@
import java.util.HashMap;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
-import java.util.zip.ZipOutputStream;
public class ArchiveReader implements DeploymentConstants {
private Log log = LogFactory.getLog(getClass());
@@ -91,91 +90,6 @@
return groupBuilder.populateServiceGroup(axisServiceGroup);
}
return null;
- }
-
- /**
- * Creates the module file archive file. Checks whether the module exists in home
- * directory. If yes, returns that else reads the given module from classpath (from resources).
- * If found, gets the module.mar file from the resource stream and writes into
- * the userhome/axis2home/module directory.
- *
- * @param moduleName
- * @return Returns File.
- * @throws DeploymentException
- */
- public File creatModuleArchivefromResource(String moduleName, String axis2repository)
- throws DeploymentException {
- File modulearchiveFile;
- File modules;
-
- try {
- int BUFFER = 2048;
-
- if (axis2repository == null) {
- String userHome = System.getProperty(DeploymentConstants.PROPERTY_TEMP_DIR);
- File userHomedir = new File(userHome);
- File repository = new File(userHomedir, DIRECTORY_AXIS2_HOME);
-
- modules = new File(repository, DIRECTORY_MODULES);
- } else {
- modules = new File(axis2repository, DIRECTORY_MODULES);
- }
-
- String modulearchiveName = moduleName + SUFFIX_MAR;
-
- modulearchiveFile = new File(modules, modulearchiveName);
-
- if (modulearchiveFile.exists()) {
- return modulearchiveFile;
- }
-
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- InputStream in = cl.getResourceAsStream(RESOURCE_MODULES + moduleName + SUFFIX_MAR);
-
- if (in == null) {
- in = cl.getResourceAsStream(RESOURCE_MODULES + moduleName + SUFFIX_JAR);
- }
-
- if (in == null) {
- throw new DeploymentException(
- Messages.getMessage(
- DeploymentErrorMsgs.MODULE_NOT_FOUND, moduleName));
- } else {
- if (!modules.exists()) {
- modules.mkdirs();
- }
-
- modulearchiveFile.createNewFile();
-
- FileOutputStream dest = new FileOutputStream(modulearchiveFile);
- ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(dest));
- byte data[] = new byte[BUFFER];
- ZipInputStream zin;
-
- zin = new ZipInputStream(in);
-
- ZipEntry entry;
-
- while ((entry = zin.getNextEntry()) != null) {
- ZipEntry zip = new ZipEntry(entry);
-
- out.putNextEntry(zip);
-
- int count;
-
- while ((count = zin.read(data, 0, BUFFER)) != -1) {
- out.write(data, 0, count);
- }
- }
-
- out.close();
- zin.close();
- }
- } catch (Exception e) {
- throw new DeploymentException(e);
- }
-
- return modulearchiveFile;
}
/**
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java?rev=384499&r1=384498&r2=384499&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java Thu Mar 9 04:33:32 2006
@@ -107,17 +107,15 @@
if (moduleref == null) {
return null;
}
-
- boolean needToadd = true;
Iterator module_itr = engagedModules.iterator();
-
while (module_itr.hasNext()) {
AxisModule module = (AxisModule) module_itr.next();
if (module.getName().equals(moduleref.getName())) {
log.debug(Messages.getMessage("modulealredyengaged",
moduleref.getName().getLocalPart()));
- needToadd = false;
+ throw new AxisFault(Messages.getMessage("modulealredyengaged",
+ moduleref.getName().getLocalPart()));
}
}
PhaseResolver phaseResolver = new PhaseResolver(axisConfig);
@@ -126,10 +124,7 @@
if (module != null) {
module.engageNotify(this);
}
-
- if (needToadd) {
- engagedModules.add(moduleref);
- }
+ engagedModules.add(moduleref);
return addModuleOperations(moduleref, axisConfig, (AxisService) getParent());
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java?rev=384499&r1=384498&r2=384499&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java Thu Mar 9 04:33:32 2006
@@ -163,15 +163,14 @@
Collection col = map.values();
for (Iterator iterator = col.iterator(); iterator.hasNext();) {
AxisOperation axisOperation = copyOperation((AxisOperation) iterator.next());
- ArrayList wsamappings = axisOperation.getWsamappingList();
-
- if (wsamappings != null) {
- for (int j = 0; j < wsamappings.size(); j++) {
- String mapping = (String) wsamappings.get(j);
- this.mapActionToOperation(mapping, axisOperation);
- }
- }
if (this.getOperation(axisOperation.getName()) == null) {
+ ArrayList wsamappings = axisOperation.getWsamappingList();
+ if (wsamappings != null) {
+ for (int j = 0; j < wsamappings.size(); j++) {
+ String mapping = (String) wsamappings.get(j);
+ this.mapActionToOperation(mapping, axisOperation);
+ }
+ }
// this opration is a control operation.
axisOperation.setControlOperation(true);
this.addOperation(axisOperation);
@@ -293,7 +292,6 @@
if (axisModule == null) {
throw new AxisFault(Messages.getMessage("modulenf"));
}
- boolean needToadd = true;
Iterator itr_engageModules = engagedModules.iterator();
while (itr_engageModules.hasNext()) {
@@ -302,7 +300,8 @@
if (module.getName().equals(axisModule.getName())) {
log.debug(Messages.getMessage("modulealredyengagetoservice",
axisModule.getName().getLocalPart()));
- needToadd = false;
+ throw new AxisFault(Messages.getMessage("modulealredyengagetoservice",
+ axisModule.getName().getLocalPart()));
}
}
@@ -324,10 +323,7 @@
}
axisOperation.engageModule(axisModule, axisConfig);
}
-
- if (needToadd) {
- engagedModules.add(axisModule);
- }
+ engagedModules.add(axisModule);
}
/**
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisServiceGroup.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisServiceGroup.java?rev=384499&r1=384498&r2=384499&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisServiceGroup.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisServiceGroup.java Thu Mar 9 04:33:32 2006
@@ -117,14 +117,14 @@
public void engageModule(AxisModule module) throws AxisFault {
QName moduleName = module.getName();
- boolean needToadd = true;
for (Iterator iterator = engagedModules.iterator(); iterator.hasNext();) {
QName modu = (QName) iterator.next();
if (modu.getLocalPart().equals(moduleName.getLocalPart())) {
log.debug(Messages.getMessage(
"modulealredyengagedtoservicegroup", moduleName.getLocalPart()));
- needToadd = false;
+ throw new AxisFault(Messages.getMessage(
+ "modulealredyengagedtoservicegroup", moduleName.getLocalPart()));
}
}
@@ -138,10 +138,7 @@
log.info(axisFault.getMessage());
}
}
-
- if (needToadd) {
- addToengagedModules(moduleName);
- }
+ addToengagedModules(moduleName);
}
public void removeService(String name) throws AxisFault {
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java?rev=384499&r1=384498&r2=384499&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java Thu Mar 9 04:33:32 2006
@@ -20,8 +20,6 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.deployment.DeploymentConstants;
-import org.apache.axis2.deployment.DeploymentEngine;
-import org.apache.axis2.deployment.repository.util.ArchiveReader;
import org.apache.axis2.deployment.util.PhasesInfo;
import org.apache.axis2.description.*;
import org.apache.axis2.i18n.Messages;
@@ -31,7 +29,6 @@
import org.apache.commons.logging.LogFactory;
import javax.xml.namespace.QName;
-import java.io.File;
import java.util.*;
/**
@@ -234,16 +231,6 @@
*/
public void engageModule(QName moduleref) throws AxisFault {
AxisModule module = getModule(moduleref);
- if (module == null) {
- // there is no module found with the given name , so better check for dafult module version
- String moduleName = moduleref.getLocalPart();
- String defaultModuleVersion = getDefaultModuleVersion(moduleName);
- if (defaultModuleVersion != null) {
- QName moduleQName = Utils.getModuleName(moduleName,
- defaultModuleVersion);
- module = loadModulefromResources(moduleQName.getLocalPart());
- }
- }
if (module != null) {
engageModule(module);
} else {
@@ -262,13 +249,11 @@
public void engageModule(String moduleName, String versionID) throws AxisFault {
QName moduleQName = Utils.getModuleName(moduleName, versionID);
AxisModule module = getModule(moduleQName);
- if (module == null) {
- module = loadModulefromResources(moduleQName.getLocalPart());
+ if (module != null) {
engageModule(module);
} else {
- engageModule(module);
+ throw new AxisFault(Messages.getMessage("refertoinvalidmodule"));
}
-
}
private void engageModule(AxisModule module) throws AxisFault {
@@ -280,7 +265,8 @@
if (moduleQName.equals(qName)) {
log.info(Messages.getMessage("modulealredyengagedglobaly",
qName.getLocalPart()));
- return;
+ throw new AxisFault(Messages.getMessage("modulealredyengagedglobaly",
+ qName.getLocalPart()));
}
}
} else {
@@ -312,27 +298,6 @@
}
engagedModules.remove(module.getName());
}
- }
-
- /**
- * Loads module from class path - the mar files in a jar file inside
- * modules/ directory
- *
- * @param moduleName
- * @return Returns ModuleDescription.
- * @throws AxisFault
- */
- public AxisModule loadModulefromResources(String moduleName) throws AxisFault {
- AxisModule module;
- // trying to read from resources
- File file = new ArchiveReader().creatModuleArchivefromResource(moduleName,
- getRepository());
- module = new DeploymentEngine().buildModule(file, this);
- if (module != null) {
- // since it is a new module
- addModule(module);
- }
- return module;
}
public void notifyObservers(int event_type, AxisService service) {
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLOnTwoChannelsSyncTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLOnTwoChannelsSyncTest.java?rev=384499&r1=384498&r2=384499&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLOnTwoChannelsSyncTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLOnTwoChannelsSyncTest.java Thu Mar 9 04:33:32 2006
@@ -31,8 +31,6 @@
import org.apache.ws.commons.om.OMFactory;
import org.apache.ws.commons.om.OMNamespace;
-import javax.xml.namespace.QName;
-
public class EchoRawXMLOnTwoChannelsSyncTest extends TestCase implements TestConstants {
public EchoRawXMLOnTwoChannelsSyncTest() {
@@ -45,9 +43,6 @@
protected void setUp() throws Exception {
UtilServer.start();
- UtilServer.getConfigurationContext().getAxisConfiguration()
- .engageModule(new QName("addressing"));
-
AxisService service =
Utils.createSimpleService(serviceName,
Echo.class.getName(),
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLOnTwoChannelsTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLOnTwoChannelsTest.java?rev=384499&r1=384498&r2=384499&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLOnTwoChannelsTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawXMLOnTwoChannelsTest.java Thu Mar 9 04:33:32 2006
@@ -55,9 +55,6 @@
protected void setUp() throws Exception {
UtilServer.start();
- UtilServer.getConfigurationContext().getAxisConfiguration()
- .engageModule(new QName("addressing"));
-
AxisService service =
Utils.createSimpleService(serviceName,
Echo.class.getName(),
@@ -111,7 +108,6 @@
};
sender = new ServiceClient(configcontext, service);
- sender.engageModule(new QName("addressing"));
sender.setOptions(options);
sender.sendReceiveNonBlocking(operationName, method, callback);
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java?rev=384499&r1=384498&r2=384499&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java Thu Mar 9 04:33:32 2006
@@ -60,8 +60,6 @@
protected void setUp() throws Exception {
String repository = "target/groovyRepo";
UtilServer.start(repository);
- UtilServer.getConfigurationContext().getAxisConfiguration()
- .engageModule(new QName("addressing"));
}
protected void tearDown() throws Exception {
@@ -92,7 +90,7 @@
ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem("target/test-resources/integrationRepo",null);
+ ConfigurationContextFactory.createConfigurationContextFromFileSystem("target/test-resources/integrationRepo", null);
ServiceClient sender = new ServiceClient(configContext, null);
sender.setOptions(options);
OMElement result = sender.sendReceive(payload);
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java?rev=384499&r1=384498&r2=384499&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java Thu Mar 9 04:33:32 2006
@@ -169,7 +169,6 @@
AxisModule axisModule = deploymentEngine.buildModule(file,
configContext.getAxisConfiguration());
configContext.getAxisConfiguration().addModule(axisModule);
- configContext.getAxisConfiguration().engageModule(new QName("addressing"));
return configContext;
}
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsTCPServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsTCPServer.java?rev=384499&r1=384498&r2=384499&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsTCPServer.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsTCPServer.java Thu Mar 9 04:33:32 2006
@@ -73,7 +73,6 @@
} catch (InterruptedException e1) {
throw new AxisFault("Thread interuptted", e1);
}
- er.getAxisConfiguration().engageModule(new QName("addressing"));
receiver = new TCPServer(UtilServer.TESTING_PORT, er);
receiver.start();
Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/AddressingMTOMSecurityWithDynamicConfigTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/AddressingMTOMSecurityWithDynamicConfigTest.java?rev=384499&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/AddressingMTOMSecurityWithDynamicConfigTest.java (added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/AddressingMTOMSecurityWithDynamicConfigTest.java Thu Mar 9 04:33:32 2006
@@ -0,0 +1,69 @@
+package org.apache.axis2.security;
+
+import org.apache.axis2.security.handler.config.OutflowConfiguration;
+import org.apache.axis2.security.handler.config.InflowConfiguration;
+import org.apache.axis2.security.handler.WSSHandlerConstants;
+/*
+* Copyright 2004,2005 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.
+*
+*
+*/
+
+public class AddressingMTOMSecurityWithDynamicConfigTest extends InteropTestBaseWithDynamicConfig{
+
+
+ protected OutflowConfiguration getOutflowConfiguration() {
+
+ OutflowConfiguration ofc = new OutflowConfiguration();
+
+ ofc.setActionItems("Timestamp Signature Encrypt");
+ ofc.setUser("alice");
+ ofc.setEncryptionUser("bob");
+ ofc.setSignaturePropFile("interop.properties");
+ ofc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ofc.setSignatureKeyIdentifier(WSSHandlerConstants.SKI_KEY_IDENTIFIER);
+ ofc.setEncryptionKeyIdentifier(WSSHandlerConstants.SKI_KEY_IDENTIFIER);
+ ofc.setSignatureParts("{Element}{" + ADDR_NS + "}To;" +
+ "{Element}{" + ADDR_NS + "}ReplyTo;" +
+ "{Element}{" + ADDR_NS + "}MessageID;" +
+ "{Element}{" + WSU_NS + "}Timestamp");
+ ofc.setOptimizeParts(
+ "//xenc:EncryptedData/xenc:CipherData/xenc:CipherValue");
+
+ return ofc;
+ }
+
+ protected InflowConfiguration getInflowConfiguration() {
+ InflowConfiguration ifc = new InflowConfiguration();
+
+ ifc.setActionItems("Timestamp Signature Encrypt");
+ ifc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ifc.setSignaturePropFile("interop.properties");
+
+ return ifc;
+ }
+
+ protected String getClientRepo() {
+ return COMPLETE_CLIENT_REPOSITORY;
+ }
+
+ protected String getServiceRepo() {
+ return COMPLETE_SERVICE_REPOSITORY;
+ }
+
+ protected boolean isUseSOAP12InStaticConfigTest() {
+ return true;
+ }
+}
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBase.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBase.java?rev=384499&r1=384498&r2=384499&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBase.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBase.java Thu Mar 9 04:33:32 2006
@@ -172,31 +172,6 @@
}
}
- public void testInteropWithDynamicConfig() {
- try {
- Class interopScenarioClientClass = Class
- .forName("org.apache.axis2.security.InteropScenarioClient");
- Constructor c = interopScenarioClientClass
- .getConstructor(new Class[]{boolean.class});
- Object clientObj = c.newInstance(new Object[]{this
- .isUseSOAP12InStaticConfigTest() ? Boolean.TRUE
- : Boolean.FALSE});
- Method m = interopScenarioClientClass.getMethod(
- "invokeWithGivenConfig", new Class[]{String.class,
- String.class, OutflowConfiguration.class,
- InflowConfiguration.class});
- m.invoke(clientObj, new Object[]{
- Constants.TESTING_PATH + DEFAULT_CLIENT_REPOSITORY,
- targetEpr, getOutflowConfiguration(),
- getInflowConfiguration()});
-
- } catch (Exception e) {
- e.printStackTrace();
- fail("Error in introperating with " + targetEpr
- + ", client configuration: " + getClientRepo());
- }
-
- }
protected abstract OutflowConfiguration getOutflowConfiguration();
Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBaseWithDynamicConfig.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBaseWithDynamicConfig.java?rev=384499&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBaseWithDynamicConfig.java (added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/InteropTestBaseWithDynamicConfig.java Thu Mar 9 04:33:32 2006
@@ -0,0 +1,178 @@
+package org.apache.axis2.security;
+
+import junit.framework.TestCase;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.integration.UtilServer;
+import org.apache.axis2.security.handler.config.InflowConfiguration;
+import org.apache.axis2.security.handler.config.OutflowConfiguration;
+import org.apache.ws.security.WSConstants;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+/*
+* Copyright 2004,2005 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.
+*
+*
+*/
+
+public abstract class InteropTestBaseWithDynamicConfig extends TestCase {
+ protected static final String SCENARIO1_SERVICE_REPOSITORY =
+ "scenario1_service_repo";
+
+ protected static final String SCENARIO1_CLIENT_REPOSITORY =
+ "scenario1_client_repo";
+
+ protected static final String SCENARIO2_SERVICE_REPOSITORY =
+ "scenario2_service_repo";
+
+ protected static final String SCENARIO2_CLIENT_REPOSITORY =
+ "scenario2_client_repo";
+
+ protected static final String SCENARIO2a_SERVICE_REPOSITORY =
+ "scenario2a_service_repo";
+
+ protected static final String SCENARIO2a_CLIENT_REPOSITORY =
+ "scenario2a_client_repo";
+
+ protected static final String SCENARIO3_SERVICE_REPOSITORY =
+ "scenario3_service_repo";
+
+ protected static final String SCENARIO3_CLIENT_REPOSITORY =
+ "scenario3_client_repo";
+
+ protected static final String SCENARIO4_SERVICE_REPOSITORY =
+ "scenario4_service_repo";
+
+ protected static final String SCENARIO4_CLIENT_REPOSITORY =
+ "scenario4_client_repo";
+
+ protected static final String SCENARIO5_SERVICE_REPOSITORY =
+ "scenario5_service_repo";
+
+ protected static final String SCENARIO5_CLIENT_REPOSITORY =
+ "scenario5_client_repo";
+
+ protected static final String SCENARIO6_SERVICE_REPOSITORY =
+ "scenario6_service_repo";
+
+ protected static final String SCENARIO6_CLIENT_REPOSITORY =
+ "scenario6_client_repo";
+
+ protected static final String SCENARIO7_SERVICE_REPOSITORY =
+ "scenario7_service_repo";
+
+ protected static final String SCENARIO7_CLIENT_REPOSITORY =
+ "scenario7_client_repo";
+
+ protected static final String SCENARIO_ST1_SERVICE_REPOSITORY =
+ "scenarioST1_service_repo";
+
+ protected static final String SCENARIO_ST1_CLIENT_REPOSITORY =
+ "scenarioST1_client_repo";
+
+ protected static final String SCENARIO_ST3_SERVICE_REPOSITORY =
+ "scenarioST3_service_repo";
+
+ protected static final String SCENARIO_ST3_CLIENT_REPOSITORY =
+ "scenarioST3_client_repo";
+
+ protected static final String SCENARIO_ST4_SERVICE_REPOSITORY =
+ "scenarioST4_service_repo";
+
+ protected static final String SCENARIO_ST4_CLIENT_REPOSITORY =
+ "scenarioST4_client_repo";
+
+ protected static final String MTOM_SEC_SERVICE_REPOSITORY =
+ "mtom_sec_service_repo";
+
+ protected static final String MTOM_SEC_CLIENT_REPOSITORY =
+ "mtom_sec_client_repo";
+
+ protected static final String COMPLETE_SERVICE_REPOSITORY =
+ "complete_service_repo";
+
+ protected static final String COMPLETE_CLIENT_REPOSITORY =
+ "complete_client_repo";
+
+ protected static final String DEFAULT_CLIENT_REPOSITORY =
+ "default_security_client_repo";
+
+ protected static final String WSSE_NS = WSConstants.WSSE_NS;
+
+ protected static final String WSU_NS = WSConstants.WSU_NS;
+
+ protected static final String ADDR_NS =
+ AddressingConstants.Final.WSA_NAMESPACE;
+
+ private String targetEpr = "http://127.0.0.1:" +
+// 5556 +
+ UtilServer.TESTING_PORT +
+ "/axis2/services/PingPort";
+
+ /**
+ * Each time an interop test is run the relevant service will be started
+ * with the given service repository
+ * <p/>
+ * set up the service
+ */
+ protected void setUp() throws Exception {
+ UtilServer.start(Constants.TESTING_PATH + getServiceRepo());
+ }
+
+ /**
+ * Cleanup
+ */
+ protected void tearDown() throws Exception {
+ UtilServer.stop();
+ }
+
+
+ public void testInteropWithDynamicConfig() {
+ try {
+ Class interopScenarioClientClass = Class
+ .forName("org.apache.axis2.security.InteropScenarioClient");
+ Constructor c = interopScenarioClientClass
+ .getConstructor(new Class[]{boolean.class});
+ Object clientObj = c.newInstance(new Object[]{this
+ .isUseSOAP12InStaticConfigTest() ? Boolean.TRUE
+ : Boolean.FALSE});
+ Method m = interopScenarioClientClass.getMethod(
+ "invokeWithGivenConfig", new Class[]{String.class,
+ String.class, OutflowConfiguration.class,
+ InflowConfiguration.class});
+ m.invoke(clientObj, new Object[]{
+ Constants.TESTING_PATH + DEFAULT_CLIENT_REPOSITORY,
+ targetEpr, getOutflowConfiguration(),
+ getInflowConfiguration()});
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("Error in introperating with " + targetEpr
+ + ", client configuration: " + getClientRepo());
+ }
+
+ }
+
+ protected abstract OutflowConfiguration getOutflowConfiguration();
+
+ protected abstract InflowConfiguration getInflowConfiguration();
+
+ protected abstract String getClientRepo();
+
+ protected abstract String getServiceRepo();
+
+ protected abstract boolean isUseSOAP12InStaticConfigTest();
+}
Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/MTOMOptimizedSecurityWithDynamicConfigTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/MTOMOptimizedSecurityWithDynamicConfigTest.java?rev=384499&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/MTOMOptimizedSecurityWithDynamicConfigTest.java (added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/MTOMOptimizedSecurityWithDynamicConfigTest.java Thu Mar 9 04:33:32 2006
@@ -0,0 +1,63 @@
+package org.apache.axis2.security;
+
+import org.apache.axis2.security.handler.config.OutflowConfiguration;
+import org.apache.axis2.security.handler.config.InflowConfiguration;
+import org.apache.axis2.security.handler.WSSHandlerConstants;
+/*
+* Copyright 2004,2005 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.
+*
+*
+*/
+
+public class MTOMOptimizedSecurityWithDynamicConfigTest extends InteropTestBaseWithDynamicConfig{
+
+ protected OutflowConfiguration getOutflowConfiguration() {
+ OutflowConfiguration ofc = new OutflowConfiguration();
+
+ ofc.setActionItems("Signature Encrypt Timestamp");
+ ofc.setUser("alice");
+ ofc.setEncryptionUser("bob");
+ ofc.setSignaturePropFile("interop.properties");
+ ofc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ofc.setSignatureKeyIdentifier(WSSHandlerConstants.BST_DIRECT_REFERENCE);
+ ofc.setEncryptionKeyIdentifier(WSSHandlerConstants.SKI_KEY_IDENTIFIER);
+ ofc.setOptimizeParts("//xenc:EncryptedData/xenc:CipherData/" +
+ "xenc:CipherValue");
+
+ return ofc;
+ }
+
+ protected InflowConfiguration getInflowConfiguration() {
+ InflowConfiguration ifc = new InflowConfiguration();
+
+ ifc.setActionItems("Signature Encrypt Timestamp");
+ ifc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ifc.setSignaturePropFile("interop.properties");
+
+ return ifc;
+ }
+
+ protected String getClientRepo() {
+ return MTOM_SEC_CLIENT_REPOSITORY;
+ }
+
+ protected String getServiceRepo() {
+ return MTOM_SEC_SERVICE_REPOSITORY;
+ }
+
+ protected boolean isUseSOAP12InStaticConfigTest() {
+ return true;
+ }
+}
Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario1WithDynamicConfigTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario1WithDynamicConfigTest.java?rev=384499&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario1WithDynamicConfigTest.java (added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario1WithDynamicConfigTest.java Thu Mar 9 04:33:32 2006
@@ -0,0 +1,49 @@
+package org.apache.axis2.security;
+
+import org.apache.axis2.security.handler.config.InflowConfiguration;
+import org.apache.axis2.security.handler.config.OutflowConfiguration;
+/*
+* Copyright 2004,2005 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.
+*
+*
+*/
+
+public class Scenario1WithDynamicConfigTest extends InteropTestBaseWithDynamicConfig {
+
+ protected OutflowConfiguration getOutflowConfiguration() {
+ OutflowConfiguration ofc = new OutflowConfiguration();
+ ofc.setActionItems("UsernameToken");
+ ofc.setUser("Chris");
+ ofc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ofc.setPasswordType("PasswordText");
+ return ofc;
+ }
+
+ protected InflowConfiguration getInflowConfiguration() {
+ return null;
+ }
+
+ protected String getClientRepo() {
+ return SCENARIO1_CLIENT_REPOSITORY;
+ }
+
+ protected String getServiceRepo() {
+ return SCENARIO1_SERVICE_REPOSITORY;
+ }
+
+ protected boolean isUseSOAP12InStaticConfigTest() {
+ return true;
+ }
+}
Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario2ayWithDynamicConfigTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario2ayWithDynamicConfigTest.java?rev=384499&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario2ayWithDynamicConfigTest.java (added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario2ayWithDynamicConfigTest.java Thu Mar 9 04:33:32 2006
@@ -0,0 +1,57 @@
+package org.apache.axis2.security;
+
+import org.apache.axis2.security.handler.WSSHandlerConstants;
+import org.apache.axis2.security.handler.config.InflowConfiguration;
+import org.apache.axis2.security.handler.config.OutflowConfiguration;
+import org.apache.ws.security.WSConstants;
+/*
+* Copyright 2004,2005 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.
+*
+*
+*/
+
+public class Scenario2ayWithDynamicConfigTest extends InteropTestBaseWithDynamicConfig {
+
+ protected OutflowConfiguration getOutflowConfiguration() {
+ OutflowConfiguration ofc = new OutflowConfiguration();
+
+ ofc.setActionItems("UsernameTokenSignature Encrypt Timestamp");
+ ofc.setUser("Chris");
+ ofc.setEncryptionParts("{Element}{" + WSSE_NS + "}UsernameToken");
+ ofc.setEncryptionUser("bob");
+ ofc.setEncryptionPropFile("interop.properties");
+ ofc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ofc.setEncryptionSymAlgorithm(WSConstants.TRIPLE_DES);
+ ofc.setEncryptionKeyIdentifier(WSSHandlerConstants.SKI_KEY_IDENTIFIER);
+
+ return ofc;
+ }
+
+ protected InflowConfiguration getInflowConfiguration() {
+ return null;
+ }
+
+ protected String getClientRepo() {
+ return SCENARIO2a_CLIENT_REPOSITORY;
+ }
+
+ protected String getServiceRepo() {
+ return SCENARIO2a_SERVICE_REPOSITORY;
+ }
+
+ protected boolean isUseSOAP12InStaticConfigTest() {
+ return true;
+ }
+}
Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario2yWithDynamicConfigTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario2yWithDynamicConfigTest.java?rev=384499&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario2yWithDynamicConfigTest.java (added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario2yWithDynamicConfigTest.java Thu Mar 9 04:33:32 2006
@@ -0,0 +1,59 @@
+package org.apache.axis2.security;
+
+import org.apache.axis2.security.handler.config.OutflowConfiguration;
+import org.apache.axis2.security.handler.config.InflowConfiguration;
+import org.apache.axis2.security.handler.WSSHandlerConstants;
+import org.apache.ws.security.WSConstants;
+/*
+* Copyright 2004,2005 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.
+*
+*
+*/
+
+public class Scenario2yWithDynamicConfigTest extends InteropTestBaseWithDynamicConfig{
+
+ protected OutflowConfiguration getOutflowConfiguration() {
+ OutflowConfiguration ofc = new OutflowConfiguration();
+
+ ofc.setActionItems("UsernameToken Encrypt");
+ ofc.setUser("Chris");
+ ofc.setAddUTElements("Nonce Created");
+ ofc.setEncryptionParts("{Element}{" + WSSE_NS + "}UsernameToken");
+ ofc.setEncryptionUser("bob");
+ ofc.setEncryptionPropFile("interop.properties");
+ ofc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ofc.setEncryptionSymAlgorithm(WSConstants.TRIPLE_DES);
+ ofc.setPasswordType(WSConstants.PW_TEXT);
+ ofc.setEncryptionKeyIdentifier(WSSHandlerConstants.SKI_KEY_IDENTIFIER);
+
+ return ofc;
+ }
+
+ protected InflowConfiguration getInflowConfiguration() {
+ return null;
+ }
+
+ protected String getClientRepo() {
+ return SCENARIO2_CLIENT_REPOSITORY;
+ }
+
+ protected String getServiceRepo() {
+ return SCENARIO2_SERVICE_REPOSITORY;
+ }
+
+ protected boolean isUseSOAP12InStaticConfigTest() {
+ return true;
+ }
+}
Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario3yWithDynamicConfigTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario3yWithDynamicConfigTest.java?rev=384499&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario3yWithDynamicConfigTest.java (added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario3yWithDynamicConfigTest.java Thu Mar 9 04:33:32 2006
@@ -0,0 +1,64 @@
+package org.apache.axis2.security;
+
+import org.apache.axis2.security.handler.config.OutflowConfiguration;
+import org.apache.axis2.security.handler.config.InflowConfiguration;
+import org.apache.axis2.security.handler.WSSHandlerConstants;
+import org.apache.ws.security.WSConstants;
+/*
+* Copyright 2004,2005 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.
+*
+*
+*/
+
+public class Scenario3yWithDynamicConfigTest extends InteropTestBaseWithDynamicConfig{
+
+ protected OutflowConfiguration getOutflowConfiguration() {
+ OutflowConfiguration ofc = new OutflowConfiguration();
+
+ ofc.setActionItems("Signature Encrypt Timestamp");
+ ofc.setUser("alice");
+ ofc.setEncryptionUser("bob");
+ ofc.setSignaturePropFile("interop.properties");
+ ofc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ofc.setEncryptionSymAlgorithm(WSConstants.TRIPLE_DES);
+ ofc.setEncryptionKeyIdentifier(WSSHandlerConstants.SKI_KEY_IDENTIFIER);
+ ofc.setSignatureKeyIdentifier(WSSHandlerConstants.BST_DIRECT_REFERENCE);
+ ofc.setEnableSignatureConfirmation(false);
+
+ return ofc;
+ }
+
+ protected InflowConfiguration getInflowConfiguration() {
+ InflowConfiguration ifc = new InflowConfiguration();
+ ifc.setActionItems("Signature Encrypt Timestamp");
+ ifc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ifc.setSignaturePropFile("interop.properties");
+ ifc.setEnableSignatureConfirmation(false);
+ return ifc;
+ }
+
+ protected String getClientRepo() {
+ return SCENARIO3_CLIENT_REPOSITORY;
+ }
+
+ protected String getServiceRepo() {
+ return SCENARIO3_SERVICE_REPOSITORY;
+ }
+
+ protected boolean isUseSOAP12InStaticConfigTest() {
+ return true;
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario4WithDynamicConfigTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario4WithDynamicConfigTest.java?rev=384499&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario4WithDynamicConfigTest.java (added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario4WithDynamicConfigTest.java Thu Mar 9 04:33:32 2006
@@ -0,0 +1,63 @@
+package org.apache.axis2.security;
+
+import org.apache.axis2.security.handler.config.OutflowConfiguration;
+import org.apache.axis2.security.handler.config.InflowConfiguration;
+import org.apache.axis2.security.handler.WSSHandlerConstants;
+import org.apache.ws.security.WSConstants;
+/*
+* Copyright 2004,2005 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.
+*
+*
+*/
+
+public class Scenario4WithDynamicConfigTest extends InteropTestBaseWithDynamicConfig{
+ protected OutflowConfiguration getOutflowConfiguration() {
+ OutflowConfiguration ofc = new OutflowConfiguration();
+
+ ofc.setActionItems("Signature Encrypt Timestamp");
+ ofc.setUser("alice");
+ ofc.setSignaturePropFile("interop.properties");
+ ofc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ofc.setEncryptionSymAlgorithm(WSConstants.TRIPLE_DES);
+ ofc.setEncryptionKeyIdentifier(WSSHandlerConstants.EMBEDDED_KEYNAME);
+ ofc.setEmbeddedKeyName("SessionKey");
+ ofc.setSignatureKeyIdentifier(WSSHandlerConstants.BST_DIRECT_REFERENCE);
+ ofc.setEmbeddedKeyCallbackClass("org.apache.axis2.security.PWCallback");
+
+ return ofc;
+ }
+
+ protected InflowConfiguration getInflowConfiguration() {
+ InflowConfiguration ifc = new InflowConfiguration();
+
+ ifc.setActionItems("Signature Encrypt Timestamp");
+ ifc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ifc.setSignaturePropFile("interop.properties");
+
+ return ifc;
+ }
+
+ protected String getClientRepo() {
+ return SCENARIO4_CLIENT_REPOSITORY;
+ }
+
+ protected String getServiceRepo() {
+ return SCENARIO4_SERVICE_REPOSITORY;
+ }
+
+ protected boolean isUseSOAP12InStaticConfigTest() {
+ return true;
+ }
+}
Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario5WithDynamicConfigTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario5WithDynamicConfigTest.java?rev=384499&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario5WithDynamicConfigTest.java (added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario5WithDynamicConfigTest.java Thu Mar 9 04:33:32 2006
@@ -0,0 +1,61 @@
+package org.apache.axis2.security;
+
+import org.apache.axis2.security.handler.config.OutflowConfiguration;
+import org.apache.axis2.security.handler.config.InflowConfiguration;
+import org.apache.axis2.security.handler.WSSHandlerConstants;
+/*
+* Copyright 2004,2005 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.
+*
+*
+*/
+
+public class Scenario5WithDynamicConfigTest extends InteropTestBaseWithDynamicConfig{
+
+ protected OutflowConfiguration getOutflowConfiguration() {
+ OutflowConfiguration ofc = new OutflowConfiguration(2);
+
+ ofc.setActionItems("Signature NoSerialization");
+ ofc.setUser("alice");
+ ofc.setSignaturePropFile("interop.properties");
+ ofc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ofc.setSignatureKeyIdentifier(WSSHandlerConstants.BST_DIRECT_REFERENCE);
+ ofc.setSignatureParts("{}{http://xmlsoap.org/Ping}ticket");
+
+ ofc.nextAction();
+
+ ofc.setActionItems("Signature Timestamp");
+ ofc.setUser("alice");
+ ofc.setSignaturePropFile("interop.properties");
+ ofc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+
+ return ofc;
+ }
+
+ protected InflowConfiguration getInflowConfiguration() {
+ return null;
+ }
+
+ protected String getClientRepo() {
+ return SCENARIO5_CLIENT_REPOSITORY;
+ }
+
+ protected String getServiceRepo() {
+ return SCENARIO5_SERVICE_REPOSITORY;
+ }
+
+ protected boolean isUseSOAP12InStaticConfigTest() {
+ return true;
+ }
+}
Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario6WithDynamicConfigTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario6WithDynamicConfigTest.java?rev=384499&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario6WithDynamicConfigTest.java (added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario6WithDynamicConfigTest.java Thu Mar 9 04:33:32 2006
@@ -0,0 +1,63 @@
+package org.apache.axis2.security;
+
+import org.apache.axis2.security.handler.config.OutflowConfiguration;
+import org.apache.axis2.security.handler.config.InflowConfiguration;
+import org.apache.axis2.security.handler.WSSHandlerConstants;
+import org.apache.ws.security.WSConstants;
+/*
+* Copyright 2004,2005 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.
+*
+*
+*/
+
+public class Scenario6WithDynamicConfigTest extends InteropTestBaseWithDynamicConfig{
+
+ protected OutflowConfiguration getOutflowConfiguration() {
+ OutflowConfiguration ofc = new OutflowConfiguration();
+
+ ofc.setActionItems("Encrypt Signature Timestamp");
+ ofc.setUser("alice");
+ ofc.setSignaturePropFile("interop.properties");
+ ofc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ofc.setEncryptionSymAlgorithm(WSConstants.TRIPLE_DES);
+ ofc.setSignatureKeyIdentifier(WSSHandlerConstants.BST_DIRECT_REFERENCE);
+ ofc.setEncryptionKeyIdentifier(WSSHandlerConstants.SKI_KEY_IDENTIFIER);
+ ofc.setEmbeddedKeyCallbackClass("rg.apache.axis2.security.PWCallback");
+
+ return ofc;
+ }
+
+ protected InflowConfiguration getInflowConfiguration() {
+ InflowConfiguration ifc = new InflowConfiguration();
+
+ ifc.setActionItems("Encrypt Signature Timestamp");
+ ifc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ifc.setSignaturePropFile("interop.properties");
+
+ return ifc;
+ }
+
+ protected String getClientRepo() {
+ return SCENARIO6_CLIENT_REPOSITORY;
+ }
+
+ protected String getServiceRepo() {
+ return SCENARIO6_SERVICE_REPOSITORY;
+ }
+
+ protected boolean isUseSOAP12InStaticConfigTest() {
+ return true;
+ }
+}
Added: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario7WithDynamicConfigTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario7WithDynamicConfigTest.java?rev=384499&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario7WithDynamicConfigTest.java (added)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/security/Scenario7WithDynamicConfigTest.java Thu Mar 9 04:33:32 2006
@@ -0,0 +1,70 @@
+package org.apache.axis2.security;
+
+import org.apache.axis2.security.handler.config.OutflowConfiguration;
+import org.apache.axis2.security.handler.config.InflowConfiguration;
+import org.apache.axis2.security.handler.WSSHandlerConstants;
+import org.apache.ws.security.WSConstants;
+import org.apache.ws.commons.soap.SOAP11Constants;
+/*
+* Copyright 2004,2005 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.
+*
+*
+*/
+
+public class Scenario7WithDynamicConfigTest extends InteropTestBaseWithDynamicConfig{
+
+ protected OutflowConfiguration getOutflowConfiguration() {
+ OutflowConfiguration ofc = new OutflowConfiguration();
+
+ ofc.setActionItems("Signature Encrypt Timestamp");
+ ofc.setUser("alice");
+ ofc.setEncryptionUser("bob");
+ ofc.setSignaturePropFile("interop.properties");
+ ofc.setEncryptionPropFile("interop.properties");
+ ofc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ofc.setEncryptionSymAlgorithm(WSConstants.TRIPLE_DES);
+ ofc.setSignatureKeyIdentifier(WSSHandlerConstants.BST_DIRECT_REFERENCE);
+ ofc.setEncryptionKeyIdentifier(WSSHandlerConstants.SKI_KEY_IDENTIFIER);
+ ofc.setEmbeddedKeyCallbackClass("rg.apache.axis2.security.PWCallback");
+ ofc.setSignatureParts("{}{" +
+ SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI +
+ "}Body;STRTransform");
+
+ return ofc;
+ }
+
+ protected InflowConfiguration getInflowConfiguration() {
+ InflowConfiguration ifc = new InflowConfiguration();
+
+ ifc.setActionItems("Signature Encrypt Timestamp");
+ ifc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback");
+ ifc.setSignaturePropFile("interop.properties");
+ ifc.setDecryptionPropFile("interop.properties");
+
+ return ifc;
+ }
+
+ protected String getClientRepo() {
+ return SCENARIO7_CLIENT_REPOSITORY;
+ }
+
+ protected String getServiceRepo() {
+ return SCENARIO7_SERVICE_REPOSITORY;
+ }
+
+ protected boolean isUseSOAP12InStaticConfigTest() {
+ return false;
+ }
+}
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/tcp/TCPTwoChannelEchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/tcp/TCPTwoChannelEchoRawXMLTest.java?rev=384499&r1=384498&r2=384499&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/tcp/TCPTwoChannelEchoRawXMLTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/tcp/TCPTwoChannelEchoRawXMLTest.java Thu Mar 9 04:33:32 2006
@@ -90,7 +90,7 @@
value.setText("Isaac Asimov, The Foundation Trilogy");
method.addChild(value);
- ServiceClient sender = null;
+ ServiceClient sender ;
try {
Options options = new Options();
Modified: webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/security/InteropScenarioClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/security/InteropScenarioClient.java?rev=384499&r1=384498&r2=384499&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/security/InteropScenarioClient.java (original)
+++ webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/security/InteropScenarioClient.java Thu Mar 9 04:33:32 2006
@@ -24,11 +24,7 @@
import org.apache.axis2.security.handler.config.OutflowConfiguration;
import org.apache.ws.commons.soap.SOAP11Constants;
import org.apache.ws.commons.soap.SOAP12Constants;
-import org.xmlsoap.ping.TicketType;
-import org.xmlsoap.ping.PingDocument;
-import org.xmlsoap.ping.Ping;
-import org.xmlsoap.ping.PingResponseDocument;
-import org.xmlsoap.ping.PingResponse;
+import org.xmlsoap.ping.*;
/**
* Client for the interop service
@@ -92,7 +88,6 @@
stub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
//Engage the security module
-
stub._getServiceClient().engageModule(new javax.xml.namespace.QName("security"));
if (outflowConfig != null) {
@@ -106,6 +101,7 @@
PingResponse pingRes = pingResDoc.getPingResponse();
System.out.println(pingRes.getText());
+ stub = null;
}
}