From: Chris Jaekl Date: Wed, 30 Dec 2015 09:46:32 +0000 (+0900) Subject: Further unit tests: getVarId() X-Git-Url: https://jaekl.net/gitweb/?a=commitdiff_plain;h=0e31a70d77e7f8ff71484a18e9d0ced52183686a;p=cfb.git Further unit tests: getVarId() --- 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); + } }