summaryrefslogtreecommitdiffstats
path: root/branches
diff options
context:
space:
mode:
authorramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68>2009-07-03 10:48:57 +0000
committerramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68>2009-07-03 10:48:57 +0000
commiteec6912ddff319e4992a19064c470a4fdad1542b (patch)
tree12c475e70c205b7892df76a0e1ff0ba7c16b7695 /branches
parent4304fe60d1b2ab465f486c0a93c1e7d9761757ed (diff)
Updated fixes for TUSCANY-3069
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@790853 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches')
-rw-r--r--branches/sca-java-1.x/itest/spring/src/test/java/context/multiple/MultipleContextTestCase.java3
-rw-r--r--branches/sca-java-1.x/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java1
-rw-r--r--branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java40
3 files changed, 19 insertions, 25 deletions
diff --git a/branches/sca-java-1.x/itest/spring/src/test/java/context/multiple/MultipleContextTestCase.java b/branches/sca-java-1.x/itest/spring/src/test/java/context/multiple/MultipleContextTestCase.java
index 3ea2d0c207..75b296bf32 100644
--- a/branches/sca-java-1.x/itest/spring/src/test/java/context/multiple/MultipleContextTestCase.java
+++ b/branches/sca-java-1.x/itest/spring/src/test/java/context/multiple/MultipleContextTestCase.java
@@ -19,12 +19,11 @@
package context.multiple;
import junit.framework.TestCase;
-import org.junit.Ignore;
+
/**
* Tests out the big bank service
*
*/
-@Ignore("TUSCANY-3069")
public class MultipleContextTestCase extends TestCase {
public void testServer() throws Exception {
diff --git a/branches/sca-java-1.x/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java b/branches/sca-java-1.x/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java
index e9fc938d7c..a2698cf9a3 100644
--- a/branches/sca-java-1.x/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java
+++ b/branches/sca-java-1.x/itest/spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java
@@ -50,7 +50,6 @@ public abstract class AbstractSCATestCase<T> extends TestCase {
@Override
protected void setUp() throws Exception {
domain = SCADomain.newInstance("http://localhost", contributionLocation, compositeName);
- //domain = SCADomain.newInstance(getCompositeName());
service = domain.getService(getServiceClass(), "ClientComponent");
}
diff --git a/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java b/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
index f250db1631..5961c52cc4 100644
--- a/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
+++ b/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
@@ -38,7 +38,6 @@ import org.springframework.beans.factory.config.ConstructorArgumentValues;
import org.springframework.beans.factory.config.TypedStringValue;
import org.springframework.beans.factory.support.ManagedList;
import org.springframework.beans.factory.xml.XmlBeanFactory;
-import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
@@ -103,33 +102,30 @@ public class SpringContextTie {
if (beanClassName.indexOf(".ClassPathXmlApplicationContext") != -1) {
BeanDefinition beanDef = beanFactory.getBeanDefinition(bean);
- String[] listValues = null;
+ String[] configLocations = null;
List<ConstructorArgumentValues.ValueHolder> conArgs =
beanDef.getConstructorArgumentValues().getGenericArgumentValues();
for (ConstructorArgumentValues.ValueHolder conArg : conArgs) {
- if (conArg.getValue() instanceof TypedStringValue) {
- TypedStringValue value = (TypedStringValue) conArg.getValue();
- if (value.getValue().indexOf(".xml") != -1)
- listValues = new String[]{value.getValue()};
- }
- if (conArg.getValue() instanceof ManagedList) {
- Iterator itml = ((ManagedList)conArg.getValue()).iterator();
- StringBuffer values = new StringBuffer();
- while (itml.hasNext()) {
- TypedStringValue next = (TypedStringValue)itml.next();
- if (next.getValue().indexOf(".xml") != -1) {
- values.append(next.getValue());
- values.append("~");
- }
- }
- listValues = (values.toString()).split("~");
+ if (conArg.getValue() instanceof TypedStringValue) {
+ TypedStringValue value = (TypedStringValue) conArg.getValue();
+ if (value.getValue().indexOf(".xml") != -1)
+ configLocations = new String[]{value.getValue()};
+ }
+ if (conArg.getValue() instanceof ManagedList) {
+ Iterator itml = ((ManagedList)conArg.getValue()).iterator();
+ StringBuffer values = new StringBuffer();
+ while (itml.hasNext()) {
+ TypedStringValue next = (TypedStringValue)itml.next();
+ if (next.getValue().indexOf(".xml") != -1) {
+ values.append(implementation.getClassLoader().getResource(next.getValue()).toString());
+ values.append("~");
+ }
}
+ configLocations = (values.toString()).split("~");
+ }
}
- appContext = new ClassPathXmlApplicationContext(listValues, false, scaParentContext);
- appContext.setClassLoader(implementation.getClassLoader());
- appContext.refresh();
- //appContext.getBeanFactory().setBeanClassLoader(implementation.getClassLoader());
+ appContext = new ClassPathXmlApplicationContext(configLocations, true, scaParentContext);
if (isAnnotationSupported)
includeAnnotationProcessors(appContext.getBeanFactory());
return appContext;