-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Description
The following defects were found while implementing test cases for JCodeAnalyzer, JavaAnalysis, and JavaSitter. It look like several of them have a common cause so I didn't feel they needed separate bug reports. I created checkboxes for the issues so that you can keep track of them as you fix them.
Note: You need to accept this Pull Request in order to see the test cases: Created test cases to bring JCodeAnalyzer, JavaAnalysis, and JavaSitter to 90% test coverage #75
JCodeAnalyzer issues
- Calling
JCodeanalyzer.get_all_callers()with the parameterusing_symbol_table=Truereturns:
$ pytest -x tests/analysis/java/test_jcodeanalyzer.py -k test_get_all_callers
FAILED tests/analysis/java/test_jcodeanalyzer.py::::It should return all of the callers - TypeError: JavaSitter.get_calling_lines() missing 1 required positional argument: 'is_target_method_a_constructor'
- Calling
JCodeanalyzer.get_all_callees()with the parameterusing_symbol_table=Truereturns:
$ pytest -x tests/analysis/java/test_jcodeanalyzer.py -k test_get_all_callees
FAILED tests/analysis/java/test_jcodeanalyzer.py::::It should return all of the callees - TypeError: JavaSitter.get_calling_lines() missing 1 required positional argument: 'is_target_method_a_constructor'
- Calling
JCodeanalyzer.get_class_call_graph_using_symbol_table()for a class like "com.ibm.websphere.samples.daytrader.impl.direct.AsyncOrder" with the method "run()" returns the following error:
$ pytest -x tests/analysis/java/test_jcodeanalyzer.py -k test_get_class_call_graph_using_symbol_table
FAILED tests/analysis/java/test_jcodeanalyzer.py::::It should return the call graph using the symbol table - TypeError: JavaSitter.get_calling_lines() missing 1 required positional argument: 'is_target_method_a_constructor'
- Calling
JCodeanalyzer.get_all_nested_classes()for a class likecom.ibm.websphere.samples.daytrader.util.KeyBlockthat has 1 nested class fails with:
$ pytest -x tests/analysis/java/test_jcodeanalyzer.py -k test_get_all_nested_classes
FAILED tests/analysis/java/test_jcodeanalyzer.py::::It should return all of the nested classes for a class - assert 0 == 1
JavaAnalysis issues
- Calling
JavaAnalysis.get_callers()on "com.ibm.websphere.samples.daytrader.util.Log.log(String)" with parameterusing_symbol_table=Truereturns the following error:
$ pytest -x tests/analysis/java/test_java_analysis.py -k test_get_callers
FAILED tests/analysis/java/test_java_analysis.py::::It should return the callers - TypeError: JavaSitter.get_calling_lines() missing 1 required positional argument: 'is_target_method_a_constructor'
- Calling
JavaAnalysis.get_nested_classes()on "com.ibm.websphere.samples.daytrader.web.websocket.ActionMessage.doDecoding(String)" with parameterusing_symbol_table=Truereturns the following error:
$ pytest -x tests/analysis/java/test_java_analysis.py -k test_get_callees
FAILED tests/analysis/java/test_java_analysis.py::::It should return the callees - TypeError: JavaSitter.get_calling_lines() missing 1 required positional argument: 'is_target_method_a_constructor'
- Calling
JavaAnalysis.get_callers()for a class likecom.ibm.websphere.samples.daytrader.util.KeyBlockthat has 1 nested class fails with:
$ pytest -x tests/analysis/java/test_java_analysis.py -k test_get_nested_classes
FAILED tests/analysis/java/test_java_analysis.py::::It should return the nested classes for a class - assert 0 == 1
- Calling
JavaAnalysis.get_class_call_graph()withusing_symbol_table=Truereturns the following error:
$ pytest -x tests/analysis/java/test_java_analysis.py -k test_get_class_call_graph
FAILED tests/analysis/java/test_java_analysis.py::::It should return the class call graph - TypeError: JavaSitter.get_calling_lines() missing 1 required positional argument: 'is_target_method_a_constructor'
- Calling
JavaAnalysis.test_remove_all_comments()is in conflict. It requires Treesitter but the JCodeanalyzer does not implement it:
$ pytest -x tests/analysis/java/test_java_analysis.py -k test_remove_all_comments
FAILED tests/analysis/java/test_java_analysis.py::::It should remove all comments - NotImplementedError: Support for this functionality has not been implemented yet.
- Calling
JavaAnalysis.get_methods_with_annotations()is in conflict. It requires Treesitter but the JCodeanalyzer does not implement it:
$ pytest -x tests/analysis/java/test_java_analysis.py -k test_get_methods_with_annotations
FAILED tests/analysis/java/test_java_analysis.py::::It should return methods with annotations - NotImplementedError: Support for this functionality has not been implemented yet.
- Calling
JavaAnalysis.get_test_methods()is in conflict. It requires Treesitter but the JCodeanalyzer does not implement it:
$ pytest -x tests/analysis/java/test_java_analysis.py -k test_get_test_methods
FAILED tests/analysis/java/test_java_analysis.py::::It should return test methods - NotImplementedError: Support for this functionality has not been implemented yet.
- Calling
JavaAnalysis.get_calling_lines()is calling a methodget_calling_linesonJCodeAnalyzerthat doesn't exists and returns the following error:
$ pytest -x tests/analysis/java/test_java_analysis.py -k test_get_calling_lines
FAILED tests/analysis/java/test_java_analysis.py::::It should return calling lines - AttributeError: 'JCodeanalyzer' object has no attribute 'get_calling_lines'
- Calling
JavaAnalysis.get_call_targets()is calling a methodget_call_targetsonJCodeAnalyzerthat doesn't exists and returns the following error:
$ pytest -x tests/analysis/java/test_java_analysis.py -k test_get_call_targets
FAILED tests/analysis/java/test_java_analysis.py::::It should return calling targets - AttributeError: 'JCodeanalyzer' object has no attribute 'get_call_targets'
JavaSitter issues
- Calling
JavaSitter.get_superclass()passing in the source code forcom.ibm.websphere.samples.daytrader.util.KeyBlockreturns the following error instead ofAbstractSequentialList:
$ pytest -x tests/analysis/java/test_java_sitter.py -k test_get_superclass
FAILED tests/analysis/java/test_java_sitter.py::::It should return the superclass name - AssertionError: assert '' == 'AbstractSequentialList'
- Calling
JavaSitter.safe_ascend()passing in a child node and anascend_countof 1 returns aValueError. Shouldn't it return the parent of the child? I believe the logic should test forascend_count == 0before it tests fornode.parent is None:
$ pytest -x tests/analysis/java/test_java_sitter.py -k test_safe_ascend
FAILED tests/analysis/java/test_java_sitter.py::::It should safely ascend a node - ValueError: Node has no parent.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels