Author: alessio.soldano(a)jboss.com
Date: 2011-05-03 06:50:15 -0400 (Tue, 03 May 2011)
New Revision: 14225
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/common/config/jaxws-endpoint-config.xml
Log:
[JBWS-3282][JBWS-3285] Update EndpointMetaData and configuration testcase to new stack
agnostic configurations
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2011-05-03
10:48:29 UTC (rev 14224)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2011-05-03
10:50:15 UTC (rev 14225)
@@ -64,12 +64,9 @@
import org.jboss.ws.core.jaxws.wsaddressing.NativeEndpointReference;
import org.jboss.ws.core.soap.Style;
import org.jboss.ws.core.soap.Use;
-import org.jboss.ws.extensions.wsrm.config.RMConfig;
-import org.jboss.ws.extensions.wsrm.config.RMPortConfig;
import org.jboss.ws.metadata.accessor.AccessorFactory;
import org.jboss.ws.metadata.accessor.AccessorFactoryCreator;
import org.jboss.ws.metadata.accessor.JAXBAccessorFactoryCreator;
-import org.jboss.ws.metadata.config.CommonConfig;
import org.jboss.ws.metadata.config.Configurable;
import org.jboss.ws.metadata.config.ConfigurationProvider;
import org.jboss.ws.metadata.config.EndpointFeature;
@@ -78,6 +75,7 @@
import org.jboss.wsf.spi.binding.BindingCustomization;
import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+import org.jboss.wsf.spi.metadata.config.CommonConfig;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
@@ -915,62 +913,12 @@
log.debug("Create new config [name=" + configName + ",file="
+ configFile + "]");
JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance(getClassLoader());
- List<RMPortConfig> rmPortMetaData = null;
- if (base != null)
- {
- rmPortMetaData = backupRMMD(base.getConfig());
- }
CommonConfig config = factory.getConfig(getRootFile(), configName, configFile);
- propagateRMMD(rmPortMetaData, config);
toInitialise.setConfig(config);
toInitialise.configHandlerMetaData();
}
- private List<RMPortConfig> backupRMMD(CommonConfig config)
- {
- if ((config != null) && (config.getRMMetaData() != null))
- return config.getRMMetaData().getPorts();
-
- return null;
- }
-
- private void propagateRMMD(List<RMPortConfig> backedUpMD, CommonConfig config)
- {
- if ((backedUpMD != null) && (backedUpMD.size() > 0))
- {
- if (config.getRMMetaData() == null)
- {
- config.setRMMetaData(new RMConfig());
- config.getRMMetaData().getPorts().addAll(backedUpMD);
- }
- else
- {
- // RM policy specified in config file will be always used
- List<RMPortConfig> ports = config.getRMMetaData().getPorts();
- for (RMPortConfig portMD : backedUpMD)
- {
- QName portName = portMD.getPortName();
- if (!contains(ports, portName))
- {
- ports.add(portMD);
- }
- }
- }
- }
- }
-
- private boolean contains(List<RMPortConfig> ports, QName portName)
- {
- for (RMPortConfig pMD : ports)
- {
- if (pMD.getPortName().equals(portName))
- return true;
- }
-
- return false;
- }
-
public List<Class> getRegisteredTypes()
{
return Collections.unmodifiableList(registeredTypes);
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java 2011-05-03
10:48:29 UTC (rev 14224)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java 2011-05-03
10:50:15 UTC (rev 14225)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -22,21 +22,14 @@
package org.jboss.test.ws.common.config;
import java.io.File;
-import java.util.List;
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.extensions.wsrm.config.RMBackPortsServerConfig;
-import org.jboss.ws.extensions.wsrm.config.RMConfig;
-import org.jboss.ws.extensions.wsrm.config.RMDeliveryAssuranceConfig;
-import org.jboss.ws.extensions.wsrm.config.RMMessageRetransmissionConfig;
-import org.jboss.ws.extensions.wsrm.config.RMPortConfig;
import org.jboss.ws.metadata.config.JBossWSConfigFactory;
import org.jboss.ws.metadata.config.jaxrpc.CommonConfigJAXRPC;
import org.jboss.ws.metadata.config.jaxrpc.ConfigRootJAXRPC;
import org.jboss.ws.metadata.config.jaxrpc.EndpointConfigJAXRPC;
-import org.jboss.ws.metadata.config.jaxws.ConfigRootJAXWS;
-import org.jboss.ws.metadata.config.jaxws.EndpointConfigJAXWS;
+import org.jboss.wsf.spi.metadata.config.ConfigRoot;
+import org.jboss.wsf.spi.metadata.config.EndpointConfig;
+import org.jboss.wsf.spi.metadata.config.Feature;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.wsf.test.JBossWSTest;
@@ -83,14 +76,14 @@
assertTrue(confFile.exists());
JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
- ConfigRootJAXWS config = (ConfigRootJAXWS)factory.parse(confFile.toURI().toURL());
+ ConfigRoot config = (ConfigRoot)factory.parse(confFile.toURI().toURL());
assertNotNull("Null config", config);
- EndpointConfigJAXWS epConfig =
(EndpointConfigJAXWS)config.getConfigByName("Standard MTOM Endpoint");
+ EndpointConfig epConfig = (EndpointConfig)config.getConfigByName("Standard
MTOM Endpoint");
assertTrue("Feature not set",
epConfig.hasFeature("http://org.jboss.ws/mtom"));
// disable feature
- epConfig.setFeature("http://org.jboss.ws/mtom", false);
+ epConfig.setFeature(new Feature("http://org.jboss.ws/mtom"), false);
assertFalse("Feature still set",
epConfig.hasFeature("http://org.jboss.ws/mtom"));
}
@@ -116,43 +109,12 @@
assertTrue(confFile.exists());
JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
- ConfigRootJAXWS config = (ConfigRootJAXWS)factory.parse(confFile.toURI().toURL());
+ ConfigRoot config = (ConfigRoot)factory.parse(confFile.toURI().toURL());
assertNotNull("Null config", config);
- EndpointConfigJAXWS epConfig =
(EndpointConfigJAXWS)config.getConfigByName("Standard WSSecurity Endpoint");
+ EndpointConfig epConfig = (EndpointConfig)config.getConfigByName("Standard
WSSecurity Endpoint");
String value =
epConfig.getProperty("http://org.jboss.ws/mtom#threshold");
assertNotNull("Property does not exist", value);
assertEquals("Wrong property valule", value, "5000");
}
-
- public void testWSRMConfiguration() throws Exception
- {
- File confFile =
getResourceFile("common/config/jaxws-endpoint-config.xml");
- assertTrue(confFile.exists());
-
- JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
- ConfigRootJAXWS config = (ConfigRootJAXWS)factory.parse(confFile.toURI().toURL());
- EndpointConfigJAXWS epConfig =
(EndpointConfigJAXWS)config.getConfigByName("Standard WSRM Endpoint");
- RMConfig wsrmConfig = epConfig.getRMMetaData();
- assertNotNull(wsrmConfig);
- RMDeliveryAssuranceConfig deliveryAssurance = wsrmConfig.getDeliveryAssurance();
- assertEquals(deliveryAssurance.getInOrder(), "true");
- assertEquals(deliveryAssurance.getQuality(), "AtLeastOnce");
- List<RMPortConfig> ports = wsrmConfig.getPorts();
- RMPortConfig port1 = ports.get(0);
- assertEquals(port1.getPortName(), new QName("http://custom/namespace/",
"Port1"));
- assertEquals(port1.getDeliveryAssurance().getInOrder(), "false");
- assertEquals(port1.getDeliveryAssurance().getQuality(), "AtMostOnce");
- RMPortConfig port2 = ports.get(1);
- assertEquals(port2.getPortName(), new QName("http://custom/namespace/",
"Port2"));
- assertEquals(port2.getDeliveryAssurance().getInOrder(), "true");
- assertEquals(port2.getDeliveryAssurance().getQuality(), "ExactlyOnce");
- RMBackPortsServerConfig backportsServer = wsrmConfig.getBackPortsServer();
- assertEquals(backportsServer.getHost(), "realhostname.realdomain");
- assertEquals(backportsServer.getPort(), "9999");
- RMMessageRetransmissionConfig messageRetransmission =
wsrmConfig.getMessageRetransmission();
- assertEquals(messageRetransmission.getCountOfAttempts(), 50);
- assertEquals(messageRetransmission.getRetransmissionInterval(), 10);
- assertEquals(messageRetransmission.getMessageTimeout(), 3);
- }
}
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/common/config/jaxws-endpoint-config.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/common/config/jaxws-endpoint-config.xml 2011-05-03
10:48:29 UTC (rev 14224)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/common/config/jaxws-endpoint-config.xml 2011-05-03
10:50:15 UTC (rev 14225)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jaxws-config xmlns="urn:jboss:jaxws-config:2.0"
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xsi:schemaLocation="urn:jboss:jaxws-config:2.0
jaxws-config_2_0.xsd">
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0
jaxws-config_2_0.xsd">
<endpoint-config>
<config-name>Standard Endpoint</config-name>
@@ -12,7 +12,7 @@
<endpoint-config>
<config-name>Standard MTOM Endpoint</config-name>
- <feature>http://org.jboss.ws/mtom</feature>
+
<feature><feature-name>http://org.jboss.ws/mtom</feature-name></feature>
</endpoint-config>
@@ -30,7 +30,7 @@
</javaee:handler-chain>
</pre-handler-chains>
- <feature>http://org.jboss.ws/mtom</feature>
+
<feature><feature-name>http://org.jboss.ws/mtom</feature-name></feature>
<property>
<property-name>http://org.jboss.ws/mtom#threshold</property-name>
@@ -39,21 +39,4 @@
</endpoint-config>
- <endpoint-config>
-
- <config-name>Standard WSRM Endpoint</config-name>
- <reliable-messaging>
- <delivery-assurance inOrder="true"
quality="AtLeastOnce"/>
- <backports-server host="realhostname.realdomain"
port="9999"/>
- <message-retransmission attempts="50" interval="10"
timeout="3"/>
- <port name="{http://custom/namespace/}Port1">
- <delivery-assurance inOrder="false"
quality="AtMostOnce"/>
- </port>
- <port name="{http://custom/namespace/}Port2">
- <delivery-assurance inOrder="true"
quality="ExactlyOnce"/>
- </port>
- </reliable-messaging>
-
- </endpoint-config>
-
</jaxws-config>