You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generating test classes for a Web application with Servlets fails with the following exception:
Caused by: java.util.MissingResourceException: Can't find bundle for base name javax.servlet.LocalStrings, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1581)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1396)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:782)
at javax.servlet.GenericServlet.<clinit>(GenericServlet.java:95)
... 6 more
Attachments
To help us diagnose the failure, please add these attachments to the issue, as appropriate:
The toml file containing the configuration information used
❯ tkltest \
--config-file ~/Workspaces/ws-konveyor/sample-apps/migration-sample-app/simple-sample-web/tkltest_config.toml \
generate \
ctd-amplified
[tkltest|11:40:57.965] Loading config file /home/rmarting/Workspaces/ws-konveyor/sample-apps/migration-sample-app/simple-sample-web/tkltest_config.toml
[tkltest|11:40:57.971] Computing coverage goals using CTD
* CTD interaction level: 1
* Total number of classes: 3
* Targeting 3 classes
* Created a total of 5 test combinations for 5 target methods of 3 target classes
[tkltest|11:40:58.686] Computing test plans with CTD took 0.71 seconds
[tkltest|11:40:58.686] Generating basic block test sequences using CombinedTestGenerator
[tkltest|11:40:58.686] Test generator output will be written to simple-sample-web_CombinedTestGenerator_output.log
[tkltest|11:41:27.769] Generating basic block test sequences with CombinedTestGenerator took 29.08 seconds
[tkltest|11:41:27.769] Extending sequences to reach coverage goals and generating junit tests
* Read test plans for: 3 classes, 5 methods
* Read 441 base test sequences
* Starting sequence parsing
* Full:434 Part:0 Skip:0 Excp:7
* Class sequence pool: 2 classes, 2 sequences
* Method sequence pool: 2 methods, 60 sequences
[tkltest|11:41:38.013] ERROR: Extending sequences and generating JUnit tests failed with return code 1: Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at randoop.types.Type.forName(Type.java:73)
at org.konveyor.tackle.testgen.core.extender.TestSequenceExtender.augmentClassSequencePool(TestSequenceExtender.java:1649)
at org.konveyor.tackle.testgen.core.extender.TestSequenceExtender.<init>(TestSequenceExtender.java:262)
at org.konveyor.tackle.testgen.core.extender.TestSequenceExtender.main(TestSequenceExtender.java:1856)
Caused by: java.util.MissingResourceException: Can't find bundle for base name javax.servlet.LocalStrings, locale en_US at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1581) at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1396) at java.util.ResourceBundle.getBundle(ResourceBundle.java:782) at javax.servlet.GenericServlet.<clinit>(GenericServlet.java:95) ... 6 more
Source code of the application available here, analyzing the Web module of the application.
Content of tkltest_classpath.txt file identified in app_classpath_file option:
@rmarting I added the dependency below to the pom.xml of simple-sample-web, then recompiled and got this jar in my maven repo: javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar, which I added to the classpath.txt file.
With the additional jar I was able to complete generate and execute commands successfully. If I turn on the augmentation flag, tackle-test reaches 57.5% instruction coverage:
[tkltest|15:00:46.144] Final test-suite coverage rate: instruction=131/228(57.5%), branch=4/8(50.0%), line=36/59(61.0%), method=12/13(92.3%)
coverage_efficiency=0.05223285486443381 (11 test methods)
Describe the bug
Generating test classes for a Web application with Servlets fails with the following exception:
Attachments
To help us diagnose the failure, please add these attachments to the issue, as appropriate:
Source code of the application available here, analyzing the Web module of the application.
Content of
tkltest_classpath.txt
file identified inapp_classpath_file
option:generate
command:simple-sample-web_ctd_models_and_test_plans.json
Environment information
❯ cat /etc/redhat-release Fedora release 35 (Thirty Five) ❯ uname -a Linux redhat 5.14.18-300.fc35.x86_64 #1 SMP Fri Nov 12 16:43:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: