cayenne git commit: Fix test random failure

2018-10-04 Thread ntimofeev
Repository: cayenne
Updated Branches:
  refs/heads/master a8162dadf -> 7d9d2c00f


Fix test random failure


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/7d9d2c00
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/7d9d2c00
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/7d9d2c00

Branch: refs/heads/master
Commit: 7d9d2c00fcf8bc358d9cd197e50ef67c38d3c738
Parents: a8162da
Author: Nikita Timofeev 
Authored: Thu Oct 4 16:38:15 2018 +0300
Committer: Nikita Timofeev 
Committed: Thu Oct 4 16:38:15 2018 +0300

--
 .../test/java/org/apache/cayenne/util/WeakValueMapTest.java | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cayenne/blob/7d9d2c00/cayenne-server/src/test/java/org/apache/cayenne/util/WeakValueMapTest.java
--
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/util/WeakValueMapTest.java 
b/cayenne-server/src/test/java/org/apache/cayenne/util/WeakValueMapTest.java
index 6f24c37..8afd2c4 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/util/WeakValueMapTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/util/WeakValueMapTest.java
@@ -143,10 +143,15 @@ public class WeakValueMapTest {
 @Test
 public void testSerializationSupport() throws Exception {
 WeakValueMap map = new WeakValueMap<>();
+
+// hold references so gc won't clean them
+Integer val1 = Integer.valueOf(543);
+TestSerializable val2 = new TestSerializable();
+
 map.put("key_1", 123);
 map.put("key_2", 42);
-map.put("key_3", 543);
-map.put("key_4", new TestSerializable());
+map.put("key_3", val1);
+map.put("key_4", val2);
 assertEquals(4, map.size());
 
 WeakValueMap clone = Util.cloneViaSerialization(map);



[GitHub] cayenne pull request #329: Replace weak reference to soft reference in tests...

2018-10-04 Thread aarrsseni
GitHub user aarrsseni opened a pull request:

https://github.com/apache/cayenne/pull/329

Replace weak reference to soft reference in tests. Only ObjectStoreGC…

…IT uses weak references.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/aarrsseni/cayenne addSoftRefToTests

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cayenne/pull/329.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #329


commit a3937f055bc7933a702bdda0ac5b90e48ad1840f
Author: Arseni Bulatski 
Date:   2018-09-27T13:17:33Z

Replace weak reference to soft reference in tests. Only ObjectStoreGCIT 
uses weak references.




---