remove sal-common-testutil with TestEntityOwnershipService 02/69002/1
authorMichael Vorburger <vorburger@redhat.com>
Fri, 2 Mar 2018 14:09:13 +0000 (15:09 +0100)
committerMichael Vorburger <vorburger@redhat.com>
Fri, 2 Mar 2018 14:09:16 +0000 (15:09 +0100)
because it is no longer used, and the only remaining
dependency from genius to this got removed in
https://git.opendaylight.org/gerrit/#/c/68986/

a better alternative is to use the
SimpleDOMEntityOwnershipService (with BindingDOMEntityOwnershipServiceAdapter)

Change-Id: Ibea71db52fd0b014aff8764a77d4689cb2165adf
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
opendaylight/md-sal/pom.xml
opendaylight/md-sal/sal-common-testutil/pom.xml [deleted file]
opendaylight/md-sal/sal-common-testutil/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/testutil/TestEntityOwnershipService.java [deleted file]

index f003465..0831fac 100644 (file)
@@ -21,7 +21,6 @@
     <module>sal-common-api</module>
     <module>sal-common-impl</module>
     <module>sal-common-util</module>
-    <module>sal-common-testutil</module>
 
     <!-- Binding Independent -->
     <module>sal-dom-api</module>
diff --git a/opendaylight/md-sal/sal-common-testutil/pom.xml b/opendaylight/md-sal/sal-common-testutil/pom.xml
deleted file mode 100644 (file)
index 9ed5dd1..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.opendaylight.odlparent</groupId>
-    <artifactId>odlparent</artifactId>
-    <version>3.0.2</version>
-    <relativePath />
-  </parent>
-
-  <groupId>org.opendaylight.controller</groupId>
-  <artifactId>sal-common-testutil</artifactId>
-  <version>1.8.0-SNAPSHOT</version>
-
-  <dependencies>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>sal-common-api</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
-      <scope>compile</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.yangtools</groupId>
-      <artifactId>testutils</artifactId>
-      <version>2.0.1</version>
-    </dependency>
-  </dependencies>
-</project>
diff --git a/opendaylight/md-sal/sal-common-testutil/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/testutil/TestEntityOwnershipService.java b/opendaylight/md-sal/sal-common-testutil/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/testutil/TestEntityOwnershipService.java
deleted file mode 100644 (file)
index 230f59c..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.md.sal.common.api.clustering.testutil;
-
-import static org.opendaylight.yangtools.testutils.mockito.MoreAnswers.realOrException;
-
-import com.google.common.base.Optional;
-import org.mockito.Mockito;
-import org.opendaylight.controller.md.sal.common.api.clustering.Entity;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipCandidateRegistration;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipListener;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipListenerRegistration;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipState;
-
-/**
- * Fake EntityOwnershipService suitable for non-clustered component tests.
- *
- * @author Michael Vorburger
- */
-public abstract class TestEntityOwnershipService implements EntityOwnershipService {
-
-    private static final EntityOwnershipState STATE = new EntityOwnershipState(true, true);
-
-    public static EntityOwnershipService newInstance() {
-        return Mockito.mock(TestEntityOwnershipService.class, realOrException());
-    }
-
-    @Override
-    public EntityOwnershipCandidateRegistration registerCandidate(Entity entity) {
-        return Mockito.mock(EntityOwnershipCandidateRegistration.class, realOrException());
-    }
-
-    @Override
-    public EntityOwnershipListenerRegistration registerListener(String entityType, EntityOwnershipListener listener) {
-        return Mockito.mock(EntityOwnershipListenerRegistration.class, realOrException());
-    }
-
-    @Override
-    public Optional<EntityOwnershipState> getOwnershipState(Entity forEntity) {
-        return Optional.of(STATE);
-    }
-
-    @Override
-    public boolean isCandidateRegistered(Entity entity) {
-        return true;
-    }
-}

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.