From 0e31a70d77e7f8ff71484a18e9d0ced52183686a Mon Sep 17 00:00:00 2001 From: Chris Jaekl Date: Wed, 30 Dec 2015 18:46:32 +0900 Subject: [PATCH] Further unit tests: getVarId() --- test/net/jaekl/cfb/store/DbStoreTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/net/jaekl/cfb/store/DbStoreTest.java b/test/net/jaekl/cfb/store/DbStoreTest.java index 98656c8..9c6c117 100644 --- a/test/net/jaekl/cfb/store/DbStoreTest.java +++ b/test/net/jaekl/cfb/store/DbStoreTest.java @@ -292,4 +292,16 @@ public class DbStoreTest { assertEquals(StoreException.Type.INVALID_VAR_ID, exc.getType()); } } + + @Test + public void testGetVarId_notFoundIsStored() throws SQLException, TypeMismatchException { + LocalVariable var = new LocalVariable(2345678901L, "VariableNameDoesNotYetExist", "VARIABLE_READ"); + + Long varId = m_store.getVarId(var); + assertNotNull(varId); + assertTrue(varId.longValue() > 0); + + Long secondVarId = m_store.getVarId(var); + assertEquals(varId, secondVarId); + } } -- 2.39.2