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 2018/07/18 19:13:03 UTC

[geode] branch feature/GEODE-5212-export-logs updated (5dd82b1 -> 3cd0c96)

This is an automated email from the ASF dual-hosted git repository.

sai_boorlagadda pushed a change to branch feature/GEODE-5212-export-logs
in repository https://gitbox.apache.org/repos/asf/geode.git.


 discard 5dd82b1  GEODE-5212: Convert ExportLogsIntegrationTest to DistributedTest
     new 3cd0c96  GEODE-5212: Convert ExportLogsIntegrationTest to DistributedTest

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (5dd82b1)
            \
             N -- N -- N   refs/heads/feature/GEODE-5212-export-logs (3cd0c96)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:


[geode] 01/01: GEODE-5212: Convert ExportLogsIntegrationTest to DistributedTest

Posted by sa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sai_boorlagadda pushed a commit to branch feature/GEODE-5212-export-logs
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 3cd0c96e4558b08c18d93bc6d24f85de5c53d9ae
Author: Sai Boorlagadda <sb...@pivotal.io>
AuthorDate: Wed Jul 18 12:11:10 2018 -0700

    GEODE-5212: Convert ExportLogsIntegrationTest to DistributedTest
    
      Due to differences on how defaultDirectory is initialized between
      windows and unix causes this test to fail if its integration test.
      So converted it to be a DistributedTest.
    
    Signed-off-by: Jens Deppe <jd...@pivotal.io>
---
 .../internal/cli/commands/ExportLogsDUnitTest.java | 34 ++++++++
 .../cli/commands/ExportLogsIntegrationTest.java    | 97 ----------------------
 2 files changed, 34 insertions(+), 97 deletions(-)

diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportLogsDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportLogsDUnitTest.java
index d21d395..ad74a44 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportLogsDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportLogsDUnitTest.java
@@ -27,6 +27,7 @@ import java.io.File;
 import java.io.IOException;
 import java.io.Serializable;
 import java.nio.charset.Charset;
+import java.nio.file.Path;
 import java.time.LocalDateTime;
 import java.time.ZoneId;
 import java.time.ZonedDateTime;
@@ -107,6 +108,39 @@ public class ExportLogsDUnitTest {
   }
 
   @Test
