diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-05-19 00:53:52 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-05-19 00:53:52 +0000 |
commit | d683dc4b30c79348b5e73f0f11b1cfd8ce4b9812 (patch) | |
tree | 3b64741b708c3e13a6a301f7df21bec070547bfc /sca-java-2.x/trunk/modules/databinding/src/test/java | |
parent | a0bfd24b7af22df3174e1c1e4e6d2eb913f41d2f (diff) |
Merge branch 'jaxrs' into trunk
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@945980 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/databinding/src/test/java')
5 files changed, 19 insertions, 12 deletions
diff --git a/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/MediatorImplTestCase.java b/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/MediatorImplTestCase.java index a74a8e5550..953e539dd1 100644 --- a/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/MediatorImplTestCase.java +++ b/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/MediatorImplTestCase.java @@ -87,8 +87,8 @@ public class MediatorImplTestCase { registry.addTransformer(new String2SAX(), true); registry.addTransformer(new SAX2DOMPipe(extensionPointRegistry), true); - registry.addTransformer(new Node2String(), true); - registry.addTransformer(new Node2Writer(), true); + registry.addTransformer(new Node2String(extensionPointRegistry), true); + registry.addTransformer(new Node2Writer(extensionPointRegistry), true); mediator = new MediatorImpl(dataBindingRegistry, registry); } diff --git a/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DataPipeTestCase.java b/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DataPipeTestCase.java index 682fbd4243..da18a4f89c 100644 --- a/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DataPipeTestCase.java +++ b/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DataPipeTestCase.java @@ -27,6 +27,7 @@ import java.io.Writer; import org.apache.tuscany.sca.common.xml.dom.DOMHelper; import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.databinding.DataPipe; import org.apache.tuscany.sca.databinding.DataPipeTransformer; import org.apache.tuscany.sca.databinding.impl.PipedTransformer; @@ -76,11 +77,12 @@ public class DataPipeTestCase { @Test public final void testPiped() throws Exception { - Node2Writer node2Writer = new Node2Writer(); + ExtensionPointRegistry registry = new DefaultExtensionPointRegistry(); + Node2Writer node2Writer = new Node2Writer(registry); Writer2ReaderDataPipe pipe = new Writer2ReaderDataPipe(); PipedTransformer<Node, Writer, Reader> transformer = new PipedTransformer<Node, Writer, Reader>(node2Writer, pipe); - Document document = DOMHelper.getInstance(new DefaultExtensionPointRegistry()).newDocument(); + Document document = DOMHelper.getInstance(registry).newDocument(); Element element = document.createElementNS("http://ns1", "root"); document.appendChild(element); Reader reader = transformer.transform(document, null); diff --git a/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/Node2StringTestCase.java b/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/Node2StringTestCase.java index 516b57c851..75c43dbf79 100644 --- a/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/Node2StringTestCase.java +++ b/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/Node2StringTestCase.java @@ -20,6 +20,7 @@ package org.apache.tuscany.sca.databinding.xml; import org.apache.tuscany.sca.common.xml.dom.DOMHelper; import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.junit.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -32,10 +33,11 @@ public class Node2StringTestCase { @Test public void testTransformation() throws Exception { - Document document = DOMHelper.getInstance(new DefaultExtensionPointRegistry()).newDocument(); + ExtensionPointRegistry registry = new DefaultExtensionPointRegistry(); + Document document = DOMHelper.getInstance(registry).newDocument(); Element element = document.createElementNS("http://ns1", "test"); document.appendChild(element); - new Node2String().transform(document, null); + new Node2String(registry).transform(document, null); } } diff --git a/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/PushTransformationTestCase.java b/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/PushTransformationTestCase.java index a8657a5be8..5027f64f01 100644 --- a/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/PushTransformationTestCase.java +++ b/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/PushTransformationTestCase.java @@ -73,7 +73,7 @@ public class PushTransformationTestCase { new PipedTransformer<XMLStreamReader, ContentHandler, Node>(t2, new SAX2DOMPipe(registry)); Node node = t3.transform(reader, null); Assert.assertNotNull(node); - Node2String t4 = new Node2String(); + Node2String t4 = new Node2String(registry); String xml = t4.transform(node, null); Assert.assertTrue(xml != null && xml.indexOf("<shipDate>1999-12-05</shipDate>") != -1); } diff --git a/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/TraxTransformerTestCase.java b/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/TraxTransformerTestCase.java index fb9895f120..6fd8ce2e8b 100644 --- a/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/TraxTransformerTestCase.java +++ b/sca-java-2.x/trunk/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/TraxTransformerTestCase.java @@ -28,6 +28,8 @@ import java.io.StringWriter; import java.io.Writer; import java.net.URL; +import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.junit.Before; import org.junit.Test; import org.w3c.dom.Node; @@ -50,22 +52,23 @@ public class TraxTransformerTestCase { @Test public void testTransformDOM() throws IOException { + ExtensionPointRegistry registry = new DefaultExtensionPointRegistry(); InputStream is = url.openStream(); - InputStream2Node t1 = new InputStream2Node(); + InputStream2Node t1 = new InputStream2Node(registry); Node node = t1.transform(is, null); is.close(); Writer writer = new StringWriter(); - Node2Writer t2 = new Node2Writer(); + Node2Writer t2 = new Node2Writer(registry); t2.transform(node, writer, null); String str = writer.toString(); StringReader reader = new StringReader(str); - Reader2Node t3 = new Reader2Node(); + Reader2Node t3 = new Reader2Node(registry); node = t3.transform(reader, null); ByteArrayOutputStream os = new ByteArrayOutputStream(); - Node2OutputStream t4 = new Node2OutputStream(); + Node2OutputStream t4 = new Node2OutputStream(registry); t4.transform(node, os, null); InputSource inputSource = new InputSource(new ByteArrayInputStream(os.toByteArray())); - InputSource2Node t5 = new InputSource2Node(); + InputSource2Node t5 = new InputSource2Node(registry); node = t5.transform(inputSource, null); } |