You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by sa...@apache.org on 2016/06/23 17:25:25 UTC

[01/15] incubator-geode git commit: GEODE-1565: exclude GemfireDataCommandsDUnitTest over HTTP

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-1573 24f9db74e -> b006d993b


GEODE-1565: exclude GemfireDataCommandsDUnitTest over HTTP

Testing GemfireDataCommandsDUnitTest over HTTP is enabled on feature-GEODE-1565 and will be merged back to develop as soon as it's passing again.


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

Branch: refs/heads/feature/GEODE-1573
Commit: db739b221d2603eb7984ec24a79338c8efdf53e2
Parents: 832ddd1
Author: Kirk Lund <kl...@apache.org>
Authored: Sat Jun 18 13:44:24 2016 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Sat Jun 18 13:44:24 2016 -0700

----------------------------------------------------------------------
 .../internal/cli/commands/CommandOverHttpDUnitTest.java           | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db739b22/geode-web/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CommandOverHttpDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CommandOverHttpDUnitTest.java b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CommandOverHttpDUnitTest.java
index 6cc475e..cad3f31 100644
--- a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CommandOverHttpDUnitTest.java
+++ b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CommandOverHttpDUnitTest.java
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package com.gemstone.gemfire.management.internal.cli.commands;
 
 import org.junit.experimental.categories.Category;
@@ -43,7 +42,7 @@ import org.junit.runners.Suite;
   DeployCommandsDUnitTest.class,
   DiskStoreCommandsDUnitTest.class,
   FunctionCommandsDUnitTest.class,
-  GemfireDataCommandsDUnitTest.class,
+  //GemfireDataCommandsDUnitTest.class, restore when GEODE-1565 is fixed
   GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest.class,
   IndexCommandsDUnitTest.class,
   ListAndDescribeDiskStoreCommandsDUnitTest.class,


[04/15] incubator-geode git commit: GEODE-1567: update golden-help-offline for HelpCommandsIntegrationTest

Posted by sa...@apache.org.
GEODE-1567: update golden-help-offline for HelpCommandsIntegrationTest

* update golden-help-offline.properties to match changes made for GEODE-985 and GEODE-1408
* restore geode.properties back to gemfire.properties in CliStrings until GEODE-1466 is completed
* restore GeodeRedisServer back to GemFireRedisServer in CliStrings until GEODE-1566 is completed
* fix typo for cacheLoader default in CreateAlterDestroyRegionCommands from "help" to "null"


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

Branch: refs/heads/feature/GEODE-1573
Commit: 858bc35445a861acdcc2d2f678466d903987cbba
Parents: 0296476
Author: Kirk Lund <kl...@apache.org>
Authored: Mon Jun 20 12:47:56 2016 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Mon Jun 20 12:47:56 2016 -0700

----------------------------------------------------------------------
 .../CreateAlterDestroyRegionCommands.java       |  2 +-
 .../internal/cli/i18n/CliStrings.java           |  8 +-
 .../commands/HelpCommandsIntegrationTest.java   |  4 +
 .../cli/commands/golden-help-offline.properties | 82 ++++++++++----------
 4 files changed, 50 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/858bc354/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java
