checkStyleViolationSeverity=error implemented for mdsal-singleton-common-api and... 76/45276/5
authorjanab <brinda.jana@nexusis.com>
Tue, 6 Sep 2016 22:05:55 +0000 (15:05 -0700)
committerTom Pantelis <tpanteli@brocade.com>
Fri, 23 Sep 2016 19:02:36 +0000 (19:02 +0000)
Done implementing code review comments.

Change-Id: I09443eeb61b09844d1e6960e7ff480dcaaface9f
Signed-off-by: Brinda Jana <brinda.jana@nexusis.com>
singleton-service/mdsal-singleton-common-api/pom.xml
singleton-service/mdsal-singleton-common-api/src/main/java/org/opendaylight/mdsal/singleton/common/api/ServiceGroupIdentifier.java
singleton-service/mdsal-singleton-dom-impl/pom.xml
singleton-service/mdsal-singleton-dom-impl/src/main/java/org/opendaylight/mdsal/singleton/dom/impl/AbstractClusterSingletonServiceProviderImpl.java
singleton-service/mdsal-singleton-dom-impl/src/main/java/org/opendaylight/mdsal/singleton/dom/impl/ClusterSingletonServiceGroupImpl.java
singleton-service/mdsal-singleton-dom-impl/src/main/java/org/opendaylight/mdsal/singleton/dom/impl/ClusterSingletonServiceRegistrationDelegator.java
singleton-service/mdsal-singleton-dom-impl/src/main/java/org/opendaylight/mdsal/singleton/dom/impl/DOMClusterSingletonServiceProviderImpl.java
singleton-service/mdsal-singleton-dom-impl/src/test/java/org/opendaylight/mdsal/singleton/dom/impl/ClusterSingletonServiceGroupImplTest.java
singleton-service/mdsal-singleton-dom-impl/src/test/java/org/opendaylight/mdsal/singleton/dom/impl/ClusterSingletonServiceRegistrationDelegatorTest.java
singleton-service/mdsal-singleton-dom-impl/src/test/java/org/opendaylight/mdsal/singleton/dom/impl/DOMClusterSingletonServiceProviderImplTest.java
singleton-service/mdsal-singleton-dom-impl/src/test/java/org/opendaylight/mdsal/singleton/dom/impl/util/TestInstanceIdentifier.java

index d7824e7cf6921a9cfa294157b1cc160b31eea2f9..4c14b90fe6db46f7941bdf061d3c9aeb0d83e7cf 100644 (file)
       <scope>test</scope>
     </dependency>
   </dependencies>
+  <build>
+      <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+                </configuration>
+            </plugin>
+        </plugins>
+  </build>
 
   <scm>
     <connection>scm:git:http://git.opendaylight.org/gerrit/mdsal.git</connection>
index c858a703930b9130ccb0ded2ec39e81cb07a92a2..d40efc644caba6817232757cd8aec21acaf48583 100644 (file)
@@ -16,10 +16,10 @@ import org.opendaylight.yangtools.util.AbstractStringIdentifier;
 public class ServiceGroupIdentifier extends AbstractStringIdentifier<ServiceGroupIdentifier> {
 
     /**
-     * Method create immutable instance of {@link ServiceGroupIdentifier}
+     * Method to create immutable instances of {@link ServiceGroupIdentifier}.
      *
-     * @param serviceGroupIdentifier
-     * @return {@link ServiceGroupIdentifier} instance
+     * @param serviceGroupIdentifier the String identifier for the ServiceGroupIdentifier instance
+     * @return {@link ServiceGroupIdentifier} new instance
      */
     public static ServiceGroupIdentifier create(final String serviceGroupIdentifier) {
         return new ServiceGroupIdentifier(serviceGroupIdentifier);
index b97cb6ace58f43fe3dbd0278a37eb1ae5709a12a..238507bd6233367c13ea7290007809dee68e9154 100644 (file)
         <artifactId>maven-bundle-plugin</artifactId>
         <extensions>true</extensions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+            <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
   <scm>
index a1a56d8a2f4404002e4b6ea681dfe6202f2b4aca..2955f6c941ec4f52c91cc0f20157ded7f2bec445 100644 (file)
@@ -26,8 +26,8 @@ import org.opendaylight.mdsal.eos.common.api.GenericEntityOwnershipListener;
 import org.opendaylight.mdsal.eos.common.api.GenericEntityOwnershipListenerRegistration;
 import org.opendaylight.mdsal.eos.common.api.GenericEntityOwnershipService;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
+import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
 import org.opendaylight.yangtools.concepts.Path;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -46,10 +46,10 @@ import org.slf4j.LoggerFactory;
  * @param <R> the GenericEntityOwnershipListenerRegistration type
  */
 public abstract class AbstractClusterSingletonServiceProviderImpl<P extends Path<P>, E extends GenericEntity<P>,
-                                                                  C extends GenericEntityOwnershipChange<P, E>,
-                                                                  G extends GenericEntityOwnershipListener<P, C>,
-                                                                  S extends GenericEntityOwnershipService<P, E, G>,
-                                                                  R extends GenericEntityOwnershipListenerRegistration<P, G>>
+        C extends GenericEntityOwnershipChange<P, E>,
+        G extends GenericEntityOwnershipListener<P, C>,
+        S extends GenericEntityOwnershipService<P, E, G>,
+        R extends GenericEntityOwnershipListenerRegistration<P, G>>
         implements ClusterSingletonServiceProvider, GenericEntityOwnershipListener<P, C> {
 
     private static final Logger LOG = LoggerFactory
@@ -59,14 +59,15 @@ public abstract class AbstractClusterSingletonServiceProviderImpl<P extends Path
     private static final String CLOSE_SERVICE_ENTITY_TYPE = "org.opendaylight.mdsal.AsyncServiceCloseEntityType";
 
     private final S entityOwnershipService;
-    private final ConcurrentMap<String, ClusterSingletonServiceGroup<P, E, C>> serviceGroupMap = new ConcurrentHashMap<>();
+    private final ConcurrentMap<String, ClusterSingletonServiceGroup<P, E, C>> serviceGroupMap =
+            new ConcurrentHashMap<>();
 
     /* EOS Entity Listeners Registration */
     private R serviceEntityListenerReg;
     private R asyncCloseEntityListenerReg;
 
     /**
-     * Class constructor
+     * Class constructor.
      *
      * @param entityOwnershipService relevant EOS
      */
@@ -130,8 +131,8 @@ public abstract class AbstractClusterSingletonServiceProviderImpl<P extends Path
             }
 
             @Override
-            public void onFailure(final Throwable t) {
-                cleaningProvider(t);
+            public void onFailure(final Throwable throwable) {
+                cleaningProvider(throwable);
             }
         });
     }
