Enforcing no space(s) after a left parenthesis and before a right
parenthesis is a proposed change [0] which can only be merged when all
violations are fixed in projects enforcing checkstyle. This patch fixes
those violations.
[0] https://git.opendaylight.org/gerrit/#/c/51316/
Change-Id: Iae1f085f903579a264b24176d0b4c17416f6b8a0
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
19 files changed:
@Override
public void delete(final LogicalDatastoreType store, final InstanceIdentifier<?> path) {
@Override
public void delete(final LogicalDatastoreType store, final InstanceIdentifier<?> path) {
- doDelete( store, path);
if (data instanceof LeafSetNode) {
return false;
}
if (data instanceof LeafSetNode) {
return false;
}
- if( data instanceof LeafSetEntryNode<?>) {
+ if (data instanceof LeafSetEntryNode<?>) {
return false;
}
if (data instanceof MapNode) {
return false;
}
if (data instanceof MapNode) {
- private static BindingNormalizedNodeCodecRegistry codec(final Class<?>... classes ) {
+ private static BindingNormalizedNodeCodecRegistry codec(final Class<?>... classes) {
final ModuleInfoBackedContext ctx = ModuleInfoBackedContext.create();
for(final Class<?> clazz : classes) {
YangModuleInfo modInfo;
final ModuleInfoBackedContext ctx = ModuleInfoBackedContext.create();
for(final Class<?> clazz : classes) {
YangModuleInfo modInfo;
assertNotNull(entryContainer.getKey());
final YangInstanceIdentifier.NodeIdentifierWithPredicates nodeIdentifierWithPredicates4798 = new YangInstanceIdentifier
assertNotNull(entryContainer.getKey());
final YangInstanceIdentifier.NodeIdentifierWithPredicates nodeIdentifierWithPredicates4798 = new YangInstanceIdentifier
- .NodeIdentifierWithPredicates( nestedListQname4798, nestedListKeyQname4798, "foo" );
+ .NodeIdentifierWithPredicates(nestedListQname4798, nestedListKeyQname4798, "foo");
final YangInstanceIdentifier yangInstanceIdentifier4798 = YangInstanceIdentifier.of(containerIdentifierQname4798)
.node(choiceIdentifierQname4798)
.node(nestedListQname4798)
final YangInstanceIdentifier yangInstanceIdentifier4798 = YangInstanceIdentifier.of(containerIdentifierQname4798)
.node(choiceIdentifierQname4798)
.node(nestedListQname4798)
* is obtained from a system property (<i>org.opendaylight.yangtools.sal.generatedCodecSourceDir</i>) or
* defaults to "generated-codecs".
*/
* is obtained from a system property (<i>org.opendaylight.yangtools.sal.generatedCodecSourceDir</i>) or
* defaults to "generated-codecs".
*/
- public DefaultSourceCodeGenerator( String generatedSourceDir ) {
- if( generatedSourceDir != null ) {
+ public DefaultSourceCodeGenerator(String generatedSourceDir) {
+ if(generatedSourceDir != null) {
this.generatedSourceDir = generatedSourceDir;
}
else {
this.generatedSourceDir = generatedSourceDir;
}
else {
- this.generatedSourceDir = System.getProperty( GENERATED_SOURCE_DIR_PROP, "generated-codecs" );
+ this.generatedSourceDir = System.getProperty(GENERATED_SOURCE_DIR_PROP, "generated-codecs");
public class NullSourceCodeGenerator implements SourceCodeGenerator {
@Override
public class NullSourceCodeGenerator implements SourceCodeGenerator {
@Override
- public void appendField( CtField field, String value ) {
+ public void appendField(CtField field, String value) {
- public void appendMethod( CtMethod method, String code ) {
+ public void appendMethod(CtMethod method, String code) {
- public void outputGeneratedSource( CtClass ctClass ) {
+ public void outputGeneratedSource(CtClass ctClass) {
/**
* Appends the given class field and value to the temporary output.
*/
/**
* Appends the given class field and value to the temporary output.
*/
- void appendField( CtField field, String value );
+ void appendField(CtField field, String value);
/**
* Appends the given method and source code body to the temporary output.
*/
/**
* Appends the given method and source code body to the temporary output.
*/
- void appendMethod( CtMethod method, String code );
+ void appendMethod(CtMethod method, String code);
/**
* Generates the full source code for the given class and outputs it.
*/
/**
* Generates the full source code for the given class and outputs it.
*/
- void outputGeneratedSource( CtClass ctClass );
+ void outputGeneratedSource(CtClass ctClass);
}
\ No newline at end of file
}
\ No newline at end of file
* @param generatedSourceDir the directory in which to put generated source files. If null,
* a default is used (see DefaultSourceCodeGenerator).
*/
* @param generatedSourceDir the directory in which to put generated source files. If null,
* a default is used (see DefaultSourceCodeGenerator).
*/
- public SourceCodeGenerator getInstance( String generatedSourceDir ) {
+ public SourceCodeGenerator getInstance(String generatedSourceDir) {
- boolean generateSource = Boolean.valueOf( System.getProperty( GENERATE_CODEC_SOURCE_PROP, "false") );
- if( generateSource ) {
- return new DefaultSourceCodeGenerator( generatedSourceDir );
+ boolean generateSource = Boolean.valueOf(System.getProperty( GENERATE_CODEC_SOURCE_PROP, "false"));
+ if(generateSource) {
+ return new DefaultSourceCodeGenerator(generatedSourceDir);
currentNode = ((ChoiceSchemaNode) child).getCaseNodeByName(caseQName);
} else {
// Search in grouping
currentNode = ((ChoiceSchemaNode) child).getCaseNodeByName(caseQName);
} else {
// Search in grouping
- for( final GroupingDefinition grouping : currentNode.getGroupings()) {
- if(currentArg.equals(grouping.getQName())) {
+ for (final GroupingDefinition grouping : currentNode.getGroupings()) {
+ if (currentArg.equals(grouping.getQName())) {
currentNode = grouping;
break;
}
currentNode = grouping;
break;
}
assertEquals("\"default value\"", typeProvider.getTypeDefaultConstruction(leafSchemaNode, "default value"));
fail("Expected NoSuchElementException");
} catch (Exception e) {
assertEquals("\"default value\"", typeProvider.getTypeDefaultConstruction(leafSchemaNode, "default value"));
fail("Expected NoSuchElementException");
} catch (Exception e) {
- assertTrue( e instanceof NoSuchElementException);
+ assertTrue(e instanceof NoSuchElementException);
* <h3>Example usage:</h3>
*
* <pre>
* <h3>Example usage:</h3>
*
* <pre>
- * private void doWrite( final int tries ) {
+ * private void doWrite(final int tries) {
* WriteTransaction writeTx = dataBroker.newWriteOnlyTransaction();
* MyDataObject data = ...;
* InstanceIdentifier<MyDataObject> path = ...;
* WriteTransaction writeTx = dataBroker.newWriteOnlyTransaction();
* MyDataObject data = ...;
* InstanceIdentifier<MyDataObject> path = ...;
- * writeTx.put( LogicalDatastoreType.OPERATIONAL, path, data );
- * Futures.addCallback( writeTx.submit(), new FutureCallback<Void>() {
- * public void onSuccess( Void result ) {
+ * writeTx.put(LogicalDatastoreType.OPERATIONAL, path, data);
+ * Futures.addCallback(writeTx.submit(), new FutureCallback<Void>() {
+ * public void onSuccess(Void result) {
- * public void onFailure( Throwable t ) {
- * if( t instanceof OptimisticLockFailedException ) {
- * if( ( tries - 1 ) > 0 ) {
+ * public void onFailure(Throwable t) {
+ * if(t instanceof OptimisticLockFailedException) {
+ * if(( tries - 1) > 0 ) {
- * doWrite( tries - 1 );
* } else {
* // out of retries
* }
* } else {
* // failed due to another type of TransactionCommitFailedException.
* }
* } else {
* // out of retries
* }
* } else {
* // failed due to another type of TransactionCommitFailedException.
* }
* </pre>
*
* <h2>Failure scenarios</h2>
* </pre>
*
* <h2>Failure scenarios</h2>
public static final TransactionCommitFailedExceptionMapper COMMIT_ERROR_MAPPER = create("commit");
private TransactionCommitFailedExceptionMapper(final String opName) {
public static final TransactionCommitFailedExceptionMapper COMMIT_ERROR_MAPPER = create("commit");
private TransactionCommitFailedExceptionMapper(final String opName) {
- super( opName, TransactionCommitFailedException.class );
+ super(opName, TransactionCommitFailedException.class);
}
public static TransactionCommitFailedExceptionMapper create(final String opName) {
}
public static TransactionCommitFailedExceptionMapper create(final String opName) {
- protected TransactionCommitFailedException newWithCause( final String message, final Throwable cause ) {
- return new TransactionCommitFailedException( message, cause );
+ protected TransactionCommitFailedException newWithCause(final String message, final Throwable cause) {
+ return new TransactionCommitFailedException(message, cause);
}
}
\ No newline at end of file
}
}
\ No newline at end of file
}
final int numUrls = Iterables.size(urls);
}
final int numUrls = Iterables.size(urls);
if (LOG.isDebugEnabled()) {
LOG.debug("removedBundle: {}, state: {}, # urls: {}", bundle.getSymbolicName(),
bundle.getState(), numUrls);
if (LOG.isDebugEnabled()) {
LOG.debug("removedBundle: {}, state: {}, # urls: {}", bundle.getSymbolicName(),
bundle.getState(), numUrls);
@After
public void tearDown() {
@After
public void tearDown() {
- if (executor != null ) {
+ if (executor != null) {
executor.shutdownNow();
}
executor.shutdownNow();
}
@Test(expected = TransactionCommitFailedException.class)
public void testRejectedCommit() throws Exception {
@Test(expected = TransactionCommitFailedException.class)
public void testRejectedCommit() throws Exception {
- commitExecutor.delegate = Mockito.mock( ExecutorService.class );
- Mockito.doThrow( new RejectedExecutionException( "mock" ) )
- .when( commitExecutor.delegate ).execute( Mockito.any( Runnable.class ) );
- Mockito.doNothing().when( commitExecutor.delegate ).shutdown();
- Mockito.doReturn( Collections.emptyList() ).when( commitExecutor.delegate ).shutdownNow();
- Mockito.doReturn( "" ).when( commitExecutor.delegate ).toString();
- Mockito.doReturn( true ).when( commitExecutor.delegate )
- .awaitTermination( Mockito.anyLong(), Mockito.any( TimeUnit.class ) );
+ commitExecutor.delegate = Mockito.mock(ExecutorService.class);
+ Mockito.doThrow(new RejectedExecutionException("mock"))
+ .when(commitExecutor.delegate).execute(Mockito.any(Runnable.class));
+ Mockito.doNothing().when(commitExecutor.delegate).shutdown();
+ Mockito.doReturn(Collections.emptyList()).when(commitExecutor.delegate).shutdownNow();
+ Mockito.doReturn("").when(commitExecutor.delegate).toString();
+ Mockito.doReturn(true).when(commitExecutor.delegate)
+ .awaitTermination(Mockito.anyLong(), Mockito.any(TimeUnit.class));
final DOMDataTreeWriteTransaction writeTx = domBroker.newWriteOnlyTransaction();
final DOMDataTreeWriteTransaction writeTx = domBroker.newWriteOnlyTransaction();
- writeTx.put( OPERATIONAL, TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME) );
+ writeTx.put(OPERATIONAL, TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
- writeTx.submit().checkedGet( 5, TimeUnit.SECONDS );
+ writeTx.submit().checkedGet(5, TimeUnit.SECONDS);
}
@SuppressWarnings("checkstyle:IllegalCatch")
}
@SuppressWarnings("checkstyle:IllegalCatch")
- AtomicReference<Throwable> submitTxAsync( final DOMDataTreeWriteTransaction writeTx ) {
+ AtomicReference<Throwable> submitTxAsync(final DOMDataTreeWriteTransaction writeTx) {
final AtomicReference<Throwable> caughtEx = new AtomicReference<>();
new Thread() {
@Override
final AtomicReference<Throwable> caughtEx = new AtomicReference<>();
new Thread() {
@Override
- } catch ( final Throwable e ) {
- caughtEx.set( e );
+ } catch (final Throwable e) {
+ caughtEx.set(e);
ExecutorService delegate;
ExecutorService delegate;
- CommitExecutorService( final ExecutorService delegate ) {
+ CommitExecutorService(final ExecutorService delegate) {
this.delegate = delegate;
}
this.delegate = delegate;
}
int dclExecutorMaxPoolSize = actualProperties.getMaxDataChangeExecutorPoolSize();
ExecutorService dataChangeListenerExecutor = SpecialExecutors.newBlockingBoundedFastThreadPool(
int dclExecutorMaxPoolSize = actualProperties.getMaxDataChangeExecutorPoolSize();
ExecutorService dataChangeListenerExecutor = SpecialExecutors.newBlockingBoundedFastThreadPool(
- dclExecutorMaxPoolSize, dclExecutorMaxQueueSize, name + "-DCL" );
+ dclExecutorMaxPoolSize, dclExecutorMaxQueueSize, name + "-DCL");
final InMemoryDOMDataStore dataStore = new InMemoryDOMDataStore(name, dataChangeListenerExecutor,
actualProperties.getMaxDataChangeListenerQueueSize(), debugTransactions);
final InMemoryDOMDataStore dataStore = new InMemoryDOMDataStore(name, dataChangeListenerExecutor,
actualProperties.getMaxDataChangeListenerQueueSize(), debugTransactions);
public void testDelete() throws Exception {
DOMStoreWriteTransaction writeTx = domStore.newWriteOnlyTransaction();
public void testDelete() throws Exception {
DOMStoreWriteTransaction writeTx = domStore.newWriteOnlyTransaction();
- assertNotNull( writeTx );
+ assertNotNull(writeTx);
// Write /test and commit
// Write /test and commit
- writeTx.write( TestModel.TEST_PATH, ImmutableNodes.containerNode( TestModel.TEST_QNAME ) );
+ writeTx.write(TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
- assertThreePhaseCommit( writeTx.ready() );
+ assertThreePhaseCommit(writeTx.ready());
Optional<NormalizedNode<?, ?>> afterCommitRead =
Optional<NormalizedNode<?, ?>> afterCommitRead =
- domStore.newReadOnlyTransaction().read(TestModel.TEST_PATH ).get();
- assertEquals( "After commit read: isPresent", true, afterCommitRead.isPresent() );
+ domStore.newReadOnlyTransaction().read(TestModel.TEST_PATH).get();
+ assertEquals("After commit read: isPresent", true, afterCommitRead.isPresent());
// Delete /test and verify
writeTx = domStore.newWriteOnlyTransaction();
// Delete /test and verify
writeTx = domStore.newWriteOnlyTransaction();
- writeTx.delete( TestModel.TEST_PATH );
+ writeTx.delete(TestModel.TEST_PATH);
- assertThreePhaseCommit( writeTx.ready() );
+ assertThreePhaseCommit(writeTx.ready());
- afterCommitRead = domStore.newReadOnlyTransaction().read(TestModel.TEST_PATH ).get();
- assertEquals( "After commit read: isPresent", false, afterCommitRead.isPresent() );
+ afterCommitRead = domStore.newReadOnlyTransaction().read(TestModel.TEST_PATH).get();
+ assertEquals("After commit read: isPresent", false, afterCommitRead.isPresent());
}
@Test
public void testMerge() throws Exception {
DOMStoreWriteTransaction writeTx = domStore.newWriteOnlyTransaction();
}
@Test
public void testMerge() throws Exception {
DOMStoreWriteTransaction writeTx = domStore.newWriteOnlyTransaction();
- assertNotNull( writeTx );
+ assertNotNull(writeTx);
ContainerNode containerNode = ImmutableContainerNodeBuilder.create()
ContainerNode containerNode = ImmutableContainerNodeBuilder.create()
- .withNodeIdentifier( new NodeIdentifier( TestModel.TEST_QNAME ) )
- .addChild( ImmutableNodes.mapNodeBuilder( TestModel.OUTER_LIST_QNAME )
- .addChild( ImmutableNodes.mapEntry( TestModel.OUTER_LIST_QNAME,
- TestModel.ID_QNAME, 1 ) ).build() ).build();
+ .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
+ .addChild(ImmutableNodes.mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
+ .addChild(ImmutableNodes.mapEntry(TestModel.OUTER_LIST_QNAME,
+ TestModel.ID_QNAME, 1)).build()).build();
- writeTx.merge( TestModel.TEST_PATH, containerNode );
+ writeTx.merge(TestModel.TEST_PATH, containerNode);
- assertThreePhaseCommit( writeTx.ready() );
+ assertThreePhaseCommit(writeTx.ready());
Optional<NormalizedNode<?, ?>> afterCommitRead =
Optional<NormalizedNode<?, ?>> afterCommitRead =
- domStore.newReadOnlyTransaction().read(TestModel.TEST_PATH ).get();
- assertEquals( "After commit read: isPresent", true, afterCommitRead.isPresent() );
- assertEquals( "After commit read: data", containerNode, afterCommitRead.get() );
+ domStore.newReadOnlyTransaction().read(TestModel.TEST_PATH).get();
+ assertEquals("After commit read: isPresent", true, afterCommitRead.isPresent());
+ assertEquals("After commit read: data", containerNode, afterCommitRead.get());
// Merge a new list entry node
writeTx = domStore.newWriteOnlyTransaction();
// Merge a new list entry node
writeTx = domStore.newWriteOnlyTransaction();
- assertNotNull( writeTx );
+ assertNotNull(writeTx);
containerNode = ImmutableContainerNodeBuilder.create()
containerNode = ImmutableContainerNodeBuilder.create()
- .withNodeIdentifier( new NodeIdentifier( TestModel.TEST_QNAME ) )
- .addChild( ImmutableNodes.mapNodeBuilder( TestModel.OUTER_LIST_QNAME )
- .addChild( ImmutableNodes.mapEntry( TestModel.OUTER_LIST_QNAME,
- TestModel.ID_QNAME, 1 ) )
- .addChild( ImmutableNodes.mapEntry( TestModel.OUTER_LIST_QNAME,
- TestModel.ID_QNAME, 2 ) ).build() ).build();
+ .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
+ .addChild(ImmutableNodes.mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
+ .addChild(ImmutableNodes.mapEntry(TestModel.OUTER_LIST_QNAME,
+ TestModel.ID_QNAME, 1))
+ .addChild(ImmutableNodes.mapEntry(TestModel.OUTER_LIST_QNAME,
+ TestModel.ID_QNAME, 2)).build()).build();
- writeTx.merge( TestModel.TEST_PATH, containerNode );
+ writeTx.merge(TestModel.TEST_PATH, containerNode);
- assertThreePhaseCommit( writeTx.ready() );
+ assertThreePhaseCommit(writeTx.ready());
- afterCommitRead = domStore.newReadOnlyTransaction().read(TestModel.TEST_PATH ).get();
- assertEquals( "After commit read: isPresent", true, afterCommitRead.isPresent() );
- assertEquals( "After commit read: data", containerNode, afterCommitRead.get() );
+ afterCommitRead = domStore.newReadOnlyTransaction().read(TestModel.TEST_PATH).get();
+ assertEquals("After commit read: isPresent", true, afterCommitRead.isPresent());
+ assertEquals("After commit read: data", containerNode, afterCommitRead.get());
public void testExistsForExistingData() throws Exception {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
public void testExistsForExistingData() throws Exception {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
- assertNotNull( writeTx );
+ assertNotNull(writeTx);
ContainerNode containerNode = ImmutableContainerNodeBuilder.create()
ContainerNode containerNode = ImmutableContainerNodeBuilder.create()
- .withNodeIdentifier( new NodeIdentifier( TestModel.TEST_QNAME ) )
- .addChild( ImmutableNodes.mapNodeBuilder( TestModel.OUTER_LIST_QNAME )
- .addChild( ImmutableNodes.mapEntry( TestModel.OUTER_LIST_QNAME,
- TestModel.ID_QNAME, 1 ) ).build() ).build();
+ .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
+ .addChild(ImmutableNodes.mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
+ .addChild(ImmutableNodes.mapEntry(TestModel.OUTER_LIST_QNAME,
+ TestModel.ID_QNAME, 1)).build()).build();
- writeTx.merge( TestModel.TEST_PATH, containerNode );
+ writeTx.merge(TestModel.TEST_PATH, containerNode);
CheckedFuture<Boolean, ReadFailedException> exists =
writeTx.exists(TestModel.TEST_PATH);
CheckedFuture<Boolean, ReadFailedException> exists =
writeTx.exists(TestModel.TEST_PATH);
ready.commit().get();
DOMStoreReadTransaction readTx = domStore.newReadOnlyTransaction();
ready.commit().get();
DOMStoreReadTransaction readTx = domStore.newReadOnlyTransaction();
- assertNotNull( readTx );
exists =
readTx.exists(TestModel.TEST_PATH);
exists =
readTx.exists(TestModel.TEST_PATH);
public void testExistsForNonExistingData() throws Exception {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
public void testExistsForNonExistingData() throws Exception {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
- assertNotNull( writeTx );
+ assertNotNull(writeTx);
CheckedFuture<Boolean, ReadFailedException> exists =
writeTx.exists(TestModel.TEST_PATH);
CheckedFuture<Boolean, ReadFailedException> exists =
writeTx.exists(TestModel.TEST_PATH);
assertEquals(false, exists.checkedGet());
DOMStoreReadTransaction readTx = domStore.newReadOnlyTransaction();
assertEquals(false, exists.checkedGet());
DOMStoreReadTransaction readTx = domStore.newReadOnlyTransaction();
- assertNotNull( readTx );
exists =
readTx.exists(TestModel.TEST_PATH);
exists =
readTx.exists(TestModel.TEST_PATH);
public void testExistsThrowsReadFailedException() throws Exception {
DOMStoreReadTransaction readTx = domStore.newReadOnlyTransaction();
public void testExistsThrowsReadFailedException() throws Exception {
DOMStoreReadTransaction readTx = domStore.newReadOnlyTransaction();
- assertNotNull( readTx );
public void testReadWithReadOnlyTransactionClosed() throws Throwable {
DOMStoreReadTransaction readTx = domStore.newReadOnlyTransaction();
public void testReadWithReadOnlyTransactionClosed() throws Throwable {
DOMStoreReadTransaction readTx = domStore.newReadOnlyTransaction();
- assertNotNull( readTx );
- doReadAndThrowEx( readTx );
+ doReadAndThrowEx(readTx);
}
@SuppressWarnings("checkstyle:IllegalThrows")
@Test(expected = ReadFailedException.class)
public void testReadWithReadOnlyTransactionFailure() throws Throwable {
}
@SuppressWarnings("checkstyle:IllegalThrows")
@Test(expected = ReadFailedException.class)
public void testReadWithReadOnlyTransactionFailure() throws Throwable {
- DataTreeSnapshot mockSnapshot = Mockito.mock( DataTreeSnapshot.class );
- Mockito.doThrow( new RuntimeException( "mock ex" ) ).when( mockSnapshot )
- .readNode( Mockito.any( YangInstanceIdentifier.class ) );
+ DataTreeSnapshot mockSnapshot = Mockito.mock(DataTreeSnapshot.class);
+ Mockito.doThrow(new RuntimeException("mock ex")).when(mockSnapshot)
+ .readNode(Mockito.any(YangInstanceIdentifier.class));
DOMStoreReadTransaction readTx = SnapshotBackedTransactions.newReadTransaction("1", true, mockSnapshot);
DOMStoreReadTransaction readTx = SnapshotBackedTransactions.newReadTransaction("1", true, mockSnapshot);
- doReadAndThrowEx( readTx );
+ doReadAndThrowEx(readTx);
}
@SuppressWarnings("checkstyle:IllegalThrows")
}
@SuppressWarnings("checkstyle:IllegalThrows")
public void testReadWithReadWriteTransactionClosed() throws Throwable {
DOMStoreReadTransaction readTx = domStore.newReadWriteTransaction();
public void testReadWithReadWriteTransactionClosed() throws Throwable {
DOMStoreReadTransaction readTx = domStore.newReadWriteTransaction();
- assertNotNull( readTx );
- doReadAndThrowEx( readTx );
+ doReadAndThrowEx(readTx);
}
@SuppressWarnings("checkstyle:IllegalThrows")
@Test(expected = ReadFailedException.class)
public void testReadWithReadWriteTransactionFailure() throws Throwable {
}
@SuppressWarnings("checkstyle:IllegalThrows")
@Test(expected = ReadFailedException.class)
public void testReadWithReadWriteTransactionFailure() throws Throwable {
- DataTreeSnapshot mockSnapshot = Mockito.mock( DataTreeSnapshot.class );
- DataTreeModification mockModification = Mockito.mock( DataTreeModification.class );
- Mockito.doThrow( new RuntimeException( "mock ex" ) ).when( mockModification )
- .readNode( Mockito.any( YangInstanceIdentifier.class ) );
- Mockito.doReturn( mockModification ).when( mockSnapshot ).newModification();
+ DataTreeSnapshot mockSnapshot = Mockito.mock(DataTreeSnapshot.class);
+ DataTreeModification mockModification = Mockito.mock(DataTreeModification.class);
+ Mockito.doThrow(new RuntimeException("mock ex")).when(mockModification)
+ .readNode(Mockito.any(YangInstanceIdentifier.class));
+ Mockito.doReturn(mockModification).when(mockSnapshot).newModification();
@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked")
- TransactionReadyPrototype<String> mockReady = Mockito.mock( TransactionReadyPrototype.class );
+ TransactionReadyPrototype<String> mockReady = Mockito.mock(TransactionReadyPrototype.class);
DOMStoreReadTransaction readTx = SnapshotBackedTransactions.newReadWriteTransaction(
"1", false, mockSnapshot, mockReady);
DOMStoreReadTransaction readTx = SnapshotBackedTransactions.newReadWriteTransaction(
"1", false, mockSnapshot, mockReady);
- doReadAndThrowEx( readTx );
+ doReadAndThrowEx(readTx);
}
@SuppressWarnings("checkstyle:IllegalThrows")
}
@SuppressWarnings("checkstyle:IllegalThrows")
- private static void doReadAndThrowEx( final DOMStoreReadTransaction readTx ) throws Throwable {
+ private static void doReadAndThrowEx(final DOMStoreReadTransaction readTx) throws Throwable {
try {
readTx.read(TestModel.TEST_PATH).get();
try {
readTx.read(TestModel.TEST_PATH).get();
- } catch ( ExecutionException e ) {
+ } catch (ExecutionException e) {
writeTx.ready();
// Should throw ex
writeTx.ready();
// Should throw ex
- writeTx.write( TestModel.TEST_PATH, ImmutableNodes.containerNode( TestModel.TEST_QNAME ) );
+ writeTx.write(TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
}
@Test(expected = IllegalStateException.class)
}
@Test(expected = IllegalStateException.class)
private final ExecutorService postSetupExecutor;
private final ExecutorService postSetupExecutor;
- public TestDCLExecutorService( final ExecutorService postSetupExecutor ) {
+ public TestDCLExecutorService(final ExecutorService postSetupExecutor) {
this.postSetupExecutor = postSetupExecutor;
}
this.postSetupExecutor = postSetupExecutor;
}
shardDataModification = TestUtils.createModification(SHARD_ROOT_MODIFICATION_CONTEXT,
ImmutableMap.of(YANG_INSTANCE_IDENTIFIER, FOREIGN_SHARD_MODIFICATION_CONTEXT));
final DataTreeModificationCursor dataTreeModificationCursor = mock(DataTreeModificationCursor.class);
shardDataModification = TestUtils.createModification(SHARD_ROOT_MODIFICATION_CONTEXT,
ImmutableMap.of(YANG_INSTANCE_IDENTIFIER, FOREIGN_SHARD_MODIFICATION_CONTEXT));
final DataTreeModificationCursor dataTreeModificationCursor = mock(DataTreeModificationCursor.class);
- doReturn(DataTreeModificationCursorAdaptor.of( dataTreeModificationCursor))
+ doReturn(DataTreeModificationCursorAdaptor.of(dataTreeModificationCursor))
.when(SHARD_ROOT_MODIFICATION_CONTEXT).cursor();
doNothing().when(SHARD_ROOT_MODIFICATION_CONTEXT).closeCursor();
final DataTreeCandidate dataTreeCandidate = mock(DataTreeCandidate.class);
.when(SHARD_ROOT_MODIFICATION_CONTEXT).cursor();
doNothing().when(SHARD_ROOT_MODIFICATION_CONTEXT).closeCursor();
final DataTreeCandidate dataTreeCandidate = mock(DataTreeCandidate.class);
final DOMEntityOwnershipChange domOwnershipChange = new DOMEntityOwnershipChange(DOM_ENTITY,
EntityOwnershipChangeState.LOCAL_OWNERSHIP_GRANTED, true);
final DOMEntityOwnershipChange domOwnershipChange = new DOMEntityOwnershipChange(DOM_ENTITY,
EntityOwnershipChangeState.LOCAL_OWNERSHIP_GRANTED, true);
- domListenerCaptor.getValue().ownershipChanged(domOwnershipChange );
+ domListenerCaptor.getValue().ownershipChanged(domOwnershipChange);
final ArgumentCaptor<EntityOwnershipChange> ownershipChangeCaptor = ArgumentCaptor.forClass(
EntityOwnershipChange.class);
final ArgumentCaptor<EntityOwnershipChange> ownershipChangeCaptor = ArgumentCaptor.forClass(
EntityOwnershipChange.class);
mockCodecRegistry));
final DOMEntityOwnershipChange domOwnershipChange = mock(DOMEntityOwnershipChange.class);
doThrow(IllegalStateException.class).when(domOwnershipChange).getEntity();
mockCodecRegistry));
final DOMEntityOwnershipChange domOwnershipChange = mock(DOMEntityOwnershipChange.class);
doThrow(IllegalStateException.class).when(domOwnershipChange).getEntity();
- domEntityOwnershipListenerAdapter.ownershipChanged(domOwnershipChange );
+ domEntityOwnershipListenerAdapter.ownershipChanged(domOwnershipChange);