From 24b4137deb19c4f07f5b73c97797ac59b73eb6b4 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Fri, 2 Mar 2018 15:09:13 +0100 Subject: [PATCH] remove sal-common-testutil with TestEntityOwnershipService 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 --- opendaylight/md-sal/pom.xml | 1 - .../md-sal/sal-common-testutil/pom.xml | 33 ------------ .../testutil/TestEntityOwnershipService.java | 53 ------------------- 3 files changed, 87 deletions(-) delete mode 100644 opendaylight/md-sal/sal-common-testutil/pom.xml delete mode 100644 opendaylight/md-sal/sal-common-testutil/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/testutil/TestEntityOwnershipService.java diff --git a/opendaylight/md-sal/pom.xml b/opendaylight/md-sal/pom.xml index f0034658fc..0831fac029 100644 --- a/opendaylight/md-sal/pom.xml +++ b/opendaylight/md-sal/pom.xml @@ -21,7 +21,6 @@ sal-common-api sal-common-impl sal-common-util - sal-common-testutil sal-dom-api diff --git a/opendaylight/md-sal/sal-common-testutil/pom.xml b/opendaylight/md-sal/sal-common-testutil/pom.xml deleted file mode 100644 index 9ed5dd1fa9..0000000000 --- a/opendaylight/md-sal/sal-common-testutil/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - 4.0.0 - - - org.opendaylight.odlparent - odlparent - 3.0.2 - - - - org.opendaylight.controller - sal-common-testutil - 1.8.0-SNAPSHOT - - - - ${project.groupId} - sal-common-api - ${project.version} - - - org.mockito - mockito-core - compile - - - org.opendaylight.yangtools - testutils - 2.0.1 - - - 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 index 230f59c5ff..0000000000 --- a/opendaylight/md-sal/sal-common-testutil/src/main/java/org/opendaylight/controller/md/sal/common/api/clustering/testutil/TestEntityOwnershipService.java +++ /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 getOwnershipState(Entity forEntity) { - return Optional.of(STATE); - } - - @Override - public boolean isCandidateRegistered(Entity entity) { - return true; - } -} -- 2.36.6