]> jaekl.net Git - cfb.git/commitdiff
Further unit tests: getVarId()
authorChris Jaekl <cejaekl@yahoo.com>
Wed, 30 Dec 2015 09:46:32 +0000 (18:46 +0900)
committerChris Jaekl <cejaekl@yahoo.com>
Wed, 30 Dec 2015 09:46:32 +0000 (18:46 +0900)
test/net/jaekl/cfb/store/DbStoreTest.java

index 98656c81872c42af2a7a6466e5be6021d4ecc4c9..9c6c1175c0b56098d4544901201d87bb59936db4 100644 (file)
@@ -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);
+       }
 }