Discussion:
[mule-scm] [mule][23731] branches/mule-3.2.x/tests/integration/src/test/java/org/mule/ issues/PersistentStore6007TestCase.java: Make test more reliable
Pablo Kraan
2012-01-27 11:24:56 UTC
Permalink
Hi Mike,

Seems like this change is not making any difference during the build:
http://bamboo.mulesoft.org/browse/MULE32-MULE32XJDK6-238
Can you review the test again?
**
Revision 23731 <http://fisheye.codehaus.org/changelog/mule/?cs=23731>
Author mike.schilling Date 2012-01-26 13:35:31 -0600 (Thu, 26 Jan 2012) Log
Message
Make test more reliable
Modified Paths
-
branches/mule-3.2.x/tests/integration/src/test/java/org/mule/issues/PersistentStore6007TestCase.java<#1351b84ea8ba604f_branchesmule32xtestsintegrationsrctestjavaorgmuleissuesPersistentStore6007TestCasejava>
Diff
branches/mule-3.2.x/tests/integration/src/test/java/org/mule/issues/PersistentStore6007TestCase.java
(23730 => 23731)
--- branches/mule-3.2.x/tests/integration/src/test/java/org/mule/issues/PersistentStore6007TestCase.java 2012-01-26 18:53:34 UTC (rev 23730)
------------------------------
http://xircles.codehaus.org/manage_email
Mike Schilling
2012-01-27 21:46:31 UTC
Permalink
I see it now. I didn't make the component a singleton, so synchronizing
one of its instance methods doesn't do much :-) I'll fix it.

Mike
Post by Pablo Kraan
Hi Mike,
http://bamboo.mulesoft.org/browse/MULE32-MULE32XJDK6-238
Can you review the test again?
Revision
23731 <http://fisheye.codehaus.org/changelog/mule/?cs=23731>
Author
mike.schilling
Date
2012-01-26 13:35:31 -0600 (Thu, 26 Jan 2012)
Log Message
Make test more reliable
Modified Paths
* branches/mule-3.2.x/tests/integration/src/test/java/org/mule/issues/PersistentStore6007TestCase.java
<#1351b84ea8ba604f_branchesmule32xtestsintegrationsrctestjavaorgmuleissuesPersistentStore6007TestCasejava>
Diff
branches/mule-3.2.x/tests/integration/src/test/java/org/mule/issues/PersistentStore6007TestCase.java
(23730 => 23731)
--- branches/mule-3.2.x/tests/integration/src/test/java/org/mule/issues/PersistentStore6007TestCase.java 2012-01-26 18:53:34 UTC (rev 23730)
+++ branches/mule-3.2.x/tests/integration/src/test/java/org/mule/issues/PersistentStore6007TestCase.java 2012-01-26 19:35:31 UTC (rev 23731)
@@ -98,31 +98,31 @@
}
@Override
- public List<Serializable> allKeys() throws ObjectStoreException
+ public synchronized List<Serializable> allKeys() throws ObjectStoreException
{
return new ArrayList<Serializable>(events.keySet());
}
@Override
- public boolean contains(Serializable key) throws ObjectStoreException
+ public synchronized boolean contains(Serializable key) throws ObjectStoreException
{
return events.containsKey(key);
}
@Override
- public void store(Serializable key, Serializable value) throws ObjectStoreException
+ public synchronized void store(Serializable key, Serializable value) throws ObjectStoreException
{
events.put(key, value);
}
@Override
- public Serializable retrieve(Serializable key) throws ObjectStoreException
+ public synchronized Serializable retrieve(Serializable key) throws ObjectStoreException
{
return events.get(key);
}
@Override
- public Serializable remove(Serializable key) throws ObjectStoreException
+ public synchronized Serializable remove(Serializable key) throws ObjectStoreException
{
return events.remove(key);
}
@@ -138,8 +138,9 @@
{
private static Set<String> payloads = new HashSet<String>();
private static Latch latch;
+
@Override
- public Object onCall(MuleEventContext eventContext) throws Exception
+ public synchronized Object onCall(MuleEventContext eventContext) throws Exception
{
payloads.add(eventContext.getMessageAsString());
if (payloads.size() == 4)
------------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
Loading...