diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-12-18 17:55:54 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-12-18 17:55:54 +0000 |
commit | 1d9d90639d2b679dc82443dd1b2011effc34261b (patch) | |
tree | fb450853240b387a97adc63f461c836c01f1b430 /sca-java-2.x/trunk/modules/contribution/src/test | |
parent | c49527a54252db75c7498b786a736b86e56f8572 (diff) |
TUSCANY-3397 - Adding support for identifying the sca spec version used for contribution metadata being read
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@892324 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/contribution/src/test')
-rw-r--r-- | sca-java-2.x/trunk/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessorTestCase.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessorTestCase.java b/sca-java-2.x/trunk/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessorTestCase.java index a4aa564392..de6a8ac151 100644 --- a/sca-java-2.x/trunk/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessorTestCase.java +++ b/sca-java-2.x/trunk/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataProcessorTestCase.java @@ -50,6 +50,7 @@ import org.junit.Test; */ public class ContributionMetadataProcessorTestCase { + private static final String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200912"; private static final String VALID_XML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<contribution xmlns=\"http://docs.oasis-open.org/ns/opencsa/sca/200912\"" @@ -64,7 +65,7 @@ public class ContributionMetadataProcessorTestCase { + "<deployable composite=\"ns:Composite1\"/>" + "<deployable/>" + "</contribution>"; - + private static XMLInputFactory inputFactory; private static XMLOutputFactory outputFactory; private static StAXArtifactProcessor<Object> staxProcessor; @@ -110,6 +111,14 @@ public class ContributionMetadataProcessorTestCase { } @Test + public void testReadSpecVersion() throws Exception { + XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(VALID_XML)); + ContributionMetadata contribution = (ContributionMetadata)staxProcessor.read(reader, context); + assertNotNull(contribution); + assertEquals(SCA11_NS, contribution.getSpecVersion()); + } + + @Test public void testWrite() throws Exception { XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(VALID_XML)); ContributionMetadata contribution = (ContributionMetadata)staxProcessor.read(reader, context); |