summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'branches/sca-java-1.x/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java')
-rw-r--r--branches/sca-java-1.x/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java26
1 files changed, 15 insertions, 11 deletions
diff --git a/branches/sca-java-1.x/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java b/branches/sca-java-1.x/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java
index 1f508d6a4a..5e213e3729 100644
--- a/branches/sca-java-1.x/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java
+++ b/branches/sca-java-1.x/modules/contribution-namespace/src/test/java/org/apache/tuscany/sca/contribution/namespace/impl/NamespaceExportProcessorTestCase.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.contribution.namespace.impl;
@@ -41,17 +41,19 @@ import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
/**
* Test NamespaceExportProcessorTestCase
- *
+ *
* @version $Rev$ $Date$
*/
public class NamespaceExportProcessorTestCase extends TestCase {
private static final String VALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
- + "<export xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\" namespace=\"http://foo\"/>";
+ "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
+ + "<export xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\""
+ + " ns:ext=\"extended\" namespace=\"http://foo\">"
+ + "<ns:foo/></export>";
private static final String INVALID_XML =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
+ "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
+ "<export xmlns=\"http://www.osoa.org/xmlns/sca/1.0\" xmlns:ns=\"http://ns\"/>";
private XMLInputFactory inputFactory;
@@ -64,11 +66,11 @@ public class NamespaceExportProcessorTestCase extends TestCase {
inputFactory = XMLInputFactory.newInstance();
// Create a monitor
UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl();
+ MonitorFactory monitorFactory = new DefaultMonitorFactoryImpl();
if (monitorFactory != null) {
monitor = monitorFactory.createMonitor();
utilities.addUtility(monitorFactory);
- }
+ }
StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, monitor);
}
@@ -81,6 +83,8 @@ public class NamespaceExportProcessorTestCase extends TestCase {
XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(VALID_XML));
NamespaceExport namespaceExport = (NamespaceExport)staxProcessor.read(reader);
assertEquals("http://foo", namespaceExport.getNamespace());
+ assertEquals(1, namespaceExport.getAttributeExtensions().size());
+ assertEquals(1, namespaceExport.getExtensions().size());
}
/**
@@ -96,8 +100,8 @@ public class NamespaceExportProcessorTestCase extends TestCase {
assertTrue(true);
}*/
staxProcessor.read(reader);
- Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+ Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
assertNotNull(problem);
assertEquals("AttributeNameSpaceMissing", problem.getMessageId());
- }
+ }
}