[jira] [Commented] (GEODE-3254) Refactor ConfigCommands

2017-08-29 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-3254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16145614#comment-16145614
 ] 

ASF subversion and git services commented on GEODE-3254:


Commit 3bfe7a201ce77365f6197be36a3947afea749f10 in geode's branch 
refs/heads/develop from YehEmily
[ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=3bfe7a2 ]

GEODE-3436: Restore refactoring of ConfigCommands

* See initial commit GEODE-3254 (97c4e9a59f17c7bc914e39dd048b0a4cd96293c4)


> Refactor ConfigCommands
> ---
>
> Key: GEODE-3254
> URL: https://issues.apache.org/jira/browse/GEODE-3254
> Project: Geode
>  Issue Type: Sub-task
>  Components: gfsh
>Reporter: Emily Yeh
>Assignee: Emily Yeh
>
> {{ConfigCommands.java}} is a large class that contains multiple commands. 
> Each command should be refactored into a separate class, and the methods 
> shared by the commands should be refactored into a new and appropriately 
> named class of their own.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-3254) Refactor ConfigCommands

2017-08-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-3254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16124242#comment-16124242
 ] 

ASF GitHub Bot commented on GEODE-3254:
---

Github user asfgit closed the pull request at:

https://github.com/apache/geode/pull/665


> Refactor ConfigCommands
> ---
>
> Key: GEODE-3254
> URL: https://issues.apache.org/jira/browse/GEODE-3254
> Project: Geode
>  Issue Type: Sub-task
>  Components: gfsh
>Reporter: Emily Yeh
>Assignee: Emily Yeh
>
> {{ConfigCommands.java}} is a large class that contains multiple commands. 
> Each command should be refactored into a separate class, and the methods 
> shared by the commands should be refactored into a new and appropriately 
> named class of their own.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-3254) Refactor ConfigCommands

2017-08-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-3254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16111532#comment-16111532
 ] 

ASF GitHub Bot commented on GEODE-3254:
---

Github user YehEmily commented on a diff in the pull request:

https://github.com/apache/geode/pull/665#discussion_r130965197
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/Interceptor.java
 ---
@@ -0,0 +1,79 @@
+/*
+ * 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 org.apache.geode.management.internal.cli.commands;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.Map;
+
+import org.apache.geode.management.cli.Result;
+import 
org.apache.geode.management.internal.cli.AbstractCliAroundInterceptor;
+import org.apache.geode.management.internal.cli.GfshParseResult;
+import org.apache.geode.management.internal.cli.i18n.CliStrings;
+import org.apache.geode.management.internal.cli.result.ResultBuilder;
+import org.apache.geode.management.internal.cli.shell.Gfsh;
+
+/**
+ * Interceptor used by gfsh to intercept execution of export config 
command at "shell".
+ */
+public class Interceptor extends AbstractCliAroundInterceptor {
--- End diff --

Oops - it seems that it's actually being used, but only in 
`ExportConfigCommand`, so I moved it there. Thanks for pointing this out!


> Refactor ConfigCommands
> ---
>
> Key: GEODE-3254
> URL: https://issues.apache.org/jira/browse/GEODE-3254
> Project: Geode
>  Issue Type: Sub-task
>  Components: gfsh
>Reporter: Emily Yeh
>Assignee: Emily Yeh
>
> {{ConfigCommands.java}} is a large class that contains multiple commands. 
> Each command should be refactored into a separate class, and the methods 
> shared by the commands should be refactored into a new and appropriately 
> named class of their own.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-3254) Refactor ConfigCommands

2017-08-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-3254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16111500#comment-16111500
 ] 

ASF GitHub Bot commented on GEODE-3254:
---

Github user YehEmily commented on a diff in the pull request:

https://github.com/apache/geode/pull/665#discussion_r130960859
  
--- Diff: 
geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ExportConfigCommandDUnitTest.java
 ---
