Author: jsdelfino
Date: Wed Nov 28 14:59:23 2007
New Revision: 599183
URL: http://svn.apache.org/viewvc?rev=599183&view=rev
Log:
Strawman implementation of the implementation.ejb described in the white paper
at http://www.osoa.org/pages/viewpage.action?pageId=3980
Added:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/
- copied from r598683,
incubator/tuscany/java/sca/modules/implementation-node-xml/
incubator/tuscany/java/sca/modules/implementation-ejb-xml/DISCLAIMER
- copied unchanged from r599180,
incubator/tuscany/java/sca/modules/implementation-node-xml/DISCLAIMER
incubator/tuscany/java/sca/modules/implementation-ejb-xml/LICENSE
- copied unchanged from r599180,
incubator/tuscany/java/sca/modules/implementation-node-xml/LICENSE
incubator/tuscany/java/sca/modules/implementation-ejb-xml/NOTICE
- copied unchanged from r599180,
incubator/tuscany/java/sca/modules/implementation-node-xml/NOTICE
incubator/tuscany/java/sca/modules/implementation-ejb-xml/pom.xml
- copied, changed from r599180,
incubator/tuscany/java/sca/modules/implementation-node-xml/pom.xml
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/
- copied from r599180,
incubator/tuscany/java/sca/modules/implementation-node-xml/src/
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java
(with props)
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/ReadTestCase.java
(with props)
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java
(with props)
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/resources/org/apache/tuscany/sca/implementation/ejb/
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/resources/org/apache/tuscany/sca/implementation/ejb/xml/
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/resources/org/apache/tuscany/sca/implementation/ejb/xml/TestEJB.composite
(with props)
Removed:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/node/
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/resources/org/apache/tuscany/sca/implementation/node/
Modified:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
Copied: incubator/tuscany/java/sca/modules/implementation-ejb-xml/pom.xml (from
r599180, incubator/tuscany/java/sca/modules/implementation-node-xml/pom.xml)
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-ejb-xml/pom.xml?p2=incubator/tuscany/java/sca/modules/implementation-ejb-xml/pom.xml&p1=incubator/tuscany/java/sca/modules/implementation-node-xml/pom.xml&r1=599180&r2=599183&rev=599183&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-node-xml/pom.xml
(original)
+++ incubator/tuscany/java/sca/modules/implementation-ejb-xml/pom.xml Wed Nov
28 14:59:23 2007
@@ -26,13 +26,13 @@
<relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>tuscany-implementation-node-xml</artifactId>
- <name>Apache Tuscany Node Implementation XML Model</name>
+ <artifactId>tuscany-implementation-ejb-xml</artifactId>
+ <name>Apache Tuscany EJB Session Bean Implementation XML Model</name>
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-node</artifactId>
+ <artifactId>tuscany-implementation-ejb</artifactId>
<version>1.1-incubating-SNAPSHOT</version>
</dependency>
Added:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java?rev=599183&view=auto
==============================================================================
---
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java
(added)
+++
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java
Wed Nov 28 14:59:23 2007
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.ejb.xml;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.service.ContributionReadException;
+import
org.apache.tuscany.sca.contribution.service.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.implementation.ejb.EJBImplementation;
+import org.apache.tuscany.sca.implementation.ejb.EJBImplementationFactory;
+
+
+/**
+ * Implements a STAX artifact processor for EJB implementations.
+ */
+public class EJBImplementationProcessor extends BaseStAXArtifactProcessor
implements StAXArtifactProcessor<EJBImplementation> {
+ private static final QName IMPLEMENTATION_EJB = new
QName(Constants.SCA10_NS, "implementation.ejb");
+
+ private AssemblyFactory assemblyFactory;
+ private EJBImplementationFactory implementationFactory;
+
+ public EJBImplementationProcessor(ModelFactoryExtensionPoint
modelFactories) {
+ assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
+ implementationFactory =
modelFactories.getFactory(EJBImplementationFactory.class);
+ }
+
+ public QName getArtifactType() {
+ // Returns the qname of the XML element processed by this processor
+ return IMPLEMENTATION_EJB;
+ }
+
+ public Class<EJBImplementation> getModelType() {
+ // Returns the type of model processed by this processor
+ return EJBImplementation.class;
+ }
+
+ public EJBImplementation read(XMLStreamReader reader) throws
ContributionReadException, XMLStreamException {
+
+ // Read an <implementation.ejb> element
+ EJBImplementation implementation =
implementationFactory.createEJBImplementation();
+ implementation.setUnresolved(true);
+
+ // Read the ejb-link attribute
+ String ejbLink = getString(reader, "ejb-link");
+ if (ejbLink != null) {
+ implementation.setEJBLink(ejbLink);
+
+ // Set the URI of the component type
+ implementation.setURI(ejbLink.replace('#', '/'));
+ }
+
+ // Skip to end element
+ while (reader.hasNext()) {
+ if (reader.next() == END_ELEMENT &&
IMPLEMENTATION_EJB.equals(reader.getName())) {
+ break;
+ }
+ }
+
+ return implementation;
+ }
+
+ public void resolve(EJBImplementation implementation, ModelResolver
resolver) throws ContributionResolveException {
+
+ // Resolve the component type
+ String uri = implementation.getURI();
+ if (uri != null) {
+ ComponentType componentType =
assemblyFactory.createComponentType();
+ componentType.setURI(uri + ".componentType");
+ componentType = resolver.resolveModel(ComponentType.class,
componentType);
+ if (!componentType.isUnresolved()) {
+
+ // Initialize the implementation's services, references and
properties
+
implementation.getServices().addAll(componentType.getServices());
+
implementation.getReferences().addAll(componentType.getReferences());
+
implementation.getProperties().addAll(componentType.getProperties());
+ }
+ }
+ implementation.setUnresolved(false);
+ }
+
+ public void write(EJBImplementation implementation, XMLStreamWriter
writer) throws ContributionWriteException, XMLStreamException {
+
+ // Write <implementation.ejb>
+ writeStart(writer, IMPLEMENTATION_EJB.getNamespaceURI(),
IMPLEMENTATION_EJB.getLocalPart(),
+ new XAttr("ejb-link",
implementation.getEJBLink()));
+
+ writeEnd(writer);
+ }
+}
Propchange:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor?rev=599183&r1=599180&r2=599183&view=diff
==============================================================================
---
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
(original)
+++
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
Wed Nov 28 14:59:23 2007
@@ -16,4 +16,4 @@
# under the License.
# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.implementation.node.xml.NodeImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#implementation.node,model=org.apache.tuscany.sca.implementation.node.NodeImplementation,factory=org.apache.tuscany.sca.implementation.node.NodeImplementationFactory
+org.apache.tuscany.sca.implementation.ejb.xml.EJBImplementationProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#implementation.ejb,model=org.apache.tuscany.sca.implementation.ejb.EJBImplementation,factory=org.apache.tuscany.sca.implementation.ejb.EJBImplementationFactory
Added:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/ReadTestCase.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/ReadTestCase.java?rev=599183&view=auto
==============================================================================
---
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/ReadTestCase.java
(added)
+++
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/ReadTestCase.java
Wed Nov 28 14:59:23 2007
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.ejb.xml;
+
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
+import org.apache.tuscany.sca.assembly.SCABindingFactory;
+import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl;
+import org.apache.tuscany.sca.assembly.xml.CompositeProcessor;
+import org.apache.tuscany.sca.binding.sca.impl.SCABindingFactoryImpl;
+import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.impl.ContributionFactoryImpl;
+import
org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import
org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.implementation.ejb.EJBImplementation;
+import org.apache.tuscany.sca.implementation.ejb.EJBImplementationFactory;
+import
org.apache.tuscany.sca.implementation.ejb.impl.EJBImplementationFactoryImpl;
+import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
+import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl;
+import org.apache.tuscany.sca.policy.DefaultIntentAttachPointTypeFactory;
+import org.apache.tuscany.sca.policy.DefaultPolicyFactory;
+import org.apache.tuscany.sca.policy.PolicyFactory;
+
+/**
+ * Test reading Node implementations.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ReadTestCase extends TestCase {
+
+ XMLInputFactory inputFactory;
+ DefaultStAXArtifactProcessorExtensionPoint staxProcessors;
+ ExtensibleStAXArtifactProcessor staxProcessor;
+ private AssemblyFactory assemblyFactory;
+ private SCABindingFactory scaBindingFactory;
+ private PolicyFactory policyFactory;
+ private InterfaceContractMapper mapper;
+
+ @Override
+ public void setUp() throws Exception {
+ ModelFactoryExtensionPoint factories = new
DefaultModelFactoryExtensionPoint();
+ assemblyFactory = new DefaultAssemblyFactory();
+ factories.addFactory(assemblyFactory);
+ scaBindingFactory = new SCABindingFactoryImpl();
+ factories.addFactory(scaBindingFactory);
+ policyFactory = new DefaultPolicyFactory();
+ factories.addFactory(policyFactory);
+ mapper = new InterfaceContractMapperImpl();
+ inputFactory = XMLInputFactory.newInstance();
+ staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(new
DefaultModelFactoryExtensionPoint());
+ staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors,
XMLInputFactory.newInstance(), XMLOutputFactory.newInstance());
+
+ EJBImplementationFactory nodeFactory = new
EJBImplementationFactoryImpl();
+ factories.addFactory(nodeFactory);
+
+ EJBImplementationProcessor ejbProcessor = new
EJBImplementationProcessor(factories);
+ staxProcessors.addArtifactProcessor(ejbProcessor);
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ }
+
+ public void testReadComposite() throws Exception {
+ CompositeProcessor compositeProcessor = new CompositeProcessor(new
ContributionFactoryImpl(), assemblyFactory, policyFactory, mapper,
staxProcessor);
+ InputStream is = getClass().getResourceAsStream("TestEJB.composite");
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
+ Composite composite = compositeProcessor.read(reader);
+ assertNotNull(composite);
+
+ CompositeBuilderImpl compositeUtil = new
CompositeBuilderImpl(assemblyFactory, scaBindingFactory, new
DefaultIntentAttachPointTypeFactory(), mapper, null, null);
+ compositeUtil.build(composite);
+
+
assertTrue(((EJBImplementation)composite.getComponents().get(0).getImplementation()).getEJBLink().equals("module.jar#TestEJB"));
+ }
+
+}
Propchange:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/ReadTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/ReadTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java?rev=599183&view=auto
==============================================================================
---
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java
(added)
+++
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java
Wed Nov 28 14:59:23 2007
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.ejb.xml;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
+import org.apache.tuscany.sca.assembly.xml.ComponentTypeProcessor;
+import org.apache.tuscany.sca.assembly.xml.CompositeProcessor;
+import org.apache.tuscany.sca.assembly.xml.ConstrainingTypeProcessor;
+import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.impl.ContributionFactoryImpl;
+import
org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import
org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.implementation.ejb.EJBImplementationFactory;
+import
org.apache.tuscany.sca.implementation.ejb.impl.EJBImplementationFactoryImpl;
+import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
+import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl;
+import org.apache.tuscany.sca.policy.DefaultPolicyFactory;
+import org.apache.tuscany.sca.policy.PolicyFactory;
+
+/**
+ * Test reading/write WSDL interfaces.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WriteTestCase extends TestCase {
+
+ XMLInputFactory inputFactory;
+ DefaultStAXArtifactProcessorExtensionPoint staxProcessors;
+ ExtensibleStAXArtifactProcessor staxProcessor;
+ private AssemblyFactory factory;
+ private PolicyFactory policyFactory;
+ private InterfaceContractMapper mapper;
+
+ @Override
+ public void setUp() throws Exception {
+ ModelFactoryExtensionPoint factories = new
DefaultModelFactoryExtensionPoint();
+ factory = new DefaultAssemblyFactory();
+ factories.addFactory(factory);
+ policyFactory = new DefaultPolicyFactory();
+ factories.addFactory(policyFactory);
+
+ mapper = new InterfaceContractMapperImpl();
+ inputFactory = XMLInputFactory.newInstance();
+ staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(new
DefaultModelFactoryExtensionPoint());
+ staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors,
XMLInputFactory.newInstance(), XMLOutputFactory.newInstance());
+
+ EJBImplementationFactory nodeFactory = new
EJBImplementationFactoryImpl();
+ factories.addFactory(nodeFactory);
+
+ staxProcessors.addArtifactProcessor(new CompositeProcessor(new
ContributionFactoryImpl(), factory, policyFactory, mapper, staxProcessor));
+ staxProcessors.addArtifactProcessor(new
ComponentTypeProcessor(factory, policyFactory, staxProcessor));
+ staxProcessors.addArtifactProcessor(new
ConstrainingTypeProcessor(factory, policyFactory, staxProcessor));
+
+ EJBImplementationProcessor ejbProcessor = new
EJBImplementationProcessor(factories);
+ staxProcessors.addArtifactProcessor(ejbProcessor);
+
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ }
+
+ public void testReadWriteComposite() throws Exception {
+ InputStream is = getClass().getResourceAsStream("TestEJB.composite");
+ Composite composite = staxProcessor.read(is, Composite.class);
+ assertNotNull(composite);
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ staxProcessor.write(composite, bos);
+
+ assertTrue(bos.toString().contains("module.jar#TestEJB"));
+
+ }
+
+}
Propchange:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/resources/org/apache/tuscany/sca/implementation/ejb/xml/TestEJB.composite
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/resources/org/apache/tuscany/sca/implementation/ejb/xml/TestEJB.composite?rev=599183&view=auto
==============================================================================
---
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/resources/org/apache/tuscany/sca/implementation/ejb/xml/TestEJB.composite
(added)
+++
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/resources/org/apache/tuscany/sca/implementation/ejb/xml/TestEJB.composite
Wed Nov 28 14:59:23 2007
@@ -0,0 +1,29 @@
+<?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
+ * "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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample/ejb"
+ xmlns:sc="http://sample/composite"
+ name="TestEJB">
+
+ <component name="TestEJB">
+ <implementation.ejb ejb-link="module.jar#TestEJB"/>
+ </component>
+
+</composite>
Propchange:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/resources/org/apache/tuscany/sca/implementation/ejb/xml/TestEJB.composite
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/java/sca/modules/implementation-ejb-xml/src/test/resources/org/apache/tuscany/sca/implementation/ejb/xml/TestEJB.composite
------------------------------------------------------------------------------
svn:keywords = Rev Date
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]