Skip to content

Commit

Permalink
Rename tests that start servers, db to IT tests.
Browse files Browse the repository at this point in the history
Disable forks for integration tests and server-enterprise.
Rename test that where matching before surefire and failsafe masks.
  • Loading branch information
MishaDemianenko committed Jun 15, 2017
1 parent 5824d0f commit ec2b8d0
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 24 deletions.
Expand Up @@ -34,7 +34,7 @@

import static org.junit.Assert.assertEquals;

public class TestDenseNodeRelChainPositionIT
public class DenseNodeRelChainPositionTest
{
@Rule
public final DatabaseRule db = new ImpermanentDatabaseRule();
Expand Down
Expand Up @@ -45,7 +45,7 @@
import static org.neo4j.graphdb.Label.label;
import static org.neo4j.helpers.collection.MapUtil.map;

public class TestLuceneSchemaBatchInsertIT
public class LuceneSchemaBatchInsertTest
{
@Rule
public final TestDirectory testDirectory = TestDirectory.testDirectory();
Expand Down
Expand Up @@ -32,7 +32,7 @@

import static org.neo4j.test.rule.SuppressOutput.suppressAll;

public class TestJetty9WebServerIT extends ExclusiveServerTestBase
public class Jetty9WebServerIT extends ExclusiveServerTestBase
{
@Rule
public SuppressOutput suppressOutput = suppressAll();
Expand Down
Expand Up @@ -71,7 +71,7 @@
import static org.neo4j.test.rule.RetryACoupleOfTimesHandler.ANY_EXCEPTION;
import static org.neo4j.test.rule.RetryACoupleOfTimesHandler.retryACoupleOfTimesOn;

public class TestBranchedData
public class BranchedDataIT
{
private final LifeRule life = new LifeRule( true );
private final TestDirectory directory = TestDirectory.testDirectory();
Expand Down
Expand Up @@ -33,7 +33,7 @@
import static org.neo4j.kernel.impl.ha.ClusterManager.masterAvailable;
import static org.neo4j.kernel.impl.ha.ClusterManager.masterSeesMembers;

public class TestClusterClientPadding
public class ClusterClientPaddingIT
{
@Rule
public ClusterRule clusterRule = new ClusterRule( getClass() )
Expand Down
Expand Up @@ -31,7 +31,7 @@
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;

public class TestClusterIndexDeletion
public class ClusterIndexDeletionIT
{
@Rule
public ClusterRule clusterRule = new ClusterRule( getClass() )
Expand Down
Expand Up @@ -63,7 +63,7 @@
* bit better than checking debug.log for certain entries. Another, more
* direct, test is present in community.
*/
public class TestPullUpdatesApplied
public class PullUpdatesAppliedIT
{
private final HighlyAvailableGraphDatabase[] dbs = new HighlyAvailableGraphDatabase[3];
@Rule
Expand Down Expand Up @@ -192,7 +192,7 @@ private static HighlyAvailableGraphDatabase database( int serverId, File path )
private static int runInOtherJvmToGetExitCode( String... args ) throws Exception
{
List<String> allArgs = new ArrayList<String>( Arrays.asList( "java", "-Djava.awt.headless=true", "-cp",
System.getProperty( "java.class.path" ), TestPullUpdatesApplied.class.getName() ) );
System.getProperty( "java.class.path" ), PullUpdatesAppliedIT.class.getName() ) );
allArgs.addAll( Arrays.asList( args ) );
Process p = Runtime.getRuntime().exec( allArgs.toArray( new String[allArgs.size()] ) );
List<Thread> threads = new LinkedList<>();
Expand Down
Expand Up @@ -66,7 +66,7 @@
import static org.neo4j.kernel.impl.ha.ClusterManager.masterAvailable;
import static org.neo4j.kernel.impl.ha.ClusterManager.masterSeesSlavesAsAvailable;

public class TestPullUpdatesIT
public class PullUpdatesIT
{
private static final int PULL_INTERVAL = 100;
private static final int SHELL_PORT = 6370;
Expand Down
Expand Up @@ -43,10 +43,10 @@
import static org.junit.Assert.assertTrue;
import static org.neo4j.kernel.impl.ha.ClusterManager.allSeesAllAsAvailable;

public class TestSlaveOnlyCluster
public class SlaveOnlyClusterIT
{
@Rule
public ClusterRule clusterRule = new ClusterRule( TestSlaveOnlyCluster.class )
public ClusterRule clusterRule = new ClusterRule( SlaveOnlyClusterIT.class )
.withInstanceSetting( HaSettings.slave_only,
value -> value == 1 || value == 2 ? Settings.TRUE : Settings.FALSE );

Expand Down
Expand Up @@ -37,7 +37,7 @@
import static org.junit.Assert.assertEquals;
import static org.neo4j.register.Registers.newDoubleLongRegister;

public class HACountsPropagationTest
public class HACountsPropagationIT
{
private static final int PULL_INTERVAL = 100;

Expand Down
Expand Up @@ -37,7 +37,7 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class TestBasicHaOperationsIT
public class BasicHaOperationsIT
{
@ClassRule
public static LoggerRule logger = new LoggerRule( Level.OFF );
Expand Down
Expand Up @@ -51,10 +51,10 @@
* at org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.applyCommit(WriteTransaction.java:476)
* at org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.doCommit(WriteTransaction.java:426)
*/
public class DeletionTest
public class DeletionIT
{
@Rule
public ClusterRule clusterRule = new ClusterRule( DeletionTest.class ).withCluster( clusterOfSize( 2 ) );
public ClusterRule clusterRule = new ClusterRule( DeletionIT.class ).withCluster( clusterOfSize( 2 ) );

/**
* The problem would manifest even if the transaction was performed on the Master, it would then occur when the
Expand Down
Expand Up @@ -35,7 +35,7 @@
import static org.junit.Assert.assertTrue;
import static org.neo4j.io.fs.FileUtils.deleteRecursively;

public class SlaveWritingAfterStoreCopyTest
public class SlaveWritingAfterStoreCopyIT
{
@Rule
public ClusterRule clusterRule = new ClusterRule( this.getClass() );
Expand Down
Expand Up @@ -66,7 +66,7 @@
import static org.neo4j.kernel.impl.ha.ClusterManager.masterSeesSlavesAsAvailable;
import static org.neo4j.kernel.impl.store.MetaDataStore.Position.LAST_TRANSACTION_COMMIT_TIMESTAMP;

public class ClusterTest
public class ClusterIT
{
@Rule
public LoggerRule logging = new LoggerRule( Level.OFF );
Expand Down
Expand Up @@ -27,23 +27,19 @@
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.TransactionFailureException;
import org.neo4j.graphdb.security.WriteOperationsNotAllowedException;
import org.neo4j.kernel.api.exceptions.ReadOnlyDbException;
import org.neo4j.kernel.configuration.Settings;
import org.neo4j.kernel.ha.HighlyAvailableGraphDatabase;
import org.neo4j.kernel.impl.ha.ClusterManager.ManagedCluster;

import static junit.framework.TestCase.fail;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertThat;
import static org.neo4j.graphdb.factory.GraphDatabaseSettings.read_only;
import static org.neo4j.kernel.ha.HaSettings.tx_push_factor;

/**
* This test ensures that read-only slaves cannot make any modifications.
*/
public class ReadOnlySlaveTest
public class ReadOnlySlaveIT
{
@Rule
public final ClusterRule clusterRule = new ClusterRule( getClass() )
Expand Down
Expand Up @@ -46,7 +46,7 @@
* This test case ensures that instances with the same store id but very old txids
* will successfully join with a full version of the store.
*/
public class TestInstanceJoin
public class InstanceJoinIT
{
@Rule
public final TestDirectory testDirectory = TestDirectory.testDirectory();
Expand Down
Expand Up @@ -37,7 +37,7 @@
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;

public class EnterpriseInProcessServerBuilderTest
public class EnterpriseInProcessServerBuilderIT
{
@Rule
public TestDirectory testDir = TestDirectory.testDirectory();
Expand Down
7 changes: 7 additions & 0 deletions enterprise/server-enterprise/pom.xml
Expand Up @@ -285,6 +285,13 @@
<useManifestOnlyJar>false</useManifestOnlyJar>
</configuration>
</plugin>

<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<forkCount>1</forkCount>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
6 changes: 6 additions & 0 deletions integrationtests/pom.xml
Expand Up @@ -23,6 +23,12 @@

<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<forkCount>1</forkCount>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down

0 comments on commit ec2b8d0

Please sign in to comment.