X-Git-Url: http://jaekl.net/gitweb/?p=cfb.git;a=blobdiff_plain;f=test%2Fnet%2Fjaekl%2Fcfb%2Fstore%2FDbStoreTest.java;fp=test%2Fnet%2Fjaekl%2Fcfb%2Fstore%2FDbStoreTest.java;h=98656c81872c42af2a7a6466e5be6021d4ecc4c9;hp=5c66c225fd38107d7e866d826bf43be269a68616;hb=7ac6be132ecd6872971a1de56f033b4434d3173a;hpb=4624f0fed5347f4f5fd62a2225c789d0f9ea6b6f diff --git a/test/net/jaekl/cfb/store/DbStoreTest.java b/test/net/jaekl/cfb/store/DbStoreTest.java index 5c66c22..98656c8 100644 --- a/test/net/jaekl/cfb/store/DbStoreTest.java +++ b/test/net/jaekl/cfb/store/DbStoreTest.java @@ -23,6 +23,7 @@ import net.jaekl.cfb.db.driver.ConnectionMock; import net.jaekl.cfb.db.driver.DbDriverMock; import net.jaekl.cfb.util.Command; import net.jaekl.cfb.xml.BugCollection; +import net.jaekl.cfb.xml.LocalVariable; import net.jaekl.cfb.xml.MessagesXmlData; import org.junit.Before; @@ -274,4 +275,21 @@ public class DbStoreTest { assertEquals(StoreException.Type.INVALID_LOC_ID, exc.getType()); } } + + @Test + public void testGetVar_nullReturnsNull() throws SQLException, TypeMismatchException, StoreException { + LocalVariable var = m_store.getVar(null); + assertNull(var); + } + + @Test + public void testGetVar_invalidId() throws SQLException, TypeMismatchException { + try { + m_store.getVar(Long.valueOf(-3)); + fail("Should have thrown a StoreException"); + } + catch (StoreException exc) { + assertEquals(StoreException.Type.INVALID_VAR_ID, exc.getType()); + } + } }