You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ud...@apache.org on 2016/09/27 23:35:54 UTC

[1/8] incubator-geode git commit: GEODE-1885: fix infinite loop

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-1801 4345fda73 -> eafd8cc9c


GEODE-1885: fix infinite loop

The previous fix for GEODE-1885 introduced a hang on off-heap regions.
If a concurrent close/destroy of the region happens while other threads
are modifying it then the thread doing the modification can get stuck
in a hot loop that never terminates.
The hot loop is in AbstractRegionMap when it tests the existing
region entry it finds to see if it can be modified.
If the region entry has a value that says it is removed
then the operation spins around and tries again.
It expects the thread that marked it as being removed
to also remove it from the map.
The previous fix for GEODE-1885 can cause a remove to not happen.
So this fix does two things:
 1. On retry remove the existing removed region entry from the map.
 2. putEntryIfAbsent now only releases the current entry if it has an off-heap reference.
    This prevents an infinite loop that was caused by the current thread who just added
    a new entry with REMOVE_PHASE1 from releasing it (changing it to REMOVE_PHASE2)
    because it sees that the region is closed/destroyed.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/55a65840
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/55a65840
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/55a65840

Branch: refs/heads/feature/GEODE-1801
Commit: 55a65840a4e4d427acaed1182aca869bf92ecae6
Parents: 6555c31
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Fri Sep 23 10:53:35 2016 -0700
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Mon Sep 26 14:43:12 2016 -0700

----------------------------------------------------------------------
 .../geode/internal/cache/AbstractRegionMap.java | 59 ++++++++++----------
 1 file changed, 30 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/55a65840/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
index 33e98b6..5861e9a 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
@@ -48,6 +48,7 @@ import org.apache.geode.internal.logging.log4j.LogMarker;
 import org.apache.geode.internal.offheap.OffHeapHelper;
 import org.apache.geode.internal.offheap.OffHeapRegionEntryHelper;
 import org.apache.geode.internal.offheap.ReferenceCountHelper;
+import org.apache.geode.internal.offheap.StoredObject;
 import org.apache.geode.internal.offheap.annotations.Released;
 import org.apache.geode.internal.offheap.annotations.Retained;
 import org.apache.geode.internal.offheap.annotations.Unretained;
