openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curti...@apache.org
Subject svn commit: r1150757 - /openjpa/trunk/openjpa-kernel/src/test/java/org/apache/openjpa/kernel/TestPCDataSerialization.java
Date Mon, 25 Jul 2011 15:49:08 GMT
Author: curtisr7
Date: Mon Jul 25 15:49:06 2011
New Revision: 1150757

URL: http://svn.apache.org/viewvc?rev=1150757&view=rev
Log:
OPENJPA-2035: Fix testcase to run from cmd line.

Modified:
    openjpa/trunk/openjpa-kernel/src/test/java/org/apache/openjpa/kernel/TestPCDataSerialization.java

Modified: openjpa/trunk/openjpa-kernel/src/test/java/org/apache/openjpa/kernel/TestPCDataSerialization.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/test/java/org/apache/openjpa/kernel/TestPCDataSerialization.java?rev=1150757&r1=1150756&r2=1150757&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/test/java/org/apache/openjpa/kernel/TestPCDataSerialization.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/test/java/org/apache/openjpa/kernel/TestPCDataSerialization.java
Mon Jul 25 15:49:06 2011
@@ -22,6 +22,9 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
 
 import junit.framework.TestCase;
 
@@ -29,11 +32,15 @@ import org.apache.openjpa.conf.OpenJPACo
 import org.apache.openjpa.conf.OpenJPAConfigurationImpl;
 import org.apache.openjpa.enhance.DynamicStorage;
 import org.apache.openjpa.enhance.DynamicStorageGenerator;
+import org.apache.openjpa.lib.util.ConcreteClassGenerator;
 import org.apache.openjpa.meta.ClassMetaData;
 import org.apache.openjpa.meta.JavaTypes;
 import org.apache.openjpa.meta.MetaDataRepository;
 import org.apache.openjpa.util.IntId;
 import org.apache.openjpa.util.OpenJPAId;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.omg.CORBA.portable.InvokeHandler;
 
 /**
  * This test ensures that we can stream a PCData and OpenJPAId to a client which may not
have the Entities on it's
@@ -147,10 +154,23 @@ public class TestPCDataSerialization ext
     }
 
     @SuppressWarnings("serial")
-    class DummyMetaDataRepository extends MetaDataRepository {
+    class DummyMetaDataRepository extends MetaDataRepository implements InvocationHandler
{
+        OpenJPAConfiguration _conf;
+
+        public DummyMetaDataRepository() {
+            _conf =
+                (OpenJPAConfiguration) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
+                    new Class[] { OpenJPAConfiguration.class }, this);
+        }
+
         @Override
         public OpenJPAConfiguration getConfiguration() {
-            return new OpenJPAConfigurationImpl();
+            return _conf;
+        }
+
+        @Override
+        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
{
+            return null;
         }
     }
 }



Mime
View raw message