X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-model-util%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fmodel%2Frepo%2Futil%2FRefcountedRegistrationTest.java;fp=yang%2Fyang-model-util%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fmodel%2Frepo%2Futil%2FRefcountedRegistrationTest.java;h=0000000000000000000000000000000000000000;hb=73575fa46421920f2af98d7b7d3dbe63b99e2524;hp=77627975286815ae0f203873cc493d78b28f6578;hpb=c12e09090073384744e8684f23f01f8c64fd307d;p=yangtools.git diff --git a/yang/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/repo/util/RefcountedRegistrationTest.java b/yang/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/repo/util/RefcountedRegistrationTest.java deleted file mode 100644 index 7762797528..0000000000 --- a/yang/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/repo/util/RefcountedRegistrationTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2016 Cisco Systems, 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.yangtools.yang.model.repo.util; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; -import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceRegistration; - -@RunWith(MockitoJUnitRunner.class) -public class RefcountedRegistrationTest { - @Mock - public SchemaSourceRegistration reg; - - @Before - public void before() { - doNothing().when(reg).close(); - } - - @Test - public void refcountDecTrue() { - final RefcountedRegistration ref = new RefcountedRegistration(reg); - assertTrue(ref.decRef()); - verify(reg, times(1)).close(); - } - - @Test - public void refcountIncDecFalse() { - final RefcountedRegistration ref = new RefcountedRegistration(reg); - ref.incRef(); - assertFalse(ref.decRef()); - verify(reg, times(0)).close(); - } - - @Test - public void refcountIncDecTrue() { - final RefcountedRegistration ref = new RefcountedRegistration(reg); - ref.incRef(); - assertFalse(ref.decRef()); - assertTrue(ref.decRef()); - verify(reg, times(1)).close(); - } -}