You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2008/06/08 07:39:57 UTC
svn commit: r664449 - in /incubator/tuscany/java/sca:
itest/properties/src/main/java/org/apache/tuscany/sca/itest/
itest/properties/src/main/java/test/
itest/properties/src/main/java/test/jaxb/
itest/properties/src/main/java/test/jaxb/props/ itest/prop...
Author: rfeng
Date: Sat Jun 7 22:39:57 2008
New Revision: 664449
URL: http://svn.apache.org/viewvc?rev=664449&view=rev
Log:
Apply the patch (itest) from Scott for TUSCANY-2377. I fix the problem per Scott's discovering of the issue
Added:
incubator/tuscany/java/sca/itest/properties/src/main/java/test/
incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/
incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/
incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java (with props)
incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java (with props)
incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/package-info.java (with props)
incubator/tuscany/java/sca/itest/properties/src/main/resources/rcProps.txt (with props)
incubator/tuscany/java/sca/itest/properties/src/main/resources/rcprops.xsd (with props)
Modified:
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
incubator/tuscany/java/sca/itest/properties/src/main/resources/PropertyTest.composite
incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyConfigurationUtil.java
Modified: incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java?rev=664449&r1=664448&r2=664449&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java Sat Jun 7 22:39:57 2008
@@ -23,6 +23,7 @@
import commonj.sdo.DataObject;
+import test.jaxb.props.ReturnCodeProperties;
/**
* It is an Interface which has method declarations. Methods which are to be accessed as a service are declared in this
* interface. Implementation for these methods is provided in PropertyComponentImpl Class
@@ -114,7 +115,20 @@
public DataObject getCustomerSdo();
/**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public ReturnCodeProperties getComplexJAXBPropertyOne();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public ReturnCodeProperties getComplexJAXBPropertyTwo();
+
+ /**
* @return
*/
public String getLocationFromComponentContext();
+
}
Modified: incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java?rev=664449&r1=664448&r2=664449&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java Sat Jun 7 22:39:57 2008
@@ -28,6 +28,8 @@
import com.example.customer.sdo.impl.CustomerImpl;
import commonj.sdo.DataObject;
+import test.jaxb.props.ReturnCodeProperties;
+
/**
* This class Implements the interface PropertyComponent and gives implementation for all methods which are declared in
* that interface.
@@ -75,6 +77,12 @@
@Property(name = "sdoArray")
protected DataObject[] sdoArray;
+ @Property
+ protected ReturnCodeProperties complexJAXBPropertyOne;
+
+ @Property
+ protected ReturnCodeProperties complexJAXBPropertyTwo;
+
public String getLocation() {
return location;
}
@@ -169,4 +177,12 @@
public String getLocationFromComponentContext() {
return context.getProperty(String.class, "location");
}
+
+ public ReturnCodeProperties getComplexJAXBPropertyOne() {
+ return complexJAXBPropertyOne;
+ }
+
+ public ReturnCodeProperties getComplexJAXBPropertyTwo() {
+ return complexJAXBPropertyTwo;
+ }
}
Added: incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java?rev=664449&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java (added)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java Sat Jun 7 22:39:57 2008
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.06.07 at 03:30:47 PM EDT
+//
+
+
+package test.jaxb.props;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the test.jaxb.props package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _MyRCProps_QNAME = new QName("http://test.sca.jaxb/rcprops", "MyRCProps");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: test.jaxb.props
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link ReturnCodeProperties }
+ *
+ */
+ public ReturnCodeProperties createReturnCodeProperties() {
+ return new ReturnCodeProperties();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link ReturnCodeProperties }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://test.sca.jaxb/rcprops", name = "MyRCProps")
+ public JAXBElement<ReturnCodeProperties> createMyRCProps(ReturnCodeProperties value) {
+ return new JAXBElement<ReturnCodeProperties>(_MyRCProps_QNAME, ReturnCodeProperties.class, null, value);
+ }
+
+}
Propchange: incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java?rev=664449&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java (added)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java Sat Jun 7 22:39:57 2008
@@ -0,0 +1,109 @@
+/*
+ * 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.
+ */
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.06.07 at 03:30:47 PM EDT
+//
+
+
+package test.jaxb.props;
+
+import java.math.BigInteger;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for ReturnCodeProperties complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="ReturnCodeProperties">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="AInt" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * <element name="BInteger" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ReturnCodeProperties", namespace = "http://test.sca.jaxb/rcprops", propOrder = {
+ "a",
+ "b"
+})
+public class ReturnCodeProperties {
+
+ @XmlElement(name = "AInt")
+ protected int a;
+ @XmlElement(name = "BInteger", required = true)
+ protected BigInteger b;
+
+ /**
+ * Gets the value of the a property.
+ *
+ */
+ public int getA() {
+ return a;
+ }
+
+ /**
+ * Sets the value of the a property.
+ *
+ */
+ public void setA(int value) {
+ this.a = value;
+ }
+
+ /**
+ * Gets the value of the b property.
+ *
+ * @return
+ * possible object is
+ * {@link BigInteger }
+ *
+ */
+ public BigInteger getB() {
+ return b;
+ }
+
+ /**
+ * Sets the value of the b property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigInteger }
+ *
+ */
+ public void setB(BigInteger value) {
+ this.b = value;
+ }
+
+}
Propchange: incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/package-info.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/package-info.java?rev=664449&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/package-info.java (added)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/package-info.java Sat Jun 7 22:39:57 2008
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.06.07 at 03:30:47 PM EDT
+//
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://test.sca.jaxb/rcprops", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package test.jaxb.props;
Propchange: incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/itest/properties/src/main/java/test/jaxb/props/package-info.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sca/itest/properties/src/main/resources/PropertyTest.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/resources/PropertyTest.composite?rev=664449&r1=664448&r2=664449&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/resources/PropertyTest.composite (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/resources/PropertyTest.composite Sat Jun 7 22:39:57 2008
@@ -21,6 +21,7 @@
xmlns:cust="http://www.example.com/Customer"
xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:rcp="http://test.sca.jaxb/rcprops"
targetNamespace="http://foo"
name="PropertyTest"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
@@ -241,6 +242,13 @@
<cust:lastName>Lasting Name 3</cust:lastName>
</cust:customer>
</property>
+ <property name="complexJAXBPropertyOne" type="rcp:ReturnCodeProperties">
+ <MyRCProps xmlns="http://test.sca.jaxb/rcprops">
+ <AInt>10</AInt>
+ <BInteger>10</BInteger>
+ </MyRCProps>
+ </property>
+ <property name="complexJAXBPropertyTwo" type="rcp:ReturnCodeProperties" file="rcProps.txt"/>
</component>
</composite>
Added: incubator/tuscany/java/sca/itest/properties/src/main/resources/rcProps.txt
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/resources/rcProps.txt?rev=664449&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/resources/rcProps.txt (added)
+++ incubator/tuscany/java/sca/itest/properties/src/main/resources/rcProps.txt Sat Jun 7 22:39:57 2008
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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
+ * 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.
+-->
+<MyRCProps xmlns="http://test.sca.jaxb/rcprops">
+ <AInt>20</AInt>
+ <BInteger>20</BInteger>
+</MyRCProps>
Propchange: incubator/tuscany/java/sca/itest/properties/src/main/resources/rcProps.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/tuscany/java/sca/itest/properties/src/main/resources/rcprops.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/resources/rcprops.xsd?rev=664449&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/resources/rcprops.xsd (added)
+++ incubator/tuscany/java/sca/itest/properties/src/main/resources/rcprops.xsd Sat Jun 7 22:39:57 2008
@@ -0,0 +1,55 @@
+<!--
+ * 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
+ * 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.
+-->
+<schema elementFormDefault="qualified" targetNamespace="http://test.sca.jaxb/rcprops"
+ xmlns:tns="http://test.sca.jaxb/rcprops" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"
+ xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+
+ <!-- Use some JAXB customizations -->
+
+ <annotation>
+ <appinfo>
+ <jaxb:schemaBindings>
+ <jaxb:package name="test.jaxb.props" />
+ </jaxb:schemaBindings>
+ </appinfo>
+ </annotation>
+
+ <element name="MyRCProps" type="tns:ReturnCodeProperties" />
+
+ <complexType name="ReturnCodeProperties">
+ <sequence>
+ <element name="AInt" type="xsd:int">
+ <annotation>
+ <appinfo>
+ <jaxb:property name="a" />
+ </appinfo>
+ </annotation>
+ </element>
+ <element name="BInteger" type="xsd:integer">
+ <annotation>
+ <appinfo>
+ <jaxb:property name="b" />
+ </appinfo>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+</schema>
+
+
Propchange: incubator/tuscany/java/sca/itest/properties/src/main/resources/rcprops.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/itest/properties/src/main/resources/rcprops.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java?rev=664449&r1=664448&r2=664449&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java Sat Jun 7 22:39:57 2008
@@ -25,6 +25,8 @@
import java.util.Arrays;
import java.util.Iterator;
+import java.math.BigInteger;
+
import junit.framework.Assert;
import org.apache.tuscany.sca.host.embedded.SCADomain;
@@ -32,6 +34,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
+import test.jaxb.props.ReturnCodeProperties;
import commonj.sdo.DataObject;
/**
@@ -46,6 +49,8 @@
private static ABCDComponent abcdService;
private static PropertyComponent propertyService;
+
+
/**
* Method annotated with
*
@@ -363,6 +368,7 @@
assertEquals("Sdo Middler Name", dataObject.getString("middleName"));
assertEquals("Sdo Lasting Name", dataObject.getString("lastName"));
}
+
@Test
public void testGetLocationFromComponentContext() {
@@ -413,6 +419,22 @@
}
}
+ @Test
+ public void testComplexJAXBProperty() {
+ ReturnCodeProperties rc = propertyService.getComplexJAXBPropertyOne();
+ assertEquals(10, rc.getA());
+ assertEquals(new BigInteger("10"), rc.getB());
+ }
+
+ @Test
+ public void testComplexJAXBPropertyFromFile() {
+ ReturnCodeProperties rc = propertyService.getComplexJAXBPropertyTwo();
+ System.out.println("SKSK: a =" + rc.getA());
+ System.out.println("SKSK: b =" + rc.getB());
+ assertEquals(20, rc.getA());
+ assertEquals(new BigInteger("20"), rc.getB());
+ }
+
/**
* Method annotated with
*
Modified: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyConfigurationUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyConfigurationUtil.java?rev=664449&r1=664448&r2=664449&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyConfigurationUtil.java (original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyConfigurationUtil.java Sat Jun 7 22:39:57 2008
@@ -48,6 +48,7 @@
import org.apache.tuscany.sca.assembly.Property;
import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
import org.w3c.dom.Document;
+import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
@@ -98,7 +99,14 @@
javax.xml.transform.Transformer transformer = TRANSFORMER_FACTORY.newTransformer();
transformer.transform(streamSource, result);
- return (Document)result.getNode();
+ Document document = (Document)result.getNode();
+
+ // TUSCANY-2377, Add a fake value element so it's consistent with
+ // the DOM tree loaded from inside SCDL
+ Element root = document.createElementNS(null, "value");
+ root.appendChild(document.getDocumentElement());
+ document.appendChild(root);
+ return document;
} finally {
if (is != null) {
is.close();