index 741da25..e525f37 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java
@@ -498,7 +498,7 @@ public class CreateAlterDestroyRegionCommands extends AbstractCommandsSupport {
       String[] cacheListeners,
       @CliOption (key = CliStrings.ALTER_REGION__CACHELOADER,
                   unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE,
-                  specifiedDefaultValue = "help",
+                  specifiedDefaultValue = "null",
                   help = CliStrings.ALTER_REGION__CACHELOADER__HELP)
       String cacheLoader,
       @CliOption (key = CliStrings.ALTER_REGION__CACHEWRITER,

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/858bc354/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/i18n/CliStrings.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/i18n/CliStrings.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/i18n/CliStrings.java
index d5ebe4c..9b38fac 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/i18n/CliStrings.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/i18n/CliStrings.java
@@ -1627,7 +1627,7 @@ public class CliStrings {
   public static final String START_LOCATOR__LOG_LEVEL = LOG_LEVEL;
   public static final String START_LOCATOR__LOG_LEVEL__HELP = "Sets the level of output logged to the Locator log file.  Possible values for log-level include: finest, finer, fine, config, info, warning, severe, none.";
   public static final String START_LOCATOR__MCAST_ADDRESS = MCAST_ADDRESS;
-  public static final String START_LOCATOR__MCAST_ADDRESS__HELP = "The IP address or hostname used to bind the UPD socket for multi-cast networking so the Locator can communicate other members in the Geode cluster using a common multicast address and port.  If mcast-port is zero, then mcast-address is ignored.";
+  public static final String START_LOCATOR__MCAST_ADDRESS__HELP = "The IP address or hostname used to bind the UPD socket for multi-cast networking so the Locator can communicate with other members in the Geode cluster using a common multicast address and port.  If mcast-port is zero, then mcast-address is ignored.";
   public static final String START_LOCATOR__MCAST_PORT = MCAST_PORT;
   public static final String START_LOCATOR__MCAST_PORT__HELP = "Sets the port used for multi-cast networking so the Locator can communicate with other members of the Geode cluster.  A zero value disables mcast.";
   public static final String START_LOCATOR__MEMBER_NAME = "name";
@@ -1635,7 +1635,7 @@ public class CliStrings {
   public static final String START_LOCATOR__PORT = "port";
   public static final String START_LOCATOR__PORT__HELP = "Port the Locator will listen on.";
   public static final String START_LOCATOR__PROPERTIES = "properties-file";
-  public static final String START_LOCATOR__PROPERTIES__HELP = "The geode.properties file for configuring the Locator's distributed system. The file's path can be absolute or relative to the gfsh working directory (--dir=).";
+  public static final String START_LOCATOR__PROPERTIES__HELP = "The gemfire.properties file for configuring the Locator's distributed system. The file's path can be absolute or relative to the gfsh working directory (--dir=)."; // TODO:GEODE-1466: update golden file to geode.properties
   public static final String START_LOCATOR__SECURITY_PROPERTIES = "security-properties-file";
   public static final String START_LOCATOR__SECURITY_PROPERTIES__HELP = "The gfsecurity.properties file for configuring the Locator's security configuration in the distributed system. The file's path can be absolute or relative to gfsh directory (--dir=).";
   public static final String START_LOCATOR__INITIALHEAP = "initial-heap";
@@ -1736,13 +1736,13 @@ public class CliStrings {
   public static final String START_SERVER__OFF_HEAP_MEMORY_SIZE = ConfigurationProperties.OFF_HEAP_MEMORY_SIZE;
   public static final String START_SERVER__OFF_HEAP_MEMORY_SIZE__HELP = "The total size of off-heap memory specified as off-heap-memory-size=<n>[g|m]. <n> is the size. [g|m] indicates whether the size should be interpreted as gigabytes or megabytes. A non-zero size causes that much memory to be allocated from the operating system and reserved for off-heap use.";
   public static final String START_SERVER__PROPERTIES = "properties-file";
-  public static final String START_SERVER__PROPERTIES__HELP = "The geode.properties file for configuring the Cache Server's distributed system. The file's path can be absolute or relative to the gfsh working directory.";
+  public static final String START_SERVER__PROPERTIES__HELP = "The gemfire.properties file for configuring the Cache Server's distributed system. The file's path can be absolute or relative to the gfsh working directory."; // TODO:GEODE-1466: update golden file to geode.properties
   public static final String START_SERVER__REDIS_PORT = ConfigurationProperties.REDIS_PORT;
   public static final String START_SERVER__REDIS_PORT__HELP = "Sets the port that the Geode Redis service listens on for Redis clients.";
   public static final String START_SERVER__REDIS_BIND_ADDRESS = ConfigurationProperties.REDIS_BIND_ADDRESS;
   public static final String START_SERVER__REDIS_BIND_ADDRESS__HELP = "Sets the IP address the Geode Redis service listens on for Redis clients. The default is to bind to the first non-loopback address for this machine.";
   public static final String START_SERVER__REDIS_PASSWORD = ConfigurationProperties.REDIS_PASSWORD;
-  public static final String START_SERVER__REDIS_PASSWORD__HELP = "Sets the authentication password for GeodeRedisServer";
+  public static final String START_SERVER__REDIS_PASSWORD__HELP = "Sets the authentication password for GemFireRedisServer"; // TODO:GEODE-1566: update golden file to GeodeRedisServer
   public static final String START_SERVER__SECURITY_PROPERTIES = "security-properties-file";
   public static final String START_SERVER__SECURITY_PROPERTIES__HELP = "The gfsecurity.properties file for configuring the Server's security configuration in the distributed system. The file's path can be absolute or relative to gfsh directory.";
   public static final String START_SERVER__REBALANCE = "rebalance";

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/858bc354/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/HelpCommandsIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/HelpCommandsIntegrationTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/HelpCommandsIntegrationTest.java
index bbb11db..7959037 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/HelpCommandsIntegrationTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/HelpCommandsIntegrationTest.java
@@ -74,6 +74,10 @@ public class HelpCommandsIntegrationTest {
     }
   }
 
+  /**
+   * TODO:GEODE-1466: update golden file to geode.properties
+   * TODO:GEODE-1566: update golden file to GeodeRedisServer
+   */
   @Test
   public void testOfflineHelp() throws Exception {
     Properties helpProps = new Properties();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/858bc354/geode-core/src/test/resources/com/gemstone/gemfire/management/internal/cli/commands/golden-help-offline.properties
----------------------------------------------------------------------
diff --git a/geode-core/src/test/resources/com/gemstone/gemfire/management/internal/cli/commands/golden-help-offline.properties b/geode-core/src/test/resources/com/gemstone/gemfire/management/internal/cli/commands/golden-help-offline.properties
index 0cd7a07..7a83679 100644
--- a/geode-core/src/test/resources/com/gemstone/gemfire/management/internal/cli/commands/golden-help-offline.properties
+++ b/geode-core/src/test/resources/com/gemstone/gemfire/management/internal/cli/commands/golden-help-offline.properties
@@ -131,7 +131,7 @@ PARAMETERS\n\
 \ \ \ \ entry-idle-time-expiration-action\n\
 \ \ \ \ \ \ \ \ Action to be taken on an entry that has exceeded the idle expiration.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
-\ \ \ \ \ \ \ \ Default (if the parameter is specified without value): __DEFAULT__\n\
+\ \ \ \ \ \ \ \ Default (if the parameter is specified without value): INVALIDATE\n\
 \ \ \ \ entry-time-to-live-expiration\n\
 \ \ \ \ \ \ \ \ How long the region's entries can remain in the cache without being accessed or updated.\n\
 \ \ \ \ \ \ \ \ The default is no expiration of this type.\n\
@@ -140,7 +140,7 @@ PARAMETERS\n\
 \ \ \ \ entry-time-to-live-expiration-action\n\
 \ \ \ \ \ \ \ \ Action to be taken on an entry that has exceeded the TTL expiration.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
-\ \ \ \ \ \ \ \ Default (if the parameter is specified without value): __DEFAULT__\n\
+\ \ \ \ \ \ \ \ Default (if the parameter is specified without value): INVALIDATE\n\
 \ \ \ \ region-idle-time-expiration\n\
 \ \ \ \ \ \ \ \ How long the region can remain in the cache without being accessed. The default is no\n\
 \ \ \ \ \ \ \ \ expiration of this type.\n\
@@ -149,7 +149,7 @@ PARAMETERS\n\
 \ \ \ \ region-idle-time-expiration-action\n\
 \ \ \ \ \ \ \ \ Action to be taken on a region that has exceeded the idle expiration.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
-\ \ \ \ \ \ \ \ Default (if the parameter is specified without value): __DEFAULT__\n\
+\ \ \ \ \ \ \ \ Default (if the parameter is specified without value): INVALIDATE\n\
 \ \ \ \ region-time-to-live-expiration\n\
 \ \ \ \ \ \ \ \ How long the region can remain in the cache without being accessed or updated. The default\n\
 \ \ \ \ \ \ \ \ is no expiration of this type.\n\
@@ -158,7 +158,7 @@ PARAMETERS\n\
 \ \ \ \ region-time-to-live-expiration-action\n\
 \ \ \ \ \ \ \ \ Action to be taken on a region that has exceeded the TTL expiration.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
-\ \ \ \ \ \ \ \ Default (if the parameter is specified without value): __DEFAULT__\n\
+\ \ \ \ \ \ \ \ Default (if the parameter is specified without value): INVALIDATE\n\
 \ \ \ \ cache-listener\n\
 \ \ \ \ \ \ \ \ Fully qualified class name of a plug-in to be instantiated for receiving after-event\n\
 \ \ \ \ \ \ \ \ notification of changes to the region and its entries. Any number of cache listeners can be\n\
@@ -170,13 +170,13 @@ PARAMETERS\n\
 \ \ \ \ \ \ \ \ region. For distributed regions, a cache loader may be invoked remotely from other members\n\
 \ \ \ \ \ \ \ \ that have the region defined.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
-\ \ \ \ \ \ \ \ Default (if the parameter is specified without value): __DEFAULT__\n\
+\ \ \ \ \ \ \ \ Default (if the parameter is specified without value): null\n\
 \ \ \ \ cache-writer\n\
 \ \ \ \ \ \ \ \ Fully qualified class name of a plug-in to be instantiated for receiving before-event\n\
 \ \ \ \ \ \ \ \ notification of changes to the region and its entries. The plug-in may cancel the event. At\n\
 \ \ \ \ \ \ \ \ most, one cache writer can be defined in each member for the region.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
-\ \ \ \ \ \ \ \ Default (if the parameter is specified without value): __DEFAULT__\n\
+\ \ \ \ \ \ \ \ Default (if the parameter is specified without value): null\n\
 \ \ \ \ async-event-queue-id\n\
 \ \ \ \ \ \ \ \ IDs of the Async Event Queues that will be used for write-behind operations.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
@@ -409,7 +409,7 @@ NAME\n\
 IS AVAILABLE\n\
 \ \ \ \ false\n\
 SYNOPSIS\n\
-\ \ \ \ Configures GemFire's Portable Data eXchange for all the cache(s) in the cluster. This command\n\
+\ \ \ \ Configures Geode's Portable Data eXchange for all the cache(s) in the cluster. This command\n\
 \ \ \ \ would not take effect on the running members in the system.\n\
 \ \ \ \ \ This command persists the pdx configuration in the locator with cluster configuration service.\n\
 \ \ \ \ \n\
@@ -477,7 +477,7 @@ PARAMETERS\n\
 \ \ \ \ \ \ \ \ Network address of the jmx-manager in the form: host[port].\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ use-http\n\
-\ \ \ \ \ \ \ \ Connects to Manager by sending HTTP requests to HTTP service hostint the Management REST\n\
+\ \ \ \ \ \ \ \ Connects to Manager by sending HTTP requests to HTTP service hosting the Management REST\n\
 \ \ \ \ \ \ \ \ API.  You must first 'disconnect' in order to reconnect to the Manager via locator or\n\
 \ \ \ \ \ \ \ \ jmx-manager using JMX.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
@@ -910,7 +910,7 @@ PARAMETERS\n\
 \ \ \ \ \ \ \ \ Group(s) of members on which the region will be created.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ skip-if-exists\n\
-\ \ \ \ \ \ \ \ Skip region ceation if the region already exists.\n\
+\ \ \ \ \ \ \ \ Skip region creation if the region already exists.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ \ \ \ \ Default (if the parameter is specified without value): true\n\
 \ \ \ \ \ \ \ \ Default (if the parameter is not specified): true\n\
@@ -937,7 +937,7 @@ PARAMETERS\n\
 \ \ \ \ \ \ \ \ Central Region with which this region should be colocated.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ compressor\n\
-\ \ \ \ \ \ \ \ The fully-qualifed class name of the Compressor to use when compressing region entry\n\
+\ \ \ \ \ \ \ \ The fully-qualified class name of the Compressor to use when compressing region entry\n\
 \ \ \ \ \ \ \ \ values.  The default is no compression.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ concurrency-level\n\
@@ -1485,7 +1485,7 @@ NAME\n\
 IS AVAILABLE\n\
 \ \ \ \ true\n\
 SYNOPSIS\n\
-\ \ \ \ Export region data from an offline disk store into gemfire snapshot files.\n\
+\ \ \ \ Export region data from an offline disk store into Geode snapshot files.\n\
 SYNTAX\n\
 \ \ \ \ export offline-disk-store --name=value --disk-dirs=value(,value)* --dir=value\n\
 PARAMETERS\n\
@@ -2157,7 +2157,7 @@ NAME\n\
 IS AVAILABLE\n\
 \ \ \ \ false\n\
 SYNOPSIS\n\
-\ \ \ \ Display any deadlocks in the GemFire distributed system.\n\
+\ \ \ \ Display any deadlocks in the Geode distributed system.\n\
 SYNTAX\n\
 \ \ \ \ show dead-locks --file=value\n\
 PARAMETERS\n\
@@ -2329,7 +2329,7 @@ IS AVAILABLE\n\
 \ \ \ \ true\n\
 SYNOPSIS\n\
 \ \ \ \ Start the JDK's JConsole tool in a separate process. JConsole will be launched, but connecting\n\
-\ \ \ \ to GemFire must be done manually.\n\
+\ \ \ \ to Geode must be done manually.\n\
 SYNTAX\n\
 \ \ \ \ start jconsole [--interval=value] [--notile(=value)?] [--pluginpath=value] [--version(=value)?]\n\
 \ \ \ \ [--J=value(,value)*]\n\
@@ -2367,7 +2367,7 @@ IS AVAILABLE\n\
 \ \ \ \ true\n\
 SYNOPSIS\n\
 \ \ \ \ Start the JDK's Java VisualVM (jvisualvm) tool in a separate process. Java VisualVM will be\n\
-\ \ \ \ launched, but connecting to GemFire must be done manually.\n\
+\ \ \ \ launched, but connecting to Geode must be done manually.\n\
 SYNTAX\n\
 \ \ \ \ start jvisualvm [--J=value(,value)*]\n\
 PARAMETERS\n\
@@ -2392,7 +2392,7 @@ SYNTAX\n\
 \ \ \ \ [--cluster-config-dir=value]\n\
 PARAMETERS\n\
 \ \ \ \ name\n\
-\ \ \ \ \ \ \ \ The member name to give this Locator in the GemFire cluster.\n\
+\ \ \ \ \ \ \ \ The member name to give this Locator in the Geode cluster.\n\
 \ \ \ \ \ \ \ \ Required: true\n\
 \ \ \ \ bind-address\n\
 \ \ \ \ \ \ \ \ IP address on which the Locator will be bound.  By default, the Locator is bound to all\n\
@@ -2421,7 +2421,7 @@ PARAMETERS\n\
 \ \ \ \ \ \ \ \ Default (if the parameter is specified without value): true\n\
 \ \ \ \ \ \ \ \ Default (if the parameter is not specified): false\n\
 \ \ \ \ locators\n\
-\ \ \ \ \ \ \ \ Sets the list of Locators used by this Locator to join the appropriate GemFire cluster.\n\
+\ \ \ \ \ \ \ \ Sets the list of Locators used by this Locator to join the appropriate Geode cluster.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ log-level\n\
 \ \ \ \ \ \ \ \ Sets the level of output logged to the Locator log file.  Possible values for log-level\n\
@@ -2429,12 +2429,12 @@ PARAMETERS\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ mcast-address\n\
 \ \ \ \ \ \ \ \ The IP address or hostname used to bind the UPD socket for multi-cast networking so the\n\
-\ \ \ \ \ \ \ \ Locator can communicate other members in the GemFire cluster using a common multicast\n\
+\ \ \ \ \ \ \ \ Locator can communicate with other members in the Geode cluster using a common multicast\n\
 \ \ \ \ \ \ \ \ address and port.  If mcast-port is zero, then mcast-address is ignored.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ mcast-port\n\
 \ \ \ \ \ \ \ \ Sets the port used for multi-cast networking so the Locator can communicate with other\n\
-\ \ \ \ \ \ \ \ members of the GemFire cluster.  A zero value disables mcast.\n\
+\ \ \ \ \ \ \ \ members of the Geode cluster.  A zero value disables mcast.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ port\n\
 \ \ \ \ \ \ \ \ Port the Locator will listen on.\n\
@@ -2504,7 +2504,7 @@ NAME\n\
 IS AVAILABLE\n\
 \ \ \ \ true\n\
 SYNOPSIS\n\
-\ \ \ \ Start a GemFire Cache Server.\n\
+\ \ \ \ Start a Geode Cache Server.\n\
 SYNTAX\n\
 \ \ \ \ start server --name=value [--assign-buckets(=value)?] [--bind-address=value]\n\
 \ \ \ \ [--cache-xml-file=value] [--classpath=value] [--critical-heap-percentage=value]\n\
@@ -2562,7 +2562,7 @@ PARAMETERS\n\
 \ \ \ \ \ \ \ \ Default (if the parameter is specified without value): true\n\
 \ \ \ \ \ \ \ \ Default (if the parameter is not specified): false\n\
 \ \ \ \ enable-time-statistics\n\
-\ \ \ \ \ \ \ \ Causes additional time-based statistics to be gathered for GemFire operations.\n\
+\ \ \ \ \ \ \ \ Causes additional time-based statistics to be gathered for Geode operations.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ \ \ \ \ Default (if the parameter is specified without value): true\n\
 \ \ \ \ eviction-heap-percentage\n\
@@ -2609,14 +2609,14 @@ PARAMETERS\n\
 \ \ \ \ \ \ \ \ will set the system property "foo.bar" to "true".\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ locators\n\
-\ \ \ \ \ \ \ \ Sets the list of Locators used by the Cache Server to join the appropriate GemFire cluster.\n\
+\ \ \ \ \ \ \ \ Sets the list of Locators used by the Cache Server to join the appropriate Geode cluster.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ locator-wait-time\n\
 \ \ \ \ \ \ \ \ Sets the number of seconds the server will wait for a locator to become available during\n\
 \ \ \ \ \ \ \ \ startup before giving up.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ lock-memory\n\
-\ \ \ \ \ \ \ \ Causes GemFire to lock heap and off-heap memory pages into RAM. This prevents the operating\n\
+\ \ \ \ \ \ \ \ Causes Geode to lock heap and off-heap memory pages into RAM. This prevents the operating\n\
 \ \ \ \ \ \ \ \ system from swapping the pages out to disk, which can cause severe performance degradation.\n\
 \ \ \ \ \ \ \ \ When you use this option, also configure the operating system limits for locked memory.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
@@ -2641,29 +2641,29 @@ PARAMETERS\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ mcast-address\n\
 \ \ \ \ \ \ \ \ The IP address or hostname used to bind the UPD socket for multi-cast networking so the\n\
-\ \ \ \ \ \ \ \ Cache Server can communicate with other members in the GemFire cluster.  If mcast-port is\n\
+\ \ \ \ \ \ \ \ Cache Server can communicate with other members in the Geode cluster.  If mcast-port is\n\
 \ \ \ \ \ \ \ \ zero, then mcast-address is ignored.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ mcast-port\n\
 \ \ \ \ \ \ \ \ Sets the port used for multi-cast networking so the Cache Server can communicate with other\n\
-\ \ \ \ \ \ \ \ members of the GemFire cluster.  A zero value disables mcast.\n\
+\ \ \ \ \ \ \ \ members of the Geode cluster.  A zero value disables mcast.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ memcached-port\n\
-\ \ \ \ \ \ \ \ Sets the port that the GemFire memcached service listens on for memcached clients.\n\
+\ \ \ \ \ \ \ \ Sets the port that the Geode memcached service listens on for memcached clients.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ memcached-protocol\n\
-\ \ \ \ \ \ \ \ Sets the protocol that the GemFire memcached service uses (ASCII or BINARY).\n\
+\ \ \ \ \ \ \ \ Sets the protocol that the Geode memcached service uses (ASCII or BINARY).\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ memcached-bind-address\n\
-\ \ \ \ \ \ \ \ Sets the IP address the GemFire memcached service listens on for memcached clients. The\n\
+\ \ \ \ \ \ \ \ Sets the IP address the Geode memcached service listens on for memcached clients. The\n\
 \ \ \ \ \ \ \ \ default is to bind to the first non-loopback address for this machine.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ redis-port\n\
-\ \ \ \ \ \ \ \ Sets the port that the GemFire Redis service listens on for Redis clients.\n\
+\ \ \ \ \ \ \ \ Sets the port that the Geode Redis service listens on for Redis clients.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ redis-bind-address\n\
-\ \ \ \ \ \ \ \ Sets the IP address the GemFire Redis service listens on for Redis clients. The default is\n\
-\ \ \ \ \ \ \ \ to bind to the first non-loopback address for this machine.\n\
+\ \ \ \ \ \ \ \ Sets the IP address the Geode Redis service listens on for Redis clients. The default is to\n\
+\ \ \ \ \ \ \ \ bind to the first non-loopback address for this machine.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ redis-password\n\
 \ \ \ \ \ \ \ \ Sets the authentication password for GemFireRedisServer\n\
@@ -2672,7 +2672,7 @@ PARAMETERS\n\
 \ \ \ \ \ \ \ \ Sets the time (in seconds ) after which a message in the client queue will expire\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ name\n\
-\ \ \ \ \ \ \ \ The member name to give this Cache Server in the GemFire cluster.\n\
+\ \ \ \ \ \ \ \ The member name to give this Cache Server in the Geode cluster.\n\
 \ \ \ \ \ \ \ \ Required: true\n\
 \ \ \ \ off-heap-memory-size\n\
 \ \ \ \ \ \ \ \ The total size of off-heap memory specified as off-heap-memory-size=<n>[g|m]. <n> is the\n\
@@ -2685,7 +2685,7 @@ PARAMETERS\n\
 \ \ \ \ \ \ \ \ file's path can be absolute or relative to the gfsh working directory.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ rebalance\n\
-\ \ \ \ \ \ \ \ Whether to initiate rebalancing across the GemFire cluster.\n\
+\ \ \ \ \ \ \ \ Whether to initiate rebalancing across the Geode cluster.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ \ \ \ \ Default (if the parameter is specified without value): true\n\
 \ \ \ \ \ \ \ \ Default (if the parameter is not specified): false\n\
@@ -2709,7 +2709,7 @@ PARAMETERS\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ spring-xml-location\n\
 \ \ \ \ \ \ \ \ Specifies the location of a Spring XML configuration file(s) for bootstrapping and\n\
-\ \ \ \ \ \ \ \ configuring a GemFire Server.\n\
+\ \ \ \ \ \ \ \ configuring a Geode Server.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ statistic-archive-file\n\
 \ \ \ \ \ \ \ \ The file that statistic samples are written to.  An empty string (default) disables\n\
@@ -2796,7 +2796,7 @@ SYNTAX\n\
 \ \ \ \ status locator [--name=value] [--host=value] [--port=value] [--pid=value] [--dir=value]\n\
 PARAMETERS\n\
 \ \ \ \ name\n\
-\ \ \ \ \ \ \ \ Member name or ID of the Locator in the GemFire cluster.\n\
+\ \ \ \ \ \ \ \ Member name or ID of the Locator in the Geode cluster.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ host\n\
 \ \ \ \ \ \ \ \ Hostname or IP address on which the Locator is running.\n\
@@ -2817,15 +2817,15 @@ NAME\n\
 IS AVAILABLE\n\
 \ \ \ \ true\n\
 SYNOPSIS\n\
-\ \ \ \ Display the status of a GemFire Cache Server.\n\
+\ \ \ \ Display the status of a Geode Cache Server.\n\
 SYNTAX\n\
 \ \ \ \ status server [--name=value] [--pid=value] [--dir=value]\n\
 PARAMETERS\n\
 \ \ \ \ name\n\
-\ \ \ \ \ \ \ \ Member name or ID of the Cache Server in the GemFire cluster.\n\
+\ \ \ \ \ \ \ \ Member name or ID of the Cache Server in the Geode cluster.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ pid\n\
-\ \ \ \ \ \ \ \ Process ID (PID) of the running GemFire Cache Server.\n\
+\ \ \ \ \ \ \ \ Process ID (PID) of the running Geode Cache Server.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ dir\n\
 \ \ \ \ \ \ \ \ Working directory in which the Cache Server is running. The default is the current\n\
@@ -2880,7 +2880,7 @@ SYNTAX\n\
 \ \ \ \ stop locator [--name=value] [--pid=value] [--dir=value]\n\
 PARAMETERS\n\
 \ \ \ \ name\n\
-\ \ \ \ \ \ \ \ Member name or ID of the Locator in the GemFire cluster.\n\
+\ \ \ \ \ \ \ \ Member name or ID of the Locator in the Geode cluster.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ pid\n\
 \ \ \ \ \ \ \ \ The process id (PID) of the running Locator.\n\
@@ -2895,7 +2895,7 @@ NAME\n\
 IS AVAILABLE\n\
 \ \ \ \ true\n\
 SYNOPSIS\n\
-\ \ \ \ Stop a GemFire Cache Server.\n\
+\ \ \ \ Stop a Geode Cache Server.\n\
 SYNTAX\n\
 \ \ \ \ stop server [--name=value] [--pid=value] [--dir=value]\n\
 MODES\n\
@@ -2909,10 +2909,10 @@ MODES\n\
 \ \ \ \ \ \ \ \ stop server  --dir=value\n\
 PARAMETERS\n\
 \ \ \ \ name\n\
-\ \ \ \ \ \ \ \ Member name or ID of the Cache Server in the GemFire cluster.\n\
+\ \ \ \ \ \ \ \ Member name or ID of the Cache Server in the Geode cluster.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ pid\n\
-\ \ \ \ \ \ \ \ Process ID (PID) of the running GemFire Cache Server.\n\
+\ \ \ \ \ \ \ \ Process ID (PID) of the running Geode Cache Server.\n\
 \ \ \ \ \ \ \ \ Required: false\n\
 \ \ \ \ dir\n\
 \ \ \ \ \ \ \ \ Working directory in which the Cache Server is running. The default is the current\n\


[10/15] incubator-geode git commit: GEODE-1565: add quotes around any value starting with hyphen

Posted by sa...@apache.org.
GEODE-1565: add quotes around any value starting with hyphen

* refactor OptionJFormatter into HyphenFormatter to format all values starting with hypen


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

Branch: refs/heads/feature/GEODE-1573
Commit: 170919bcc33dcb48d931b5c4ad707df7eec4a2f0
Parents: de6105f
Author: Kirk Lund <kl...@pivotal.io>
Authored: Tue Jun 21 10:22:29 2016 -0700
Committer: Kirk Lund <kl...@pivotal.io>
Committed: Tue Jun 21 10:24:09 2016 -0700

----------------------------------------------------------------------
 .../management/internal/cli/GfshParser.java     |   4 +-
 .../cli/parser/jopt/JoptOptionParser.java       |   4 +-
 .../internal/cli/remote/CommandProcessor.java   |   1 -
 .../internal/cli/util/HyphenFormatter.java      |  92 +++++++++
 .../internal/cli/util/OptionJFormatter.java     | 115 -----------
 .../internal/cli/GfshParserIntegrationTest.java |  38 ++++
 .../commands/GemfireDataCommandsDUnitTest.java  |  42 +++-
 .../internal/cli/util/HyphenFormatterTest.java  | 201 +++++++++++++++++++
 .../internal/cli/util/OptionJFormatterTest.java | 189 -----------------
 .../cli/commands/CommandOverHttpDUnitTest.java  |   2 +-
 10 files changed, 367 insertions(+), 321 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/170919bc/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/GfshParser.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/GfshParser.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/GfshParser.java
index 0bf2f66..9023ebe 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/GfshParser.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/GfshParser.java
@@ -893,7 +893,7 @@ public class GfshParser implements Parser {
           preConfigureConverters(commandTarget);
 
           try {
-            // TODO: next call invokes OptionJFormatter
+            // TODO: next call invokes HyphenFormatter
             parse = commandTarget.getOptionParser().parse(gfshMethodTarget.getRemainingBuffer());
           } catch (CliException ce) {
             if (ce instanceof CliCommandOptionException) {
@@ -925,7 +925,7 @@ public class GfshParser implements Parser {
           } else {
             if (coe != null) {
               logWrapper.fine("Handling exception: " + coe.getMessage());
-              ExceptionHandler.handleException(coe);
+              ExceptionHandler.handleException(coe); // TODO: this eats exception that would make it easier to debug GemfireDataCommandsDUnitTest
               // ExceptionHandler.handleException() only logs it on console.
               // When on member, we need to handle this.
               if (!CliUtil.isGfshVM()) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/170919bc/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/parser/jopt/JoptOptionParser.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/parser/jopt/JoptOptionParser.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/parser/jopt/JoptOptionParser.java
index 04590ed..de47ce6 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/parser/jopt/JoptOptionParser.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/parser/jopt/JoptOptionParser.java
@@ -39,7 +39,7 @@ import com.gemstone.gemfire.management.internal.cli.parser.SyntaxConstants;
 import com.gemstone.gemfire.management.internal.cli.parser.preprocessor.Preprocessor;
 import com.gemstone.gemfire.management.internal.cli.parser.preprocessor.PreprocessorUtils;
 import com.gemstone.gemfire.management.internal.cli.parser.preprocessor.TrimmedInput;
-import com.gemstone.gemfire.management.internal.cli.util.OptionJFormatter;
+import com.gemstone.gemfire.management.internal.cli.util.HyphenFormatter;
 
 /**
  * Implementation of {@link GfshOptionParser} which internally makes use of
@@ -115,7 +115,7 @@ public class JoptOptionParser implements GfshOptionParser {
     optionSet.setUserInput(userInput!=null?userInput.trim():"");
     if (userInput != null) {
       TrimmedInput input = PreprocessorUtils.trim(userInput);
-      String[] preProcessedInput = preProcess(new OptionJFormatter().formatCommand(input.getString()));
+      String[] preProcessedInput = preProcess(new HyphenFormatter().formatCommand(input.getString()));
       joptsimple.OptionSet joptOptionSet = null;
       CliCommandOptionException ce = null;
       // int factor = 0;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/170919bc/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/remote/CommandProcessor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/remote/CommandProcessor.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/remote/CommandProcessor.java
index b62f922..790dd6c 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/remote/CommandProcessor.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/remote/CommandProcessor.java
@@ -30,7 +30,6 @@ import com.gemstone.gemfire.management.internal.cli.GfshParser;
 import com.gemstone.gemfire.management.internal.cli.LogWrapper;
 import com.gemstone.gemfire.management.internal.cli.result.ResultBuilder;
 import com.gemstone.gemfire.management.internal.cli.util.CommentSkipHelper;
-import com.gemstone.gemfire.management.internal.cli.util.OptionJFormatter;
 import com.gemstone.gemfire.management.internal.security.ResourceOperation;
 import com.gemstone.gemfire.security.NotAuthorizedException;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/170919bc/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/util/HyphenFormatter.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/util/HyphenFormatter.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/util/HyphenFormatter.java
new file mode 100644
index 0000000..0fb4fcd
--- /dev/null
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/util/HyphenFormatter.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gemstone.gemfire.management.internal.cli.util;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Inserts quotes around the values of any option values that begin with hyphen.
+ */
+public class HyphenFormatter {
+
+  private static final String OPTION_PATTERN = "\\-\\-[a-zA-Z]+\\-?[a-zA-Z]*\\=";
+
+  private static final String QUOTE = "\"";
+  private static final String EQUAL_HYPHEN = "=-";
+  private static final String EQUAL = "=";
+  private static final String SPACE = " ";
+
+  private StringBuilder formatted;
+
+  /**
+   * Returns command with quotes around the values of any option values that begin with hyphen.
+   */
+  public String formatCommand(String command){
+    if (!containsOption(command)) {
+      return command;
+    }
+    this.formatted = new StringBuilder();
+
+    List<String> strings = split(command);
+    for (String string : strings) {
+      if (string.contains(EQUAL_HYPHEN)) {
+        int indexOfEquals = string.indexOf(EQUAL);
+        formatted.append(string.substring(0, indexOfEquals + 1));
+        formatted.append(QUOTE);
+        formatted.append(string.substring(indexOfEquals + 1));
+        formatted.append(QUOTE);
+      } else {
+        formatted.append(string);
+      }
+      formatted.append(SPACE);
+    }
+    return formatted.toString().trim();
+  }
+
+  /**
+   * Returns true if command contains any options.
+   */
+  boolean containsOption(String cmd) {
+    return Pattern.compile(OPTION_PATTERN).matcher(cmd).find();
+  }
+
+  private List<String> split(String cmd) {
+    List<String> strings = new ArrayList<>();
+
+    Matcher matcher = Pattern.compile(OPTION_PATTERN).matcher(cmd);
+
+    int index = 0; // first index of --option=
+
+    while (matcher.find()) {
+      if (matcher.start() - index > 0) {
+        String option = cmd.substring(index, matcher.start()).trim();
+        strings.add(option);
+      }
+      index = matcher.start();
+    }
+
+    String lastOne = cmd.substring(index);
+    if (lastOne != null) {
+      strings.add(lastOne);
+    }
+
+    return strings;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/170919bc/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/util/OptionJFormatter.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/util/OptionJFormatter.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/util/OptionJFormatter.java
deleted file mode 100644
index 0e3265a..0000000
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/util/OptionJFormatter.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gemstone.gemfire.management.internal.cli.util;
-
-/**
- * Inserts quotes around the values of any --J options.
- */
-public class OptionJFormatter {
-
-  private static final String J_OPTION = "--J=";
-  private static final char QUOTE = '\"';
-  private static final char SPACE = ' ';
-
-  private boolean quotesOpened;
-  private int previousSpace;
-  private String command;
-  private StringBuilder formatted;
-
-  /**
-   * Returns command with quotes inserted around the values of any --J options.
-   */
-  public String formatCommand(String command){
-    if (!containsJopt(command)) {
-      return command;
-    }
-    this.command = command;
-    this.formatted = new StringBuilder();
-    quotesOpened = false;
-
-    int nextJ = this.command.indexOf(J_OPTION);
-
-    while (nextJ > -1) {
-      String stringBeforeJ = this.command.substring(0, nextJ+4);
-      if (quotesOpened && stringBeforeJ.contains("--")){
-        previousSpace = stringBeforeJ.indexOf("--") - 1;
-        while (stringBeforeJ.charAt(previousSpace) == SPACE){
-          previousSpace--;
-        }
-        stringBeforeJ = stringBeforeJ.substring(0,previousSpace + 1) + QUOTE + stringBeforeJ.substring(previousSpace + 1);
-        quotesOpened = false;
-      }
-
-      this.command = this.command.substring(nextJ+4);
-
-      this.formatted.append(stringBeforeJ);
-      if (!this.command.startsWith(""+QUOTE)){
-        this.formatted.append(QUOTE);
-        quotesOpened = true;
-      }
-      quotesOpened = true;
-
-      int nextSpace = this.command.indexOf(SPACE);
-      String stringAfterJ = null;
-      if (nextSpace > -1) {
-        stringAfterJ = this.command.substring(0, nextSpace);
-        this.command = this.command.substring(nextSpace);
-      } else {
-        stringAfterJ = this.command.substring(0);
-        this.command = "";
-      }
-
-      this.formatted.append(stringAfterJ);
-      if (stringAfterJ.endsWith("\"")){
-        quotesOpened = false;
-      }
-
-      nextSpace = this.command.indexOf(SPACE);
-
-      if (nextSpace == -1) {
-        if (!stringAfterJ.endsWith("" + QUOTE)) {
-          this.formatted.append(QUOTE);
-          quotesOpened = false;
-        }
-      } else if (!this.formatted.toString().endsWith(""+QUOTE)) {
-        if(this.command.startsWith(" --")){
-          this.formatted.append(QUOTE);
-          quotesOpened = false;
-        }
-      }
-
-      if (!containsJopt(this.command)){
-        this.formatted.append(this.command);
-      }
-
-      nextJ = this.command.indexOf(J_OPTION);
-    }
-
-    return formatted.toString();
-  }
-
-  /**
-   * Returns true if command contains any --J options.
-   */
-  boolean containsJopt(String cmd){
-    if (cmd.contains("--J")){
-      return true;
-    }
-    return false;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/170919bc/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserIntegrationTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserIntegrationTest.java
index 17e78a5..b8f0d10 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserIntegrationTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/GfshParserIntegrationTest.java
@@ -63,6 +63,44 @@ public class GfshParserIntegrationTest {
   }
 
   @Test
+  public void optionStartsWithHyphenWithoutQuotes() throws Exception {
+    String input = "rebalance --exclude-region=/GemfireDataCommandsDUnitTestRegion2 --simulate=true --time-out=-1";
+    Map<String, String> params = params(input, "rebalance", "rebalance");
+
+    assertThat(params.get("exclude-region")).isEqualTo("/GemfireDataCommandsDUnitTestRegion2");
+    assertThat(params.get("simulate")).isEqualTo("true");
+    assertThat(params.get("time-out")).isEqualTo("\"-1\"");
+  }
+
+  @Test
+  public void optionStartsWithHyphenWithQuotes() throws Exception {
+    String input = "rebalance --exclude-region=/GemfireDataCommandsDUnitTestRegion2 --simulate=true --time-out=\"-1\"";
+    Map<String, String> params = params(input, "rebalance", "rebalance");
+
+    assertThat(params.get("exclude-region")).isEqualTo("/GemfireDataCommandsDUnitTestRegion2");
+    assertThat(params.get("simulate")).isEqualTo("true");
+    assertThat(params.get("time-out")).isEqualTo("\"-1\"");
+  }
+
+  @Test
+  public void optionContainingHyphen() throws Exception {
+    String input = "rebalance --exclude-region=/The-Region --simulate=true";
+    Map<String, String> params = params(input, "rebalance", "rebalance");
+
+    assertThat(params.get("exclude-region")).isEqualTo("/The-Region");
+    assertThat(params.get("simulate")).isEqualTo("true");
+  }
+
+  @Test
+  public void optionContainingUnderscore() throws Exception {
+    String input = "rebalance --exclude-region=/The_region --simulate=true";
+    Map<String, String> params = params(input, "rebalance", "rebalance");
+
+    assertThat(params.get("exclude-region")).isEqualTo("/The_region");
+    assertThat(params.get("simulate")).isEqualTo("true");
+  }
+
+  @Test
   public void oneJOptionWithQuotes() throws Exception {
     String input = "start locator  --J=\"-Dgemfire.http-service-port=8080\" --name=loc1";
     Map<String, String> params = params(input, "start locator", "startLocator");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/170919bc/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
index 68fe0ae..b0272b2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
@@ -34,6 +34,10 @@ import java.util.Properties;
 import java.util.Random;
 import java.util.Set;
 
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.DataPolicy;
@@ -80,9 +84,6 @@ import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
 
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
 /**
  * Dunit class for testing gemfire data commands : get, put, remove, select, rebalance
  */
@@ -1765,7 +1766,6 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
     }
   }
 
-  @Category(FlakyTest.class) // GEODE-1484
   @Test
   public void testRebalanceCommandForSimulate() {
     setupTestRebalanceForEntireDS();
@@ -1787,7 +1787,6 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
     }
   }
 
-  @Category(FlakyTest.class)
   @Test
   public void testRebalanceCommandForSimulateWithNoMember() {
     setupTestRebalanceForEntireDS();
@@ -1812,7 +1811,6 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
     }
   }
 
-  @Category(FlakyTest.class) // GEODE-1483
   @Test
   public void testRebalanceForIncludeRegionFunction() {
     // setup();
@@ -1834,7 +1832,6 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
     }
   }
 
-  @Category(FlakyTest.class) // GEODE-1551: org.eclipse.jetty.io.EofException
   @Test
   public void testSimulateForEntireDS() {
     setupTestRebalanceForEntireDS();
@@ -1842,7 +1839,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
     final VM manager = Host.getHost(0).getVM(0);
     manager.invoke(checkRegionMBeans);
 
-    getLogWriter().info("testSimulateForEntireDS verified Mbean and executin command");
+    getLogWriter().info("testSimulateForEntireDS verified MBean and executing command");
 
     String command = "rebalance --simulate=true";
 
@@ -1859,7 +1856,31 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
     }
   }
 
-  @Category(FlakyTest.class) // GEODE-1487
+  @Ignore("TODO: enable test after GEODE-1574 is fixed")
+  @Test
+  public void testSimulateForEntireDSWithTimeout() {
+    setupTestRebalanceForEntireDS();
+    //check if DistributedRegionMXBean is available so that command will not fail
+    final VM manager = Host.getHost(0).getVM(0);
+    manager.invoke(checkRegionMBeans);
+
+    getLogWriter().info("testSimulateForEntireDS verified MBean and executing command");
+
+    String command = "rebalance --simulate=true --time-out=-1";
+
+    CommandResult cmdResult = executeCommand(command);
+
+    getLogWriter().info("testSimulateForEntireDS just after executing " + cmdResult);
+
+    if (cmdResult != null) {
+      String stringResult = commandResultToString(cmdResult);
+      getLogWriter().info("testSimulateForEntireDS stringResult : " + stringResult);
+      assertEquals(Result.Status.OK, cmdResult.getStatus());
+    } else {
+      fail("testRebalanceForIncludeRegionFunction failed as did not get CommandResult");
+    }
+  }
+
   @Test
   public void testRebalanceForEntireDS() {
     setupTestRebalanceForEntireDS();
@@ -1950,7 +1971,6 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
     }
   }
 
-  @Category(FlakyTest.class)
   @Test
   public void testRebalanceForExcludeRegionFunction() {
     setupWith2Regions();
@@ -1968,7 +1988,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
     if (cmdResult != null) {
       String stringResult = commandResultToString(cmdResult);
       getLogWriter().info("testRebalanceForExcludeRegionFunction stringResult : " + stringResult);
-      assertEquals(Result.Status.OK, cmdResult.getStatus());
+      assertEquals("CommandResult=" + cmdResult, Result.Status.OK, cmdResult.getStatus());
     } else {
       fail("testRebalanceForIncludeRegionFunction failed as did not get CommandResult");
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/170919bc/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/util/HyphenFormatterTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/util/HyphenFormatterTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/util/HyphenFormatterTest.java
new file mode 100644
index 0000000..fedc597
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/util/HyphenFormatterTest.java
@@ -0,0 +1,201 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gemstone.gemfire.management.internal.cli.util;
+
+import static org.assertj.core.api.Assertions.*;
+import static org.junit.Assert.*;
+
+import java.util.Arrays;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.test.junit.categories.UnitTest;
+
+@Category(UnitTest.class)
+public class HyphenFormatterTest {
+
+  private HyphenFormatter formatter;
+  
+  @Before
+  public void setUp() {
+    this.formatter = new HyphenFormatter();
+  }
+
+  @Test
+  public void containsOptionWithOneOptionReturnsTrue() {
+    String cmd = "start locator --name=loc1";
+    assertTrue(this.formatter.containsOption(cmd));
+  }
+
+  @Test
+  public void containsOptionWithNoOptionReturnsFalse() {
+    String cmd = "start locator";
+    assertFalse(this.formatter.containsOption(cmd));
+  }
+
+  @Test
+  public void containsOptionWithMultipleOptionsReturnsTrue() {
+    String cmd = "start locator --name=loc1 --J=-Dfoo=bar --J=-Dbar=foo";
+    assertTrue(this.formatter.containsOption(cmd));
+  }
+
+  @Test
+  public void valueWithoutQuotesReturnsWithQuotes() {
+    String cmd = "start locator --name=loc1 --J=-Dfoo=bar";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+
+    String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\"";
+    assertThat(formattedCmd).isEqualTo(expected);
+  }
+
+  @Test
+  public void valueWithoutQuotesReturnsWithQuotes_2() {
+    String cmd = "start locator --J=-Dfoo=bar --name=loc1";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+
+    String expected = "start locator --J=\"-Dfoo=bar\" --name=loc1";
+    assertThat(formattedCmd).isEqualTo(expected);
+  }
+
+  @Test
+  public void valueWithHyphenWithoutQuotesFails() {
+    String cmd = "rebalance --exclude-region=/GemfireDataCommandsDUnitTestRegion2 --simulate=true --time-out=-1";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+
+    String expected = "rebalance --exclude-region=/GemfireDataCommandsDUnitTestRegion2 --simulate=true --time-out=\"-1\"";
+    assertThat(formattedCmd).isEqualTo(expected);
+  }
+
+  @Test
+  public void valueWithHyphenWithoutQuotes() {
+    String cmd = "rebalance --exclude-region=/GemfireDataCommandsDUnitTestRegion2 --simulate=true --time-out=-1";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+
+    String expected = "rebalance --exclude-region=/GemfireDataCommandsDUnitTestRegion2 --simulate=true --time-out=\"-1\"";
+    assertThat(formattedCmd).isEqualTo(expected);
+  }
+
+  @Test
+  public void nullShouldThrowNullPointerException() {
+    assertThatThrownBy(() -> this.formatter.formatCommand(null)).isExactlyInstanceOf(NullPointerException.class);
+  }
+
+  @Test
+  public void emptyShouldThrowNullPointerException() {
+    assertThat(this.formatter.formatCommand("")).isEqualTo("");
+  }
+
+  @Test
+  public void multipleJOptions() {
+    String cmd = "start locator --name=loc1 --J=-Dfoo=bar --J=-Dbar=foo";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+
+    String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\" --J=\"-Dbar=foo\"";
+    assertThat(formattedCmd).isEqualTo(expected);
+  }
+
+  @Test
+  public void multipleJOptionsWithSomethingAfter() {
+    String cmd = "start locator --name=loc1 --J=-Dfoo=bar --J=-Dbar=foo --group=locators";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+
+    String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\" --J=\"-Dbar=foo\" --group=locators";
+    assertThat(formattedCmd).isEqualTo(expected);
+  }
+
+  @Test
+  public void multipleJOptionsWithSomethingBetween() {
+    String cmd = "start locator --name=loc1 --J=-Dfoo=bar --group=locators --J=-Dbar=foo";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+
+    String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\" --group=locators --J=\"-Dbar=foo\"";
+    assertThat(formattedCmd).isEqualTo(expected);
+  }
+
+  @Test
+  public void valueWithQuotes() {
+    String cmd = "start locator --name=loc1 --J=\"-Dfoo=bar\"";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+    assertThat(formattedCmd).isEqualTo(cmd);
+  }
+
+  @Test
+  public void oneValueWithQuotesOneWithout() {
+    String cmd = "start locator --name=loc1 --J=\"-Dfoo=bar\" --J=-Dfoo=bar";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+    String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\" --J=\"-Dfoo=bar\"";
+    assertThat(formattedCmd).as(cmd).isEqualTo(expected);
+  }
+
+  @Test
+  public void oneValueWithoutQuotesOneWith() {
+    String cmd = "start locator --name=loc1 --J=-Dfoo=bar --J=\"-Dfoo=bar\"";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+    String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\" --J=\"-Dfoo=bar\"";
+    assertThat(formattedCmd).isEqualTo(expected);
+  }
+
+  @Test
+  public void twoValuesWithQuotes() {
+    String cmd = "start locator --name=loc1 --J=\"-Dfoo=bar\" --J=\"-Dfoo=bar\"";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+    assertThat(formattedCmd).as(cmd).isEqualTo(cmd);
+  }
+
+  @Test
+  public void valueContainingQuotes() {
+    String cmd = "start locator --name=loc1 --J=\"-Dfoo=region\"";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+    String expected = "start locator --name=loc1 --J=\"-Dfoo=region\"";
+    assertThat(formattedCmd).as(cmd).isEqualTo(expected);
+  }
+
+  @Test
+  public void valueContainingQuotesAndSpace() {
+    String cmd = "start locator --name=loc1 --J=\"-Dfoo=my phrase\"";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+    String expected = "start locator --name=loc1 --J=\"-Dfoo=my phrase\"";
+    assertThat(formattedCmd).as(cmd).isEqualTo(expected);
+  }
+
+  @Test
+  public void valueContainingQuotesAndMultipleSpaces() {
+    String cmd = "start locator --name=loc1 --J=\"-Dfoo=this is a phrase\"";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+    String expected = "start locator --name=loc1 --J=\"-Dfoo=this is a phrase\"";
+    assertThat(formattedCmd).as(cmd).isEqualTo(expected);
+  }
+
+  @Test
+  public void valueContainingMultipleJWithSpaces() {
+    String cmd = "start locator --name=loc1 --J=-Dfoo=this is a phrase             --J=\"-Dfoo=a short sentence\"";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+    String expected = "start locator --name=loc1 --J=\"-Dfoo=this is a phrase\" --J=\"-Dfoo=a short sentence\"";
+    assertThat(formattedCmd).as(cmd).isEqualTo(expected);
+  }
+
+  @Test
+  public void valueContainingMultipleJWithSpaces2() {
+    String cmd = "start locator --name=loc1 --J=\"-Dfoo=this is a phrase            \" --J=\"-Dfoo=a short sentence\"";
+    String formattedCmd = this.formatter.formatCommand(cmd);
+    String expected = "start locator --name=loc1 --J=\"-Dfoo=this is a phrase            \" --J=\"-Dfoo=a short sentence\"";
+    assertThat(formattedCmd).as(cmd).isEqualTo(expected);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/170919bc/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/util/OptionJFormatterTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/util/OptionJFormatterTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/util/OptionJFormatterTest.java
deleted file mode 100644
index 12dcd5e..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/util/OptionJFormatterTest.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gemstone.gemfire.management.internal.cli.util;
-
-import static org.assertj.core.api.Assertions.*;
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
-
-@Category(UnitTest.class)
-public class OptionJFormatterTest {
-
-  private OptionJFormatter formatter;
-  
-  @Before
-  public void setUp() {
-    this.formatter = new OptionJFormatter();
-  }
-
-  @Test
-  public void containsJoptShouldReturnTrueIfCmdHasJ() {
-    String cmd = "start locator --name=loc1 --J=-Dfoo=bar";
-    assertTrue(this.formatter.containsJopt(cmd));
-  }
-
-  @Test
-  public void containsJoptShouldReturnFalseIfCmdDoesntHaveJ() {
-    String cmd = "start locator --name=loc1 ";
-    assertFalse(this.formatter.containsJopt(cmd));
-  }
-
-  @Test
-  public void containsJoptShouldReturnTrueIfCmdHasMultipleJ() {
-    String cmd = "start locator --name=loc1 --J=-Dfoo=bar --J=-Dbar=foo";
-    assertTrue(this.formatter.containsJopt(cmd));
-  }
-
-  @Test
-  public void valueWithoutQuotesReturnsWithQuotes() {
-    String cmd = "start locator --name=loc1 --J=-Dfoo=bar";
-    String formattedCmd = this.formatter.formatCommand(cmd);
-
-    String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\"";
-    assertThat(formattedCmd).isEqualTo(expected);
-  }
-
-  @Test
-  public void valueWithoutQuotesReturnsWithQuotes_2() {
-    String cmd = "start locator --J=-Dfoo=bar --name=loc1";
-    String formattedCmd = this.formatter.formatCommand(cmd);
-
-    String expected = "start locator --J=\"-Dfoo=bar\" --name=loc1";
-    assertThat(formattedCmd).isEqualTo(expected);
-  }
-
-  @Test
-  public void nullShouldThrowNullPointerException() {
-    assertThatThrownBy(() -> this.formatter.formatCommand(null)).isExactlyInstanceOf(NullPointerException.class);
-  }
-
-  @Test
-  public void emptyShouldThrowNullPointerException() {
-    assertThat(this.formatter.formatCommand("")).isEqualTo("");
-  }
-
-  @Test
-  public void multipleJOptions() {
-    String cmd = "start locator --name=loc1 --J=-Dfoo=bar --J=-Dbar=foo";
-    String formattedCmd = this.formatter.formatCommand(cmd);
-
-    String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\" --J=\"-Dbar=foo\"";
-    assertThat(formattedCmd).isEqualTo(expected);
-  }
-
-  @Test
-  public void multipleJOptionsWithSomethingAfter() {
-    String cmd = "start locator --name=loc1 --J=-Dfoo=bar --J=-Dbar=foo --group=locators";
-    String formattedCmd = this.formatter.formatCommand(cmd);
-
-    String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\" --J=\"-Dbar=foo\" --group=locators";
-    assertThat(formattedCmd).isEqualTo(expected);
-  }
-
-  @Test
-  public void multipleJOptionsWithSomethingBetween() {
-    String cmd = "start locator --name=loc1 --J=-Dfoo=bar --group=locators --J=-Dbar=foo";
-    String formattedCmd = this.formatter.formatCommand(cmd);
-
-    String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\" --group=locators --J=\"-Dbar=foo\"";
-    assertThat(formattedCmd).isEqualTo(expected);
-  }
-
-  @Test
-  public void valueWithQuotes() {
-    String cmd = "start locator --name=loc1 --J=\"-Dfoo=bar\"";
-    String formattedCmd = this.formatter.formatCommand(cmd);
-    assertThat(formattedCmd).isEqualTo(cmd);
-  }
-
-  @Test
-  public void valueWithMissingEndQuote() {
-    String cmd = "start locator --J=\"-Dfoo=bar --name=loc1";
-    String formattedCmd = this.formatter.formatCommand(cmd);
-    String expected = "start locator --J=\"-Dfoo=bar\" --name=loc1";
-    assertThat(formattedCmd).isEqualTo(expected);
-  }
-
-  @Test
-  public void valueWithMissingStartQuote() {
-    String cmd = "start locator --name=loc1 --J=-Dfoo=bar\"";
-    String formattedCmd = this.formatter.formatCommand(cmd);
-    String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\"";
-    assertThat(formattedCmd).isEqualTo(expected);
-  }
-
-  @Test
-  public void oneValueWithQuotesOneWithout() {
-    String cmd = "start locator --name=loc1 --J=\"-Dfoo=bar\" --J=-Dfoo=bar";
-    String formattedCmd = this.formatter.formatCommand(cmd);
-    String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\" --J=\"-Dfoo=bar\"";
-    assertThat(formattedCmd).as(cmd).isEqualTo(expected);
-  }
-
-  @Test
-  public void oneValueWithoutQuotesOneWith() {
-    String cmd = "start locator --name=loc1 --J=-Dfoo=bar --J=\"-Dfoo=bar\"";
-    String formattedCmd = this.formatter.formatCommand(cmd);
-    String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\" --J=\"-Dfoo=bar\"";
-    assertThat(formattedCmd).isEqualTo(expected);
-  }
-
-  @Test
-  public void twoValuesWithQuotes() {
-    String cmd = "start locator --name=loc1 --J=\"-Dfoo=bar\" --J=\"-Dfoo=bar\"";
-    String formattedCmd = this.formatter.formatCommand(cmd);
-    assertThat(formattedCmd).as(cmd).isEqualTo(cmd);
-  }
-
-  @Test
-  public void valueContainingQuotes() {
-    String cmd = "start locator --name=loc1 --J=\"-Dfoo=region\"";
-    String formattedCmd = this.formatter.formatCommand(cmd);
-    String expected = "start locator --name=loc1 --J=\"-Dfoo=region\"";
-    assertThat(formattedCmd).as(cmd).isEqualTo(expected);
-  }
-
-  @Test
-  public void valueContainingQuotesAndSpace() {
-    String cmd = "start locator --name=loc1 --J=\"-Dfoo=my phrase\"";
-    String formattedCmd = this.formatter.formatCommand(cmd);
-    String expected = "start locator --name=loc1 --J=\"-Dfoo=my phrase\"";
-    assertThat(formattedCmd).as(cmd).isEqualTo(expected);
-  }
-
-  @Test
-  public void valueContainingQuotesAndMultipleSpaces() {
-    String cmd = "start locator --name=loc1 --J=\"-Dfoo=this is a phrase\"";
-    String formattedCmd = this.formatter.formatCommand(cmd);
-    String expected = "start locator --name=loc1 --J=\"-Dfoo=this is a phrase\"";
-    assertThat(formattedCmd).as(cmd).isEqualTo(expected);
-  }
-
-  @Test
-  public void valueContainingMultipleJWithSpaces() {
-    String cmd = "start locator --name=loc1 --J=-Dfoo=this is a phrase             --J=\"-Dfoo=a short sentence\"";
-    String formattedCmd = this.formatter.formatCommand(cmd);
-    String expected = "start locator --name=loc1 --J=\"-Dfoo=this is a phrase\"             --J=\"-Dfoo=a short sentence\"";
-    assertThat(formattedCmd).as(cmd).isEqualTo(expected);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/170919bc/geode-web/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CommandOverHttpDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CommandOverHttpDUnitTest.java b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CommandOverHttpDUnitTest.java
index cad3f31..14a48c7 100644
--- a/geode-web/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CommandOverHttpDUnitTest.java
+++ b/geode-web/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/CommandOverHttpDUnitTest.java
@@ -42,7 +42,7 @@ import org.junit.runners.Suite;
   DeployCommandsDUnitTest.class,
   DiskStoreCommandsDUnitTest.class,
   FunctionCommandsDUnitTest.class,
-  //GemfireDataCommandsDUnitTest.class, restore when GEODE-1565 is fixed
+  GemfireDataCommandsDUnitTest.class,
   GetCommandOnRegionWithCacheLoaderDuringCacheMissDUnitTest.class,
   IndexCommandsDUnitTest.class,
   ListAndDescribeDiskStoreCommandsDUnitTest.class,



[09/15] incubator-geode git commit: GEODE-1572: add a dunit test for client server query for lucene

Posted by sa...@apache.org.
GEODE-1572: add a dunit test for client server query for lucene


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

Branch: refs/heads/feature/GEODE-1573
Commit: de6105f98021095c110bbc91ba547f8a01904ae7
Parents: 9ccb4d5
Author: zhouxh <gz...@pivotal.io>
Authored: Tue Jun 21 10:15:21 2016 -0700
Committer: zhouxh <gz...@pivotal.io>
Committed: Tue Jun 21 10:15:59 2016 -0700

----------------------------------------------------------------------
 .../gemfire/cache/lucene/LuceneQueriesBase.java | 10 +--
 .../lucene/LuceneQueriesClientDUnitTest.java    | 70 ++++++++++++++++++++
 2 files changed, 75 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/de6105f9/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesBase.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesBase.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesBase.java
index 26cd4aa..2fdf531 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesBase.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesBase.java
@@ -47,7 +47,7 @@ public abstract class LuceneQueriesBase extends LuceneDUnitTest {
   protected VM accessor;
 
   @Override
-  public final void postSetUp() throws Exception {
+  public void postSetUp() throws Exception {
     super.postSetUp();
     accessor = Host.getHost(0).getVM(3);
   }
@@ -65,7 +65,7 @@ public abstract class LuceneQueriesBase extends LuceneDUnitTest {
     accessor.invoke(() -> initAccessor(createIndex));
 
     putDataInRegion(accessor);
-    assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
+    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
     executeTextSearch(accessor);
   }
 
@@ -79,7 +79,7 @@ public abstract class LuceneQueriesBase extends LuceneDUnitTest {
     dataStore2.invoke(() -> initDataStore(createIndex));
     accessor.invoke(() -> initAccessor(createIndex));
     putDataInRegion(accessor);
-    assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
+    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
     executeTextSearch(accessor, "world", "text", 3);
     executeTextSearch(accessor, "world", "noEntriesMapped", 0);
   }
@@ -98,10 +98,10 @@ public abstract class LuceneQueriesBase extends LuceneDUnitTest {
     dataStore1.invoke(() -> pauseSender(getCache()));
     dataStore2.invoke(() -> pauseSender(getCache()));
     putDataInRegion(accessor);
-    assertFalse(waitForFlushBeforeExecuteTextSearch(accessor, 500));
+    assertFalse(waitForFlushBeforeExecuteTextSearch(dataStore1, 500));
     dataStore1.invoke(() -> resumeSender(getCache()));
     dataStore2.invoke(() -> resumeSender(getCache()));
-    assertTrue(waitForFlushBeforeExecuteTextSearch(accessor, 60000));
+    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
     executeTextSearch(accessor);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/de6105f9/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesClientDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesClientDUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesClientDUnitTest.java
new file mode 100755
index 0000000..1988baf
--- /dev/null
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesClientDUnitTest.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.gemstone.gemfire.cache.lucene;
+
+import static com.gemstone.gemfire.cache.lucene.test.LuceneTestUtilities.REGION_NAME;
+
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
+import com.gemstone.gemfire.cache.server.CacheServer;
+import com.gemstone.gemfire.test.dunit.SerializableCallableIF;
+import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class LuceneQueriesClientDUnitTest extends LuceneQueriesBase {
+
+  @Override public void postSetUp() throws Exception {
+    super.postSetUp();
+    SerializableCallableIF<Integer> launchServer = () ->
+    {
+      final Cache cache = getCache();
+      final CacheServer server = cache.addCacheServer();
+      server.setPort(0);
+      server.start();
+      return server.getPort();
+    };
+    final int port1 = dataStore1.invoke(launchServer);
+    final int port2 = dataStore2.invoke(launchServer);
+
+    accessor.invoke(() -> {
+      ClientCacheFactory clientCacheFactory = new ClientCacheFactory();
+      clientCacheFactory.addPoolServer("localhost", port1);
+      clientCacheFactory.addPoolServer("localhost", port2);
+      ClientCache clientCache = getClientCache(clientCacheFactory);
+      clientCache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY).create(REGION_NAME);
+    });
+  }
+
+  @Override
+  protected void initAccessor(SerializableRunnableIF createIndex) throws Exception {
+  }
+
+  @Override
+  protected void initDataStore(SerializableRunnableIF createIndex) throws Exception {
+    createIndex.run();
+    getCache().createRegionFactory(RegionShortcut.PARTITION).create(REGION_NAME);
+  }
+
+}


[03/15] incubator-geode git commit: GEODE-11: Added changes to Lucene AEQ, to propagate expiration destroy events (by setting the flag forwardExpirationDestroy()).

Posted by sa...@apache.org.
GEODE-11: Added changes to Lucene AEQ, to propagate expiration destroy events (by setting the flag forwardExpirationDestroy()).


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

Branch: refs/heads/feature/GEODE-1573
Commit: 02964761656928b61eb8abb6e6029ef12e05733c
Parents: b53d28f
Author: Anil <ag...@pivotal.io>
Authored: Mon Jun 20 11:22:41 2016 -0700
Committer: Anil <ag...@pivotal.io>
Committed: Mon Jun 20 11:22:51 2016 -0700

----------------------------------------------------------------------
 .../LuceneIndexForPartitionedRegion.java        |  1 +
 .../LuceneIndexMaintenanceIntegrationTest.java  | 35 ++++++++++++++++++++
 2 files changed, 36 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/02964761/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java
index d283e29..891a658 100644
--- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java
+++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneIndexForPartitionedRegion.java
@@ -124,6 +124,7 @@ public class LuceneIndexForPartitionedRegion extends LuceneIndexImpl {
       factory.setPersistent(true);
     }
     factory.setDiskSynchronous(dataRegion.getAttributes().isDiskSynchronous());
+    factory.setForwardExpirationDestroy(true);
     return factory;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/02964761/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexMaintenanceIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexMaintenanceIntegrationTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexMaintenanceIntegrationTest.java
index 05b6990..352c6b9 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexMaintenanceIntegrationTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneIndexMaintenanceIntegrationTest.java
@@ -25,9 +25,12 @@ import java.io.Serializable;
 import java.util.concurrent.TimeUnit;
 
 import com.jayway.awaitility.Awaitility;
+
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
+import com.gemstone.gemfire.cache.ExpirationAction;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.cache.lucene.internal.LuceneIndexForPartitionedRegion;
@@ -132,6 +135,38 @@ public class LuceneIndexMaintenanceIntegrationTest extends LuceneIntegrationTest
     await(() -> assertTrue(fileSystemStats.getBytes() > 0));
   }
 
+  @Test
+  public void indexShouldBeUpdatedWithRegionExpirationDestroyOperation() throws Exception {
+    luceneService.createIndex(INDEX_NAME, REGION_NAME, "title", "description");
+
+    // Configure PR with expiration operation set to destroy
+    Region region = cache.createRegionFactory(RegionShortcut.PARTITION)
+        .setEntryTimeToLive(new ExpirationAttributes(1, ExpirationAction.DESTROY))
+        .create(REGION_NAME);
+    populateRegion(region);
+    // Wait for expiration to destroy region entries. The region should be
+    // left with zero entries.
+    Awaitility.await().atMost(60, TimeUnit.SECONDS).until(() -> {
+      assertEquals(0, region.size());
+    });
+
+    LuceneIndex index = luceneService.getIndex(INDEX_NAME, REGION_NAME);
+    // Wait for events to be flushed from AEQ.
+    index.waitUntilFlushed(WAIT_FOR_FLUSH_TIME);
+    // Execute query to fetch all the values for "description" field.
+    LuceneQuery query = luceneService.createLuceneQueryFactory().create(INDEX_NAME, REGION_NAME, "description:\"hello world\"", DEFAULT_FIELD);
+    LuceneQueryResults<Integer, TestObject> results = query.search();
+    // The query should return 0 results.
+    assertEquals(0, results.size());
+  }
+
+  private void populateRegion(Region region) {
+    region.put("object-1", new TestObject("title 1", "hello world"));
+    region.put("object-2", new TestObject("title 2", "this will not match"));
+    region.put("object-3", new TestObject("title 3", "hello world"));
+    region.put("object-4", new TestObject("hello world", "hello world"));
+  }
+
   private void await(Runnable runnable) {
     Awaitility.await().atMost(30, TimeUnit.SECONDS).until(runnable);
   }


[05/15] incubator-geode git commit: GEODE-1560 test now explicitly set mcast-port to 0.

Posted by sa...@apache.org.
GEODE-1560 test now explicitly set mcast-port to 0.

Test was picking mcast port from gemfire.properties file.


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

Branch: refs/heads/feature/GEODE-1573
Commit: 2df86745a72105f7dae8f8b85fedf105ad207148
Parents: 858bc35
Author: Hitesh Khamesra <hk...@pivotal.io>
Authored: Mon Jun 20 14:53:06 2016 -0700
Committer: Hitesh Khamesra <hk...@pivotal.io>
Committed: Mon Jun 20 14:59:25 2016 -0700

----------------------------------------------------------------------
 .../java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java     | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2df86745/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
index 2ca13b7..197a665 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java
@@ -1464,6 +1464,7 @@ public class LocatorDUnitTest extends JUnit4DistributedTestCase {
     dsProps.setProperty(LOG_LEVEL, LogWriterUtils.getDUnitLogLevel());
     dsProps.setProperty(ENABLE_NETWORK_PARTITION_DETECTION, "true");
     dsProps.setProperty(ENABLE_CLUSTER_CONFIGURATION, "false");
+    dsProps.setProperty(MCAST_PORT, "0");
 
     startLocatorSync(vm0, new Object[] { port1, dsProps });
     startLocatorSync(vm1, new Object[] { port2, dsProps });


[07/15] incubator-geode git commit: GEODE-117 - gfsh put ignores --skip-if-exists flag

Posted by sa...@apache.org.
GEODE-117 - gfsh put ignores --skip-if-exists flag

Fixed test, which erroneously reported that the --skip-if-exists flag is honored.
Implemented check for flag within the put operation.

This closes #166


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

Branch: refs/heads/feature/GEODE-1573
Commit: 91f92a49726be20dd3000738f77b3b383518adc2
Parents: 83c7c66
Author: Kevin J. Duling <kd...@pivotal.io>
Authored: Fri Jun 17 11:07:49 2016 -0700
Committer: Jinmei Liao <ji...@pivotal.io>
Committed: Tue Jun 21 09:45:20 2016 -0700

----------------------------------------------------------------------
 .../cli/functions/DataCommandFunction.java      |  9 ++-
 .../commands/GemfireDataCommandsDUnitTest.java  | 66 +++++++++++++-------
 2 files changed, 51 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/91f92a49/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/DataCommandFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/DataCommandFunction.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/DataCommandFunction.java
index 48cc83a..927aea8 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/DataCommandFunction.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/DataCommandFunction.java
@@ -609,9 +609,12 @@ public class DataCommandFunction extends FunctionAdapter implements  InternalEnt
         valueObject = getClassObject(value,valueClass);
       }catch(ClassNotFoundException e){
         return DataCommandResult.createPutResult(key, null, null, "ClassNotFoundException " + valueClass, false); 
-      }      
-      
-      Object returnValue = region.put(keyObject,valueObject);
+      }
+      Object returnValue;
+      if (putIfAbsent && region.containsKey(keyObject))
+        returnValue = region.get(keyObject);
+      else
+        returnValue = region.put(keyObject,valueObject);
       Object array[] = getJSONForNonPrimitiveObject(returnValue);             
       DataCommandResult result = DataCommandResult.createPutResult(key, array[1], null, null, true);
       if(array[0]!=null)

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/91f92a49/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
index 553b7a4..68fe0ae 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
@@ -16,7 +16,32 @@
  */
 package com.gemstone.gemfire.management.internal.cli.commands;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+import static com.gemstone.gemfire.test.dunit.IgnoredException.*;
+import static com.gemstone.gemfire.test.dunit.LogWriterUtils.*;
+import static com.gemstone.gemfire.test.dunit.Wait.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Random;
+import java.util.Set;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
 import com.gemstone.gemfire.cache.query.QueryInvalidException;
 import com.gemstone.gemfire.cache.query.data.Portfolio;
 import com.gemstone.gemfire.cache.query.internal.CompiledValue;
@@ -32,7 +57,11 @@ import com.gemstone.gemfire.management.cli.Result;
 import com.gemstone.gemfire.management.internal.cli.CliUtil;
 import com.gemstone.gemfire.management.internal.cli.HeadlessGfsh;
 import com.gemstone.gemfire.management.internal.cli.domain.DataCommandRequest;
-import com.gemstone.gemfire.management.internal.cli.dto.*;
+import com.gemstone.gemfire.management.internal.cli.dto.Car;
+import com.gemstone.gemfire.management.internal.cli.dto.Key1;
+import com.gemstone.gemfire.management.internal.cli.dto.ObjectWithCharAttr;
+import com.gemstone.gemfire.management.internal.cli.dto.Value1;
+import com.gemstone.gemfire.management.internal.cli.dto.Value2;
 import com.gemstone.gemfire.management.internal.cli.i18n.CliStrings;
 import com.gemstone.gemfire.management.internal.cli.json.GfJsonArray;
 import com.gemstone.gemfire.management.internal.cli.json.GfJsonException;
@@ -42,22 +71,18 @@ import com.gemstone.gemfire.management.internal.cli.result.CompositeResultData.S
 import com.gemstone.gemfire.management.internal.cli.result.ResultData;
 import com.gemstone.gemfire.management.internal.cli.result.TabularResultData;
 import com.gemstone.gemfire.management.internal.cli.util.CommandStringBuilder;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.SerializableCallable;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
+
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.*;
-
-import static com.gemstone.gemfire.test.dunit.Assert.*;
-import static com.gemstone.gemfire.test.dunit.IgnoredException.addIgnoredException;
-import static com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter;
-import static com.gemstone.gemfire.test.dunit.Wait.waitForCriterion;
-import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
-
 /**
  * Dunit class for testing gemfire data commands : get, put, remove, select, rebalance
  */
@@ -815,7 +840,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
     final VM vm1 = Host.getHost(0).getVM(1);
     final VM vm2 = Host.getHost(0).getVM(2);
 
-
+    // Seed the region with some keys
     SerializableRunnable putKeys = new SerializableRunnable() {
       @Override
       public void run() {
@@ -833,6 +858,7 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
     };
     vm1.invoke(putKeys);
 
+    // Now try to replace all existing keys with new values to test --skip-if-exists.  Values should not be replaced if the key is present.
     for (int i = 0; i < COUNT; i++) {
       String command = "put";
       String key = keyPrefix + i;
@@ -844,20 +870,18 @@ public class GemfireDataCommandsDUnitTest extends CliCommandTestBase {
       validateResult(cmdResult, true);
     }
 
+    // Verify that none of the values were replaced
     SerializableRunnable checkPutIfAbsentKeys = new SerializableRunnable() {
       @Override
       public void run() {
         Cache cache = getCache();
         Region region = cache.getRegion(DATA_REGION_NAME_PATH);
         assertNotNull(region);
-        for (int i = COUNT + 1; i < COUNT; i++) {
+        for (int i = 0; i < COUNT; i++) {
           String key = keyPrefix + i;
-          String notExpectedvalue = valuePrefix + i + i;
-          String expectedvalue = valuePrefix + i;
-          String value = (String) region.get(key);
-          assertNotNull(value);
-          assertEquals(value, expectedvalue);
-          if (value.equals(notExpectedvalue)) fail("Value is overriden even if put-If-absent was true");
+          String expected = valuePrefix + i;
+          String actual = (String) region.get(key);
+          assertEquals("--skip-if-exists=true failed to preserve value", expected, actual);
         }
       }
     };


[14/15] incubator-geode git commit: GEODE-1209: Typo repair in javadoc comment (AsynEventQueue -> AsyncEventQueue)

Posted by sa...@apache.org.
GEODE-1209: Typo repair in javadoc comment (AsynEventQueue -> AsyncEventQueue)


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

Branch: refs/heads/feature/GEODE-1573
Commit: fc42db82e002fbe476fd9ffa01777b568ef58dba
Parents: 5882693
Author: Dave Barnes <db...@pivotal.io>
Authored: Wed Jun 22 11:33:51 2016 -0700
Committer: Dave Barnes <db...@pivotal.io>
Committed: Wed Jun 22 11:33:51 2016 -0700

----------------------------------------------------------------------
 .../gemstone/gemfire/cache/asyncqueue/AsyncEventQueueFactory.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/fc42db82/geode-core/src/main/java/com/gemstone/gemfire/cache/asyncqueue/AsyncEventQueueFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/cache/asyncqueue/AsyncEventQueueFactory.java b/geode-core/src/main/java/com/gemstone/gemfire/cache/asyncqueue/AsyncEventQueueFactory.java
index 455fc14..3540ce3 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/cache/asyncqueue/AsyncEventQueueFactory.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/cache/asyncqueue/AsyncEventQueueFactory.java
@@ -171,7 +171,7 @@ public interface AsyncEventQueueFactory {
       GatewayEventSubstitutionFilter filter);
 
   /**
-   * Forwards destroy operations from expiration action to AsynEventQueue.
+   * Forwards destroy operations from expiration action to AsyncEventQueue.
    * By default the expiration destroy events are not added to AEQ, by
    * setting this attribute to true adds destroy event to AEQ.
    *


[13/15] incubator-geode git commit: GEODE-1494: Fixing javadocs and stats descriptions for stat suppliers

Posted by sa...@apache.org.
GEODE-1494: Fixing javadocs and stats descriptions for stat suppliers

Based on review feedback, correcting some javadocs and the description
of the sample callbacks stat.


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

Branch: refs/heads/feature/GEODE-1573
Commit: 5882693954d6f71e5479e08bfb0a2abb3ac956c2
Parents: d25dd3f
Author: Dan Smith <up...@apache.org>
Authored: Tue Jun 21 11:04:54 2016 -0700
Committer: Dan Smith <up...@apache.org>
Committed: Tue Jun 21 18:04:00 2016 -0700

----------------------------------------------------------------------
 .../java/com/gemstone/gemfire/Statistics.java   | 32 +++++++-------------
 .../gemfire/internal/StatSamplerStats.java      |  2 +-
 2 files changed, 12 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/58826939/geode-core/src/main/java/com/gemstone/gemfire/Statistics.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/Statistics.java b/geode-core/src/main/java/com/gemstone/gemfire/Statistics.java
index 0b9c18e..80426e2 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/Statistics.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/Statistics.java
@@ -466,9 +466,8 @@ public interface Statistics {
    * replaces any previously registered supplier. If the passed in suppplier is null, it
    * will remove any existing supplier
    * @return the previously registered supplier, or null if there was no previously registered supplier
-   * @throws ArrayIndexOutOfBoundsException If the id is invalid.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not int
+   * @throws IllegalArgumentException If the id is invalid.
+   * @since Geode 1.0
    */
   public IntSupplier setIntSupplier(int id, IntSupplier supplier);
 
@@ -495,8 +494,7 @@ public interface Statistics {
    *         If no statistic exists with name <code>name</code> or
    *         if the statistic named <code>name</code> is not of
    *         type <code>int</code>.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not int
+   * @since Geode 1.0
    */
   public IntSupplier setIntSupplier(String name, IntSupplier supplier);
 
@@ -524,8 +522,7 @@ public interface Statistics {
    *         If no statistic exists with the given <code>descriptor</code> or
    *         if the described statistic is not of
    *         type <code>int</code>.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not int
+   * @since Geode 1.0
    */
   public IntSupplier setIntSupplier(StatisticDescriptor descriptor, IntSupplier supplier);
 
@@ -549,9 +546,8 @@ public interface Statistics {
    * replaces any previously registered supplier. If the passed in suppplier is null, it
    * will remove any existing supplier
    * @return the previously registered supplier, or null if there was no previously registered supplier
-   * @throws ArrayIndexOutOfBoundsException If the id is invalid.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not long
+   * @throws IllegalArgumentException If the id is invalid.
+   * @since Geode 1.0
    */
   public LongSupplier setLongSupplier(int id, LongSupplier supplier);
 
@@ -578,8 +574,6 @@ public interface Statistics {
    *         If no statistic exists with name <code>name</code> or
    *         if the statistic named <code>name</code> is not of
    *         type <code>long</code>.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not long
    */
   public LongSupplier setLongSupplier(String name, LongSupplier supplier);
 
@@ -607,8 +601,7 @@ public interface Statistics {
    *         If no statistic exists with the given <code>descriptor</code> or
    *         if the described statistic is not of
    *         type <code>long</code>.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not long
+   * @since Geode 1.0
    */
   public LongSupplier setLongSupplier(StatisticDescriptor descriptor, LongSupplier supplier);
 
@@ -632,9 +625,8 @@ public interface Statistics {
    * replaces any previously registered supplier. If the passed in suppplier is null, it
    * will remove any existing supplier
    * @return the previously registered supplier, or null if there was no previously registered supplier
-   * @throws ArrayIndexOutOfBoundsException If the id is invalid.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not double
+   * @throws IllegalArgumentException If the id is invalid.
+   * @since Geode 1.0
    */
   public DoubleSupplier setDoubleSupplier(int id, DoubleSupplier supplier);
 
@@ -661,8 +653,7 @@ public interface Statistics {
    *         If no statistic exists with name <code>name</code> or
    *         if the statistic named <code>name</code> is not of
    *         type <code>double</code>.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not double
+   * @since Geode 1.0
    */
   public DoubleSupplier setDoubleSupplier(String name, DoubleSupplier supplier);
 
@@ -690,8 +681,7 @@ public interface Statistics {
    *         If no statistic exists with the given <code>descriptor</code> or
    *         if the described statistic is not of
    *         type <code>double</code>.
-   * @throws IllegalArgumentException if the type of this
-   * stat is not double
+   * @since Geode 1.0
    */
   public DoubleSupplier setDoubleSupplier(StatisticDescriptor descriptor, DoubleSupplier supplier);
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/58826939/geode-core/src/main/java/com/gemstone/gemfire/internal/StatSamplerStats.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/StatSamplerStats.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/StatSamplerStats.java
index bbe333c..c3d556f 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/StatSamplerStats.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/StatSamplerStats.java
@@ -61,7 +61,7 @@ public class StatSamplerStats {
                                                     "Total number of JVM pauses (which may or may not be full GC pauses) detected by this sampler. A JVM pause is defined as a system event which kept the statistics sampler thread from sampling for 3000 or more milliseconds. This threshold can be customized by setting the system property gemfire.statSamplerDelayThreshold (units are milliseconds).",
                                                     "jvmPauses", false),
                                  f.createIntGauge(SAMPLE_CALLBACKS,
-                                   "Total number of statistics that are sampled using callbacks.",
+                                   "Current number of statistics that are sampled using callbacks.",
                                    "resources", false),
                                  f.createIntCounter(SAMPLE_CALLBACK_ERRORS,
                                    "Total number of exceptions thrown by callbacks when performing sampling",


[02/15] incubator-geode git commit: GEODE-1568: disable PreloadedRegionTestCase with @Ignore

Posted by sa...@apache.org.
GEODE-1568: disable PreloadedRegionTestCase with @Ignore


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

Branch: refs/heads/feature/GEODE-1573
Commit: b53d28ff6696b5753c4642fc910b66042a4cc014
Parents: db739b2
Author: Kirk Lund <kl...@pivotal.io>
Authored: Sat Jun 18 18:13:44 2016 -0700
Committer: Kirk Lund <kl...@pivotal.io>
Committed: Sat Jun 18 18:13:44 2016 -0700

----------------------------------------------------------------------
 .../gemfire/cache30/PreloadedRegionTestCase.java    | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b53d28ff/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java
index b897603..7f023bb 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/PreloadedRegionTestCase.java
@@ -16,14 +16,11 @@
  */
 package com.gemstone.gemfire.cache30;
 
-import org.junit.experimental.categories.Category;
-import org.junit.Test;
-
 import static org.junit.Assert.*;
 
-import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
-import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
-import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.CacheException;
@@ -35,6 +32,7 @@ import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableRunnable;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This class tests the functionality of a cache {@link Region region}
@@ -43,12 +41,9 @@ import com.gemstone.gemfire.test.dunit.VM;
  * @since GemFire 3.0
  */
 @Category(DistributedTest.class)
+@Ignore("TODO: test disabled because of GEODE-1568")
 public class PreloadedRegionTestCase extends MultiVMRegionTestCase {
 
-  public PreloadedRegionTestCase() {
-    super();
-  }
-
   /**
    * Returns region attributes for a <code>GLOBAL</code> region
    */
@@ -92,7 +87,6 @@ public class PreloadedRegionTestCase extends MultiVMRegionTestCase {
       }
     };
 
-
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
 


[12/15] incubator-geode git commit: GEODE-11: Adding a dunit test of querying with a custom query object

Posted by sa...@apache.org.
GEODE-11: Adding a dunit test of querying with a custom query object


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

Branch: refs/heads/feature/GEODE-1573
Commit: d25dd3fe61a67027d10ebcb6b11f3b2ecf6cf444
Parents: 087da4e
Author: Dan Smith <up...@apache.org>
Authored: Wed Jun 15 15:33:13 2016 -0700
Committer: Dan Smith <up...@apache.org>
Committed: Tue Jun 21 18:03:38 2016 -0700

----------------------------------------------------------------------
 .../gemfire/cache/lucene/LuceneQueriesBase.java | 26 ++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d25dd3fe/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesBase.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesBase.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesBase.java
index 2fdf531..f077bad 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesBase.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesBase.java
@@ -33,6 +33,8 @@ import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.SerializableRunnableIF;
 import com.gemstone.gemfire.test.dunit.VM;
 
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.TermQuery;
 import org.junit.Test;
 
 /**
@@ -85,6 +87,30 @@ public abstract class LuceneQueriesBase extends LuceneDUnitTest {
   }
 
   @Test
+  public void canQueryWithCustomLuceneQueryObject() {
+    SerializableRunnableIF createIndex = () -> {
+      LuceneService luceneService = LuceneServiceProvider.get(getCache());
+      luceneService.createIndex(INDEX_NAME, REGION_NAME, "text");
+    };
+    dataStore1.invoke(() -> initDataStore(createIndex));
+    dataStore2.invoke(() -> initDataStore(createIndex));
+    accessor.invoke(() -> initAccessor(createIndex));
+    putDataInRegion(accessor);
+    assertTrue(waitForFlushBeforeExecuteTextSearch(dataStore1, 60000));
+
+    //Execute a query with a custom lucene query object
+    accessor.invoke(() -> {
+      Cache cache = getCache();
+      LuceneService service = LuceneServiceProvider.get(cache);
+      LuceneQuery query = service.createLuceneQueryFactory().create(INDEX_NAME, REGION_NAME, index ->  {
+        return new TermQuery(new Term("text", "world"));
+      });
+      final LuceneQueryResults results = query.search();
+      assertEquals(3, results.size());
+    });
+  }
+
+  @Test
   public void entriesFlushedToIndexAfterWaitForFlushCalled() {
     SerializableRunnableIF createIndex = () -> {
       LuceneService luceneService = LuceneServiceProvider.get(getCache());


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

Posted by sa...@apache.org.
Merge branch 'develop' into feature/GEODE-1573


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

Branch: refs/heads/feature/GEODE-1573
Commit: b006d993b4a3686b998a4d5876abc0e62feaea76
Parents: 24f9db7 fc42db8
Author: Sai Boorlagadda <sb...@pivotal.io>
Authored: Wed Jun 22 22:02:26 2016 -0700
Committer: Sai Boorlagadda <sb...@pivotal.io>
Committed: Wed Jun 22 22:02:26 2016 -0700

----------------------------------------------------------------------
 .../java/com/gemstone/gemfire/Statistics.java   |  32 +--
 .../asyncqueue/AsyncEventQueueFactory.java      |   2 +-
 .../gemfire/internal/StatSamplerStats.java      |   2 +-
 .../management/internal/cli/GfshParser.java     |   4 +-
 .../CreateAlterDestroyRegionCommands.java       |   2 +-
 .../cli/functions/DataCommandFunction.java      |   9 +-
 .../cli/functions/RegionCreateFunction.java     |   5 +-
 .../internal/cli/i18n/CliStrings.java           |   8 +-
 .../cli/parser/jopt/JoptOptionParser.java       |   4 +-
 .../internal/cli/remote/CommandProcessor.java   |   1 -
 .../internal/cli/util/HyphenFormatter.java      |  92 +++++++++
 .../internal/cli/util/OptionJFormatter.java     | 115 -----------
 .../cache30/PreloadedRegionTestCase.java        |  16 +-
 .../gemfire/distributed/LocatorDUnitTest.java   |   1 +
 .../internal/cli/GfshParserIntegrationTest.java |  38 ++++
 .../commands/GemfireDataCommandsDUnitTest.java  | 106 +++++++---
 .../commands/HelpCommandsIntegrationTest.java   |   4 +
 .../internal/cli/util/HyphenFormatterTest.java  | 201 +++++++++++++++++++
 .../internal/cli/util/OptionJFormatterTest.java | 189 -----------------
 .../cli/commands/golden-help-offline.properties |  82 ++++----
 .../lucene/internal/LuceneEventListener.java    |  10 +-
 .../LuceneIndexForPartitionedRegion.java        |   1 +
 .../LuceneIndexMaintenanceIntegrationTest.java  |  35 ++++
 .../gemfire/cache/lucene/LuceneQueriesBase.java |  36 +++-
 .../lucene/LuceneQueriesClientDUnitTest.java    |  70 +++++++
 .../internal/LuceneEventListenerJUnitTest.java  |  21 ++
 .../src/main/resources/gemfire.properties       |   2 +-
 geode-pulse/src/main/webapp/DataBrowser.html    |   2 +-
 geode-pulse/src/main/webapp/MemberDetails.html  |   2 +-
 .../src/main/webapp/QueryStatistics.html        |   2 +-
 geode-pulse/src/main/webapp/clusterDetail.html  |   2 +-
 .../main/webapp/properties/gemfire.properties   |   2 +-
 .../webapp/properties/gemfire_en.properties     |   2 +-
 geode-pulse/src/main/webapp/regionDetail.html   |   2 +-
 .../cli/commands/CommandOverHttpDUnitTest.java  |   1 -
 35 files changed, 661 insertions(+), 442 deletions(-)
----------------------------------------------------------------------



[06/15] incubator-geode git commit: GEODE-1557: Not logging BucketNotFoundException

Posted by sa...@apache.org.
GEODE-1557: Not logging BucketNotFoundException

Not logging BucketNotFoundException as an error in LuceneEventLister and added
a test shouldIgnoreBucketNotFoundException to verify it

This closes #168


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

Branch: refs/heads/feature/GEODE-1573
Commit: 83c7c661648c9fd7b0dac054dde60e2ae1ef12cd
Parents: 2df8674
Author: Aparna Dharmakkan <ad...@pivotal.io>
Authored: Thu Jun 16 16:07:04 2016 -0700
Committer: nabarun <nn...@pivotal.io>
Committed: Mon Jun 20 16:51:34 2016 -0700

----------------------------------------------------------------------
 .../lucene/internal/LuceneEventListener.java    | 10 +++++++---
 .../internal/LuceneEventListenerJUnitTest.java  | 21 ++++++++++++++++++++
 2 files changed, 28 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/83c7c661/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListener.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListener.java b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListener.java
index ca8077d..a7150c0 100644
--- a/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListener.java
+++ b/geode-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListener.java
@@ -36,6 +36,7 @@ import com.gemstone.gemfire.cache.lucene.internal.repository.IndexRepository;
 import com.gemstone.gemfire.cache.query.internal.DefaultQuery;
 import com.gemstone.gemfire.internal.cache.BucketNotFoundException;
 import com.gemstone.gemfire.internal.cache.CacheObserverHolder;
+import com.gemstone.gemfire.internal.cache.partitioned.Bucket;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientProxy.TestHook;
 import com.gemstone.gemfire.internal.logging.LogService;
 
@@ -68,7 +69,7 @@ public class LuceneEventListener implements AsyncEventListener {
         Region region = event.getRegion();
         Object key = event.getKey();
         Object callbackArgument = event.getCallbackArgument();
-        
+
         IndexRepository repository = repositoryManager.getRepository(region, key, callbackArgument);
 
         Operation op = event.getOperation();
@@ -86,12 +87,15 @@ public class LuceneEventListener implements AsyncEventListener {
         }
         affectedRepos.add(repository);
       }
-      
+
       for(IndexRepository repo : affectedRepos) {
         repo.commit();
       }
       return true;
-    } catch(IOException | BucketNotFoundException e) {
+    } catch(BucketNotFoundException e) {
+      logger.debug("Bucket not found while saving to lucene index: " + e.getMessage());
+      return false;
+    } catch(IOException e) {
       logger.error("Unable to save to lucene index", e);
       return false;
     } finally {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/83c7c661/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListenerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListenerJUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListenerJUnitTest.java
index 53c9db1..86ed481 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListenerJUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/LuceneEventListenerJUnitTest.java
@@ -18,13 +18,17 @@
  */
 package com.gemstone.gemfire.cache.lucene.internal;
 
+import static org.junit.Assert.*;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.*;
 
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.mockito.Mockito;
@@ -34,7 +38,9 @@ import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.asyncqueue.AsyncEvent;
 import com.gemstone.gemfire.cache.lucene.internal.repository.IndexRepository;
 import com.gemstone.gemfire.cache.lucene.internal.repository.RepositoryManager;
+import com.gemstone.gemfire.internal.cache.BucketNotFoundException;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
+import org.apache.logging.log4j.Logger;
 
 /**
  * Unit test that async event listener dispatched the events
@@ -99,4 +105,19 @@ public class LuceneEventListenerJUnitTest {
     verify(repo1, times(1)).commit();
     verify(repo2, times(1)).commit();
   }
+
+  @Test
+  public void shouldHandleBucketNotFoundExceptionWithoutLoggingError() throws BucketNotFoundException {
+    RepositoryManager manager = Mockito.mock(RepositoryManager.class);
+    Logger log=Mockito.mock(Logger.class);
+    Mockito.when(manager.getRepository(any(), any(), any()))
+      .thenThrow(BucketNotFoundException.class);
+
+    LuceneEventListener listener = new LuceneEventListener(manager);
+    listener.logger = log;
+    AsyncEvent event = Mockito.mock(AsyncEvent.class);
+    boolean result = listener.processEvents(Arrays.asList(new AsyncEvent[] {event}));
+    assertFalse(result);
+    verify(log, never()).error(anyString(), any(Exception.class));
+  }
 }


[11/15] incubator-geode git commit: GEODE-1575 - Unhandled NoClassDefFound Exception when creating regions

Posted by sa...@apache.org.
GEODE-1575 - Unhandled NoClassDefFound Exception when creating regions

Added exception clause for NoClassDefFoundError

This closes #170


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

Branch: refs/heads/feature/GEODE-1573
Commit: 087da4e3d084f64516181e7f06317cae64c8af40
Parents: 170919b
Author: Kevin J. Duling <kd...@pivotal.io>
Authored: Tue Jun 21 10:17:53 2016 -0700
Committer: Jinmei Liao <ji...@pivotal.io>
Committed: Tue Jun 21 10:27:47 2016 -0700

----------------------------------------------------------------------
 .../management/internal/cli/functions/RegionCreateFunction.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/087da4e3/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/RegionCreateFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/RegionCreateFunction.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/RegionCreateFunction.java
index 2344074..7e060c2 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/RegionCreateFunction.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/RegionCreateFunction.java
@@ -385,9 +385,10 @@ public class RegionCreateFunction extends FunctionAdapter implements InternalEnt
       if (classToLoadName != null && !classToLoadName.isEmpty()) {
         loadedClass = (Class<K>) classPathLoader.forName(classToLoadName);
       }
-    } catch (ClassNotFoundException e) {
+    } catch (ClassNotFoundException | NoClassDefFoundError e) {
       throw new RuntimeException(CliStrings.format(CliStrings.CREATE_REGION__MSG__COULDNOT_FIND_CLASS_0_SPECIFIED_FOR_1, new Object[] {classToLoadName, neededFor}), e);
-    } catch (ClassCastException e) {
+    }
+    catch (ClassCastException e) {
       throw new RuntimeException(CliStrings.format(CliStrings.CREATE_REGION__MSG__CLASS_SPECIFIED_FOR_0_SPECIFIED_FOR_1_IS_NOT_OF_EXPECTED_TYPE, new Object[] {classToLoadName, neededFor}), e);
     }
 


[08/15] incubator-geode git commit: GEODE-1549: Correct "Help" hyperlink in pulse

Posted by sa...@apache.org.
GEODE-1549: Correct "Help" hyperlink in pulse

Corrected the links to point to geode docs instead of gemfire
This closes #161


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

Branch: refs/heads/feature/GEODE-1573
Commit: 9ccb4d5bb5897c9c01d7b6eb59f4c137865cd263
Parents: 91f92a4
Author: Srikanth Manvi <sr...@gmail.com>
Authored: Wed Jun 15 23:13:58 2016 -0400
Committer: Jinmei Liao <ji...@pivotal.io>
Committed: Tue Jun 21 09:50:09 2016 -0700

----------------------------------------------------------------------
 geode-pulse/src/main/resources/gemfire.properties            | 2 +-
 geode-pulse/src/main/webapp/DataBrowser.html                 | 2 +-
 geode-pulse/src/main/webapp/MemberDetails.html               | 2 +-
 geode-pulse/src/main/webapp/QueryStatistics.html             | 2 +-
 geode-pulse/src/main/webapp/clusterDetail.html               | 2 +-
 geode-pulse/src/main/webapp/properties/gemfire.properties    | 2 +-
 geode-pulse/src/main/webapp/properties/gemfire_en.properties | 2 +-
 geode-pulse/src/main/webapp/regionDetail.html                | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9ccb4d5b/geode-pulse/src/main/resources/gemfire.properties
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/resources/gemfire.properties b/geode-pulse/src/main/resources/gemfire.properties
index 84ae196..bfb1286 100644
--- a/geode-pulse/src/main/resources/gemfire.properties
+++ b/geode-pulse/src/main/resources/gemfire.properties
@@ -25,7 +25,7 @@ pulse-writes-custom=Writes
 pulse-reads-custom=Reads
 pulse-monitoring-custom=images/pulse-monitoring.png
 pulse-aboutimg-custom=images/about-geode.png
-pulse-help-custom=http://gemfire.docs.pivotal.io/latest/userguide/index.html#tools_modules/pulse/chapter_overview.html
+pulse-help-custom=http://geode.docs.pivotal.io/docs/tools_modules/pulse/chapter_overview.html
 pulse-about-custom=The Pulse tool monitors Apache Geode&#0169; system in real time. It provides health information, detailed operational and configuration data, system alerts, throughput performance and statistics for system members and connected clients.
 pulse-regionstableCaps-custom=Regions
 pulse-rtSummaryBySize-custom=Regions Summary - By Entry Count

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9ccb4d5b/geode-pulse/src/main/webapp/DataBrowser.html
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/webapp/DataBrowser.html b/geode-pulse/src/main/webapp/DataBrowser.html
index a046cf4..165fa6f 100644
--- a/geode-pulse/src/main/webapp/DataBrowser.html
+++ b/geode-pulse/src/main/webapp/DataBrowser.html
@@ -137,7 +137,7 @@
 	        </div>
 				</div>
 				<div class="left headerTopSeperator"></div>
-	      <div class="left"><a target="_blank" href="http://gemfire.docs.pivotal.io/latest/userguide/index.html#tools_modules/pulse/chapter_overview.html" class="left headerTopLinks">Help</a></div>
+	      <div class="left"><a target="_blank" href="http://geode.docs.pivotal.io/docs/tools_modules/pulse/chapter_overview.html" class="left headerTopLinks">Help</a></div>
 	      <div class="left headerTopSeperator"></div>
 	      <div class="left headerTopLinks welcomeLabelPRZero">Welcome</div>
 	      <div class="left headerTopLinks textbold font-size12" id="userName"></div>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9ccb4d5b/geode-pulse/src/main/webapp/MemberDetails.html
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/webapp/MemberDetails.html b/geode-pulse/src/main/webapp/MemberDetails.html
index f358c1c..b416926 100644
--- a/geode-pulse/src/main/webapp/MemberDetails.html
+++ b/geode-pulse/src/main/webapp/MemberDetails.html
@@ -128,7 +128,7 @@
       
       </div>
       <div class="left headerTopSeperator"></div>
-      <div class="left"><a data-prod-custom="pulse-help-custom" target="_blank" href="http://gemfire.docs.pivotal.io/latest/userguide/index.html#tools_modules/pulse/chapter_overview.html" class="left headerTopLinks" class="left headerTopLinks">Help</a></div>
+      <div class="left"><a data-prod-custom="pulse-help-custom" target="_blank" href="http://geode.docs.pivotal.io/docs/tools_modules/pulse/chapter_overview.html" class="left headerTopLinks" class="left headerTopLinks">Help</a></div>
       <div class="left headerTopSeperator"></div>
       <div class="left headerTopLinks welcomeLabelPRZero">Welcome</div>
       <div class="left headerTopLinks textbold font-size12" id="userName"></div>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9ccb4d5b/geode-pulse/src/main/webapp/QueryStatistics.html
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/webapp/QueryStatistics.html b/geode-pulse/src/main/webapp/QueryStatistics.html
index c5fb1a0..07f61c6 100644
--- a/geode-pulse/src/main/webapp/QueryStatistics.html
+++ b/geode-pulse/src/main/webapp/QueryStatistics.html
@@ -150,7 +150,7 @@
 				<div class="left headerTopSeperator"></div>
 				<div class="left">
 					<a data-prod-custom="pulse-help-custom" target="_blank"
-						href="http://gemfire.docs.pivotal.io/latest/userguide/index.html#tools_modules/pulse/chapter_overview.html"
+						href="http://geode.docs.pivotal.io/docs/tools_modules/pulse/chapter_overview.html"
 						class="left headerTopLinks">Help</a>
 				</div>
 				<div class="left headerTopSeperator"></div>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9ccb4d5b/geode-pulse/src/main/webapp/clusterDetail.html
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/webapp/clusterDetail.html b/geode-pulse/src/main/webapp/clusterDetail.html
index 718a5b9..211e366 100644
--- a/geode-pulse/src/main/webapp/clusterDetail.html
+++ b/geode-pulse/src/main/webapp/clusterDetail.html
@@ -118,7 +118,7 @@
         </div>
       </div>
       <div class="left headerTopSeperator"></div>
-      <div class="left"><a data-prod-custom="pulse-help-custom" target="_blank" href="http://gemfire.docs.pivotal.io/latest/userguide/index.html#tools_modules/pulse/chapter_overview.html" class="left headerTopLinks" class="left headerTopLinks">Help</a></div>
+      <div class="left"><a data-prod-custom="pulse-help-custom" target="_blank" href="http://geode.docs.pivotal.io/docs/tools_modules/pulse/chapter_overview.html" class="left headerTopLinks" class="left headerTopLinks">Help</a></div>
       <div class="left headerTopSeperator"></div>
       <div class="left headerTopLinks welcomeLabelPRZero">Welcome</div>
       <div class="left headerTopLinks textbold font-size12" id="userName"></div>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9ccb4d5b/geode-pulse/src/main/webapp/properties/gemfire.properties
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/webapp/properties/gemfire.properties b/geode-pulse/src/main/webapp/properties/gemfire.properties
index 9e45d25..17e2259 100644
--- a/geode-pulse/src/main/webapp/properties/gemfire.properties
+++ b/geode-pulse/src/main/webapp/properties/gemfire.properties
@@ -23,7 +23,7 @@ pulse-writes-custom=Writes
 pulse-reads-custom=Reads
 pulse-monitoring-custom=images/pulse-monitoring.png
 pulse-aboutimg-custom=images/about-geode.png
-pulse-help-custom=http://gemfire.docs.pivotal.io/latest/userguide/index.html#tools_modules/pulse/chapter_overview.html
+pulse-help-custom=http://geode.docs.pivotal.io/docs/tools_modules/pulse/chapter_overview.html
 pulse-about-custom=The Pulse tool monitors Apache Geode system in real time. It provides health information, detailed operational and configuration data, system alerts, throughput performance and statistics for system members and connected clients.
 pulse-regionstableCaps-custom=Regions
 pulse-rtSummaryBySize-custom=Regions Summary - By Entry Count

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9ccb4d5b/geode-pulse/src/main/webapp/properties/gemfire_en.properties
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/webapp/properties/gemfire_en.properties b/geode-pulse/src/main/webapp/properties/gemfire_en.properties
index 9e45d25..17e2259 100644
--- a/geode-pulse/src/main/webapp/properties/gemfire_en.properties
+++ b/geode-pulse/src/main/webapp/properties/gemfire_en.properties
@@ -23,7 +23,7 @@ pulse-writes-custom=Writes
 pulse-reads-custom=Reads
 pulse-monitoring-custom=images/pulse-monitoring.png
 pulse-aboutimg-custom=images/about-geode.png
-pulse-help-custom=http://gemfire.docs.pivotal.io/latest/userguide/index.html#tools_modules/pulse/chapter_overview.html
+pulse-help-custom=http://geode.docs.pivotal.io/docs/tools_modules/pulse/chapter_overview.html
 pulse-about-custom=The Pulse tool monitors Apache Geode system in real time. It provides health information, detailed operational and configuration data, system alerts, throughput performance and statistics for system members and connected clients.
 pulse-regionstableCaps-custom=Regions
 pulse-rtSummaryBySize-custom=Regions Summary - By Entry Count

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/9ccb4d5b/geode-pulse/src/main/webapp/regionDetail.html
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/webapp/regionDetail.html b/geode-pulse/src/main/webapp/regionDetail.html
index 8742769..98404cb 100644
--- a/geode-pulse/src/main/webapp/regionDetail.html
+++ b/geode-pulse/src/main/webapp/regionDetail.html
@@ -210,7 +210,7 @@
         <!-- Version Details Popup -->
       </div>
       <div class="left headerTopSeperator"></div>
-      <div class="left"><a data-prod-custom="pulse-help-custom"  target="_blank" href="http://gemfire.docs.pivotal.io/latest/userguide/index.html#tools_modules/pulse/chapter_overview.html" class="left headerTopLinks">Help</a></div>
+      <div class="left"><a data-prod-custom="pulse-help-custom"  target="_blank" href="http://geode.docs.pivotal.io/docs/tools_modules/pulse/chapter_overview.html" class="left headerTopLinks">Help</a></div>
       <div class="left headerTopSeperator"></div>
       <div class="left headerTopLinks welcomeLabelPRZero">Welcome</div>
       <div class="left headerTopLinks textbold font-size12" id="userName"></div>