Hello, Is there a way to see the data of the
WEB-INf/appengine-generated/local_db.bin from Eclipse?

Thanks.

2010/2/8 dreamy <[email protected]>:
> We have no success to implement gae junit test.
> We use spring 2.5.6  and  follow the  
> http://code.google.com/appengine/docs/java/howto/unittesting.html
> .
>
> public class BaseTestCase extends
> AbstractDependencyInjectionSpringContextTests {
>         @Override
>            public void onSetUp() throws Exception {
>                ApiProxy.setEnvironmentForCurrentThread(new
> TestEnvironment());
>                ApiProxy.setDelegate(new ApiProxyLocalImpl(new File("D:/work/
> drp/src/drp/war")){});
>                super.onSetUp();
>            }
>           �...@override
>            public void onTearDown() throws Exception {
>                super.onTearDown();
>                // not strictly necessary to null these out but there's no
> harm either
>                ApiProxy.setDelegate(null);
>                ApiProxy.setEnvironmentForCurrentThread(null);
>            }
>            public String[] getConfigLocations() {
>                   String[] configLocations = { "file:war/WEB-INF/
> applicationContext.xml" };
>                   return configLocations;
>            }
> }
> but when run junit test. the exception is throw
> Failed to load from the backing store, D:\work\drp\src\drp\war\WEB-INF
> \appengine-generated\local_db.bin
> java.io.InvalidClassException:
> com.google.appengine.api.datastore.dev.LocalDatastoreService$Profile;
> local class incompatible: stream classdesc serialVersionUID =
> -6517584213397327068, local class serialVersionUID =
> -5383535353082918279
>        at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
>        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:
> 1583)
>        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:
> 1496)
>        at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:
> 1732)
>        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
>        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
>        at java.util.HashMap.readObject(HashMap.java:1030)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> 25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:
> 974)
>        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:
> 1849)
>        at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:
> 1753)
>        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
>        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:
> 1947)
>        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:
> 1871)
>        at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:
> 1753)
>        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
>        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
>        at
> com.google.appengine.api.datastore.dev.LocalDatastoreService.load(LocalDatastoreService.java:
> 949)
>        at
> com.google.appengine.api.datastore.dev.LocalDatastoreService.start_(LocalDatastoreService.java:
> 281)
>        at com.google.appengine.api.datastore.dev.LocalDatastoreService.access
> $300(LocalDatastoreService.java:90)
>        at com.google.appengine.api.datastore.dev.LocalDatastoreService
> $1.run(LocalDatastoreService.java:273)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at
> com.google.appengine.api.datastore.dev.LocalDatastoreService.start(LocalDatastoreService.java:
> 271)
>        at
> com.google.appengine.tools.development.ApiProxyLocalImpl.startServices(ApiProxyLocalImpl.java:
> 373)
>        at com.google.appengine.tools.development.ApiProxyLocalImpl.access
> $500(ApiProxyLocalImpl.java:42)
>        at com.google.appengine.tools.development.ApiProxyLocalImpl
> $2.run(ApiProxyLocalImpl.java:356)
>        at com.google.appengine.tools.development.ApiProxyLocalImpl
> $2.run(ApiProxyLocalImpl.java:354)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at
> com.google.appengine.tools.development.ApiProxyLocalImpl.getService(ApiProxyLocalImpl.java:
> 353)
>        at
> com.google.appengine.tools.development.ApiProxyLocalImpl.makeSyncCall(ApiProxyLocalImpl.java:
> 100)
>        at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:83)
>        at
> com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(DatastoreApiHelper.java:
> 52)
>        at
> com.google.appengine.api.datastore.DatastoreServiceImpl.beginTransaction(DatastoreServiceImpl.java:
> 516)
>        at
> org.datanucleus.store.appengine.RuntimeExceptionWrappingDatastoreService.beginTransaction(RuntimeExceptionWrappingDatastoreService.java:
> 209)
>        at
> org.datanucleus.store.appengine.DatastoreXAResource.start(DatastoreXAResource.java:
> 63)
>        at
> org.datanucleus.transaction.Transaction.enlistResource(Transaction.java:
> 425)
>        at
> org.datanucleus.ConnectionManagerImpl.enlistResource(ConnectionManagerImpl.java:
> 345)
>        at
> org.datanucleus.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:
> 212)
>        at
> org.datanucleus.store.appengine.DatastoreConnectionFactoryImpl.getConnection(DatastoreConnectionFactoryImpl.java:
> 109)
>        at
> org.datanucleus.store.AbstractStoreManager.getConnection(AbstractStoreManager.java:
> 288)
>        at
> org.datanucleus.store.appengine.query.DatastoreQuery.executeQuery(DatastoreQuery.java:
> 236)
>        at
> org.datanucleus.store.appengine.query.DatastoreQuery.performExecute(DatastoreQuery.java:
> 228)
>        at
> org.datanucleus.store.appengine.query.JDOQLQuery.performExecute(JDOQLQuery.java:
> 85)
>        at org.datanucleus.store.query.Query.executeQuery(Query.java:1489)
>        at org.datanucleus.store.query.Query.executeWithMap(Query.java:1398)
>        at org.datanucleus.jdo.JDOQuery.executeWithMap(JDOQuery.java:334)
>        at com.datong.drp.dao.impl.PurchaseOrderDAOImpl
> $1.doInJdo(PurchaseOrderDAOImpl.java:82)
>        at org.springframework.orm.jdo.JdoTemplate.execute(JdoTemplate.java:
> 204)
>        at org.springframework.orm.jdo.JdoTemplate.execute(JdoTemplate.java:
> 174)
>        at
> com.datong.drp.dao.impl.PurchaseOrderDAOImpl.queryPurchaseOrder(PurchaseOrderDAOImpl.java:
> 34)
>        at
> com.datong.drp.service.impl.PurchaseServiceImpl.queryPurchaseOrder(PurchaseServiceImpl.java:
> 40)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> 25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:
> 307)
>        at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:
> 182)
>        at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
> 149)
>        at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:
> 106)
>        at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
> 171)
>        at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:
> 204)
>        at $Proxy1.queryPurchaseOrder(Unknown Source)
>        at
> com.datong.drp.service.PurchaseServiceTest.testQueryPurchaseOrder(PurchaseServiceTest.java:
> 43)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> 25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at junit.framework.TestCase.runTest(TestCase.java:168)
>        at junit.framework.TestCase.runBare(TestCase.java:134)
>        at
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:
> 76)
>        at junit.framework.TestResult$1.protect(TestResult.java:110)
>        at junit.framework.TestResult.runProtected(TestResult.java:128)
>        at junit.framework.TestResult.run(TestResult.java:113)
>        at junit.framework.TestCase.run(TestCase.java:124)
>        at junit.framework.TestSuite.runTest(TestSuite.java:232)
>        at junit.framework.TestSuite.run(TestSuite.java:227)
>        at
> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:
> 83)
>        at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:
> 46)
>        at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:
> 38)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
> 467)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
> 683)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
> 390)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
> 197)
>
>
> On 2月5日, 下午10時54分, Chau Huynh <[email protected]> wrote:
>> http://code.google.com/appengine/docs/java/howto/unittesting.html#Wri...
>> I wonder if your team members can share same test case
>> and "local_db.bin" in each of your environment can have similar "record".
>> I just read it, so please try and advise if it work. Thanks
>> -Chau
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine for Java" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to