@@ -246,15 +247,19 @@ public abstract class AbstractRegionMap implements RegionMap {
 
 
   public final RegionEntry putEntryIfAbsent(Object key, RegionEntry re) {
-    RegionEntry value = (RegionEntry)_getMap().putIfAbsent(key, re);
-    if (value == null && (re instanceof OffHeapRegionEntry) 
+    RegionEntry oldRe = (RegionEntry)_getMap().putIfAbsent(key, re);
+    if (oldRe == null && (re instanceof OffHeapRegionEntry) 
         && _isOwnerALocalRegion() && _getOwner().isThisRegionBeingClosedOrDestroyed()) {
       // prevent orphan during concurrent destroy (#48068)
-      if (_getMap().remove(key, re)) {
-        ((OffHeapRegionEntry)re).release();
+      Object v = re._getValue();
+      if (v != Token.REMOVED_PHASE1 && v != Token.REMOVED_PHASE2
+          && v instanceof StoredObject && ((StoredObject)v).hasRefCount()) {
+        if (_getMap().remove(key, re)) {
+          ((OffHeapRegionEntry)re).release();
+        }
       }
     }
-    return value;
+    return oldRe;
   }
 
   @Override
@@ -640,12 +645,11 @@ public abstract class AbstractRegionMap implements RegionMap {
       while (oldRe != null) {
         synchronized (oldRe) {
           if (oldRe.isRemoved() && !oldRe.isTombstone()) {
-            oldRe = putEntryIfAbsent(key, newRe);
-            if (oldRe != null) {
-              if (_isOwnerALocalRegion()) {
-                _getOwner().getCachePerfStats().incRetries();
-              }
+            if (_isOwnerALocalRegion()) {
+              _getOwner().getCachePerfStats().incRetries();
             }
+            _getMap().remove(key, oldRe);
+            oldRe = putEntryIfAbsent(key, newRe);
           } 
           /*
            * Entry already exists which should be impossible.
@@ -844,10 +848,9 @@ public abstract class AbstractRegionMap implements RegionMap {
           while (!done && oldRe != null) {
             synchronized (oldRe) {
               if (oldRe.isRemovedPhase2()) {
+                owner.getCachePerfStats().incRetries();
+                _getMap().remove(key, oldRe);
                 oldRe = putEntryIfAbsent(key, newRe);
-                if (oldRe != null) {
-                  owner.getCachePerfStats().incRetries();
-                }
               }
               else {
                 boolean acceptedVersionTag = false;
@@ -1104,10 +1107,9 @@ public abstract class AbstractRegionMap implements RegionMap {
                   while (!opCompleted && oldRe != null) {
                     synchronized (oldRe) {
                       if (oldRe.isRemovedPhase2()) {
+                        owner.getCachePerfStats().incRetries();
+                        _getMap().remove(event.getKey(), oldRe);
                         oldRe = putEntryIfAbsent(event.getKey(), newRe);
-                        if (oldRe != null) {
-                          owner.getCachePerfStats().incRetries();
-                        }
                       } else {
                         event.setRegionEntry(oldRe);
 
@@ -1356,6 +1358,8 @@ public abstract class AbstractRegionMap implements RegionMap {
                     && (event.isOriginRemote() || event.getContext() != null || removeRecoveredEntry));
                 if (!re.isRemoved() || createTombstoneForConflictChecks) {
                   if (re.isRemovedPhase2()) {
+                    _getMap().remove(event.getKey(), re);
+                    owner.getCachePerfStats().incRetries();
                     retry = true;
                     continue;
                   }
@@ -1650,10 +1654,9 @@ public abstract class AbstractRegionMap implements RegionMap {
             while (!opCompleted && oldRe != null) {
               synchronized (oldRe) {
                 if (oldRe.isRemovedPhase2()) {
+                  owner.getCachePerfStats().incRetries();
+                  _getMap().remove(key, oldRe);
                   oldRe = putEntryIfAbsent(key, newRe);
-                  if (oldRe != null) {
-                    owner.getCachePerfStats().incRetries();
-                  }
                 }
                 else {
                   try {
@@ -1874,10 +1877,9 @@ public abstract class AbstractRegionMap implements RegionMap {
                     // that is destroying the RE will see the invalidation and not
                     // proceed to phase 2 of removal.
                     if (oldRe.isRemovedPhase2()) {
+                      owner.getCachePerfStats().incRetries();
+                      _getMap().remove(event.getKey(), oldRe);
                       oldRe = putEntryIfAbsent(event.getKey(), newRe);
-                      if (oldRe != null) {
-                        owner.getCachePerfStats().incRetries();
-                      }
                     } else {
                       opCompleted = true;
                       event.setRegionEntry(oldRe);
@@ -2335,10 +2337,9 @@ public abstract class AbstractRegionMap implements RegionMap {
               while (!opCompleted && oldRe != null) {
                 synchronized (oldRe) {
                   if (oldRe.isRemovedPhase2()) {
+                    owner.getCachePerfStats().incRetries();
+                    _getMap().remove(key, oldRe);
                     oldRe = putEntryIfAbsent(key, newRe);
-                    if (oldRe != null) {
-                      owner.getCachePerfStats().incRetries();
-                    }
                   }
                   else {
                     opCompleted = true;
@@ -2711,8 +2712,9 @@ public abstract class AbstractRegionMap implements RegionMap {
             // from the map. otherwise we can append an event to it
             // and change its state
             if (re.isRemovedPhase2()) {
-              re = getOrCreateRegionEntry(owner, event, Token.REMOVED_PHASE1, null, onlyExisting, false);
               _getOwner().getCachePerfStats().incRetries();
+              _getMap().remove(event.getKey(), re);
+              re = getOrCreateRegionEntry(owner, event, Token.REMOVED_PHASE1, null, onlyExisting, false);
               if (re == null) {
                 // this will happen when onlyExisting is true
                 return null;
@@ -3192,10 +3194,9 @@ public abstract class AbstractRegionMap implements RegionMap {
             while (!opCompleted && oldRe != null) {
               synchronized (oldRe) {
                 if (oldRe.isRemovedPhase2()) {
+                  owner.getCachePerfStats().incRetries();
+                  _getMap().remove(key, oldRe);
                   oldRe = putEntryIfAbsent(key, newRe);
-                  if (oldRe != null) {
-                    owner.getCachePerfStats().incRetries();
-                  }
                 }
                 else {
                   opCompleted = true;


[6/8] incubator-geode git commit: GEODE-1769: add the ignored exception to the AbstractSecureServerDUnitTest

Posted by ud...@apache.org.
GEODE-1769: add the ignored exception to the AbstractSecureServerDUnitTest


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/1890e60e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/1890e60e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/1890e60e

Branch: refs/heads/feature/GEODE-1801
Commit: 1890e60e231767d6e94712483e29cd86a68ce51b
Parents: ddf4f3d
Author: Jinmei Liao <ji...@pivotal.io>
Authored: Tue Sep 27 11:00:14 2016 -0700
Committer: Jinmei Liao <ji...@pivotal.io>
Committed: Tue Sep 27 14:04:42 2016 -0700

----------------------------------------------------------------------
 .../apache/geode/security/AbstractSecureServerDUnitTest.java  | 7 +++++--
 .../IntegratedClientRegisterInterestAuthDistributedTest.java  | 1 -
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1890e60e/geode-core/src/test/java/org/apache/geode/security/AbstractSecureServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/AbstractSecureServerDUnitTest.java b/geode-core/src/test/java/org/apache/geode/security/AbstractSecureServerDUnitTest.java
index 23b851a..435b426 100644
--- a/geode-core/src/test/java/org/apache/geode/security/AbstractSecureServerDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/security/AbstractSecureServerDUnitTest.java
@@ -24,7 +24,6 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Properties;
 
-import org.apache.geode.security.templates.SampleSecurityManager;
 import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
 import org.junit.Before;
 
@@ -36,9 +35,11 @@ import org.apache.geode.cache.client.ClientCache;
 import org.apache.geode.cache.client.ClientCacheFactory;
 import org.apache.geode.cache.client.ClientRegionShortcut;
 import org.apache.geode.cache.server.CacheServer;
-import org.apache.geode.distributed.*;
+import org.apache.geode.distributed.ConfigurationProperties;
+import org.apache.geode.security.templates.SampleSecurityManager;
 import org.apache.geode.security.templates.UserPasswordAuthInit;
 import org.apache.geode.test.dunit.Host;
+import org.apache.geode.test.dunit.IgnoredException;
 import org.apache.geode.test.dunit.Invoke;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
@@ -69,6 +70,8 @@ public class AbstractSecureServerDUnitTest extends JUnit4CacheTestCase {
 
   @Before
   public void before() throws Exception {
+    IgnoredException.addIgnoredException("No longer connected to localhost");
+
     final Host host = Host.getHost(0);
     this.client1 = host.getVM(1);
     this.client2 = host.getVM(2);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1890e60e/geode-core/src/test/java/org/apache/geode/security/IntegratedClientRegisterInterestAuthDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/IntegratedClientRegisterInterestAuthDistributedTest.java b/geode-core/src/test/java/org/apache/geode/security/IntegratedClientRegisterInterestAuthDistributedTest.java
index f897b5e..d066e9d 100644
--- a/geode-core/src/test/java/org/apache/geode/security/IntegratedClientRegisterInterestAuthDistributedTest.java
+++ b/geode-core/src/test/java/org/apache/geode/security/IntegratedClientRegisterInterestAuthDistributedTest.java
@@ -32,7 +32,6 @@ import org.apache.geode.test.junit.categories.SecurityTest;
 
 @Category({ DistributedTest.class, SecurityTest.class })
 public class IntegratedClientRegisterInterestAuthDistributedTest extends AbstractSecureServerDUnitTest {
-
   @Test
   public void testRegisterInterest() throws InterruptedException {
     // client1 connects to server as a user not authorized to do any operations


[2/8] incubator-geode git commit: GEODE-1937: Fixing failures from the example tests

Posted by ud...@apache.org.
GEODE-1937: Fixing failures from the example tests

Setting a default GEODE_HOME to use when running example tests. Fixing
the example tests scripts to indicate that they are bash scripts as the
first line in the header.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/62bd240f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/62bd240f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/62bd240f

Branch: refs/heads/feature/GEODE-1801
Commit: 62bd240f28258620e5140d52ce21c2004598f7ea
Parents: 55a6584
Author: Dan Smith <up...@apache.org>
Authored: Mon Sep 26 11:03:25 2016 -0700
Committer: Dan Smith <up...@apache.org>
Committed: Tue Sep 27 10:43:56 2016 -0700

----------------------------------------------------------------------
 geode-examples/build.gradle                    | 6 ++++++
 geode-examples/replicated/scripts/pidkiller.sh | 5 ++---
 geode-examples/replicated/scripts/setEnv.sh    | 2 +-
 geode-examples/replicated/scripts/startAll.sh  | 2 +-
 geode-examples/replicated/scripts/stopAll.sh   | 2 +-
 5 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/62bd240f/geode-examples/build.gradle
----------------------------------------------------------------------
diff --git a/geode-examples/build.gradle b/geode-examples/build.gradle
index 1eadc31..1e638bc 100644
--- a/geode-examples/build.gradle
+++ b/geode-examples/build.gradle
@@ -48,6 +48,12 @@ subprojects {
         }
     }
 
+    test {
+      def geodeHome = System.getenv('GEODE_HOME');
+      geodeHome = geodeHome != null ? geodeHome : file('../../geode-assembly/build/install/apache-geode/').absolutePath
+      environment 'GEODE_HOME': geodeHome
+    }
+
 
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/62bd240f/geode-examples/replicated/scripts/pidkiller.sh
----------------------------------------------------------------------
diff --git a/geode-examples/replicated/scripts/pidkiller.sh b/geode-examples/replicated/scripts/pidkiller.sh
index 1a3eaf2..ecf8f2d 100755
--- a/geode-examples/replicated/scripts/pidkiller.sh
+++ b/geode-examples/replicated/scripts/pidkiller.sh
@@ -1,3 +1,4 @@
+#!/bin/bash
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -14,9 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-#!/bin/bash
-#
-# @brief Script that look for .pid files on a directory and kill those processes. 
+# @brief Script that look for .pid files on a directory and kill those processes.
 #
 
 export DIR=$1

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/62bd240f/geode-examples/replicated/scripts/setEnv.sh
----------------------------------------------------------------------
diff --git a/geode-examples/replicated/scripts/setEnv.sh b/geode-examples/replicated/scripts/setEnv.sh
index 60befc6..e9e860e 100755
--- a/geode-examples/replicated/scripts/setEnv.sh
+++ b/geode-examples/replicated/scripts/setEnv.sh
@@ -1,3 +1,4 @@
+#!/bin/bash
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -14,7 +15,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-#!/bin/bash
 
 ## check if locator port has been set otherwise set to default
 export GEODE_LOCATOR_PORT="${GEODE_LOCATOR_PORT:-10334}"

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/62bd240f/geode-examples/replicated/scripts/startAll.sh
----------------------------------------------------------------------
diff --git a/geode-examples/replicated/scripts/startAll.sh b/geode-examples/replicated/scripts/startAll.sh
index f4ce413..2b08f19 100755
--- a/geode-examples/replicated/scripts/startAll.sh
+++ b/geode-examples/replicated/scripts/startAll.sh
@@ -1,3 +1,4 @@
+#!/bin/bash
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -14,7 +15,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-#!/bin/bash
 
 set -e
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/62bd240f/geode-examples/replicated/scripts/stopAll.sh
----------------------------------------------------------------------
diff --git a/geode-examples/replicated/scripts/stopAll.sh b/geode-examples/replicated/scripts/stopAll.sh
index 2a2c39b..a6364a8 100755
--- a/geode-examples/replicated/scripts/stopAll.sh
+++ b/geode-examples/replicated/scripts/stopAll.sh
@@ -1,3 +1,4 @@
+#!/bin/bash
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -14,7 +15,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-#!/bin/bash
 set -e
 
 current=`pwd`


[4/8] incubator-geode git commit: GEODE-1940: increase line length to prevent line-wrapping

Posted by ud...@apache.org.
GEODE-1940: increase line length to prevent line-wrapping


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/9f422dd3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/9f422dd3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/9f422dd3

Branch: refs/heads/feature/GEODE-1801
Commit: 9f422dd39ac5311db26431fb96e5adfc32546119
Parents: 8a6a46a
Author: Kirk Lund <kl...@apache.org>
Authored: Tue Sep 27 12:48:24 2016 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Tue Sep 27 13:54:39 2016 -0700

----------------------------------------------------------------------
 etc/eclipseFormatterProfile.xml | 2 +-
 etc/intellijIdeaCodeStyle.xml   | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9f422dd3/etc/eclipseFormatterProfile.xml
----------------------------------------------------------------------
diff --git a/etc/eclipseFormatterProfile.xml b/etc/eclipseFormatterProfile.xml
index ead2f39..b9f8410 100755
--- a/etc/eclipseFormatterProfile.xml
+++ b/etc/eclipseFormatterProfile.xml
@@ -288,7 +288,7 @@
 <setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
 <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
 <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="160"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="999"/>
 <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
 <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
 </profile>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9f422dd3/etc/intellijIdeaCodeStyle.xml
----------------------------------------------------------------------
diff --git a/etc/intellijIdeaCodeStyle.xml b/etc/intellijIdeaCodeStyle.xml
index 5b01917..0b5c31b 100755
--- a/etc/intellijIdeaCodeStyle.xml
+++ b/etc/intellijIdeaCodeStyle.xml
@@ -60,6 +60,7 @@
     </indentOptions>
   </codeStyleSettings>
   <codeStyleSettings language="JAVA">
+    <option name="RIGHT_MARGIN" value="999" />
     <option name="KEEP_LINE_BREAKS" value="false" />
     <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
     <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
@@ -82,6 +83,7 @@
     <option name="WHILE_BRACE_FORCE" value="3" />
     <option name="FOR_BRACE_FORCE" value="3" />
     <option name="VARIABLE_ANNOTATION_WRAP" value="2" />
+    <option name="WRAP_ON_TYPING" value="0" />
     <indentOptions>
       <option name="INDENT_SIZE" value="2" />
       <option name="CONTINUATION_INDENT_SIZE" value="2" />


[8/8] incubator-geode git commit: Merge branch 'develop' into feature/GEODE-1801

Posted by ud...@apache.org.
Merge branch 'develop' into feature/GEODE-1801


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/eafd8cc9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/eafd8cc9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/eafd8cc9

Branch: refs/heads/feature/GEODE-1801
Commit: eafd8cc9c85f70203ab812e308423791cdbfd581
Parents: 4345fda 0ad1848
Author: Udo Kohlmeyer <uk...@pivotal.io>
Authored: Wed Sep 28 09:35:34 2016 +1000
Committer: Udo Kohlmeyer <uk...@pivotal.io>
Committed: Wed Sep 28 09:35:34 2016 +1000

----------------------------------------------------------------------
 build.gradle                                    |  11 ++
 etc/eclipseFormatterProfile.xml                 |   2 +-
 etc/intellijIdeaCodeStyle.xml                   |   2 +
 geode-assembly/build.gradle                     |   2 +
 .../geode/internal/cache/AbstractRegionMap.java |  59 +++++-----
 .../geode/internal/net/JSSESocketJUnitTest.java | 111 ++++++-------------
 .../net/SocketCreatorFactoryJUnitTest.java      |  77 +++++++------
 .../security/AbstractSecureServerDUnitTest.java |   7 +-
 ...ientRegisterInterestAuthDistributedTest.java |   1 -
 geode-examples/build.gradle                     |   6 +
 geode-examples/replicated/scripts/pidkiller.sh  |   5 +-
 geode-examples/replicated/scripts/setEnv.sh     |   2 +-
 geode-examples/replicated/scripts/startAll.sh   |   2 +-
 geode-examples/replicated/scripts/stopAll.sh    |   2 +-
 14 files changed, 138 insertions(+), 151 deletions(-)
----------------------------------------------------------------------



[3/8] incubator-geode git commit: GEODE-1937: Making precheckin depend on running examples

Posted by ud...@apache.org.
GEODE-1937: Making precheckin depend on running examples


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/8a6a46ab
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/8a6a46ab
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/8a6a46ab

Branch: refs/heads/feature/GEODE-1801
Commit: 8a6a46abde1a7f08fcf4605877f60ce9480fb296
Parents: 62bd240
Author: Dan Smith <up...@apache.org>
Authored: Mon Sep 26 11:18:41 2016 -0700
Committer: Dan Smith <up...@apache.org>
Committed: Tue Sep 27 10:43:56 2016 -0700

----------------------------------------------------------------------
 build.gradle                | 11 +++++++++++
 geode-assembly/build.gradle |  2 ++
 2 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8a6a46ab/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index f7ce6bc..b360c40 100755
--- a/build.gradle
+++ b/build.gradle
@@ -86,3 +86,14 @@ subprojects {
   clean.finalizedBy rootProject.cleanAll
 }
 
+task cleanExamples(type: GradleBuild) {
+  buildFile = 'geode-examples/build.gradle'
+  tasks = ['clean']
+}
+
+clean.dependsOn cleanExamples
+
+task buildExamples(type: GradleBuild, dependsOn: ':geode-assembly:installDist') {
+  buildFile = 'geode-examples/build.gradle'
+  tasks = ['build']
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8a6a46ab/geode-assembly/build.gradle
----------------------------------------------------------------------
diff --git a/geode-assembly/build.gradle b/geode-assembly/build.gradle
index a83b7a9..2b960eb 100755
--- a/geode-assembly/build.gradle
+++ b/geode-assembly/build.gradle
@@ -387,6 +387,8 @@ flakyTest dependOnInstalledProduct
 // Make build final task to generate all test and product resources
 build.dependsOn installDist
 
+precheckin.dependsOn ':buildExamples'
+
 installDist.dependsOn ':extensions/geode-modules-assembly:dist'
 
 /**Print the names of all jar files in a fileTree */


[7/8] incubator-geode git commit: GEODE-1937: Don't use a relative path to the geode-examples location

Posted by ud...@apache.org.
GEODE-1937: Don't use a relative path to the geode-examples location


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/0ad18488
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/0ad18488
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/0ad18488

Branch: refs/heads/feature/GEODE-1801
Commit: 0ad18488b800f34cca41cab022948ef3355d73d7
Parents: 1890e60
Author: Dan Smith <up...@apache.org>
Authored: Tue Sep 27 16:10:46 2016 -0700
Committer: Dan Smith <up...@apache.org>
Committed: Tue Sep 27 16:11:52 2016 -0700

----------------------------------------------------------------------
 build.gradle | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0ad18488/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index b360c40..bc31c92 100755
--- a/build.gradle
+++ b/build.gradle
@@ -87,13 +87,13 @@ subprojects {
 }
 
 task cleanExamples(type: GradleBuild) {
-  buildFile = 'geode-examples/build.gradle'
+  buildFile = "${rootProject.projectDir}/geode-examples/build.gradle"
   tasks = ['clean']
 }
 
 clean.dependsOn cleanExamples
 
 task buildExamples(type: GradleBuild, dependsOn: ':geode-assembly:installDist') {
-  buildFile = 'geode-examples/build.gradle'
+  buildFile = "${rootProject.projectDir}/geode-examples/build.gradle"
   tasks = ['build']
 }


[5/8] incubator-geode git commit: GEODE-1939: change test category to IntegrationTest

Posted by ud...@apache.org.
GEODE-1939: change test category to IntegrationTest

* remove class hierarchy because it repeats running of tests
* reformat, privatize vars and methods
* remove catching of unexpected exceptions
* remove system out statements
* move all setup to setup method
* fix minor concurrency bug in JSSESocketJUnitTest


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/ddf4f3db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/ddf4f3db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/ddf4f3db

Branch: refs/heads/feature/GEODE-1801
Commit: ddf4f3dbc6cbd1ca68ba812128c25163aa5c23ac
Parents: 9f422dd
Author: Kirk Lund <kl...@apache.org>
Authored: Tue Sep 27 13:50:21 2016 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Tue Sep 27 13:54:40 2016 -0700

----------------------------------------------------------------------
 .../geode/internal/net/JSSESocketJUnitTest.java | 111 ++++++-------------
 .../net/SocketCreatorFactoryJUnitTest.java      |  77 +++++++------
 2 files changed, 76 insertions(+), 112 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ddf4f3db/geode-core/src/test/java/org/apache/geode/internal/net/JSSESocketJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/net/JSSESocketJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/net/JSSESocketJUnitTest.java
index 4a62ec7..e63a46f 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/net/JSSESocketJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/net/JSSESocketJUnitTest.java
@@ -30,6 +30,8 @@ import java.net.InetAddress;
 import java.net.ServerSocket;
 import java.net.Socket;
 import java.util.Properties;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.LogManager;
@@ -43,9 +45,12 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.contrib.java.lang.system.SystemErrRule;
+import org.junit.contrib.java.lang.system.SystemOutRule;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.TestName;
 
+import org.apache.geode.distributed.ClientSocketFactory;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.DistributionConfigImpl;
 import org.apache.geode.internal.AvailablePort;
@@ -62,48 +67,39 @@ import org.apache.geode.util.test.TestUtil;
 @Category(IntegrationTest.class)
 public class JSSESocketJUnitTest {
 
-  public
-  @Rule
-  TestName name = new TestName();
-
-  private static final org.apache.logging.log4j.Logger logger = LogService.getLogger();
+  private static volatile boolean factoryInvoked;
 
-  ServerSocket acceptor;
-  Socket server;
+  private ServerSocket acceptor;
+  private Socket server;
+  private int randport;
 
-  static ByteArrayOutputStream baos = new ByteArrayOutputStream();
+  @Rule
+  public TestName name = new TestName();
 
-  private int randport = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+  @Rule
+  public SystemOutRule systemOutRule = new SystemOutRule();
 
   @Before
   public void setUp() throws Exception {
-    System.out.println("\n\n########## setup " + name.getMethodName() + " ############\n\n");
-    server = null;
-    acceptor = null;
-    baos.reset();
+    randport = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
   }
 
   @After
   public void tearDown() throws Exception {
-    System.out.println("\n\n########## teardown " + name.getMethodName() + " ############\n\n");
-
     if (server != null) {
       server.close();
     }
     if (acceptor != null) {
       acceptor.close();
     }
-    System.out.println(baos.toString());
     SocketCreatorFactory.close();
   }
 
-  //----- test methods ------
-
   @Test
   public void testSSLSocket() throws Exception {
-    final Object[] receiver = new Object[1];
+    systemOutRule.mute().enableLog();
 
-    TestAppender.create();
+    final Object[] receiver = new Object[1];
 
     // Get original base log level
     Level originalBaseLevel = LogService.getBaseLogLevel();
@@ -136,7 +132,7 @@ public class JSSESocketJUnitTest {
       Socket client = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER).connectForServer(InetAddress.getByName("localhost"), randport);
 
       ObjectOutputStream oos = new ObjectOutputStream(client.getOutputStream());
-      String expected = new String("testing " + name.getMethodName());
+      String expected = "testing " + name.getMethodName();
       oos.writeObject(expected);
       oos.flush();
 
@@ -144,27 +140,19 @@ public class JSSESocketJUnitTest {
 
       client.close();
       serverSocket.close();
-      if (expected.equals(receiver[0])) {
-        System.out.println("received " + receiver[0] + " as expected.");
-      } else {
-        throw new Exception("Expected \"" + expected + "\" but received \"" + receiver[0] + "\"");
-      }
+      assertEquals("Expected \"" + expected + "\" but received \"" + receiver[0] + "\"", expected, receiver[0]);
 
-      String logOutput = baos.toString();
-      StringReader sreader = new StringReader(logOutput);
-      LineNumberReader reader = new LineNumberReader(sreader);
-      int peerLogCount = 0;
-      String line = null;
-      while ((line = reader.readLine()) != null) {
+      String stdOut = systemOutRule.getLog();
+      int foundExpectedString = 0;
 
-        if (line.matches(".*peer CN=.*")) {
-          System.out.println("Found peer log statement.");
-          peerLogCount++;
-        }
-      }
-      if (peerLogCount != 2) {
-        throw new Exception("Expected to find to peer identities logged.");
+      Pattern pattern = Pattern.compile(".*peer CN=.*");
+      Matcher matcher = pattern.matcher(stdOut);
+      while (matcher.find()) {
+        foundExpectedString++;
       }
+
+      assertEquals(2, foundExpectedString);
+
     } finally {
       // Reset original base log level
       LogService.setBaseLogLevel(originalBaseLevel);
@@ -198,22 +186,7 @@ public class JSSESocketJUnitTest {
     }
   }
 
-  static boolean factoryInvoked;
-
-  public static class TSocketFactory implements org.apache.geode.distributed.ClientSocketFactory {
-
-    public TSocketFactory() {
-    }
-
-    public Socket createSocket(InetAddress address, int port) throws IOException {
-      JSSESocketJUnitTest.factoryInvoked = true;
-      throw new IOException("splort!");
-    }
-  }
-
-  //------------- utilities -----
-
-  protected File findTestJKS() {
+  private File findTestJKS() {
     return new File(TestUtil.getResourcePath(getClass(), "/ssl/trusted.keystore"));
   }
 
@@ -237,32 +210,14 @@ public class JSSESocketJUnitTest {
     return t;
   }
 
-  public static final class TestAppender extends AbstractAppender {
-
-    private static final String APPENDER_NAME = TestAppender.class.getName();
-    private final static String SOCKET_CREATOR_CLASSNAME = SocketCreator.class.getName();
+  private static class TSocketFactory implements ClientSocketFactory {
 
-    private TestAppender() {
-      super(APPENDER_NAME, null, PatternLayout.createDefaultLayout());
-      start();
-    }
-
-    public static Appender create() {
-      Appender appender = new TestAppender();
-      Logger socketCreatorLogger = (Logger) LogManager.getLogger(SOCKET_CREATOR_CLASSNAME);
-      LoggerConfig config = socketCreatorLogger.getContext().getConfiguration().getLoggerConfig(SOCKET_CREATOR_CLASSNAME);
-      config.addAppender(appender, Level.DEBUG, null);
-      return appender;
+    public TSocketFactory() {
     }
 
-    @SuppressWarnings("synthetic-access")
-    @Override
-    public void append(final LogEvent event) {
-      try {
-        baos.write(new String(event.getMessage().getFormattedMessage() + "\n").getBytes());
-      } catch (IOException ioex) {
-        logger.warn(ioex);
-      }
+    public Socket createSocket(InetAddress address, int port) throws IOException {
+      JSSESocketJUnitTest.factoryInvoked = true;
+      throw new IOException("splort!");
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ddf4f3db/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorFactoryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorFactoryJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorFactoryJUnitTest.java
index 16e2837..b9faff0 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorFactoryJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/net/SocketCreatorFactoryJUnitTest.java
@@ -22,20 +22,27 @@ import java.io.File;
 import java.io.IOException;
 import java.util.Properties;
 
+import org.junit.After;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.distributed.internal.DistributionConfigImpl;
 import org.apache.geode.internal.security.SecurableCommunicationChannel;
 import org.apache.geode.test.dunit.Assert;
-import org.apache.geode.test.junit.categories.UnitTest;
+import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.apache.geode.util.test.TestUtil;
 
-@Category(UnitTest.class)
-public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest {
+@Category(IntegrationTest.class)
+public class SocketCreatorFactoryJUnitTest {
+
+  @After
+  public void tearDown() throws Exception {
+    SocketCreatorFactory.close();
+  }
 
   @Test
-  public void testNewSSLConfigSSLComponentLocator() {
+  public void testNewSSLConfigSSLComponentLocator() throws Exception {
     Properties properties = configureSSLProperties(SecurableCommunicationChannel.LOCATOR.getConstant());
 
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
@@ -50,7 +57,7 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest {
   }
 
   @Test
-  public void testNewSSLConfigSSLComponentALL() {
+  public void testNewSSLConfigSSLComponentALL() throws Exception {
     Properties properties = configureSSLProperties(SecurableCommunicationChannel.ALL.getConstant());
 
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
@@ -65,7 +72,7 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest {
   }
 
   @Test
-  public void testNewSSLConfigSSLComponentCLUSTER() {
+  public void testNewSSLConfigSSLComponentCLUSTER() throws Exception {
     Properties properties = configureSSLProperties(SecurableCommunicationChannel.CLUSTER.getConstant());
 
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
@@ -80,7 +87,7 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest {
   }
 
   @Test
-  public void testNewSSLConfigSSLComponentGATEWAY() {
+  public void testNewSSLConfigSSLComponentGATEWAY() throws Exception {
     Properties properties = configureSSLProperties(SecurableCommunicationChannel.GATEWAY.getConstant());
 
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
@@ -95,7 +102,7 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest {
   }
 
   @Test
-  public void testNewSSLConfigSSLComponentHTTP_SERVICE() {
+  public void testNewSSLConfigSSLComponentHTTP_SERVICE() throws Exception {
     Properties properties = configureSSLProperties(SecurableCommunicationChannel.WEB.getConstant());
 
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
@@ -110,7 +117,7 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest {
   }
 
   @Test
-  public void testNewSSLConfigSSLComponentJMX() {
+  public void testNewSSLConfigSSLComponentJMX() throws Exception {
     Properties properties = configureSSLProperties(SecurableCommunicationChannel.JMX.getConstant());
 
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
@@ -125,7 +132,7 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest {
   }
 
   @Test
-  public void testNewSSLConfigSSLComponentSERVER() {
+  public void testNewSSLConfigSSLComponentSERVER() throws Exception {
     Properties properties = configureSSLProperties(SecurableCommunicationChannel.SERVER.getConstant());
 
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
@@ -141,7 +148,7 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest {
   }
 
   @Test
-  public void testNewSSLConfigSSLComponentCombinations1() {
+  public void testNewSSLConfigSSLComponentCombinations1() throws Exception {
     Properties properties = configureSSLProperties(commaDelimitedString(SecurableCommunicationChannel.CLUSTER.getConstant(), SecurableCommunicationChannel.SERVER.getConstant()));
 
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
@@ -156,9 +163,8 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest {
   }
 
   @Test
-  public void testNewSSLConfigSSLComponentCombinations2() {
-    Properties properties = configureSSLProperties(commaDelimitedString(SecurableCommunicationChannel.CLUSTER.getConstant(), SecurableCommunicationChannel.SERVER.getConstant(), SecurableCommunicationChannel.WEB
-      .getConstant(), SecurableCommunicationChannel.JMX.getConstant()));
+  public void testNewSSLConfigSSLComponentCombinations2() throws Exception {
+    Properties properties = configureSSLProperties(commaDelimitedString(SecurableCommunicationChannel.CLUSTER.getConstant(), SecurableCommunicationChannel.SERVER.getConstant(), SecurableCommunicationChannel.WEB.getConstant(), SecurableCommunicationChannel.JMX.getConstant()));
 
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
     SocketCreatorFactory.setDistributionConfig(distributionConfig);
@@ -172,7 +178,7 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest {
   }
 
   @Test
-  public void testNewSSLConfigSSLComponentAliasWithMultiKeyStore() {
+  public void testNewSSLConfigSSLComponentAliasWithMultiKeyStore() throws Exception {
     Properties properties = configureSSLProperties(SecurableCommunicationChannel.ALL.getConstant());
 
     properties.setProperty(SSL_KEYSTORE, TestUtil.getResourcePath(getClass(), "/org/apache/geode/internal/net/multiKey.jks"));
@@ -193,7 +199,7 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest {
   }
 
   @Test
-  public void testNewSSLConfigSSLComponentWithoutAliasWithMultiKeyStore() {
+  public void testNewSSLConfigSSLComponentWithoutAliasWithMultiKeyStore() throws Exception {
     Properties properties = configureSSLProperties(SecurableCommunicationChannel.ALL.getConstant());
 
     properties.setProperty(SSL_KEYSTORE, TestUtil.getResourcePath(getClass(), "/org/apache/geode/internal/net/multiKey.jks"));
@@ -210,28 +216,24 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest {
     Assert.assertTrue(SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.LOCATOR).useSSL());
   }
 
-  private Properties configureSSLProperties(String sslComponents) {
+  private Properties configureSSLProperties(String sslComponents) throws IOException {
+    File jks = findTestJKS();
+
     Properties properties = new Properties();
-    try {
-      File jks = findTestJKS();
-
-      properties.setProperty(MCAST_PORT, "0");
-      properties.setProperty(SSL_REQUIRE_AUTHENTICATION, "true");
-      properties.setProperty(SSL_CIPHERS, "TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384,TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,TLS_DHE_DSS_WITH_AES_256_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA");
-      properties.setProperty(SSL_PROTOCOLS, "TLSv1,TLSv1.1,TLSv1.2");
-      properties.setProperty(SSL_KEYSTORE, jks.getCanonicalPath());
-      properties.setProperty(SSL_KEYSTORE_PASSWORD, "password");
-      properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
-      properties.setProperty(SSL_TRUSTSTORE, jks.getCanonicalPath());
-      properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
-      properties.setProperty(SSL_ENABLED_COMPONENTS, sslComponents);
-    } catch (IOException e) {
-      Assert.fail("Failed to configure the cluster");
-    }
+    properties.setProperty(MCAST_PORT, "0");
+    properties.setProperty(SSL_REQUIRE_AUTHENTICATION, "true");
+    properties.setProperty(SSL_CIPHERS, "TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384,TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,TLS_DHE_DSS_WITH_AES_256_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA");
+    properties.setProperty(SSL_PROTOCOLS, "TLSv1,TLSv1.1,TLSv1.2");
+    properties.setProperty(SSL_KEYSTORE, jks.getCanonicalPath());
+    properties.setProperty(SSL_KEYSTORE_PASSWORD, "password");
+    properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
+    properties.setProperty(SSL_TRUSTSTORE, jks.getCanonicalPath());
+    properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
+    properties.setProperty(SSL_ENABLED_COMPONENTS, sslComponents);
+
     return properties;
   }
 
-
   private String commaDelimitedString(final String... sslComponents) {
     StringBuilder stringBuilder = new StringBuilder();
     for (String sslComponent : sslComponents) {
@@ -241,20 +243,27 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest {
     return stringBuilder.substring(0, stringBuilder.length() - 1);
   }
 
+  @Ignore("Test is not implemented")
   @Test
   public void testLegacyServerSSLConfig() {
   }
 
+  @Ignore("Test is not implemented")
   @Test
   public void testLegacyJMXSSLConfig() {
   }
 
+  @Ignore("Test is not implemented")
   @Test
   public void testLegacyGatewaySSLConfig() {
   }
 
+  @Ignore("Test is not implemented")
   @Test
   public void testLegacyHttpServiceSSLConfig() {
   }
 
+  private File findTestJKS() {
+    return new File(TestUtil.getResourcePath(getClass(), "/ssl/trusted.keystore"));
+  }
 }