Skip to content

Commit

Permalink
Rename TestSessions to SessionRule
Browse files Browse the repository at this point in the history
  • Loading branch information
davidegrohmann committed Jul 14, 2016
1 parent e49716f commit e450dba
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Expand Up @@ -37,7 +37,7 @@
public class SessionAuthIT public class SessionAuthIT
{ {
@Rule @Rule
public TestSessions env = new TestSessions().withAuthEnabled( true ); public SessionRule env = new SessionRule().withAuthEnabled( true );


@Test @Test
public void shouldGiveCredentialsExpiredStatusOnExpiredCredentials() throws Throwable public void shouldGiveCredentialsExpiredStatusOnExpiredCredentials() throws Throwable
Expand Down
Expand Up @@ -56,7 +56,7 @@ public class SessionIT
private static final Map<String,Object> EMPTY_PARAMS = emptyMap(); private static final Map<String,Object> EMPTY_PARAMS = emptyMap();


@Rule @Rule
public TestSessions env = new TestSessions(); public SessionRule env = new SessionRule();
private final RecordingCallback responses = new RecordingCallback<>(); private final RecordingCallback responses = new RecordingCallback<>();
private final RecordingCallback<RecordStream, ?> pulling = new RecordingCallback<>(); private final RecordingCallback<RecordStream, ?> pulling = new RecordingCallback<>();
private final RecordingCallback<Void, ?> discarding = new RecordingCallback<>(); private final RecordingCallback<Void, ?> discarding = new RecordingCallback<>();
Expand Down
Expand Up @@ -48,7 +48,7 @@
import org.neo4j.test.TestGraphDatabaseFactory; import org.neo4j.test.TestGraphDatabaseFactory;
import org.neo4j.udc.UsageData; import org.neo4j.udc.UsageData;


class TestSessions implements TestRule, Sessions class SessionRule implements TestRule, Sessions
{ {
private GraphDatabaseAPI gdb; private GraphDatabaseAPI gdb;
private Sessions actual; private Sessions actual;
Expand Down Expand Up @@ -109,7 +109,7 @@ public Session newSession( String connectionDescriptor, boolean isEncrypted )
return session; return session;
} }


TestSessions withAuthEnabled( boolean authEnabled ) SessionRule withAuthEnabled( boolean authEnabled )
{ {
this.authEnabled = authEnabled; this.authEnabled = authEnabled;
return this; return this;
Expand All @@ -126,6 +126,11 @@ URL putTmpFile( String prefix, String suffix, String contents ) throws IOExcepti
return tmpFile.toURI().toURL(); return tmpFile.toURI().toURL();
} }


public GraphDatabaseAPI graph()
{
return gdb;
}

long lastClosedTxId() long lastClosedTxId()
{ {
return gdb.getDependencyResolver().resolveDependency( TransactionIdStore.class ).getLastClosedTransactionId(); return gdb.getDependencyResolver().resolveDependency( TransactionIdStore.class ).getLastClosedTransactionId();
Expand Down
Expand Up @@ -35,7 +35,7 @@ public class TransactionIT
private static final Map<String, Object> EMPTY_PARAMS = Collections.emptyMap(); private static final Map<String, Object> EMPTY_PARAMS = Collections.emptyMap();


@Rule @Rule
public TestSessions env = new TestSessions(); public SessionRule env = new SessionRule();


@Test @Test
public void shouldHandleBeginCommit() throws Throwable public void shouldHandleBeginCommit() throws Throwable
Expand Down

0 comments on commit e450dba

Please sign in to comment.