commands.add( new Command.NeoStoreCommand( change.getBefore(), change.forReadingData() ) );
@Test public void testVisitNeoStoreCommand() throws Exception { // Make sure it just calls through to visit Command.NeoStoreCommand cmd = mock( Command.NeoStoreCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitNeoStoreCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitNeoStoreCommand( cmd ); inOrder.verify( txApplier2 ).visitNeoStoreCommand( cmd ); inOrder.verify( txApplier3 ).visitNeoStoreCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); }
commands.add( new Command.NeoStoreCommand( change.getBefore(), change.forReadingData() ) );
private Command visitNeoStoreCommand( ReadableChannel channel ) throws IOException { NeoStoreRecord before = readNeoStoreRecord( channel ); NeoStoreRecord after = readNeoStoreRecord( channel ); return new Command.NeoStoreCommand( before, after ); }
private Command visitNeoStoreCommand( ReadableChannel channel ) throws IOException { long nextProp = channel.getLong(); NeoStoreRecord record = new NeoStoreRecord(); record.setNextProp( nextProp ); return new Command.NeoStoreCommand( null, record ); }
private Command visitNeoStoreCommand( ReadableChannel channel ) throws IOException { long nextProp = channel.getLong(); NeoStoreRecord record = new NeoStoreRecord(); record.setNextProp( nextProp ); return new Command.NeoStoreCommand( null, record ); }
@Override public void serialize( WritableChannel channel ) throws IOException { channel.put( NeoCommandType.NEOSTORE_COMMAND ); writeNeoStoreRecord( channel, before ); writeNeoStoreRecord( channel, after ); }
public void update( NeoStoreRecord record ) { Command.NeoStoreCommand command = new Command.NeoStoreCommand(); command.init( record ); addCommand( command ); }
private Command visitNeoStoreCommand( ReadableChannel channel ) throws IOException { NeoStoreRecord before = readNeoStoreRecord( channel ); NeoStoreRecord after = readNeoStoreRecord( channel ); return new Command.NeoStoreCommand( before, after ); }
public void add( NeoStoreRecord record ) { Command.NeoStoreCommand command = new Command.NeoStoreCommand(); command.init( record ); addCommand( command ); }
@Test public void shouldApplyNeoStoreCommandToTheStore() throws Exception { // given final BatchTransactionApplier applier = newApplier( false ); final NeoStoreRecord before = new NeoStoreRecord(); final NeoStoreRecord after = new NeoStoreRecord(); after.setNextProp( 42 ); final Command command = new Command.NeoStoreCommand( before, after ); // when boolean result = apply( applier, command::handle, transactionToApply ); // then assertFalse( result ); verify( metaDataStore, times( 1 ) ).setGraphNextProp( after.getNextProp() ); }
@Test public void shouldReadNeoStoreCommand() throws Throwable { // Given InMemoryClosableChannel channel = new InMemoryClosableChannel(); NeoStoreRecord before = new NeoStoreRecord(); NeoStoreRecord after = new NeoStoreRecord(); after.setNextProp( 42 ); new Command.NeoStoreCommand( before, after ).serialize( channel ); // When PhysicalLogCommandReaderV3_0 reader = new PhysicalLogCommandReaderV3_0(); Command command = reader.read( channel ); assertTrue( command instanceof Command.NeoStoreCommand); Command.NeoStoreCommand neoStoreCommand = (Command.NeoStoreCommand) command; // Then assertEquals( before.getNextProp(), neoStoreCommand.getBefore().getNextProp() ); assertEquals( after.getNextProp(), neoStoreCommand.getAfter().getNextProp() ); }
public void add( NeoStoreRecord before, NeoStoreRecord after ) { otherCommands.add( new Command.NeoStoreCommand( before, after ) ); }
public void update( NeoStoreRecord before, NeoStoreRecord after ) { otherCommands.add( new Command.NeoStoreCommand( before, after ) ); }
@Test public void shouldApplyNeoStoreCommandToTheStoreInRecovery() throws Exception { // given final BatchTransactionApplier applier = newApplier( true ); final NeoStoreRecord before = new NeoStoreRecord(); final NeoStoreRecord after = new NeoStoreRecord(); after.setNextProp( 42 ); final Command command = new Command.NeoStoreCommand( before, after ); // when boolean result = apply( applier, command::handle, transactionToApply ); // then assertFalse( result ); verify( metaDataStore, times( 1 ) ).setGraphNextProp( after.getNextProp() ); }
private Command visitNeoStoreCommand( ReadableChannel channel ) throws IOException { long nextProp = channel.getLong(); NeoStoreRecord record = new NeoStoreRecord(); record.setNextProp( nextProp ); return new Command.NeoStoreCommand( null, record ); }
private Command visitNeoStoreCommand( ReadableChannel channel ) throws IOException { NeoStoreRecord before = readNeoStoreRecord( channel ); NeoStoreRecord after = readNeoStoreRecord( channel ); return new Command.NeoStoreCommand( before, after ); }
@Override public void serialize( WritableChannel channel ) throws IOException { channel.put( NeoCommandType.NEOSTORE_COMMAND ); writeNeoStoreRecord( channel, before ); writeNeoStoreRecord( channel, after ); }
private Command visitNeoStoreCommand( ReadableChannel channel ) throws IOException { long nextProp = channel.getLong(); NeoStoreRecord record = new NeoStoreRecord(); record.setNextProp( nextProp ); return new Command.NeoStoreCommand( null, record ); }
private Command visitNeoStoreCommand( ReadableChannel channel ) throws IOException { NeoStoreRecord before = readNeoStoreRecord( channel ); NeoStoreRecord after = readNeoStoreRecord( channel ); return new Command.NeoStoreCommand( before, after ); }