+  public void withFiles_savedToLocatorWorkingDir() {
+    String[] extensions = {"zip"};
+    // Expects locator to produce file in own working directory when connected via JMX
+    gfshConnector.executeCommand("export logs");
+    assertThat(FileUtils.listFiles(locator.getWorkingDir(), extensions, false)).isNotEmpty();
+  }
+
+  @Test
+  public void withFiles_savedToLocatorSpecifiedRelativeDir() throws Exception {
+    String[] extensions = {"zip"};
+    Path workingDirPath = locator.getWorkingDir().toPath();
+    Path subdirPath = workingDirPath.resolve("some").resolve("test").resolve("directory");
+    Path relativeDir = workingDirPath.relativize(subdirPath);
+    // Expects locator to produce file in own working directory when connected via JMX
+    gfshConnector.executeCommand("export logs --dir=" + relativeDir.toString());
+    assertThat(FileUtils.listFiles(locator.getWorkingDir(), extensions, false)).isEmpty();
+    assertThat(FileUtils.listFiles(locator.getWorkingDir(), extensions, true)).isNotEmpty();
+    assertThat(FileUtils.listFiles(subdirPath.toFile(), extensions, false)).isNotEmpty();
+  }
+
+  @Test
+  public void withFiles_savedToLocatorSpecifiedAbsoluteDir() throws Exception {
+    String[] extensions = {"zip"};
+    Path workingDirPath = locator.getWorkingDir().toPath();
+    Path absoluteDirPath =
+        workingDirPath.resolve("some").resolve("test").resolve("directory").toAbsolutePath();
+    // Expects locator to produce file in own working directory when connected via JMX
+    gfshConnector.executeCommand("export logs --dir=" + absoluteDirPath.toString());
+    assertThat(FileUtils.listFiles(locator.getWorkingDir(), extensions, false)).isEmpty();
+    assertThat(FileUtils.listFiles(locator.getWorkingDir(), extensions, true)).isNotEmpty();
+    assertThat(FileUtils.listFiles(absoluteDirPath.toFile(), extensions, false)).isNotEmpty();
+  }
+  @Test
   public void startAndEndDateCanIncludeLogs() throws Exception {
     ZonedDateTime now = LocalDateTime.now().atZone(ZoneId.systemDefault());
     ZonedDateTime yesterday = now.minusDays(1);
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/ExportLogsIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/ExportLogsIntegrationTest.java
deleted file mode 100644
index 08d5240..0000000
--- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/ExportLogsIntegrationTest.java
+++ /dev/null
@@ -1,97 +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 org.apache.geode.management.internal.cli.commands;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.io.File;
-import java.nio.file.Path;
-
-import org.apache.commons.io.FileUtils;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import org.apache.geode.test.junit.categories.LoggingTest;
-import org.apache.geode.test.junit.rules.GfshCommandRule;
-import org.apache.geode.test.junit.rules.LocatorStarterRule;
-
-@Category({LoggingTest.class})
-public class ExportLogsIntegrationTest {
-  @ClassRule
-  public static LocatorStarterRule locator =
-      new LocatorStarterRule().withWorkingDir().withLogFile().withAutoStart();
-
-  @Rule
-  public GfshCommandRule gfsh = new GfshCommandRule();
-
-  @Before
-  public void connect() throws Exception {
-    gfsh.connectAndVerify(locator);
-  }
-
-  public File getWorkingDirectory() throws Exception {
-    return locator.getWorkingDir();
-  }
-
-  @Test
-  public void testInvalidMember() throws Exception {
-    gfsh.executeCommand("export logs --member=member1,member2");
-    assertThat(gfsh.getGfshOutput()).contains("No Members Found");
-  }
-
-  @Test
-  public void testNothingToExport() throws Exception {
-    gfsh.executeCommand("export logs --stats-only");
-    assertThat(gfsh.getGfshOutput()).contains("No files to be exported.");
-  }
-
-  @Test
-  public void withFiles_savedToLocatorWorkingDir() throws Exception {
-    String[] extensions = {"zip"};
-    // Expects locator to produce file in own working directory when connected via JMX
-    gfsh.executeCommand("export logs");
-    assertThat(FileUtils.listFiles(getWorkingDirectory(), extensions, false)).isNotEmpty();
-  }
-
-  @Test
-  public void withFiles_savedToLocatorSpecifiedRelativeDir() throws Exception {
-    String[] extensions = {"zip"};
-    Path workingDirPath = getWorkingDirectory().toPath();
-    Path subdirPath = workingDirPath.resolve("some").resolve("test").resolve("directory");
-    Path relativeDir = workingDirPath.relativize(subdirPath);
-    // Expects locator to produce file in own working directory when connected via JMX
-    gfsh.executeCommand("export logs --dir=" + relativeDir.toString());
-    assertThat(FileUtils.listFiles(getWorkingDirectory(), extensions, false)).isEmpty();
-    assertThat(FileUtils.listFiles(getWorkingDirectory(), extensions, true)).isNotEmpty();
-    assertThat(FileUtils.listFiles(subdirPath.toFile(), extensions, false)).isNotEmpty();
-  }
-
-  @Test
-  public void withFiles_savedToLocatorSpecifiedAbsoluteDir() throws Exception {
-    String[] extensions = {"zip"};
-    Path workingDirPath = getWorkingDirectory().toPath();
-    Path absoluteDirPath =
-        workingDirPath.resolve("some").resolve("test").resolve("directory").toAbsolutePath();
-    // Expects locator to produce file in own working directory when connected via JMX
-    gfsh.executeCommand("export logs --dir=" + absoluteDirPath.toString());
-    assertThat(FileUtils.listFiles(getWorkingDirectory(), extensions, false)).isEmpty();
-    assertThat(FileUtils.listFiles(getWorkingDirectory(), extensions, true)).isNotEmpty();
-    assertThat(FileUtils.listFiles(absoluteDirPath.toFile(), extensions, false)).isNotEmpty();
-  }
-}