geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-3413) Overhaul launcher tests and process tests
Date Wed, 09 Aug 2017 21:12:00 GMT

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

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

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

    https://github.com/apache/geode/pull/699#discussion_r132308040
  
    --- Diff: geode-core/src/test/java/org/apache/geode/distributed/AbstractLauncherTest.java
---
    @@ -14,253 +14,370 @@
      */
     package org.apache.geode.distributed;
     
    +import static java.util.concurrent.TimeUnit.DAYS;
    +import static java.util.concurrent.TimeUnit.HOURS;
    +import static java.util.concurrent.TimeUnit.MILLISECONDS;
    +import static java.util.concurrent.TimeUnit.MINUTES;
    +import static java.util.concurrent.TimeUnit.SECONDS;
    +import static org.apache.geode.distributed.AbstractLauncher.ServiceState.toDaysHoursMinutesSeconds;
     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.assertNotNull;
    -import static org.junit.Assert.assertNull;
    -import static org.junit.Assert.assertTrue;
    +import static org.assertj.core.api.Assertions.assertThat;
    +import static org.assertj.core.api.Assertions.entry;
     import static org.mockito.Mockito.mock;
     import static org.mockito.Mockito.times;
     import static org.mockito.Mockito.verify;
     
    +import java.net.URL;
    +import java.util.Properties;
    +
     import org.apache.commons.lang.StringUtils;
    -import org.apache.geode.test.junit.categories.UnitTest;
     import org.junit.Test;
     import org.junit.experimental.categories.Category;
     
    -import java.net.MalformedURLException;
    -import java.net.URL;
    -import java.util.Properties;
    -import java.util.concurrent.TimeUnit;
    +import org.apache.geode.test.junit.categories.UnitTest;
     
     /**
    - * The AbstractLauncherTest class is a test suite of unit tests testing the contract
and
    - * functionality of the AbstractLauncher class.
    - * <p/>
    - * 
    - * @see org.apache.geode.distributed.AbstractLauncher
    - * @see org.junit.Assert
    - * @see org.junit.Test
    + * Unit tests for {@link AbstractLauncher}.
    + *
      * @since GemFire 7.0
      */
     @Category(UnitTest.class)
     public class AbstractLauncherTest {
     
    -  private AbstractLauncher<?> createAbstractLauncher(final String memberName,
    -      final String memberId) {
    -    return new FakeServiceLauncher(memberName, memberId);
    -  }
    -
       @Test
    -  public void shouldBeMockable() throws Exception {
    +  public void canBeMocked() throws Exception {
         AbstractLauncher mockAbstractLauncher = mock(AbstractLauncher.class);
         mockAbstractLauncher.setDebug(true);
         verify(mockAbstractLauncher, times(1)).setDebug(true);
       }
     
       @Test
    -  public void testIsSet() {
    -    final Properties properties = new Properties();
    +  public void isSetReturnsFalseIfPropertyDoesNotExist() throws Exception {
    +    assertThat(AbstractLauncher.isSet(new Properties(), NAME)).isFalse();
    +  }
     
    -    assertFalse(properties.containsKey(NAME));
    -    assertFalse(AbstractLauncher.isSet(properties, NAME));
    +  @Test
    +  public void isSetReturnsFalseIfPropertyHasEmptyValue() throws Exception {
    +    Properties properties = new Properties();
     
         properties.setProperty(NAME, "");
    --- End diff --
    
    Done! I made this change in all launcher and process main classes and test classes.


> Overhaul launcher tests and process tests
> -----------------------------------------
>
>                 Key: GEODE-3413
>                 URL: https://issues.apache.org/jira/browse/GEODE-3413
>             Project: Geode
>          Issue Type: Improvement
>          Components: gfsh
>            Reporter: Kirk Lund
>            Assignee: Kirk Lund
>              Labels: LauncherTest, ProcessTest
>
> The launcher and process tests are closely related and in need of overhauling to improve
debugging and remove flakiness.
> In addition, the org.apache.geode.internal.process package is need of improving the test
code coverage.
> Launcher tests:
> * geode-assembly/src/test/java/org/apache/geode/distributed/LocatorLauncherAssemblyIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/AbstractLauncherIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/AbstractLauncherServiceStatusTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/AbstractLauncherTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/LauncherMemberMXBeanIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/LocatorLauncherIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/LocatorLauncherLocalFileIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/LocatorLauncherLocalIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/LocatorLauncherRemoteFileIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/LocatorLauncherRemoteIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/LocatorLauncherRemoteWithCustomLoggingIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/LocatorLauncherTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/LocatorStateTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/ServerLauncherIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/ServerLauncherLocalFileIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/ServerLauncherLocalIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/ServerLauncherRemoteFileIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/ServerLauncherRemoteIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/ServerLauncherRemoteWithCustomLoggingIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/ServerLauncherRemoteWithCustomLoggingIntegrationTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/ServerLauncherTest.java
> * geode-core/src/test/java/org/apache/geode/distributed/ServerLauncherWithProviderIntegrationTest.java
> Process tests:
> * geode-core/src/test/java/org/apache/geode/internal/process/BlockingProcessStreamReaderJUnitTest.java
> * geode-core/src/test/java/org/apache/geode/internal/process/FileProcessControllerIntegrationJUnitTest.java
> * geode-core/src/test/java/org/apache/geode/internal/process/LocalProcessControllerJUnitTest.java
> * geode-core/src/test/java/org/apache/geode/internal/process/LocalProcessLauncherDUnitTest.java
> * geode-core/src/test/java/org/apache/geode/internal/process/LocalProcessLauncherJUnitTest.java
> * geode-core/src/test/java/org/apache/geode/internal/process/NonBlockingProcessStreamReaderJUnitTest.java
> * geode-core/src/test/java/org/apache/geode/internal/process/PidFileJUnitTest.java
> * geode-core/src/test/java/org/apache/geode/internal/process/ProcessControllerFactoryJUnitTest.java



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

Mime
View raw message