EpisodicMemoryDatabase extends AbstractSoarDatabase { public void prepare() throws SoarException, IOException { super.prepare(); pool_find_edge_queries = new SoarPreparedStatement[][] { { pool_find_edge_queries_0_0, pool_find_edge_queries_0_1 }, { pool_find_edge_queries_1_0, pool_find_edge_queries_1_1 } }; pool_find_interval_queries = new SoarPreparedStatement[][][] { { { pool_find_interval_queries_0_0_0, pool_find_interval_queries_0_0_1, pool_find_interval_queries_0_0_2 }, { pool_find_interval_queries_0_1_0, pool_find_interval_queries_0_1_1, pool_find_interval_queries_0_1_2 } }, { { pool_find_interval_queries_1_0_0, pool_find_interval_queries_1_0_1, pool_find_interval_queries_1_0_2 }, { pool_find_interval_queries_1_1_0, pool_find_interval_queries_1_1_1, pool_find_interval_queries_1_1_2 } }, }; pool_find_lti_queries = new SoarPreparedStatement[][] { { pool_find_lti_queries_0_0, pool_find_lti_queries_0_1, pool_find_lti_queries_0_2 }, { pool_find_lti_queries_1_0, pool_find_lti_queries_1_1, pool_find_lti_queries_1_2 } }; } EpisodicMemoryDatabase(String driver, Connection db); void prepare(); void dropEpmemTables(); boolean backupDb(String fileName); public SoarPreparedStatement[][] pool_find_edge_queries; public SoarPreparedStatement[][][] pool_find_interval_queries; public SoarPreparedStatement[][] pool_find_lti_queries; }
@Test public void testPreparesStatements() throws Exception { final EpisodicMemoryDatabase emdb = new EpisodicMemoryDatabase("org.sqlite.JDBC", db); emdb.structure(); emdb.prepare(); assertNotNull(emdb.begin); assertNotNull(emdb.commit); assertNotNull(emdb.rollback); assertNotNull(emdb.var_get); assertNotNull(emdb.var_set); assertNotNull(emdb.rit_add_left); assertNotNull(emdb.rit_truncate_left); assertNotNull(emdb.rit_add_right); assertNotNull(emdb.rit_truncate_right); assertNotNull(emdb.hash_rev_int); assertNotNull(emdb.hash_rev_float); assertNotNull(emdb.hash_rev_str); assertNotNull(emdb.hash_get_int); assertNotNull(emdb.hash_get_float); assertNotNull(emdb.hash_get_str); assertNotNull(emdb.hash_get_type); assertNotNull(emdb.hash_add_type); assertNotNull(emdb.hash_add_int); assertNotNull(emdb.hash_add_float); assertNotNull(emdb.hash_add_str); assertNotNull(emdb.add_node); assertNotNull(emdb.add_time); assertNotNull(emdb.add_epmem_wmes_constant_now); assertNotNull(emdb.delete_epmem_wmes_constant_now); assertNotNull(emdb.add_epmem_wmes_constant_point); assertNotNull(emdb.add_epmem_wmes_constant_range); assertNotNull(emdb.add_epmem_wmes_constant); assertNotNull(emdb.find_epmem_wmes_constant); assertNotNull(emdb.add_epmem_wmes_identifier_now); assertNotNull(emdb.delete_epmem_wmes_identifier_now); assertNotNull(emdb.add_epmem_wmes_identifier_point); assertNotNull(emdb.add_epmem_wmes_identifier_range); assertNotNull(emdb.add_epmem_wmes_identifier); assertNotNull(emdb.find_epmem_wmes_identifier); assertNotNull(emdb.find_epmem_wmes_identifier_shared); assertNotNull(emdb.valid_episode); assertNotNull(emdb.next_episode); assertNotNull(emdb.prev_episode); assertNotNull(emdb.get_wmes_with_constant_values); assertNotNull(emdb.get_wmes_with_constant_values); assertNotNull(emdb.promote_id); assertNotNull(emdb.find_lti); assertNotNull(emdb.find_lti_promotion_time); assertNotNull(emdb.update_epmem_wmes_identifier_last_episode_id); }