Skip to content

Commit

Permalink
Double time for ExplicitIndexTest, cleanup deprecated things
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaDemianenko committed Nov 8, 2017
1 parent ff943fb commit 5269994
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 33 deletions.
Expand Up @@ -571,7 +571,7 @@ final class TransactionBoundQueryContext(tc: TransactionalContextWrapper)
PathExpanderBuilder.allTypes(toGraphDb(dir)) PathExpanderBuilder.allTypes(toGraphDb(dir))
case TypeAndDirectionExpander(_, _, typDirs) => case TypeAndDirectionExpander(_, _, typDirs) =>
typDirs.foldLeft(PathExpanderBuilder.empty()) { typDirs.foldLeft(PathExpanderBuilder.empty()) {
case (acc, (typ, dir)) => acc.add(DynamicRelationshipType.withName(typ), toGraphDb(dir)) case (acc, (typ, dir)) => acc.add(RelationshipType.withName(typ), toGraphDb(dir))
} }
} }


Expand Down
Expand Up @@ -36,7 +36,7 @@
import org.neo4j.test.rule.ImpermanentDatabaseRule; import org.neo4j.test.rule.ImpermanentDatabaseRule;


import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.neo4j.graphdb.DynamicLabel.label; import static org.neo4j.graphdb.Label.label;


