@@ -81,11 +81,14 @@ def test_agent_captures_invocations(self, compiled_workload: Path, trace_db: Pat
8181 conn = sqlite3 .connect (str (trace_db ))
8282 try :
8383 rows = conn .execute ("SELECT function, classname, descriptor, length(args) FROM function_calls" ).fetchall ()
84- assert len (rows ) >= 2 , f"Expected at least 2 captured invocations, got { len (rows )} "
84+ assert len (rows ) >= 5 , f"Expected at least 5 captured invocations, got { len (rows )} "
8585
8686 # Check that specific methods were captured
8787 functions = {row [0 ] for row in rows }
8888 assert "computeSum" in functions
89+ assert "repeatString" in functions
90+ assert "filterEvens" in functions
91+ assert "instanceMethod" in functions
8992
9093 # Verify all rows have non-empty args blobs
9194 for row in rows :
@@ -94,7 +97,7 @@ def test_agent_captures_invocations(self, compiled_workload: Path, trace_db: Pat
9497 # Verify metadata
9598 metadata = dict (conn .execute ("SELECT key, value FROM metadata" ).fetchall ())
9699 assert "totalCaptures" in metadata
97- assert int (metadata ["totalCaptures" ]) >= 2
100+ assert int (metadata ["totalCaptures" ]) >= 5
98101 finally :
99102 conn .close ()
100103
@@ -133,7 +136,7 @@ def test_max_function_count_limit(self, compiled_workload: Path, trace_db: Path)
133136
134137 conn = sqlite3 .connect (str (trace_db ))
135138 try :
136- # computeSum is called 2 times (direct calls in main )
139+ # computeSum is called 4 times (2 direct + 2 from instanceMethod )
137140 compute_count = conn .execute (
138141 "SELECT COUNT(*) FROM function_calls WHERE function = 'computeSum'"
139142 ).fetchone ()[0 ]
@@ -196,6 +199,7 @@ def test_generates_test_files(self, compiled_workload: Path, trace_db: Path, tmp
196199 assert "import org.junit.jupiter.api.Test;" in content
197200 assert "ReplayHelper" in content
198201 assert "replay_computeSum_0" in content
202+ assert "replay_repeatString_0" in content
199203
200204 def test_metadata_parsing (self , compiled_workload : Path , trace_db : Path , tmp_path : Path ) -> None :
201205 """Test that metadata comments are correctly parsed from generated tests."""
@@ -292,6 +296,7 @@ def test_full_trace_and_replay_generation(self, compiled_workload: Path, tmp_pat
292296 assert len (workload_files ) == 1
293297 content = workload_files [0 ].read_text (encoding = "utf-8" )
294298 assert "replay_computeSum" in content
299+ assert "replay_instanceMethod" in content
295300
296301 def test_package_detection (self ) -> None :
297302 """Test that package detection finds Java packages from source files."""
0 commit comments