Embedded spaces with disabled Lookup Service in integration tests

I already posted a question how to disabled the Lookup service in my integration tests.
http://ask.gigaspaces.org/question/99...
Now the lookup service is disabled (I think) but this leads me to the next problem.

My test looks like this:
I have two embedded spaces using the setup code shown below.

The production code starts a thread which starts a transaction and waits (blocking take) for an object written into Space-A

I write this object into Space-A from the unit test runner thread

The other thread takes it and converts it into another object and writes this other object into Space-B

After it has written the converted object the transaction is commited

Now I do a blocking take on Space-B (in the unt test runner thread) and wait until the converted object shows up

Unfortunetly I never see the converted object appearing in Space-B.
I checked the transaction commit and this seems to work (at least no exception appears).

I am currently creating the GigaSpace instances once and re-use the same instance in the code under test as well as the test code itself.
What I mean is that I changed the dependency injection config of my production code classes to inject them the GigaSpace instance that I created in the test code. So I only create the instances once and re-use them.
Can this be a problem?

I am still using the DistributedJiniTxManager, can this be a problem when using embedded spaces where the lookup service is disabled?

1 Answer

Hi,
You say you have 2 different spaces, Space A and Space B,
How do you create the proxy to space B? did you make sure you are doing the blocking take on teh converted object on Space B and not A
i suggest you add some filters to the space and print something before_write and after_write to make sure the objects are there, see more information here: http://docs.gigaspaces.com/xap97/the-...

Comments

I create the proxy as shown above (using the UrlSpaceConfigurer).
I tried to use the same proxy instance in my production code but as I already said the writes did not show up when doing the take in the test runner thread.
I also tried to create another proxy in my production code and use this to make the writes, I got the same problem.

I also tried to just write and read from Space B in the test code and this works.

I guess the problem has to do with the transaction manager because in the production code I write inside a transaction.

I dont really get how this UrlSpaceConfigurer works.. what happens if I execute the code above twice in a row (using exactly the same URL)? Does it just create two proxies to the same space or does it create two different spaces?

see here all the information about the space URL:http://docs.gigaspaces.com/xap97/the-space-configuration.html
my suggestion is to use remote proxy to the space since you are running 2 different spaces, you need 2 separate space proxies
If that does not work, i suggest we set up a webex and review the test code together and see how to resolve it, sounds OK?