Protostuff serialized bytecode on Android cannot be deserialized on PC - java

When I try to deserialize my serialized model on PC, I get the strange error seen at the bottom.
Deserializing works on Android, as does the case where I serialize the same model on PC and deserialize it on PC.
So this appears to be an interoperability problem.
What can I do to ensure it serializes the same way?
My model that has to be serialized has the following POJOS and collections:
ExplicitIdStrategy.Registry reg = new ExplicitIdStrategy.Registry();
reg.registerPojo(EntityData.class, 1);
reg.registerPojo(ProbabilityModel.class, 2);
reg.registerPojo(ProbabilityModelEntryList.class, 3);
reg.registerCollection(CollectionSchema.MessageFactories.valueOf("ArrayList"), 4);
reg.registerMap(MapSchema.MessageFactories.valueOf("HashMap"), 5);
reg.registerEnum(ProbabilityModel.OtherCounted.class, 6);
reg.registerCollection(CollectionSchema.MessageFactories.valueOf("HashSet"), 7);
It seems the Map is serialized differently on Android and on a Windows PC. I have no deep knowledge of protostuff, but it is fairly strange that it depends on operating systems when using operating system independent JAVA...
com.dyuproject.protostuff.ProtostuffException: The map was incorrectly serialized.
at com.dyuproject.protostuff.MapSchema.mergeFrom(MapSchema.java:316)
at com.dyuproject.protostuff.MapSchema.mergeFrom(MapSchema.java:31)
at com.dyuproject.protostuff.GraphCodedInput.mergeFrom(GraphCodedInput.java:153)
at com.dyuproject.protostuff.CodedInput.mergeObjectEncodedAsGroup(CodedInput.java:271)
at com.dyuproject.protostuff.CodedInput.mergeObject(CodedInput.java:239)
at com.dyuproject.protostuff.GraphCodedInput.mergeObject(GraphCodedInput.java:108)
at com.dyuproject.protostuff.runtime.RuntimeMapFieldFactory$5.mergeFrom(RuntimeMapFieldFactory.java:463)
at com.dyuproject.protostuff.runtime.MappedSchema.mergeFrom(MappedSchema.java:188)
at com.dyuproject.protostuff.GraphIOUtil.mergeFrom(GraphIOUtil.java:76)
at com.android.diabetesmodel.ModelEntity.deserialize(ModelEntity.java:185)
at com.android.diabetesmodel.test.VersionManagerEntityTest.from1to2Upgrade(VersionManagerEntityTest.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
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)

Did you serialize and deserialize with the same Protostuff JVM option protostuff.runtime.collection_schema_on_repeated_fields?

Related

Firestore local junit tests