@@ -0,0 +1,181 @@
+/*
+ * 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 org.apache.geode.management.internal.cli.commands;
+
+import static org.apache.commons.io.FileUtils.deleteDirectory;
+import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
+import static org.apache.geode.distributed.ConfigurationProperties.NAME;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.internal.cache.xmlcache.CacheXmlGenerator;
+import org.apache.geode.management.cli.Result;
+import org.apache.geode.management.internal.cli.result.CommandResult;
+import org.apache.geode.test.dunit.Host;
+import org.apache.geode.test.dunit.SerializableRunnable;
+import org.apache.geode.test.junit.categories.DistributedTest;
+import org.apache.geode.test.junit.categories.FlakyTest;
+
+@Category(DistributedTest.class)
+public class ExportConfigCommandDUnitTest extends CliCommandTestBase {
+  private File managerConfigFile;
+  private File managerPropsFile;
+  private File vm1ConfigFile;
+  private File vm1PropsFile;
+  private File vm2ConfigFile;
+  private File vm2PropsFile;
+  private File shellConfigFile;
+  private File shellPropsFile;
+  private File subDir;
+  private File subManagerConfigFile;
+
+  @Override
+  protected final void postSetUpCliCommandTestBase() throws Exception {
+this.managerConfigFile = 
this.temporaryFolder.newFile("Manager-cache.xml");
+this.managerPropsFile = 
this.temporaryFolder.newFile("Manager-gf.properties");
+this.vm1ConfigFile = this.temporaryFolder.newFile("VM1-cache.xml");
+this.vm1PropsFile = this.temporaryFolder.newFile("VM1-gf.properties");
+this.vm2ConfigFile = this.temporaryFolder.newFile("VM2-cache.xml");
+this.vm2PropsFile = this.temporaryFolder.newFile("VM2-gf.properties");
+this.shellConfigFile = this.temporaryFolder.newFile("Shell-cache.xml");
+this.shellPropsFile = 
this.temporaryFolder.newFile("Shell-gf.properties");
+this.subDir = this.temporaryFolder.newFolder(getName());
+this.subManagerConfigFile = new File(this.subDir, 
this.managerConfigFile.getName());
+  }
+
+  @Category(FlakyTest.class) // GEODE-1449
+  @Test
+  public void testExportConfig() throws Exception {
+Properties localProps = new Properties();
+localProps.setProperty(NAME, "Manager");
+localProps.setProperty(GROUPS, "Group1");
+setUpJmxManagerOnVm0ThenConnect(localProps);
+
+// Create a cache in another VM (VM1)
+Host.getHost(0).getVM(1).invoke(new SerializableRunnable() {
+  public void run() {
+Properties localProps = new Properties();
+localProps.setProperty(NAME, "VM1");
+localProps.setProperty(GROUPS, "Group2");
+getSystem(localProps);
+getCache();
+  }
+});
+
+// Create a cache in a 3rd VM (VM2)
+Host.getHost(0).getVM(2).invoke(new SerializableRunnable() {
+  public void run() {
+Properties localProps = new Properties();
+localProps.setProperty(NAME, "VM2");
  

[jira] [Commented] (GEODE-3254) Refactor ConfigCommands

2017-08-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-3254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16111493#comment-16111493
 ] 

ASF GitHub Bot commented on GEODE-3254:
---

Github user YehEmily commented on a diff in the pull request:

https://github.com/apache/geode/pull/665#discussion_r130960231
  
--- Diff: 
geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/Interceptor.java
 ---
@@ -0,0 +1,79 @@
+/*
+ * 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 org.apache.geode.management.internal.cli.commands;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.Map;
+
+import org.apache.geode.management.cli.Result;
+import 
org.apache.geode.management.internal.cli.AbstractCliAroundInterceptor;
+import org.apache.geode.management.internal.cli.GfshParseResult;
+import org.apache.geode.management.internal.cli.i18n.CliStrings;
+import org.apache.geode.management.internal.cli.result.ResultBuilder;
+import org.apache.geode.management.internal.cli.shell.Gfsh;
+
+/**
+ * Interceptor used by gfsh to intercept execution of export config 
command at "shell".
+ */
+public class Interceptor extends AbstractCliAroundInterceptor {
--- End diff --

Ahh, not sure how I didn't notice that! I've deleted it - thanks for your 
feedback!


> Refactor ConfigCommands
> ---
>
> Key: GEODE-3254
> URL: https://issues.apache.org/jira/browse/GEODE-3254
> Project: Geode
>  Issue Type: Sub-task
>  Components: gfsh
>Reporter: Emily Yeh
>Assignee: Emily Yeh
>
> {{ConfigCommands.java}} is a large class that contains multiple commands. 
> Each command should be refactored into a separate class, and the methods 
> shared by the commands should be refactored into a new and appropriately 
> named class of their own.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-3254) Refactor ConfigCommands

2017-07-28 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GEODE-3254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16105329#comment-16105329
 ] 

ASF GitHub Bot commented on GEODE-3254:
---

GitHub user YehEmily opened a pull request:

https://github.com/apache/geode/pull/665

GEODE-3254: Refactoring ConfigCommands and ConfigCommandsDUnitTest

[View the JIRA ticket 
here.](https://issues.apache.org/jira/browse/GEODE-3254)

`ConfigCommands.java` was a large class that contained multiple commands. 
Each command was refactored into a separate class. 
`ConfigCommandsDUnitTest.java` was also split into separate test classes.

- [x] JIRA ticket referenced

- [x] PR rebased

- [x] Single squashed commit

- [x] Builds cleanly

- [x] Tests updated

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

$ git pull https://github.com/YehEmily/geode GEODE-3254

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

https://github.com/apache/geode/pull/665.patch

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

This closes #665


commit 11c88b725eee219e5ec90e546d6e6fa1709a1b16
Author: YehEmily 
Date:   2017-07-26T18:07:09Z

GEODE-3254: Refactoring ConfigCommands and ConfigCommandsDUnitTest




> Refactor ConfigCommands
> ---
>
> Key: GEODE-3254
> URL: https://issues.apache.org/jira/browse/GEODE-3254
> Project: Geode
>  Issue Type: Sub-task
>  Components: gfsh
>Reporter: Emily Yeh
>Assignee: Emily Yeh
>
> {{ConfigCommands.java}} is a large class that contains multiple commands. 
> Each command should be refactored into a separate class, and the methods 
> shared by the commands should be refactored into a new and appropriately 
> named class of their own.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)