Skip to content

Commit 853e6bb

Browse files
committed
Added 24 test cases and 64% code coverage for codeanalyzer.py
Signed-off-by: John Rofrano <johnnyroy@johnrofrano.com>
1 parent d9e329a commit 853e6bb

3 files changed

Lines changed: 705 additions & 3 deletions

File tree

cldk/analysis/java/codeanalyzer/codeanalyzer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def _init_codeanalyzer(self, analysis_level=1) -> JApplication:
237237
data = json.load(f)
238238
return JApplication(**data)
239239

240-
def _codeanalyzer_single_file(self):
240+
def _codeanalyzer_single_file(self) -> JApplication:
241241
"""Invokes codeanalyzer in a single file mode.
242242
243243
Returns:

tests/analysis/java/test_java.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
from pdb import set_trace
1+
"""
2+
Java Tests
3+
"""
4+
25
from cldk import CLDK
36
from typing import List, Tuple
47
from cldk.analysis import AnalysisLevel
58
from cldk.models.java.models import JMethodDetail
69

710

811
def test_get_symbol_table_is_not_null(test_fixture, codeanalyzer_jar_path):
9-
# Initialize the CLDK object with the project directory, language, and analysis_backend.
12+
"""It should return a symbol table that is not null"""
13+
# Initialize the CLDK object with the project directory, language, and analysis_backend
1014
cldk = CLDK(language="java")
1115
analysis = cldk.analysis(
1216
project_path=test_fixture,
@@ -19,6 +23,7 @@ def test_get_symbol_table_is_not_null(test_fixture, codeanalyzer_jar_path):
1923

2024

2125
def test_get_class_call_graph(test_fixture, codeanalyzer_jar_path):
26+
"""It should return the class call graph"""
2227
# Initialize the CLDK object with the project directory, language, and analysis_backend.
2328
cldk = CLDK(language="java")
2429

0 commit comments

Comments
 (0)