Is there a library to get a mocked version of Firestore for local unit tests like the one for google app engines datastore:
private final LocalServiceTestHelper helper =
new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig()); (https://cloud.google.com/appengine/docs/standard/java/tools/localunittesting#datastore-memcache)
The Firestore mock of this file https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-firestore/src/test/java/com/google/cloud/firestore/FirestoreTest.java does not work:
java.lang.NullPointerException
at com.google.cloud.firestore.FirestoreImpl.sendRequest(FirestoreImpl.java:399)
at com.google.cloud.firestore.UpdateBuilder.commit(UpdateBuilder.java:467)
at com.google.cloud.firestore.WriteBatch.commit(WriteBatch.java:41)
at com.google.cloud.firestore.DocumentReference.set(DocumentReference.java:156)
at com.google.cloud.firestore.FirestoreMocked.test(FirestoreMocked.kt:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.mockito.internal.runners.DefaultInternalRunner$1.run(DefaultInternalRunner.java:79)
at org.mockito.internal.runners.DefaultInternalRunner.run(DefaultInternalRunner.java:85)
at org.mockito.internal.runners.StrictRunner.run(StrictRunner.java:39)
at org.mockito.junit.MockitoJUnitRunner.run(MockitoJUnitRunner.java:163)

Sikuli is throwing exception org.sikuli.api.robot.desktop.DesktopScreen.getSize

When I run my code, I am getting below error. I am running my code on remote server using Selenium grid. Though when I run on my local machine code is working fine.
error is -----------
`java.lang.ExceptionInInitializerError
at org.sikuli.api.robot.desktop.DesktopScreen.getSize(DesktopScreen.java:43)
at org.sikuli.api.AbstractScreenRegion.<init>(AbstractScreenRegion.java:19)
at org.sikuli.api.DefaultScreenRegion.<init>(DefaultScreenRegion.java:37)
at org.sikuli.api.DesktopScreenRegion.<init>(DesktopScreenRegion.java:11)
at com.test.accenture.acp.onboardoperation.OnboardingOperationScenario.I_click_on_Choose_file(OnboardingOperationScenario.java:3596)
at ✽.Then I click on Choose file(com/test/accenture/acp/onboardoperation/0002CreateBlueprint.feature:19)
Caused by: java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at sun.java2d.HeadlessGraphicsEnvironment.getScreenDevices(HeadlessGraphicsEnvironment.java:72)
at org.sikuli.api.robot.desktop.AWTDesktop.<clinit>(AWTDesktop.java:27)
at org.sikuli.api.robot.desktop.DesktopScreen.getSize(DesktopScreen.java:43)
at org.sikuli.api.AbstractScreenRegion.<init>(AbstractScreenRegion.java:19)
at org.sikuli.api.DefaultScreenRegion.<init>(DefaultScreenRegion.java:37)
at org.sikuli.api.DesktopScreenRegion.<init>(DesktopScreenRegion.java:11)
at com.test.accenture.acp.onboardoperation.OnboardingOperationScenario.I_click_on_Choose_file(OnboardingOperationScenario.java:3596)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:37)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:44)
at cucumber.runtime.Runtime.runStep(Runtime.java:223)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:36)
at cucumber.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:76)
at cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:65)
at cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:20)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at cucumber.junit.FeatureRunner.run(FeatureRunner.java:72)
at cucumber.junit.Cucumber.runChild(Cucumber.java:75)
at cucumber.junit.Cucumber.runChild(Cucumber.java:36)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at cucumber.junit.Cucumber.run(Cucumber.java:80)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:158)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)
`
System
Windows server R2 datacenter / 64 bit operating system
sikuli 1.0.2
Does your remote server have a UI? Or is there an active desktop session when you are running this? Sikuli requires an active desktop session (on a remote server, this usually requires someone to be logged in via RDP or VNC).

Error trying to test XML parsing with Robolectric

I'm using Robolectric and trying to test parsing a XML response. I'm getting the following exception:
java.lang.NoClassDefFoundError: java/lang/AutoCloseable
at android.util.Xml.parse(Xml.java:80)
at com.test.app.network.parser.soap.BaseSoapParser.doParse(BaseSoapParser.java:57)
at com.test.app.network.parser.soap.RecipeParser.parse(RecipeParser.java:57)
at com.test.app.network.command.RecipeCommand.searchRecipes(RecipeCommand.java:64)
at com.test.app.data.PrepopulateDB.prepopulateDB(PrepopulateDB.java:53)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:230)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:172)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
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)
Caused by: java.lang.ClassNotFoundException: java.lang.AutoCloseable
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.robolectric.bytecode.AsmInstrumentingClassLoader.loadClass(AsmInstrumentingClassLoader.java:100)
at android.util.Xml.$$robo$$Xml_e8aa_parse(Xml.java:80)
at android.util.Xml.parse(Xml.java)
at com.test.app.network.parser.soap.BaseSoapParser.doParse(BaseSoapParser.java:57)
at com.test.test.app.network.parser.soap.RecipeParser.parse(RecipeParser.java:57)
at com.test.app.network.command.RecipeCommand.searchRecipes(RecipeCommand.java:64)
at com.test.app.data.PrepopulateDB.prepopulateDB(PrepopulateDB.java:53)
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)
... 22 more
The thing is that "AutoCloseable" was only added in Java 7 and since Android uses Java 6 I can understand why the class isn't found - any help will be appreciated.
Libraries:
robolectric-2.3-20140204.032758-112-jar-with-dependencies.jar
android-all-4.4_r1-robolectric-0.jar /
android-all-4.3_r2-robolectric-0.jar
Update:
I tested this using JDK 6 and Target API 18 with the same result.
Update 2:
It seems that the source of the problem is this class: org.apache.harmony.xml.ExpatReader it is using AutoClosable which isn't available on Java 6 or Android API 18.
Actually this interface is in the Android SDK : https://developer.android.com/reference/java/lang/AutoCloseable.html
Added in API level 19
Before level 19, it was there but "hidden".
This error happens when you compile your project with a higher API version than some of your required classes, your target is API 18, but as Guillaume sais, when you use AutoCloseable you're trying to load a class which is not added until API 19. So your application crashes at runtime. You need to modify your minSDK version of your project or consider an alternative.
Download the SDK bundle [1], extract it and then update/overwrite your Eclipse and Android SDK (just make a backup copy of eclipse and android-sdk folder beforehand).
Of course afterwards make all the necessary updates within the SDK and Eclipse IDE
[1] https://developer.android.com/sdk/index.html

