From f030908cc43f1af67e1e76d625d2e373a33399d6 Mon Sep 17 00:00:00 2001 From: Sai Gandham Date: Thu, 3 Jan 2019 14:47:53 -0600 Subject: Add more junits misc env impl Modified slot class Issue-ID: AAF-111 Change-Id: Iff3d8d1319110c56dba00a6c0f992473f94da4e1 Signed-off-by: Sai Gandham --- .../org/onap/aaf/misc/env/JU_StoreImplTest.java | 144 ++++++++++ .../org/onap/aaf/misc/env/impl/JU_AbsTrans.java | 292 +++++++++++++++++++++ .../onap/aaf/misc/env/impl/JU_AbsTransJaxb.java | 177 +++++++++++++ .../onap/aaf/misc/env/jaxb/JU_StoreImplTest.java | 144 ---------- 4 files changed, 613 insertions(+), 144 deletions(-) create mode 100644 misc/env/src/test/java/org/onap/aaf/misc/env/JU_StoreImplTest.java create mode 100644 misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTrans.java create mode 100644 misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTransJaxb.java delete mode 100644 misc/env/src/test/java/org/onap/aaf/misc/env/jaxb/JU_StoreImplTest.java (limited to 'misc/env/src/test/java/org') diff --git a/misc/env/src/test/java/org/onap/aaf/misc/env/JU_StoreImplTest.java b/misc/env/src/test/java/org/onap/aaf/misc/env/JU_StoreImplTest.java new file mode 100644 index 00000000..db48345c --- /dev/null +++ b/misc/env/src/test/java/org/onap/aaf/misc/env/JU_StoreImplTest.java @@ -0,0 +1,144 @@ +/** + * ============LICENSE_START==================================================== + * org.onap.aaf + * =========================================================================== + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * =========================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END==================================================== + * + */ +package org.onap.aaf.misc.env; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.MockitoAnnotations.initMocks; + +import java.io.File; +import java.util.List; +import java.util.Properties; + +import javax.xml.namespace.QName; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.runners.MockitoJUnitRunner; + +@RunWith(MockitoJUnitRunner.class) +public class JU_StoreImplTest { + + @Mock + QName qname; + + @Mock + Env env; + + TimeTaken tt,ttstringify; + + LogTarget logT; + + @Before + public void setUp() { + initMocks(this); + tt=Mockito.mock(TimeTaken.class); + Mockito.doReturn(tt).when(env).start("JAXB Marshal", Env.XML); + Mockito.doNothing().when(tt).done(); + logT = Mockito.mock(LogTarget.class); + Mockito.doReturn(logT).when(env).debug(); + } + + @Test + public void testPropsFromArgs() { + StoreImpl bdfObj = new StoreImpl(); + bdfObj = new StoreImpl(""); + bdfObj.propsFromArgs(null, new String[] {"test"}); + bdfObj.propsFromArgs("test", new String[] {"test","te=st","test=1"}); + + } + + @Test + public void testMorePropsConstructor() { + Properties props = Mockito.mock(Properties.class); + new StoreImpl(null,props); + StoreImpl bdfObj = new StoreImpl("test",props); + } + + @Test + public void testMorePropsFileNOtExists() { + Properties props = Mockito.mock(Properties.class); + Mockito.doReturn("test").when(props).getProperty("test"); + StoreImpl bdfObj = new StoreImpl("test",props); + } + + @Test + public void testMorePropsExists() { + Properties props = Mockito.mock(Properties.class); + Mockito.doReturn(System.getProperty("user.dir")+"/src/test/java/org/onap/aaf/misc/env/JU_StoreImplTest.java").when(props).getProperty("test"); + StoreImpl bdfObj = new StoreImpl("test",props); + } + + @Test + public void testNewTransState() { + StoreImpl bdfObj = new StoreImpl(null, new String[] {}); + bdfObj.newTransState(); + } + + @Test + public void testSlot() { + StoreImpl bdfObj = new StoreImpl("test", new String[] {}); + Slot slot = bdfObj.slot(null); + assertEquals(slot.toString(),"=0"); + slot = bdfObj.slot("test"); + assertEquals(slot.toString(),"test=1"); + } + + @Test + public void testExistingSlot() { + StoreImpl bdfObj = new StoreImpl("test", new String[] {"test","test=1"}); + Slot retVal = bdfObj.existingSlot("test"); + assertNull(retVal); + } + + @Test + public void testExistingSlotNames() { + StoreImpl bdfObj = new StoreImpl("test", new String[] {"test","test=1"}); + List retVal = bdfObj.existingSlotNames(); + assertTrue(retVal.size()==0); + } + + @Test + public void testGet() { + StoreImpl bdfObj = new StoreImpl("test", new String[] {"test","test=1"}); + Object retVal = bdfObj.get(new StaticSlot(1,"test"),qname); + assertTrue(retVal instanceof QName); + } + + @Test + public void testGetSlot() { + StoreImpl bdfObj = new StoreImpl("test", new String[] {"test","test=1"}); + Object retVal = bdfObj.get(new StaticSlot(1,"test")); + assertNull(retVal); + } + + @Test + public void testExistingStaticSlotNames() { + StoreImpl bdfObj = new StoreImpl("test", new String[] {"test","test=1"}); + List retVal = bdfObj.existingStaticSlotNames(); + assertTrue(retVal.size()==1); + } +} diff --git a/misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTrans.java b/misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTrans.java new file mode 100644 index 00000000..572941f3 --- /dev/null +++ b/misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTrans.java @@ -0,0 +1,292 @@ +/** + * ============LICENSE_START==================================================== + * org.onap.aaf + * =========================================================================== + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * =========================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END==================================================== + * + */ + +package org.onap.aaf.misc.env.impl; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.MockitoAnnotations.initMocks; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.onap.aaf.misc.env.Decryptor; +import org.onap.aaf.misc.env.Encryptor; +import org.onap.aaf.misc.env.Env; +import org.onap.aaf.misc.env.LogTarget; +import org.onap.aaf.misc.env.Slot; +import org.onap.aaf.misc.env.StaticSlot; +import org.onap.aaf.misc.env.StoreImpl; +import org.onap.aaf.misc.env.TimeTaken; + +public class JU_AbsTrans { + + @Mock + Env delegate; + + @Mock + BasicEnv delegate1; + + @Mock + LogTarget lt; + + @Before + public void setUp() { + initMocks(this); + } + + class AbsTransImpl extends AbsTrans{ + + public AbsTransImpl(Env delegate) { + super(delegate); + // TODO Auto-generated constructor stub + } + + public AbsTransImpl(BasicEnv delegate) { + super(delegate); + // TODO Auto-generated constructor stub + } + + @Override + public Slot slot(String name) { + // TODO Auto-generated method stub + return new Slot(-1, "test"); + } + + @Override + public T get(StaticSlot slot, T dflt) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String setProperty(String tag, String value) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getProperty(String tag) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getProperty(String tag, String deflt) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Decryptor decryptor() { + // TODO Auto-generated method stub + return null; + } + + @Override + public Encryptor encryptor() { + // TODO Auto-generated method stub + return null; + } + + @Override + protected TimeTaken newTimeTaken(String name, int flag) { + // TODO Auto-generated method stub + return new TimeTaken("nameTest", Env.XML) { + + @Override + public void output(StringBuilder sb) { + // TODO Auto-generated method stub + + } + }; + } + + } + + @Test + public void testFatal() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + Mockito.doReturn(lt).when(delegate).fatal(); + LogTarget lt = absTransObj.fatal(); + assertTrue(lt instanceof LogTarget); + } + + @Test + public void testError() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + Mockito.doReturn(lt).when(delegate).error(); + LogTarget lt = absTransObj.error(); + assertTrue(lt instanceof LogTarget); + } + + @Test + public void testAudit() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + Mockito.doReturn(lt).when(delegate).audit(); + LogTarget lt = absTransObj.audit(); + assertTrue(lt instanceof LogTarget); + } + + @Test + public void testInit() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + Mockito.doReturn(lt).when(delegate).init(); + LogTarget lt = absTransObj.init(); + assertTrue(lt instanceof LogTarget); + } + + @Test + public void testWarn() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + Mockito.doReturn(lt).when(delegate).warn(); + LogTarget lt = absTransObj.warn(); + assertTrue(lt instanceof LogTarget); + } + + @Test + public void testInfo() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + Mockito.doReturn(lt).when(delegate).info(); + LogTarget lt = absTransObj.info(); + assertTrue(lt instanceof LogTarget); + } + + @Test + public void testDebug() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + Mockito.doReturn(lt).when(delegate).debug(); + LogTarget lt = absTransObj.debug(); + assertTrue(lt instanceof LogTarget); + } + + @Test + public void testTrace() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + Mockito.doReturn(lt).when(delegate).trace(); + LogTarget lt = absTransObj.trace(); + assertTrue(lt instanceof LogTarget); + } + + @Test + public void testStart() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + TimeTaken lt = absTransObj.start("test",1); + assertEquals("nameTest", lt.name); + } + + @Test + public void testCheckpint() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + absTransObj.checkpoint("test"); + assertEquals("nameTest", ((TimeTaken)absTransObj.trail.get(0)).name); + } + + @Test + public void testCheckpintAddFlag() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + absTransObj.checkpoint("test",1); + assertEquals("nameTest", ((TimeTaken)absTransObj.trail.get(0)).name); + } + + @Test + public void testAuditTrailWithEmptyTrail() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + Mockito.doReturn(lt).when(delegate).info(); + Mockito.doReturn(true).when(lt).isLoggable(); + absTransObj.auditTrail(1, new StringBuilder(), 1); + //assertEquals("nameTest", ((TimeTaken)absTransObj.trail.get(0)).name); + } + + @Test + public void testAuditTrail() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + Mockito.doReturn(lt).when(delegate).info(); + Mockito.doReturn(true).when(lt).isLoggable(); + TimeTaken tt=absTransObj.newTimeTaken("test", 1); + absTransObj.trail.add(tt); + absTransObj.trail.add(tt); + absTransObj.trail.add(tt); + absTransObj.auditTrail(1, new StringBuilder(), 2); + //assertEquals("nameTest", ((TimeTaken)absTransObj.trail.get(0)).name); + } + + @Test + public void testAuditTrailLoggableFalse() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + Mockito.doReturn(lt).when(delegate).info(); + Mockito.doReturn(false).when(lt).isLoggable(); + TimeTaken tt=absTransObj.newTimeTaken("test", 1); + absTransObj.trail.add(tt); + absTransObj.trail.add(tt); + absTransObj.trail.add(tt); + absTransObj.auditTrail(1, new StringBuilder(), 1); + //assertEquals("nameTest", ((TimeTaken)absTransObj.trail.get(0)).name); + } + + @Test + public void testAuditTrailNullSB() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + Mockito.doReturn(lt).when(delegate).info(); + Mockito.doReturn(true).when(lt).isLoggable(); + TimeTaken tt=absTransObj.newTimeTaken("test", 1); + absTransObj.trail.add(tt); + absTransObj.trail.add(tt); + absTransObj.trail.add(tt); + absTransObj.auditTrail(1, null, 1); + //assertEquals("nameTest", ((TimeTaken)absTransObj.trail.get(0)).name); + } + + @Test + public void testAuditTrailEmpptyFlag() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate); + Mockito.doReturn(lt).when(delegate).info(); + Mockito.doReturn(true).when(lt).isLoggable(); + TimeTaken tt=absTransObj.newTimeTaken("test", 1); + absTransObj.trail.add(tt); + absTransObj.trail.add(tt); + absTransObj.trail.add(tt); + absTransObj.auditTrail(1, null, new int[] {}); + //assertEquals("nameTest", ((TimeTaken)absTransObj.trail.get(0)).name); + } + + @Test + public void testPut() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate1); + try { + absTransObj.put(absTransObj.slot("test"), "test"); + } catch(Exception e){ + assertTrue(e instanceof NullPointerException); + } + } + + @Test + public void testGet() { + AbsTransImpl absTransObj = new AbsTransImpl(delegate1); + try { + absTransObj.get(absTransObj.slot("test"), "test"); + } catch(Exception e){ + e.printStackTrace(); + assertTrue(e instanceof NullPointerException); + } + } +} \ No newline at end of file diff --git a/misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTransJaxb.java b/misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTransJaxb.java new file mode 100644 index 00000000..98848804 --- /dev/null +++ b/misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTransJaxb.java @@ -0,0 +1,177 @@ +/** + * ============LICENSE_START==================================================== + * org.onap.aaf + * =========================================================================== + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * =========================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END==================================================== + * + */ + +package org.onap.aaf.misc.env.impl; + +import static org.mockito.MockitoAnnotations.initMocks; + +import javax.xml.namespace.QName; +import javax.xml.validation.Schema; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.onap.aaf.misc.env.APIException; +import org.onap.aaf.misc.env.DataFactory; +import org.onap.aaf.misc.env.Decryptor; +import org.onap.aaf.misc.env.Encryptor; +import org.onap.aaf.misc.env.EnvJAXB; +import org.onap.aaf.misc.env.LogTarget; +import org.onap.aaf.misc.env.Slot; +import org.onap.aaf.misc.env.StaticSlot; +import org.onap.aaf.misc.env.TimeTaken; + +public class JU_AbsTransJaxb { + + @Mock + EnvJAXB delegate; + + @Mock + LogTarget lt; + + @Before + public void setUp() { + initMocks(this); + } + + class AbsTransJAXBImpl extends AbsTransJAXB{ + + public AbsTransJAXBImpl(EnvJAXB env) { + super(env); + // TODO Auto-generated constructor stub + } + + @Override + public String setProperty(String tag, String value) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getProperty(String tag) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getProperty(String tag, String deflt) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Decryptor decryptor() { + // TODO Auto-generated method stub + return null; + } + + @Override + public Encryptor encryptor() { + // TODO Auto-generated method stub + return null; + } + + @Override + public Slot slot(String name) { + // TODO Auto-generated method stub + return null; + } + + @Override + public T get(StaticSlot slot, T dflt) { + // TODO Auto-generated method stub + return null; + } + + @Override + protected TimeTaken newTimeTaken(String name, int flag) { + // TODO Auto-generated method stub + return null; + } + + + } + + + @Test + public void testNewDataFactory() { + AbsTransJAXB absTransObj = new AbsTransJAXBImpl(delegate); + DataFactory lt = null; + + try { + Mockito.doReturn(lt).when(delegate).newDataFactory(new Class[] {AbsTransJAXB.class}); + lt = absTransObj.newDataFactory(new Class[] {AbsTransJAXB.class}); + } catch (APIException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + //assertTrue(lt instanceof LogTarget); + } + + @Test + public void testNewDataFactorySchema() { + AbsTransJAXB absTransObj = new AbsTransJAXBImpl(delegate); + DataFactory lt = null; + Schema schema = Mockito.mock(Schema.class); + try { + Mockito.doReturn(lt).when(delegate).newDataFactory(schema, new Class[] {AbsTransJAXB.class}); + lt = absTransObj.newDataFactory(schema, new Class[] {AbsTransJAXB.class}); + } catch (APIException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + //assertTrue(lt instanceof LogTarget); + } + + @Test + public void testNewDataFactoryQname() { + AbsTransJAXB absTransObj = new AbsTransJAXBImpl(delegate); + DataFactory lt = null; + QName schema = Mockito.mock(QName.class); + try { + Mockito.doReturn(lt).when(delegate).newDataFactory(schema, new Class[] {AbsTransJAXB.class}); + lt = absTransObj.newDataFactory(schema, new Class[] {AbsTransJAXB.class}); + } catch (APIException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + //assertTrue(lt instanceof LogTarget); + } + + @Test + public void testNewDataFactorySchemaQname() { + AbsTransJAXB absTransObj = new AbsTransJAXBImpl(delegate); + DataFactory lt = null; + QName qname = Mockito.mock(QName.class); + Schema schema = Mockito.mock(Schema.class); + try { + Mockito.doReturn(lt).when(delegate).newDataFactory(schema, qname,new Class[] {AbsTransJAXB.class}); + lt = absTransObj.newDataFactory(schema, qname,new Class[] {AbsTransJAXB.class}); + } catch (APIException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + //assertTrue(lt instanceof LogTarget); + } + + +} \ No newline at end of file diff --git a/misc/env/src/test/java/org/onap/aaf/misc/env/jaxb/JU_StoreImplTest.java b/misc/env/src/test/java/org/onap/aaf/misc/env/jaxb/JU_StoreImplTest.java deleted file mode 100644 index db48345c..00000000 --- a/misc/env/src/test/java/org/onap/aaf/misc/env/jaxb/JU_StoreImplTest.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * ============LICENSE_START==================================================== - * org.onap.aaf - * =========================================================================== - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * =========================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END==================================================== - * - */ -package org.onap.aaf.misc.env; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; -import static org.mockito.MockitoAnnotations.initMocks; - -import java.io.File; -import java.util.List; -import java.util.Properties; - -import javax.xml.namespace.QName; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class JU_StoreImplTest { - - @Mock - QName qname; - - @Mock - Env env; - - TimeTaken tt,ttstringify; - - LogTarget logT; - - @Before - public void setUp() { - initMocks(this); - tt=Mockito.mock(TimeTaken.class); - Mockito.doReturn(tt).when(env).start("JAXB Marshal", Env.XML); - Mockito.doNothing().when(tt).done(); - logT = Mockito.mock(LogTarget.class); - Mockito.doReturn(logT).when(env).debug(); - } - - @Test - public void testPropsFromArgs() { - StoreImpl bdfObj = new StoreImpl(); - bdfObj = new StoreImpl(""); - bdfObj.propsFromArgs(null, new String[] {"test"}); - bdfObj.propsFromArgs("test", new String[] {"test","te=st","test=1"}); - - } - - @Test - public void testMorePropsConstructor() { - Properties props = Mockito.mock(Properties.class); - new StoreImpl(null,props); - StoreImpl bdfObj = new StoreImpl("test",props); - } - - @Test - public void testMorePropsFileNOtExists() { - Properties props = Mockito.mock(Properties.class); - Mockito.doReturn("test").when(props).getProperty("test"); - StoreImpl bdfObj = new StoreImpl("test",props); - } - - @Test - public void testMorePropsExists() { - Properties props = Mockito.mock(Properties.class); - Mockito.doReturn(System.getProperty("user.dir")+"/src/test/java/org/onap/aaf/misc/env/JU_StoreImplTest.java").when(props).getProperty("test"); - StoreImpl bdfObj = new StoreImpl("test",props); - } - - @Test - public void testNewTransState() { - StoreImpl bdfObj = new StoreImpl(null, new String[] {}); - bdfObj.newTransState(); - } - - @Test - public void testSlot() { - StoreImpl bdfObj = new StoreImpl("test", new String[] {}); - Slot slot = bdfObj.slot(null); - assertEquals(slot.toString(),"=0"); - slot = bdfObj.slot("test"); - assertEquals(slot.toString(),"test=1"); - } - - @Test - public void testExistingSlot() { - StoreImpl bdfObj = new StoreImpl("test", new String[] {"test","test=1"}); - Slot retVal = bdfObj.existingSlot("test"); - assertNull(retVal); - } - - @Test - public void testExistingSlotNames() { - StoreImpl bdfObj = new StoreImpl("test", new String[] {"test","test=1"}); - List retVal = bdfObj.existingSlotNames(); - assertTrue(retVal.size()==0); - } - - @Test - public void testGet() { - StoreImpl bdfObj = new StoreImpl("test", new String[] {"test","test=1"}); - Object retVal = bdfObj.get(new StaticSlot(1,"test"),qname); - assertTrue(retVal instanceof QName); - } - - @Test - public void testGetSlot() { - StoreImpl bdfObj = new StoreImpl("test", new String[] {"test","test=1"}); - Object retVal = bdfObj.get(new StaticSlot(1,"test")); - assertNull(retVal); - } - - @Test - public void testExistingStaticSlotNames() { - StoreImpl bdfObj = new StoreImpl("test", new String[] {"test","test=1"}); - List retVal = bdfObj.existingStaticSlotNames(); - assertTrue(retVal.size()==1); - } -} -- cgit 1.2.3-korg