summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/databinding-jaxb/src/test/java/org/apache
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-10-30 00:04:47 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-10-30 00:04:47 +0000
commit8a515e9f25fc7fefa03860d1f14e4bcf47bdeb63 (patch)
treeb58a349a83afd25a8a677e7c3b1058e3996b2bcd /java/sca/modules/databinding-jaxb/src/test/java/org/apache
parent4fa2f6af33e964521800a3ad2919c2e14c6c956f (diff)
Refactor JAXBContextCache/JAXBContextHelper to be a utility bound to the extension point registry
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@831163 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/databinding-jaxb/src/test/java/org/apache')
-rw-r--r--java/sca/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCacheTestCase.java5
-rw-r--r--java/sca/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTestCase.java8
2 files changed, 7 insertions, 6 deletions
diff --git a/java/sca/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCacheTestCase.java b/java/sca/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCacheTestCase.java
index 1c46765d9f..7f616ac5e9 100644
--- a/java/sca/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCacheTestCase.java
+++ b/java/sca/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextCacheTestCase.java
@@ -29,6 +29,7 @@ import javax.xml.namespace.QName;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
import org.apache.tuscany.sca.databinding.util.LRUCache;
import org.junit.Assert;
import org.junit.Test;
@@ -42,7 +43,7 @@ import com.example.ipo.jaxb.PurchaseOrderType;
public class JAXBContextCacheTestCase {
@Test
public void testCache() throws JAXBException {
- JAXBContextCache cache = new JAXBContextCache();
+ JAXBContextCache cache = new JAXBContextCache(new DefaultExtensionPointRegistry());
JAXBContext context1 = cache.getJAXBContext(String.class);
JAXBContext context2 = cache.getJAXBContext(int.class);
JAXBContext context3 = cache.getJAXBContext(String[].class);
@@ -85,7 +86,7 @@ public class JAXBContextCacheTestCase {
@Test
public void testPerf() throws JAXBException {
- JAXBContextCache cache = new JAXBContextCache();
+ JAXBContextCache cache = new JAXBContextCache(new DefaultExtensionPointRegistry());
// Test JAXBContext for simple java classes
long start = System.currentTimeMillis();
diff --git a/java/sca/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTestCase.java b/java/sca/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTestCase.java
index f1329ab571..6e2a540ada 100644
--- a/java/sca/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTestCase.java
+++ b/java/sca/modules/databinding-jaxb/src/test/java/org/apache/tuscany/sca/databinding/jaxb/JAXBTestCase.java
@@ -75,7 +75,7 @@ public class JAXBTestCase {
@Test
public void testTransform() throws Exception {
- Reader2JAXB t0 = new Reader2JAXB();
+ Reader2JAXB t0 = new Reader2JAXB(registry);
DataType targetDataType = new DataTypeImpl<Class>(PurchaseOrderType.class, null);
@@ -94,7 +94,7 @@ public class JAXBTestCase {
Assert.assertNotNull(node);
- Node2JAXB t2 = new Node2JAXB();
+ Node2JAXB t2 = new Node2JAXB(registry);
Object object2 = t2.transform(node, tContext);
Assert.assertNotNull(object2);
@@ -102,7 +102,7 @@ public class JAXBTestCase {
@Test
public void testTransform2() throws Exception {
- Reader2JAXB t0 = new Reader2JAXB();
+ Reader2JAXB t0 = new Reader2JAXB(registry);
QName root = new QName("http://www.example.com/IPO", "purchaseOrder");
DataType targetDataType = new DataTypeImpl<XMLType>(PurchaseOrderType.class, new XMLType(root, null));
@@ -123,7 +123,7 @@ public class JAXBTestCase {
Assert.assertNotNull(node);
- Node2JAXB t2 = new Node2JAXB();
+ Node2JAXB t2 = new Node2JAXB(registry);
Object object2 = t2.transform(node, tContext);
Assert.assertNotNull(object2);