Mock spring MessageContext

i would like to mock these methods:
SaajSoapMessage saajSoapMessage = (SaajSoapMessage) messageContext.getRequest();
SoapBody requestBody = saajSoapMessage.getSoapBody();
I tried it with this
messageContextMock = mock(MessageContext.class);
saajSoapMessageMock = mock(SaajSoapMessage.class);
when(messageContextMock.getRequest()).thenReturn((SaajSoapMessage) saajSoapMessageMock);
when(saajSoapMessageMock.getSoapBody()).thenReturn(soapBodyMock);
But I have problem with mocking getSoapBody() because Junit wrote me:
at org.springframework.ws.soap.AbstractSoapMessage.getSoapBody(AbstractSoapMessage.java:36)
How to mock this operation correctly?
EDIT (full stack):
java.lang.NullPointerException
at org.springframework.ws.soap.AbstractSoapMessage.getSoapBody(AbstractSoapMessage.java:36)
at com.project.my.WebMessageTest.setUp(WebMessageTest.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
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)
Try adding a body to your mocked objects, try this:
messageContextMock = mock(MessageContext.class);
saajSoapMessageMock = mock(SaajSoapMessage.class);
soapEnvelopeMock = mock(SOAPEnvelope.class);
when(saajSoapMessageMock.getEnvelope()).thenReturn(soapEnvelopeMock);
when(messageContextMock.getRequest()).thenReturn(saajSoapMessageMock);

JUnit - IllegalArgumentException.class failes?

I have created an extremely simple junit test, which creates a null product in the product table in the db.
#Test(expected = IllegalArgumentException.class)
public void testCreate_NULL() {
Product p = null;
createProduct(p);
}
but when I do the junit test it turns blue.
btw. other tests like creating a product, deleting ect. are all green...
I appreciate your answer!!!
PS.: I am using hsql db!
PPS.: The error is:
java.lang.AssertionError: Expected exception:
java.lang.IllegalArgumentException at
org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:35)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at
org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at
org.junit.runners.ParentRunner.run(ParentRunner.java:300) at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
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)
UPDATE:
my createProduct Method justs inserts a product into the db and before it checks:
if(p==null) {
throw new IllegalArgumentException("null objects impossible");
}
Perhaps it's throwing NullReferenceException instead of IllegalArgumentException? You should be able to see in the test failure details.
It's fairly hard to diagnose this without any indication of what's in the createProduct method.

Categories

Resources