From: Robert Varga Date: Wed, 12 Feb 2020 16:49:15 +0000 (+0100) Subject: Enable Bug6972Test X-Git-Tag: v4.0.8~41 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=a8ae26e3d389f44fd68524c221c8c6fdd62024e7;p=yangtools.git Enable Bug6972Test This is an ancient test to assert that unit statements share the same instance. Enable it now that we have fixed underlying issue. JIRA: YANGTOOLS-694 Change-Id: Ifc88e2fc63cf0f2fc9b33459caf6980b3a1545ec Signed-off-by: Robert Varga --- diff --git a/yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug6972Test.java b/yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug6972Test.java index 6a445e9042..e2f4444ed9 100644 --- a/yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug6972Test.java +++ b/yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug6972Test.java @@ -5,14 +5,12 @@ * 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.stmt; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertSame; -import org.junit.Ignore; import org.junit.Test; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.Revision; @@ -25,8 +23,6 @@ import org.opendaylight.yangtools.yang.model.api.stmt.LeafEffectiveStatement; import org.opendaylight.yangtools.yang.model.api.stmt.UnitsEffectiveStatement; public class Bug6972Test { - - @Ignore @Test public void allUnitsShouldBeTheSameInstance() throws Exception { final SchemaContext schemaContext = StmtTestUtils.parseYangSources("/bugs/bug6972"); @@ -43,16 +39,14 @@ public class Bug6972Test { final QName barFooLeaf = QName.create("bar-ns", "foo", revision); final UnitsEffectiveStatement unitsBar1 = getEffectiveUnits(bar, barExportCont, barFooLeaf); - final UnitsEffectiveStatement unitsBar2 = getEffectiveUnits(bar, barFooCont, barFooLeaf); + assertSame(unitsBar1, getEffectiveUnits(bar, barFooCont, barFooLeaf)); final QName bazExportCont = QName.create("baz-ns", "baz-export", revision); final QName bazFooCont = QName.create("baz-ns", "baz-foo", revision); final QName bazFooLeaf = QName.create("baz-ns", "foo", revision); - final UnitsEffectiveStatement unitsBaz1 = getEffectiveUnits(baz, bazExportCont, bazFooLeaf); - final UnitsEffectiveStatement unitsBaz2 = getEffectiveUnits(baz, bazFooCont, bazFooLeaf); - - assertTrue(unitsBar1 == unitsBar2 && unitsBar1 == unitsBaz1 && unitsBar1 == unitsBaz2); + assertSame(unitsBar1, getEffectiveUnits(baz, bazExportCont, bazFooLeaf)); + assertSame(unitsBar1, getEffectiveUnits(baz, bazFooCont, bazFooLeaf)); } private static UnitsEffectiveStatement getEffectiveUnits(final Module module, final QName containerQName,