geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kirklund <...@git.apache.org>
Subject [GitHub] geode pull request #699: GEODE-3413: overhaul launcher and process classes a...
Date Thu, 10 Aug 2017 19:10:21 GMT
Github user kirklund commented on a diff in the pull request:

    https://github.com/apache/geode/pull/699#discussion_r132542106
  
    --- Diff: geode-core/src/test/java/org/apache/geode/distributed/LauncherIntegrationTestCase.java
---
    @@ -0,0 +1,505 @@
    +/*
    + * 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.distributed;
    +
    +import static java.util.concurrent.TimeUnit.MINUTES;
    +import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
    +import static org.apache.geode.internal.AvailablePort.SOCKET;
    +import static org.apache.geode.internal.AvailablePort.isPortAvailable;
    +import static org.apache.geode.internal.process.ProcessUtils.identifyPid;
    +import static org.apache.geode.internal.process.ProcessUtils.isProcessAlive;
    +import static org.assertj.core.api.Assertions.assertThat;
    +import static org.junit.Assert.assertTrue;
    +
    +import java.io.BufferedReader;
    +import java.io.File;
    +import java.io.FileReader;
    +import java.io.FileWriter;
    +import java.io.IOException;
    +import java.io.UncheckedIOException;
    +import java.lang.management.ManagementFactory;
    +import java.net.ServerSocket;
    +import java.nio.file.Files;
    +import java.util.List;
    +import java.util.Properties;
    +import java.util.concurrent.Callable;
    +import java.util.concurrent.atomic.AtomicBoolean;
    +
    +import org.apache.commons.lang.StringUtils;
    +import org.apache.logging.log4j.Logger;
    +import org.awaitility.Awaitility;
    +import org.awaitility.core.ConditionFactory;
    +import org.junit.After;
    +import org.junit.Before;
    +import org.junit.Rule;
    +import org.junit.contrib.java.lang.system.RestoreSystemProperties;
    +import org.junit.rules.TemporaryFolder;
    +import org.junit.rules.TestName;
    +
    +import org.apache.geode.distributed.internal.DistributionConfig;
    +import org.apache.geode.distributed.internal.InternalDistributedSystem;
    +import org.apache.geode.internal.logging.LogService;
    +import org.apache.geode.internal.net.SocketCreatorFactory;
    +import org.apache.geode.internal.process.PidUnavailableException;
    +import org.apache.geode.internal.process.ProcessStreamReader.InputListener;
    +import org.apache.geode.internal.process.ProcessType;
    +import org.apache.geode.internal.process.ProcessUtils;
    +import org.apache.geode.internal.process.lang.AvailablePid;
    +import org.apache.geode.internal.util.StopWatch;
    +import org.apache.geode.test.dunit.IgnoredException;
    +
    +/**
    + * Abstract base class for integration tests of both {@link LocatorLauncher} and
    + * {@link ServerLauncher}.
    + *
    + * @since GemFire 8.0
    + */
    +public abstract class LauncherIntegrationTestCase {
    +  protected static final Logger logger = LogService.getLogger();
    +
    +  protected static final int WAIT_FOR_PROCESS_TO_DIE_TIMEOUT = 5 * 60 * 1000; // 5 minutes
    +  protected static final int TIMEOUT_MILLISECONDS = WAIT_FOR_PROCESS_TO_DIE_TIMEOUT;
    +  protected static final int WAIT_FOR_FILE_CREATION_TIMEOUT = 10 * 1000; // 10s
    +  protected static final int WAIT_FOR_FILE_DELETION_TIMEOUT = 10 * 1000; // 10s
    +  protected static final int WAIT_FOR_MBEAN_TIMEOUT = 10 * 1000; // 10s
    +  protected static final int INTERVAL_MILLISECONDS = 100;
    +
    +  protected static final int PREFERRED_FAKE_PID = 42;
    +
    +  private static final String EXPECTED_EXCEPTION_ADD =
    +      "<ExpectedException action=add>{}</ExpectedException>";
    +  private static final String EXPECTED_EXCEPTION_REMOVE =
    --- End diff --
    
    All unused fields deleted.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message