@@ -54,8 +54,8 @@ void testAllPlaceholderSkips() throws Exception {
5454 KryoPlaceholder .create (new Object (), "unserializable" , "root" )
5555 );
5656
57- insertRow (originalDb , "iter_1_0" , 1 , placeholderBytes );
58- insertRow (candidateDb , "iter_1_1" , 1 , placeholderBytes );
57+ insertRow (originalDb , 1 , 1 , placeholderBytes );
58+ insertRow (candidateDb , 1 , 1 , placeholderBytes );
5959
6060 String json = Comparator .compareDatabases (originalDb .toString (), candidateDb .toString ());
6161 Map <String , Object > result = parseJson (json );
@@ -74,8 +74,8 @@ void testDeserializationErrorSkipped() throws Exception {
7474 // Insert corrupted byte data that will fail Kryo deserialization
7575 byte [] corruptedBytes = new byte []{0x01 , 0x02 , 0x03 , (byte ) 0xFF , (byte ) 0xFE };
7676
77- insertRow (originalDb , "iter_1_0" , 1 , corruptedBytes );
78- insertRow (candidateDb , "iter_1_1" , 1 , corruptedBytes );
77+ insertRow (originalDb , 1 , 1 , corruptedBytes );
78+ insertRow (candidateDb , 1 , 1 , corruptedBytes );
7979
8080 String json = Comparator .compareDatabases (originalDb .toString (), candidateDb .toString ());
8181 Map <String , Object > result = parseJson (json );
@@ -97,12 +97,12 @@ void testMixedRealAndPlaceholder() throws Exception {
9797 KryoPlaceholder .create (new Object (), "unserializable" , "root" )
9898 );
9999
100- insertRow (originalDb , "iter_1_0" , 1 , realBytes1 );
101- insertRow (candidateDb , "iter_1_1" , 1 , realBytes1 );
102- insertRow (originalDb , "iter_2_0" , 1 , realBytes2 );
103- insertRow (candidateDb , "iter_2_1" , 1 , realBytes2 );
104- insertRow (originalDb , "iter_3_0" , 1 , placeholderBytes );
105- insertRow (candidateDb , "iter_3_1" , 1 , placeholderBytes );
100+ insertRow (originalDb , 1 , 1 , realBytes1 );
101+ insertRow (candidateDb , 1 , 1 , realBytes1 );
102+ insertRow (originalDb , 2 , 1 , realBytes2 );
103+ insertRow (candidateDb , 2 , 1 , realBytes2 );
104+ insertRow (originalDb , 3 , 1 , placeholderBytes );
105+ insertRow (candidateDb , 3 , 1 , placeholderBytes );
106106
107107 String json = Comparator .compareDatabases (originalDb .toString (), candidateDb .toString ());
108108 Map <String , Object > result = parseJson (json );
@@ -121,10 +121,10 @@ void testNormalHappyPath() throws Exception {
121121 byte [] bytes1 = Serializer .serialize (100 );
122122 byte [] bytes2 = Serializer .serialize ("world" );
123123
124- insertRow (originalDb , "iter_1_0" , 1 , bytes1 );
125- insertRow (candidateDb , "iter_1_1" , 1 , bytes1 );
126- insertRow (originalDb , "iter_2_0" , 1 , bytes2 );
127- insertRow (candidateDb , "iter_2_1" , 1 , bytes2 );
124+ insertRow (originalDb , 1 , 1 , bytes1 );
125+ insertRow (candidateDb , 1 , 1 , bytes1 );
126+ insertRow (originalDb , 2 , 1 , bytes2 );
127+ insertRow (candidateDb , 2 , 1 , bytes2 );
128128
129129 String json = Comparator .compareDatabases (originalDb .toString (), candidateDb .toString ());
130130 Map <String , Object > result = parseJson (json );
@@ -144,8 +144,8 @@ void testNormalMismatch() throws Exception {
144144 byte [] origBytes = Serializer .serialize (42 );
145145 byte [] candBytes = Serializer .serialize (99 );
146146
147- insertRow (originalDb , "iter_1_0" , 1 , origBytes );
148- insertRow (candidateDb , "iter_1_1" , 1 , candBytes );
147+ insertRow (originalDb , 1 , 1 , origBytes );
148+ insertRow (candidateDb , 1 , 1 , candBytes );
149149
150150 String json = Comparator .compareDatabases (originalDb .toString (), candidateDb .toString ());
151151 Map <String , Object > result = parseJson (json );
@@ -161,8 +161,8 @@ void testVoidMethodsBothNull() throws Exception {
161161 createTestDb (candidateDb );
162162
163163 // Insert rows with NULL return_value (void methods)
164- insertRow (originalDb , "iter_1_0" , 1 , null );
165- insertRow (candidateDb , "iter_1_1" , 1 , null );
164+ insertRow (originalDb , 1 , 1 , null );
165+ insertRow (candidateDb , 1 , 1 , null );
166166
167167 String json = Comparator .compareDatabases (originalDb .toString (), candidateDb .toString ());
168168 Map <String , Object > result = parseJson (json );
@@ -178,7 +178,7 @@ void testOneSideEmpty() throws Exception {
178178 createTestDb (candidateDb );
179179
180180 byte [] bytes = Serializer .serialize (42 );
181- insertRow (originalDb , "iter_1_0" , 1 , bytes );
181+ insertRow (originalDb , 1 , 1 , bytes );
182182 // candidateDb has no rows
183183
184184 String json = Comparator .compareDatabases (originalDb .toString (), candidateDb .toString ());
@@ -216,21 +216,29 @@ private void createTestDb(Path dbPath) throws Exception {
216216 try (Connection conn = DriverManager .getConnection (url );
217217 Statement stmt = conn .createStatement ()) {
218218 stmt .execute ("CREATE TABLE IF NOT EXISTS test_results ("
219- + "iteration_id TEXT NOT NULL, "
220- + "loop_index INTEGER NOT NULL, "
219+ + "test_module_path TEXT, "
220+ + "test_class_name TEXT, "
221+ + "test_function_name TEXT, "
222+ + "function_getting_tested TEXT, "
223+ + "loop_index INTEGER, "
224+ + "iteration_id INTEGER, "
225+ + "runtime INTEGER, "
221226 + "return_value BLOB, "
222- + "PRIMARY KEY (iteration_id, loop_index) )" );
227+ + "verification_type TEXT )" );
223228 }
224229 }
225230
226- private void insertRow (Path dbPath , String iterationId , int loopIndex , byte [] returnValue ) throws Exception {
231+ private void insertRow (Path dbPath , int iterationId , int loopIndex , byte [] returnValue ) throws Exception {
227232 String url = "jdbc:sqlite:" + dbPath ;
228233 try (Connection conn = DriverManager .getConnection (url );
229234 PreparedStatement ps = conn .prepareStatement (
230- "INSERT INTO test_results (iteration_id, loop_index, return_value) VALUES (?, ?, ?)" )) {
231- ps .setString (1 , iterationId );
232- ps .setInt (2 , loopIndex );
233- ps .setBytes (3 , returnValue );
235+ "INSERT INTO test_results (test_module_path, test_class_name, test_function_name, iteration_id, loop_index, return_value) VALUES (?, ?, ?, ?, ?, ?)" )) {
236+ ps .setString (1 , "com.example" );
237+ ps .setString (2 , "TestClass" );
238+ ps .setString (3 , "testMethod" );
239+ ps .setInt (4 , iterationId );
240+ ps .setInt (5 , loopIndex );
241+ ps .setBytes (6 , returnValue );
234242 ps .executeUpdate ();
235243 }
236244 }
0 commit comments