public class DeleteNodeStressIT public class DeleteNodeStressIT
{ {
Expand Down
Expand Up @@ -31,15 +31,15 @@
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;


import org.neo4j.graphdb.DynamicRelationshipType;
import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship; import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Result; import org.neo4j.graphdb.Result;
import org.neo4j.graphdb.Transaction; import org.neo4j.graphdb.Transaction;
import org.neo4j.test.rule.ImpermanentDatabaseRule; import org.neo4j.test.rule.ImpermanentDatabaseRule;


import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.neo4j.graphdb.DynamicLabel.label; import static org.neo4j.graphdb.Label.label;


public class DeleteRelationshipStressIT public class DeleteRelationshipStressIT
{ {
Expand All @@ -64,7 +64,7 @@ public void setup()


if ( prev != null ) if ( prev != null )
{ {
Relationship rel = prev.createRelationshipTo( node, DynamicRelationshipType.withName( "T" ) ); Relationship rel = prev.createRelationshipTo( node, RelationshipType.withName( "T" ) );
rel.setProperty( "prop", i + j ); rel.setProperty( "prop", i + j );
} }
prev = node; prev = node;
Expand Down
Expand Up @@ -39,7 +39,7 @@
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat; import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import static org.neo4j.graphdb.DynamicLabel.label; import static org.neo4j.graphdb.Label.label;
import static org.neo4j.helpers.Exceptions.rootCause; import static org.neo4j.helpers.Exceptions.rootCause;


public class GraphDatabaseShutdownTest public class GraphDatabaseShutdownTest
Expand Down
Expand Up @@ -23,7 +23,6 @@
import org.apache.commons.lang3.RandomUtils; import org.apache.commons.lang3.RandomUtils;
import org.junit.Test; import org.junit.Test;


import org.neo4j.graphdb.DynamicLabel;
import org.neo4j.graphdb.Label; import org.neo4j.graphdb.Label;
import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.PropertyContainer; import org.neo4j.graphdb.PropertyContainer;
Expand Down Expand Up @@ -124,7 +123,7 @@ public void shouldPrintCypherEsqueRelationshipToString() throws Exception
@Test @Test
public void createDropRelationshipLongStringProperty() public void createDropRelationshipLongStringProperty()
{ {
Label markerLabel = DynamicLabel.label( "marker" ); Label markerLabel = Label.label( "marker" );
String testPropertyKey = "testProperty"; String testPropertyKey = "testProperty";
String propertyValue = RandomStringUtils.randomAscii( 255 ); String propertyValue = RandomStringUtils.randomAscii( 255 );


Expand Down Expand Up @@ -162,7 +161,7 @@ public void createDropRelationshipLongStringProperty()
@Test @Test
public void createDropRelationshipLongArrayProperty() public void createDropRelationshipLongArrayProperty()
{ {
Label markerLabel = DynamicLabel.label( "marker" ); Label markerLabel = Label.label( "marker" );
String testPropertyKey = "testProperty"; String testPropertyKey = "testProperty";
byte[] propertyValue = RandomUtils.nextBytes( 1024 ); byte[] propertyValue = RandomUtils.nextBytes( 1024 );


Expand Down
Expand Up @@ -29,11 +29,11 @@


import org.neo4j.graphdb.ConstraintViolationException; import org.neo4j.graphdb.ConstraintViolationException;
import org.neo4j.graphdb.Direction; import org.neo4j.graphdb.Direction;
import org.neo4j.graphdb.DynamicRelationshipType;
import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.NotFoundException; import org.neo4j.graphdb.NotFoundException;
import org.neo4j.graphdb.Relationship; import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Transaction; import org.neo4j.graphdb.Transaction;
import org.neo4j.helpers.collection.PrefetchingIterator; import org.neo4j.helpers.collection.PrefetchingIterator;
import org.neo4j.kernel.impl.AbstractNeo4jTestCase; import org.neo4j.kernel.impl.AbstractNeo4jTestCase;
Expand Down Expand Up @@ -204,7 +204,7 @@ public void cannotDeleteNodeWithLoopStillAttached() throws Exception
try ( Transaction tx = db.beginTx() ) try ( Transaction tx = db.beginTx() )
{ {
node = db.createNode(); node = db.createNode();
node.createRelationshipTo( node, DynamicRelationshipType.withName( "MAYOR_OF" ) ); node.createRelationshipTo( node, RelationshipType.withName( "MAYOR_OF" ) );
tx.success(); tx.success();
} }


Expand Down
Expand Up @@ -43,8 +43,8 @@


import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
import static org.neo4j.graphdb.DynamicLabel.label; import static org.neo4j.graphdb.Label.label;
import static org.neo4j.graphdb.DynamicRelationshipType.withName; import static org.neo4j.graphdb.RelationshipType.withName;
import static org.neo4j.kernel.api.ReadOperations.ANY_LABEL; import static org.neo4j.kernel.api.ReadOperations.ANY_LABEL;
import static org.neo4j.kernel.api.ReadOperations.ANY_RELATIONSHIP_TYPE; import static org.neo4j.kernel.api.ReadOperations.ANY_RELATIONSHIP_TYPE;


Expand Down
Expand Up @@ -23,7 +23,6 @@
import org.junit.Test; import org.junit.Test;
import org.junit.rules.ExpectedException; import org.junit.rules.ExpectedException;


import org.neo4j.graphdb.DynamicRelationshipType;
import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship; import org.neo4j.graphdb.Relationship;
Expand All @@ -43,7 +42,7 @@


public class ExplicitIndexTest public class ExplicitIndexTest
{ {
private static final RelationshipType TYPE = DynamicRelationshipType.withName( "TYPE" ); private static final RelationshipType TYPE = RelationshipType.withName( "TYPE" );


@Rule @Rule
public final DatabaseRule db = new ImpermanentDatabaseRule(); public final DatabaseRule db = new ImpermanentDatabaseRule();
Expand Down
Expand Up @@ -25,7 +25,6 @@
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;


import org.neo4j.graphdb.DynamicRelationshipType;
import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.PropertyContainer; import org.neo4j.graphdb.PropertyContainer;
import org.neo4j.graphdb.Relationship; import org.neo4j.graphdb.Relationship;
Expand Down Expand Up @@ -80,7 +79,7 @@ public void shouldNotAcceptValuesWithNullToString() throws Exception
{ {
Node node = db.createNode(); Node node = db.createNode();
Node otherNode = db.createNode(); Node otherNode = db.createNode();
Relationship rel = node.createRelationshipTo( otherNode, DynamicRelationshipType.withName( "recovery" ) ); Relationship rel = node.createRelationshipTo( otherNode, RelationshipType.withName( "recovery" ) );
Index<Node> nodeIndex = db.index().forNodes( "node-index" ); Index<Node> nodeIndex = db.index().forNodes( "node-index" );
RelationshipIndex relationshipIndex = db.index().forRelationships( "rel-index" ); RelationshipIndex relationshipIndex = db.index().forRelationships( "rel-index" );


Expand Down
Expand Up @@ -38,7 +38,7 @@


public class ExplicitIndexTest public class ExplicitIndexTest
{ {
private static final long TEST_TIMEOUT = 40_000; private static final long TEST_TIMEOUT = 80_000;


@Rule @Rule
public TestDirectory directory = TestDirectory.testDirectory(); public TestDirectory directory = TestDirectory.testDirectory();
Expand Down
Expand Up @@ -30,7 +30,7 @@
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;


import org.neo4j.graphdb.DynamicRelationshipType; import org.neo4j.graphdb.RelationshipType;
import org.neo4j.server.scripting.UserScriptClassWhiteList; import org.neo4j.server.scripting.UserScriptClassWhiteList;


import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.instanceOf;
Expand Down Expand Up @@ -117,7 +117,7 @@ public void shouldAllowAccessToWhiteListedClassMembers() throws Exception
Scriptable scope = cx.initStandardObjects(); Scriptable scope = cx.initStandardObjects();


// When // When
Object wrapped = wrapper.wrap( cx, scope, DynamicRelationshipType.withName( "blah" ), null ); Object wrapped = wrapper.wrap( cx, scope, RelationshipType.withName( "blah" ), null );


// Then // Then
assertThat( wrapped, is( instanceOf( NativeJavaObject.class ) ) ); assertThat( wrapped, is( instanceOf( NativeJavaObject.class ) ) );
Expand Down
Expand Up @@ -28,7 +28,6 @@
import java.io.File; import java.io.File;


import org.neo4j.graphdb.Direction; import org.neo4j.graphdb.Direction;
import org.neo4j.graphdb.DynamicRelationshipType;
import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship; import org.neo4j.graphdb.Relationship;
Expand All @@ -37,8 +36,8 @@
import org.neo4j.graphdb.factory.GraphDatabaseSettings; import org.neo4j.graphdb.factory.GraphDatabaseSettings;
import org.neo4j.kernel.configuration.Config; import org.neo4j.kernel.configuration.Config;
import org.neo4j.kernel.configuration.Settings; import org.neo4j.kernel.configuration.Settings;
import org.neo4j.ports.allocation.PortAuthority;
import org.neo4j.kernel.impl.enterprise.configuration.OnlineBackupSettings; import org.neo4j.kernel.impl.enterprise.configuration.OnlineBackupSettings;
import org.neo4j.ports.allocation.PortAuthority;
import org.neo4j.test.DbRepresentation; import org.neo4j.test.DbRepresentation;
import org.neo4j.test.TestGraphDatabaseFactory; import org.neo4j.test.TestGraphDatabaseFactory;
import org.neo4j.test.rule.SuppressOutput; import org.neo4j.test.rule.SuppressOutput;
Expand Down Expand Up @@ -187,8 +186,8 @@ private DbRepresentation createTransactiongWithWeirdRelationshipGroupRecord( Fil
db = startGraphDatabase( path ); db = startGraphDatabase( path );
int i = 0; int i = 0;
Node node; Node node;
DynamicRelationshipType typeToDelete = DynamicRelationshipType.withName( "A" ); RelationshipType typeToDelete = RelationshipType.withName( "A" );
DynamicRelationshipType theOtherType = DynamicRelationshipType.withName( "B" ); RelationshipType theOtherType = RelationshipType.withName( "B" );
int defaultDenseNodeThreshold = int defaultDenseNodeThreshold =
Integer.parseInt( GraphDatabaseSettings.dense_node_threshold.getDefaultValue() ); Integer.parseInt( GraphDatabaseSettings.dense_node_threshold.getDefaultValue() );


Expand Down
Expand Up @@ -27,9 +27,8 @@


import java.io.File; import java.io.File;


import org.neo4j.graphdb.DynamicLabel;
import org.neo4j.graphdb.DynamicRelationshipType;
import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Label;
import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.QueryExecutionException; import org.neo4j.graphdb.QueryExecutionException;
import org.neo4j.graphdb.Relationship; import org.neo4j.graphdb.Relationship;
Expand Down Expand Up @@ -57,8 +56,8 @@
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat; import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import static org.neo4j.graphdb.DynamicLabel.label; import static org.neo4j.graphdb.Label.label;
import static org.neo4j.graphdb.DynamicRelationshipType.withName; import static org.neo4j.graphdb.RelationshipType.withName;
import static org.neo4j.helpers.collection.Iterables.count; import static org.neo4j.helpers.collection.Iterables.count;
import static org.neo4j.helpers.collection.Iterables.single; import static org.neo4j.helpers.collection.Iterables.single;
import static org.neo4j.io.fs.FileUtils.deleteRecursively; import static org.neo4j.io.fs.FileUtils.deleteRecursively;
Expand All @@ -82,7 +81,7 @@ protected void createConstraint( GraphDatabaseService db, String type, String va
@Override @Override
protected ConstraintDefinition getConstraint( GraphDatabaseService db, String type, String value ) protected ConstraintDefinition getConstraint( GraphDatabaseService db, String type, String value )
{ {
return Iterables.singleOrNull( db.schema().getConstraints( DynamicLabel.label( type ) ) ); return Iterables.singleOrNull( db.schema().getConstraints( label( type ) ) );
} }


@Override @Override
Expand Down Expand Up @@ -127,7 +126,7 @@ protected void createConstraint( GraphDatabaseService db, String type, String va
@Override @Override
protected ConstraintDefinition getConstraint( GraphDatabaseService db, String type, String value ) protected ConstraintDefinition getConstraint( GraphDatabaseService db, String type, String value )
{ {
return Iterables.singleOrNull( db.schema().getConstraints( DynamicRelationshipType.withName( type ) ) ); return Iterables.singleOrNull( db.schema().getConstraints( withName( type ) ) );
} }


@Override @Override
Expand Down Expand Up @@ -176,13 +175,13 @@ protected void createConstraint( GraphDatabaseService db, String type, String va
@Override @Override
protected ConstraintDefinition getConstraint( GraphDatabaseService db, String type, String value ) protected ConstraintDefinition getConstraint( GraphDatabaseService db, String type, String value )
{ {
return Iterables.singleOrNull( db.schema().getConstraints( DynamicLabel.label( type ) ) ); return Iterables.singleOrNull( db.schema().getConstraints( Label.label( type ) ) );
} }


@Override @Override
protected IndexDefinition getIndex( GraphDatabaseService db, String type, String value ) protected IndexDefinition getIndex( GraphDatabaseService db, String type, String value )
{ {
return Iterables.singleOrNull( db.schema().getIndexes( DynamicLabel.label( type ) ) ); return Iterables.singleOrNull( db.schema().getIndexes( Label.label( type ) ) );
} }


@Override @Override
Expand Down
Expand Up @@ -28,7 +28,7 @@
import org.neo4j.test.ha.ClusterRule; import org.neo4j.test.ha.ClusterRule;


import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
import static org.neo4j.graphdb.DynamicRelationshipType.withName; import static org.neo4j.graphdb.RelationshipType.withName;
import static org.neo4j.kernel.impl.ha.ClusterManager.clusterOfSize; import static org.neo4j.kernel.impl.ha.ClusterManager.clusterOfSize;


/** /**
Expand Down

0 comments on commit 5269994

Please sign in to comment.