@@ -170,7 +171,7 @@ public abstract class AbstractClusterSingletonServiceProviderImpl<P extends Path
     /**
      * Method is responsible for parsing ServiceGroupIdentifier from E entity.
      *
-     * @param entity
+     * @param entity instance of GenericEntity type
      * @return ServiceGroupIdentifier parsed from entity key value.
      */
     protected abstract String getServiceIdentifierFromEntity(final E entity);
@@ -178,12 +179,13 @@ public abstract class AbstractClusterSingletonServiceProviderImpl<P extends Path
     /**
      * Method is called async. from close method in end of Provider lifecycle.
      *
-     * @param t Throwable (needs for log)
+     * @param throwable Throwable (needs for log)
      */
-    protected final void cleaningProvider(@Nullable final Throwable t) {
+    protected final void cleaningProvider(@Nullable final Throwable throwable) {
         LOG.debug("Final cleaning ClusterSingletonServiceProvider {}", this.getClass().getName());
-        if (t != null) {
-            LOG.warn("Unexpected problem by closing ClusterSingletonServiceProvider {}", this.getClass().getName(), t);
+        if (throwable != null) {
+            LOG.warn("Unexpected problem by closing ClusterSingletonServiceProvider {}",
+                    this.getClass().getName(), throwable);
         }
         if (asyncCloseEntityListenerReg != null) {
             asyncCloseEntityListenerReg.close();
index af18888ef24dddd43799754d35041df6cf276887..e335140bca4e6c64cf194233060713fa0b4a4026 100644 (file)
@@ -37,7 +37,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Implementation of {@link ClusterSingletonServiceGroup}
+ * Implementation of {@link ClusterSingletonServiceGroup}.
  *
  * @param <P> the instance identifier path type
  * @param <E> the GenericEntity type
@@ -73,12 +73,13 @@ final class ClusterSingletonServiceGroupImpl<P extends Path<P>, E extends Generi
     private GenericEntityOwnershipCandidateRegistration<P, E> asyncCloseEntityCandidateReg;
 
     /**
-     * Class constructor
+     * Class constructor.
      *
      * @param clusterSingletonServiceGroupIdentifier not empty string as identifier
-     * @param mainEntity
-     * @param closeEntity
-     * @param entityOwnershipService
+     * @param mainEntity as Entity instance
+     * @param closeEntity as Entity instance
+     * @param entityOwnershipService GenericEntityOwnershipService instance
+     * @param allServiceGroups concurrentMap of String and ClusterSingletonServiceGroup type
      */
     ClusterSingletonServiceGroupImpl(final String clusterSingletonServiceGroupIdentifier, final E mainEntity,
             final E closeEntity, final S entityOwnershipService,
@@ -92,15 +93,17 @@ final class ClusterSingletonServiceGroupImpl<P extends Path<P>, E extends Generi
         this.allServiceGroups = Preconditions.checkNotNull(allServiceGroups);
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
-    public final ListenableFuture<List<Void>> closeClusterSingletonGroup() {
+    public ListenableFuture<List<Void>> closeClusterSingletonGroup() {
         LOG.debug("Close method for service Provider {}", clusterSingletonGroupIdentifier);
         boolean needReleaseLock = false;
         final ListenableFuture<List<Void>> destroyFuture;
         try {
             needReleaseLock = clusterLock.tryAcquire(10, TimeUnit.SECONDS);
         } catch (final Exception e) {
-            LOG.warn("Unexpected Exception for service Provider {} in closing phase.", clusterSingletonGroupIdentifier, e);
+            LOG.warn("Unexpected Exception for service Provider {} in closing phase.",
+                    clusterSingletonGroupIdentifier, e);
         } finally {
             if (serviceEntityCandidateReg != null) {
                 serviceEntityCandidateReg.close();
@@ -119,8 +122,9 @@ final class ClusterSingletonServiceGroupImpl<P extends Path<P>, E extends Generi
         return destroyFuture;
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
-    public final void initializationClusterSingletonGroup() {
+    public void initializationClusterSingletonGroup() {
         LOG.debug("Initialization ClusterSingletonGroup {}", clusterSingletonGroupIdentifier);
         boolean needReleaseLock = false;
         boolean needCloseProviderInstance = false;
@@ -139,8 +143,9 @@ final class ClusterSingletonServiceGroupImpl<P extends Path<P>, E extends Generi
         }
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
-    public final ClusterSingletonServiceRegistration registerService(final ClusterSingletonService service) {
+    public ClusterSingletonServiceRegistration registerService(final ClusterSingletonService service) {
         LOG.debug("RegisterService method call for ClusterSingletonServiceGroup {}", clusterSingletonGroupIdentifier);
         Verify.verify(clusterSingletonGroupIdentifier.equals(service.getIdentifier().getValue()));
         boolean needReleaseLock = false;
@@ -164,8 +169,9 @@ final class ClusterSingletonServiceGroupImpl<P extends Path<P>, E extends Generi
         return reg;
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
-    public final void unregisterService(final ClusterSingletonService service) {
+    public void unregisterService(final ClusterSingletonService service) {
         LOG.debug("UnregisterService method call for ClusterSingletonServiceGroup {}", clusterSingletonGroupIdentifier);
         Verify.verify(clusterSingletonGroupIdentifier.equals(service.getIdentifier().getValue()));
         boolean needReleaseLock = false;
@@ -188,8 +194,9 @@ final class ClusterSingletonServiceGroupImpl<P extends Path<P>, E extends Generi
         }
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
-    public final void ownershipChanged(final C ownershipChange) {
+    public void ownershipChanged(final C ownershipChange) {
         LOG.debug("Ownership change {} for ClusterSingletonServiceGrou {}", ownershipChange,
                 clusterSingletonGroupIdentifier);
         try {
@@ -239,7 +246,7 @@ final class ClusterSingletonServiceGroupImpl<P extends Path<P>, E extends Generi
             } else {
                 LOG.warn("Unexpected EntityOwnershipChangeEvent for entity {}", ownershipChange);
             }
-        } catch (final Exception e) {
+        } catch (Exception e) {
             LOG.error("Unexpected Exception for service Provider {}", clusterSingletonGroupIdentifier, e);
             // TODO : think about close ... is it necessary?
         }
@@ -249,6 +256,7 @@ final class ClusterSingletonServiceGroupImpl<P extends Path<P>, E extends Generi
      * Help method to registered DoubleCandidateEntity. It is first step
      * before the actual instance take Leadership.
      */
+    @SuppressWarnings("checkstyle:IllegalCatch")
     private void tryToTakeOwnership() {
         LOG.debug("TryToTakeLeadership method for service Provider {}", clusterSingletonGroupIdentifier);
         boolean needReleaseLock = false;
@@ -259,7 +267,7 @@ final class ClusterSingletonServiceGroupImpl<P extends Path<P>, E extends Generi
             Verify.verify(serviceEntityCandidateReg != null);
             Verify.verify(asyncCloseEntityCandidateReg == null);
             asyncCloseEntityCandidateReg = entityOwnershipService.registerCandidate(doubleCandidateEntity);
-        } catch (final Exception e) {
+        } catch (Exception e) {
             LOG.error("Unexpected exception state for service Provider {} in TryToTakeLeadership",
                     clusterSingletonGroupIdentifier, e);
             needCloseProviderInstance = true;
@@ -271,6 +279,7 @@ final class ClusterSingletonServiceGroupImpl<P extends Path<P>, E extends Generi
     /*
      * Help method calls setupService method for create single cluster-wide service instance.
      */
+    @SuppressWarnings("checkstyle:IllegalCatch")
     private void takeOwnership() {
         LOG.debug("TakeLeadership method for service Provider {}", clusterSingletonGroupIdentifier);
         boolean needReleaseLock = false;
@@ -298,6 +307,7 @@ final class ClusterSingletonServiceGroupImpl<P extends Path<P>, E extends Generi
      * The last async. step has to close DoubleCandidateRegistration reference what should initialize
      * new election for DoubleCandidateEntity.
      */
+    @SuppressWarnings("checkstyle:IllegalCatch")
     private void lostOwnership() {
         LOG.debug("LostLeadership method for service Provider {}", clusterSingletonGroupIdentifier);
         boolean needReleaseLock = false;
@@ -350,8 +360,8 @@ final class ClusterSingletonServiceGroupImpl<P extends Path<P>, E extends Generi
                 }
 
                 @Override
-                public void onFailure(final Throwable t) {
-                    removeThisGroupFromProvider(t);
+                public void onFailure(final Throwable throwable) {
+                    removeThisGroupFromProvider(throwable);
                 }
             });
         }
@@ -360,9 +370,9 @@ final class ClusterSingletonServiceGroupImpl<P extends Path<P>, E extends Generi
     /*
      * Help method for final ClusterSingletonGroup removing
      */
-    protected final void removeThisGroupFromProvider(@Nullable final Throwable t) {
+    protected void removeThisGroupFromProvider(@Nullable final Throwable throwable) {
         LOG.debug("Removing ClusterSingletonServiceGroup {}", clusterSingletonGroupIdentifier);
-        if (t != null) {
+        if (throwable != null) {
             LOG.warn("Unexpected problem by closingResources ClusterSingletonServiceGroup {}",
                     clusterSingletonGroupIdentifier);
         }
@@ -373,9 +383,9 @@ final class ClusterSingletonServiceGroupImpl<P extends Path<P>, E extends Generi
      * Help method creates FutureCallback for suspend Future
      */
     private FutureCallback<List<Void>> newAsyncCloseCallback(@Nullable final Semaphore semaphore) {
-        final Consumer<Throwable> closeEntityCandidateRegistration = (@Nullable final Throwable t) -> {
-            if (t != null) {
-                LOG.warn("Unexpected error closing service instance {}", clusterSingletonGroupIdentifier, t);
+        final Consumer<Throwable> closeEntityCandidateRegistration = (@Nullable final Throwable throwable) -> {
+            if (throwable != null) {
+                LOG.warn("Unexpected error closing service instance {}", clusterSingletonGroupIdentifier, throwable);
             } else {
                 LOG.debug("Destroy service Instance {} is success", clusterSingletonGroupIdentifier);
             }
@@ -397,8 +407,8 @@ final class ClusterSingletonServiceGroupImpl<P extends Path<P>, E extends Generi
             }
 
             @Override
-            public void onFailure(final Throwable t) {
-                closeEntityCandidateRegistration.accept(t);
+            public void onFailure(final Throwable throwable) {
+                closeEntityCandidateRegistration.accept(throwable);
             }
         };
     }
index b7eabf6c427790d16154a137869ced7074b29894..8728298c1317f8cad54b658f451550613292cc26 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
  * Close registration means remove {@link ClusterSingletonService} instance from internal
  * ClusterSingletonServiceGroup list reference.
  *
+ *<p>
  * Close {@link ClusterSingletonServiceRegistration} is prepared for a possible restart
  * service or application in osgi container. Any another services from group can not be
  * stopped.
index 17a2b7162e8eb56a9a5d18ecece850c5e32f843a..e834a0eead0af7dcdba1b39e735aa254146d07bf 100644 (file)
@@ -18,7 +18,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 
 /**
- * Binding version of {@link AbstractClusterSingletonServiceProviderImpl}
+ * Binding version of {@link AbstractClusterSingletonServiceProviderImpl}.
  */
 public final class DOMClusterSingletonServiceProviderImpl extends
         AbstractClusterSingletonServiceProviderImpl<YangInstanceIdentifier, DOMEntity,
@@ -29,7 +29,7 @@ public final class DOMClusterSingletonServiceProviderImpl extends
         implements DOMEntityOwnershipListener {
 
     /**
-     * Initialization all needed class internal property for {@link DOMClusterSingletonServiceProviderImpl}
+     * Initialization all needed class internal property for {@link DOMClusterSingletonServiceProviderImpl}.
      *
      * @param entityOwnershipService - we need only {@link GenericEntityOwnershipService}
      */
@@ -38,12 +38,12 @@ public final class DOMClusterSingletonServiceProviderImpl extends
     }
 
     @Override
-    protected final DOMEntity createEntity(final String type, final String ident) {
+    protected DOMEntity createEntity(final String type, final String ident) {
         return new DOMEntity(type, ident);
     }
 
     @Override
-    protected final DOMEntityOwnershipListenerRegistration registerListener(final String type,
+    protected DOMEntityOwnershipListenerRegistration registerListener(final String type,
             final DOMEntityOwnershipService eos) {
         return eos.registerListener(type, this);
     }
index bf1421435458268edf8edb406631cd0ae3b0d2cb..51f41d4d1bec5c9cb818ada4c134dc51a10e7217 100644 (file)
@@ -12,6 +12,7 @@ import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
+
 import com.google.common.util.concurrent.Futures;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
@@ -28,13 +29,11 @@ import org.opendaylight.mdsal.eos.common.api.GenericEntityOwnershipService;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
 import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
-import org.opendaylight.mdsal.singleton.dom.impl.ClusterSingletonServiceGroup;
-import org.opendaylight.mdsal.singleton.dom.impl.ClusterSingletonServiceGroupImpl;
 import org.opendaylight.mdsal.singleton.dom.impl.util.TestEntity;
 import org.opendaylight.mdsal.singleton.dom.impl.util.TestInstanceIdentifier;
 
 /**
- * Testing {@link ClusterSingletonServiceGroupImpl}
+ * Testing {@link ClusterSingletonServiceGroupImpl}.
  */
 public class ClusterSingletonServiceGroupImplTest {
 
@@ -52,54 +51,62 @@ public class ClusterSingletonServiceGroupImplTest {
     @Mock
     private GenericEntityOwnershipCandidateRegistration<?, ?> mockCloseEntityCandReg;
     @Mock
-    private GenericEntityOwnershipListener<TestInstanceIdentifier,GenericEntityOwnershipChange<TestInstanceIdentifier, TestEntity>> mockEosListener;
+    private GenericEntityOwnershipListener<TestInstanceIdentifier,
+        GenericEntityOwnershipChange<TestInstanceIdentifier, TestEntity>> mockEosListener;
 
     @Mock
-    private GenericEntityOwnershipService<TestInstanceIdentifier,TestEntity, GenericEntityOwnershipListener<TestInstanceIdentifier,GenericEntityOwnershipChange<TestInstanceIdentifier, TestEntity>>> mockEosService;
-
-    private ClusterSingletonServiceGroupImpl<TestInstanceIdentifier,TestEntity,GenericEntityOwnershipChange<TestInstanceIdentifier,TestEntity>,
-                                         GenericEntityOwnershipListener<TestInstanceIdentifier, GenericEntityOwnershipChange<TestInstanceIdentifier, TestEntity>>,
-                                         GenericEntityOwnershipService<TestInstanceIdentifier, TestEntity, GenericEntityOwnershipListener<TestInstanceIdentifier,
-                                         GenericEntityOwnershipChange<TestInstanceIdentifier, TestEntity>>>> singletonServiceGroup;
+    private GenericEntityOwnershipService<TestInstanceIdentifier,TestEntity,
+        GenericEntityOwnershipListener<TestInstanceIdentifier,
+            GenericEntityOwnershipChange<TestInstanceIdentifier, TestEntity>>> mockEosService;
+
+    private ClusterSingletonServiceGroupImpl<TestInstanceIdentifier,TestEntity,
+        GenericEntityOwnershipChange<TestInstanceIdentifier,TestEntity>,
+            GenericEntityOwnershipListener<TestInstanceIdentifier,
+                GenericEntityOwnershipChange<TestInstanceIdentifier, TestEntity>>,
+                    GenericEntityOwnershipService<TestInstanceIdentifier, TestEntity,
+                        GenericEntityOwnershipListener<TestInstanceIdentifier,
+                            GenericEntityOwnershipChange<TestInstanceIdentifier, TestEntity>>>> singletonServiceGroup;
 
     private final TestEntity mainEntity = new TestEntity(SERVICE_ENTITY_TYPE, SERVICE_IDENTIFIER);
     private final TestEntity closeEntity = new TestEntity(CLOSE_SERVICE_ENTITY_TYPE, SERVICE_IDENTIFIER);
     private final ConcurrentMap<String, ClusterSingletonServiceGroup<?, ?, ?>> map = new ConcurrentHashMap<>();
 
     /**
-     * Initialization functionality for every Tests in this suite
+     * Initialization functionality for every Tests in this suite.
      *
      * @throws Exception - unexpected exception
      */
-   @Before
-   public void setup() throws Exception {
-       MockitoAnnotations.initMocks(this);
+    @Before
+    public void setup() throws Exception {
+        MockitoAnnotations.initMocks(this);
 
-       doReturn(mockEntityCandReg).when(mockEosService).registerCandidate(mainEntity);
-       doReturn(mockCloseEntityCandReg).when(mockEosService).registerCandidate(closeEntity);
-       doNothing().when(mockEntityCandReg).close();
-       doNothing().when(mockCloseEntityCandReg).close();
-       doNothing().when(mockClusterSingletonService).instantiateServiceInstance();
-       doReturn(Futures.immediateFuture(null)).when(mockClusterSingletonService).closeServiceInstance();
+        doReturn(mockEntityCandReg).when(mockEosService).registerCandidate(mainEntity);
+        doReturn(mockCloseEntityCandReg).when(mockEosService).registerCandidate(closeEntity);
+        doNothing().when(mockEntityCandReg).close();
+        doNothing().when(mockCloseEntityCandReg).close();
+        doNothing().when(mockClusterSingletonService).instantiateServiceInstance();
+        doReturn(Futures.immediateFuture(null)).when(mockClusterSingletonService).closeServiceInstance();
 
         doReturn(SERVICE_GROUP_IDENT).when(mockClusterSingletonService).getIdentifier();
         doReturn(SERVICE_GROUP_IDENT).when(mockClusterSingletonServiceSecond).getIdentifier();
 
-       singletonServiceGroup = new ClusterSingletonServiceGroupImpl(SERVICE_IDENTIFIER, mainEntity, closeEntity, mockEosService, map);
+        singletonServiceGroup = new ClusterSingletonServiceGroupImpl(
+            SERVICE_IDENTIFIER, mainEntity, closeEntity, mockEosService, map);
     }
 
     /**
-     * Test NULL ServiceIdent input for new ServiceGroup instance
+     * Test NULL ServiceIdent input for new ServiceGroup instance.
      *
      * @throws Exception - unexpected exception
      */
     @Test(expected = IllegalArgumentException.class)
     public void instantiationClusterSingletonServiceGroupNullIdentTest() throws Exception {
-        singletonServiceGroup = new ClusterSingletonServiceGroupImpl(null, mainEntity, closeEntity, mockEosService, map);
+        singletonServiceGroup = new ClusterSingletonServiceGroupImpl(
+                null, mainEntity, closeEntity, mockEosService, map);
     }
 
     /**
-     * Test empty ServiceIdent input for new ServiceGroup instance
+     * Test empty ServiceIdent input for new ServiceGroup instance.
      *
      * @throws Exception - unexpected exception
      */
@@ -109,47 +116,51 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     /**
-     * Test NULL MainEntity input for new ServiceGroup instance
+     * Test NULL MainEntity input for new ServiceGroup instance.
      *
      * @throws Exception - unexpected exception
      */
     @Test(expected = NullPointerException.class)
     public void instantiationClusterSingletonServiceGroupNullMainEntityTest() throws Exception {
-        singletonServiceGroup = new ClusterSingletonServiceGroupImpl(SERVICE_IDENTIFIER, null, closeEntity, mockEosService, map);
+        singletonServiceGroup = new ClusterSingletonServiceGroupImpl(
+                SERVICE_IDENTIFIER, null, closeEntity, mockEosService, map);
     }
 
     /**
-     * Test NULL MainEntity input for new ServiceGroup instance
+     * Test NULL MainEntity input for new ServiceGroup instance.
      *
      * @throws Exception - unexpected exception
      */
     @Test(expected = NullPointerException.class)
     public void instantiationClusterSingletonServiceGroupNullCloseEntityTest() throws Exception {
-        singletonServiceGroup = new ClusterSingletonServiceGroupImpl(SERVICE_IDENTIFIER, mainEntity, null, mockEosService, map);
+        singletonServiceGroup = new ClusterSingletonServiceGroupImpl(
+                SERVICE_IDENTIFIER, mainEntity, null, mockEosService, map);
     }
 
     /**
-     * Test NULL MainEntity input for new ServiceGroup instance
+     * Test NULL MainEntity input for new ServiceGroup instance.
      *
      * @throws Exception - unexpected exception
      */
     @Test(expected = NullPointerException.class)
     public void instantiationClusterSingletonServiceGroupNullEOS_Test() throws Exception {
-        singletonServiceGroup = new ClusterSingletonServiceGroupImpl(SERVICE_IDENTIFIER, mainEntity, closeEntity, null, map);
+        singletonServiceGroup = new ClusterSingletonServiceGroupImpl(
+                SERVICE_IDENTIFIER, mainEntity, closeEntity, null, map);
     }
 
     /**
-     * Test NULL MainEntity input for new ServiceGroup instance
+     * Test NULL MainEntity input for new ServiceGroup instance.
      *
      * @throws Exception - unexpected exception
      */
     @Test(expected = NullPointerException.class)
     public void instantiationClusterSingletonServiceGroupNullMapRefTest() throws Exception {
-        singletonServiceGroup = new ClusterSingletonServiceGroupImpl(SERVICE_IDENTIFIER, mainEntity, closeEntity, mockEosService, null);
+        singletonServiceGroup = new ClusterSingletonServiceGroupImpl(
+                SERVICE_IDENTIFIER, mainEntity, closeEntity, mockEosService, null);
     }
 
     /**
-     * Test GoldPath for initialization ServiceGroup
+     * Test GoldPath for initialization ServiceGroup.
      *
      * @throws Exception - unexpected exception
      */
@@ -160,7 +171,7 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     /**
-     * Test GoldPath for NO-TO-SLAVE entity Candidate role change
+     * Test GoldPath for NO-TO-SLAVE entity Candidate role change.
      *
      * @throws Exception - unexpected exception
      */
@@ -177,7 +188,7 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     /**
-     * Test GoldPath for NO-TO-SLAVE but without MASTER entity Candidate role change
+     * Test GoldPath for NO-TO-SLAVE but without MASTER entity Candidate role change.
      *
      * @throws Exception - unexpected exception
      */
@@ -194,7 +205,7 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     /**
-     * Test GoldPath for InJeopardy entity Candidate role change
+     * Test GoldPath for InJeopardy entity Candidate role change.
      *
      * @throws Exception - unexpected exception
      */
@@ -214,7 +225,7 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     /**
-     * Test GoldPath for registration SingletonService
+     * Test GoldPath for registration SingletonService.
      *
      * @throws Exception - unexpected exception
      */
@@ -228,7 +239,7 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     /**
-     * Test GoldPath for registration SingletonService
+     * Test GoldPath for registration SingletonService.
      *
      * @throws Exception - unexpected exception
      */
@@ -246,7 +257,7 @@ public class ClusterSingletonServiceGroupImplTest {
 
     /**
      * Test GoldPath for unregistration SingletonService don't call closeServiceInstance
-     * without mastership and don't remove ServiceGroup from map
+     * without mastership and don't remove ServiceGroup from map.
      *
      * @throws Exception - unexpected exception
      */
@@ -266,7 +277,7 @@ public class ClusterSingletonServiceGroupImplTest {
 
     /**
      * Test GoldPath for unregistration SingletonService don't call closeServiceInstance
-     * without mastership and don't remove ServiceGroup from map
+     *     without mastership and don't remove ServiceGroup from map.
      *
      * @throws Exception - unexpected exception
      */
@@ -288,7 +299,7 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     /**
-     * Test GoldPath get Slave role for registered main entity
+     * Test GoldPath get Slave role for registered main entity.
      *
      * @throws Exception - unexpected exception
      */
@@ -304,7 +315,7 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     /**
-     * Test GoldPath get Master role for registered main entity
+     * Test GoldPath get Master role for registered main entity.
      *
      * @throws Exception - unexpected exception
      */
@@ -321,7 +332,7 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     /**
-     * Test GoldPath get Master role for registered close entity
+     * Test GoldPath get Master role for registered close entity.
      *
      * @throws Exception - unexpected exception
      */
@@ -341,7 +352,7 @@ public class ClusterSingletonServiceGroupImplTest {
 
     /**
      * Test GoldPath get Master role for registered entity but initial Slave
-     * role for closeEntity
+     *     role for closeEntity.
      *
      * @throws Exception - unexpected exception
      */
@@ -364,7 +375,7 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     /**
-     * Test inJeopardy validation during wait phase for Master role for closeEntity
+     * Test inJeopardy validation during wait phase for Master role for closeEntity.
      *
      * @throws Exception - unexpected exception
      */
@@ -387,7 +398,7 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     /**
-     * Test inJeopardy validation during wait phase for Master role for closeEntity
+     * Test inJeopardy validation during wait phase for Master role for closeEntity.
      *
      * @throws Exception - unexpected exception
      */
@@ -413,7 +424,7 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     /**
-     * Test inJeopardy validation for holding leadership
+     * Test inJeopardy validation for holding leadership.
      *
      * @throws Exception - unexpected exception
      */
@@ -437,7 +448,7 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     /**
-     * Test GoldPath for SLAVE-TO-MASTER entity Candidate role change
+     * Test GoldPath for SLAVE-TO-MASTER entity Candidate role change.
      *
      * @throws Exception - unexpected exception
      */
@@ -459,8 +470,8 @@ public class ClusterSingletonServiceGroupImplTest {
 
     /**
      * Test checks validation Error processing for SLAVE-TO-MASTER entity Candidate role change.
-     * Not initialized provider has to close and remove all singletonServices from Group and
-     * Group itself remove too.
+     *     Not initialized provider has to close and remove all singletonServices from Group and
+     *     Group itself remove too.
      *
      * @throws Exception - unexpected exception
      */
@@ -475,7 +486,7 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     /**
-     * Test checks closing procesing for close {@link ClusterSingletonServiceRegistration}
+     * Test checks closing procesing for close {@link ClusterSingletonServiceRegistration}.
      *
      * @throws Exception - unexpected exception
      */
@@ -497,7 +508,7 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     /**
-     * Test checks validation Error processing for MASTER-TO-SLAVE closeEntity Candidate role change
+     * Test checks validation Error processing for MASTER-TO-SLAVE closeEntity Candidate role change.
      *
      * @throws Exception - unexpected exception
      */
@@ -522,7 +533,7 @@ public class ClusterSingletonServiceGroupImplTest {
 
     /**
      * Test checks validation Error processing for MASTER-TO-SLAVE closeEntity Candidate role change
-     * without closeEntity registration
+     *     without closeEntity registration.
      *
      * @throws Exception - unexpected exception
      */
@@ -568,7 +579,8 @@ public class ClusterSingletonServiceGroupImplTest {
     }
 
     private GenericEntityOwnershipChange<TestInstanceIdentifier, TestEntity> getEntityToJeopardy() {
-        return new GenericEntityOwnershipChange<>(mainEntity, EntityOwnershipChangeState.from(false, false, false), true);
+        return new GenericEntityOwnershipChange<>(mainEntity,
+            EntityOwnershipChangeState.from(false, false, false), true);
     }
 
 }
index d79b09b3df4e0f42b9bfc506d3d200b96ecc214a..b16d61472f4485584f2a5c65faee51e0a057276b 100644 (file)
@@ -12,6 +12,7 @@ import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.verify;
+
 import com.google.common.util.concurrent.Futures;
 import org.junit.Assert;
 import org.junit.Before;
@@ -20,12 +21,9 @@ import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
 import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
-import org.opendaylight.mdsal.singleton.dom.impl.ClusterSingletonServiceGroup;
-import org.opendaylight.mdsal.singleton.dom.impl.ClusterSingletonServiceGroupImpl;
-import org.opendaylight.mdsal.singleton.dom.impl.ClusterSingletonServiceRegistrationDelegator;
 
 /**
- * Testing {@link ClusterSingletonServiceRegistrationDelegator}
+ * Testing {@link ClusterSingletonServiceRegistrationDelegator}.
  */
 public class ClusterSingletonServiceRegistrationDelegatorTest {
 
@@ -41,7 +39,7 @@ public class ClusterSingletonServiceRegistrationDelegatorTest {
     private ClusterSingletonServiceRegistrationDelegator delegator;
 
     /**
-     * Initialization functionality for every Tests in this suite
+     * Initialization functionality for every Tests in this suite.
      *
      * @throws Exception - unexpected setup exception
      */
@@ -59,7 +57,7 @@ public class ClusterSingletonServiceRegistrationDelegatorTest {
     }
 
     /**
-     * Test create input with {@link ClusterSingletonService} as null
+     * Test create input with {@link ClusterSingletonService} as null.
      */
     @Test(expected = NullPointerException.class)
     public void testSetupNullService() {
@@ -67,7 +65,7 @@ public class ClusterSingletonServiceRegistrationDelegatorTest {
     }
 
     /**
-     * Test create input with {@link ClusterSingletonServiceGroupImpl} as null
+     * Test create input with {@link ClusterSingletonServiceGroupImpl} as null.
      */
     @Test(expected = NullPointerException.class)
     public void testSetupNullGroup() {
@@ -75,7 +73,7 @@ public class ClusterSingletonServiceRegistrationDelegatorTest {
     }
 
     /**
-     * Test a method delegation {@link ClusterSingletonService#instantiateServiceInstance()}
+     * Test a method delegation {@link ClusterSingletonService#instantiateServiceInstance()}.
      */
     @Test
     public void testInstatiateServiceDelegMethod() {
@@ -84,7 +82,7 @@ public class ClusterSingletonServiceRegistrationDelegatorTest {
     }
 
     /**
-     * Test a method delegation {@link ClusterSingletonService#instantiateServiceInstance()}
+     * Test a method delegation {@link ClusterSingletonService#instantiateServiceInstance()}.
      */
     @Test
     public void testCloseServiceDelegMethod() {
@@ -93,7 +91,7 @@ public class ClusterSingletonServiceRegistrationDelegatorTest {
     }
 
     /**
-     * Test a method delegation {@link ClusterSingletonService#getIdentifier()}
+     * Test a method delegation {@link ClusterSingletonService#getIdentifier()}.
      */
     @Test
     public void testGetServiceIdentifierDelegMethod() {
@@ -103,7 +101,8 @@ public class ClusterSingletonServiceRegistrationDelegatorTest {
     }
 
     /**
-     * Test a close method delegation to {@link ClusterSingletonServiceGroupImpl#unregisterService(ClusterSingletonService)}
+     * Test a close method delegation to
+     *     {@link ClusterSingletonServiceGroupImpl#unregisterService(ClusterSingletonService)}.
      *
      * @throws Exception is from AutoclosableInterface
      */
index 6a05eb1cbbc644a9353ab219c7f4cd3de995a331..096b8759317244410a4d7ecabfe557eecbac5e71 100644 (file)
@@ -15,6 +15,7 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
+
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import org.junit.Assert;
@@ -34,7 +35,7 @@ import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegist
 import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
 
 /**
- * Testing {@link DOMClusterSingletonServiceProviderImpl} implementation
+ * Testing {@link DOMClusterSingletonServiceProviderImpl} implementation.
  */
 public class DOMClusterSingletonServiceProviderImplTest {
 
@@ -61,9 +62,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     private final DOMEntity doubleEntity = new DOMEntity(CLOSE_SERVICE_ENTITY_TYPE, SERVICE_NAME);
 
     /**
-     * Initialization functionality for every Tests in this suite
+     * Initialization functionality for every Tests in this suite.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Before
     public void setup() throws Exception {
@@ -93,9 +94,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test checks NullPointer for null {@link DOMEntityOwnershipService} input value
+     * Test checks NullPointer for null {@link DOMEntityOwnershipService} input value.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test(expected = NullPointerException.class)
     public void initializationClusterSingletonServiceProviderNullInputTest() throws Exception {
@@ -103,9 +104,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test GoldPath for close {@link DOMClusterSingletonServiceProviderImpl}
+     * Test GoldPath for close {@link DOMClusterSingletonServiceProviderImpl}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void closeClusterSingletonServiceProviderTest() throws Exception {
@@ -117,9 +118,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test parser ServiceIdentifier from Entity
+     * Test parser ServiceIdentifier from Entity.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void makeEntityClusterSingletonServiceProviderTest() throws Exception {
@@ -131,9 +132,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test parser ServiceIdentifier from Entity
+     * Test parser ServiceIdentifier from Entity.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void getIdentifierClusterSingletonServiceProviderTest() throws Exception {
@@ -144,9 +145,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test GoldPath for initialization {@link ClusterSingletonService}
+     * Test GoldPath for initialization {@link ClusterSingletonService}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void initializationClusterSingletonServiceTest() throws Exception {
@@ -158,9 +159,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test GoldPath for initialization with init ownership result SLAVE {@link ClusterSingletonService}
+     * Test GoldPath for initialization with init ownership result SLAVE {@link ClusterSingletonService}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void slaveInitClusterSingletonServiceTest() throws Exception {
@@ -174,9 +175,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test GoldPath for initialization with init ownership result SLAVE, but NO-MASTER {@link ClusterSingletonService}
+     * Test GoldPath for initialization with init ownership result SLAVE, but NO-MASTER {@link ClusterSingletonService}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void slaveInitNoMasterClusterSingletonServiceTest() throws Exception {
@@ -190,9 +191,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test GoldPath for initialization with init ownership result MASTER {@link ClusterSingletonService}
+     * Test GoldPath for initialization with init ownership result MASTER {@link ClusterSingletonService}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void masterInitClusterSingletonServiceTest() throws Exception {
@@ -206,9 +207,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test GoldPath for initialization with init ownership result MASTER {@link ClusterSingletonService}
+     * Test GoldPath for initialization with init ownership result MASTER {@link ClusterSingletonService}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void masterInitSlaveDoubleCandidateClusterSingletonServiceTest() throws Exception {
@@ -223,9 +224,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test GoldPath for takeLeadership with ownership result MASTER {@link ClusterSingletonService}
+     * Test GoldPath for takeLeadership with ownership result MASTER {@link ClusterSingletonService}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void takeLeadershipClusterSingletonServiceTest() throws Exception {
@@ -241,9 +242,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test GoldPath for initialization with init ownership result MASTER {@link ClusterSingletonService}
+     * Test GoldPath for initialization with init ownership result MASTER {@link ClusterSingletonService}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void masterInitClusterSingletonServiceTwoServicesTest() throws Exception {
@@ -261,9 +262,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test GoldPath for takeLeadership with ownership result MASTER {@link ClusterSingletonService}
+     * Test GoldPath for takeLeadership with ownership result MASTER {@link ClusterSingletonService}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void takeLeadershipClusterSingletonServiceTwoAddDuringWaitPhaseServicesTest() throws Exception {
@@ -284,9 +285,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test GoldPath for takeLeadership with ownership result MASTER {@link ClusterSingletonService}
+     * Test GoldPath for takeLeadership with ownership result MASTER {@link ClusterSingletonService}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void takeLeadershipClusterSingletonServiceTowServicesTest() throws Exception {
@@ -306,9 +307,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test checks CandidateAlreadyRegisteredException processing in initialization phase
+     * Test checks CandidateAlreadyRegisteredException processing in initialization phase.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void initializationClusterSingletonServiceCandidateAlreadyRegistredTest() throws Exception {
@@ -320,9 +321,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
 
     /**
      * Test GoldPath for lostLeadership during tryToTakeLeadership with ownership result MASTER
-     * {@link ClusterSingletonService}
+     *     {@link ClusterSingletonService}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void lostLeadershipDuringTryToTakeLeadershipClusterSingletonServiceTest() throws Exception {
@@ -340,9 +341,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test GoldPath for lostLeadership with ownership result MASTER-TO-SLAVE {@link ClusterSingletonService}
+     * Test GoldPath for lostLeadership with ownership result MASTER-TO-SLAVE {@link ClusterSingletonService}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void lostLeadershipClusterSingletonServiceTest() throws Exception {
@@ -362,9 +363,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test checks umexpected change for MASTER-TO-SLAVE double Candidate role change
+     * Test checks umexpected change for MASTER-TO-SLAVE double Candidate role change.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void unexpectedLostLeadershipDoubleCandidateTest() throws Exception {
@@ -387,9 +388,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test checks inJeopardy Cluster Node state for Master Instance
+     * Test checks inJeopardy Cluster Node state for Master Instance.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void inJeopardyMasterTest() throws Exception {
@@ -413,9 +414,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test checks inJeopardy Cluster Node state for Slave Instance
+     * Test checks inJeopardy Cluster Node state for Slave Instance.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void inJeopardySlaveTest() throws Exception {
@@ -435,9 +436,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test checks close procesing for {@link ClusterSingletonServiceRegistration}
+     * Test checks close processing for {@link ClusterSingletonServiceRegistration}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void closeClusterSingletonServiceRegistrationNoRoleTest() throws Exception {
@@ -455,9 +456,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test checks close procesing for {@link ClusterSingletonServiceRegistration}
+     * Test checks close procesing for {@link ClusterSingletonServiceRegistration}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void closeClusterSingletonServiceRegistrationNoRoleTwoServicesTest() throws Exception {
@@ -480,9 +481,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test checks close procesing for {@link ClusterSingletonServiceRegistration}
+     * Test checks close procesing for {@link ClusterSingletonServiceRegistration}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void closeClusterSingletonServiceRegistrationSlaveTest() throws Exception {
@@ -501,9 +502,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test checks close procesing for {@link ClusterSingletonServiceRegistration}
+     * Test checks close procesing for {@link ClusterSingletonServiceRegistration}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void closeClusterSingletonServiceRegistrationSlaveTwoServicesTest() throws Exception {
@@ -527,9 +528,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test checks close procesing for {@link ClusterSingletonServiceRegistration}
+     * Test checks close procesing for {@link ClusterSingletonServiceRegistration}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void closeClusterSingletonServiceRegistrationMasterTest() throws Exception {
@@ -551,9 +552,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test checks close procesing for {@link ClusterSingletonServiceRegistration}
+     * Test checks close procesing for {@link ClusterSingletonServiceRegistration}.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void closeClusterSingletonServiceRegistrationMasterTwoServicesTest() throws Exception {
@@ -581,9 +582,9 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Test checks validation Error processing for SLAVE-TO-MASTER entity Candidate role change
+     * Test checks validation Error processing for SLAVE-TO-MASTER entity Candidate role change.
      *
-     * @throws Exception
+     * @throws Exception if the condition does not meet
      */
     @Test
     public void tryToTakeLeaderForClosedServiceRegistrationTest() throws Exception {
@@ -643,32 +644,32 @@ public class DOMClusterSingletonServiceProviderImplTest {
     }
 
     /**
-     * Base states for AbstractClusterProjectProvider
+     * Base states for AbstractClusterProjectProvider.
      */
-    static enum TestClusterSingletonServiceState {
+    enum TestClusterSingletonServiceState {
         /**
-         * State represents a correct Instantiated process
+         * State represents a correct Instantiated process.
          */
         STARTED,
         /**
-         * State represents a correct call abstract method instantiatingProject
+         * State represents a correct call abstract method instantiatingProject.
          */
         INITIALIZED,
         /**
-         * State represents a correct call abstract method destryingProject
+         * State represents a correct call abstract method destryingProject.
          */
         DESTROYED;
     }
 
     /**
-     * Test implementation of {@link ClusterSingletonService}
+     * Test implementation of {@link ClusterSingletonService}.
      */
     class TestClusterSingletonServiceInstance implements ClusterSingletonService {
 
-        private final ServiceGroupIdentifier SERVICE_IDENT = ServiceGroupIdentifier.create(SERVICE_NAME);
+        private final ServiceGroupIdentifier serviceIndent = ServiceGroupIdentifier.create(SERVICE_NAME);
         private TestClusterSingletonServiceState serviceState;
 
-        public TestClusterSingletonServiceInstance() {
+        TestClusterSingletonServiceInstance() {
             this.serviceState = TestClusterSingletonServiceState.INITIALIZED;
         }
 
@@ -689,7 +690,7 @@ public class DOMClusterSingletonServiceProviderImplTest {
 
         @Override
         public ServiceGroupIdentifier getIdentifier() {
-            return SERVICE_IDENT;
+            return serviceIndent;
         }
     }
 }
index 92597bceb4a922acd0912069634bf0d41213fe85..b7b07045f0cd836ff25d4b067b26f6dabd3b6214 100644 (file)
@@ -23,11 +23,6 @@ public class TestInstanceIdentifier implements Path<TestInstanceIdentifier> {
 
     private final ImmutableList<String> path;
 
-    /**
-     * {@link TestInstanceIdentifier} constructor
-     *
-     * @param path - path
-     */
     public TestInstanceIdentifier(final Iterable<? extends TestInstanceIdentifier> path) {
         Preconditions.checkArgument(path != null);
         final List<String> tiis = new LinkedList<>();