|
1 | 1 | package de.fraunhofer.iem.swan; |
2 | 2 |
|
3 | 3 | import de.fraunhofer.iem.swan.cli.SwanOptions; |
4 | | -import de.fraunhofer.iem.swan.data.Method; |
5 | 4 | import de.fraunhofer.iem.swan.features.FeatureSetSelector; |
6 | 5 | import de.fraunhofer.iem.swan.features.IFeatureSet; |
7 | 6 | import de.fraunhofer.iem.swan.io.dataset.Dataset; |
8 | 7 | import de.fraunhofer.iem.swan.io.dataset.SrmList; |
9 | 8 | import de.fraunhofer.iem.swan.io.dataset.SrmListUtils; |
| 9 | +import de.fraunhofer.iem.swan.io.doc.JavadocProcessor; |
10 | 10 | import de.fraunhofer.iem.swan.model.ModelEvaluator; |
11 | 11 | import de.fraunhofer.iem.swan.soot.Soot; |
12 | 12 | import de.fraunhofer.iem.swan.util.Util; |
13 | 13 | import org.slf4j.Logger; |
14 | 14 | import org.slf4j.LoggerFactory; |
15 | 15 |
|
16 | 16 | import java.io.IOException; |
17 | | -import java.util.Set; |
18 | 17 |
|
19 | 18 | /** |
20 | 19 | * Runner for SWAN |
@@ -56,9 +55,12 @@ public void run() throws IOException, InterruptedException { |
56 | 55 |
|
57 | 56 | //Load methods from the test set |
58 | 57 | dataset.setTest(new SrmList(options.getTestDataDir())); |
59 | | - Set<Method> testMethods = soot.loadMethods(dataset.getTest().getTestClasses()); |
60 | | - dataset.getTest().setMethods(testMethods); |
61 | | - logger.info("Loaded {} methods from {}", testMethods.size(), options.getTestDataDir()); |
| 58 | + dataset.getTest().setMethods(soot.loadMethods(dataset.getTest().getTestClasses())); |
| 59 | + |
| 60 | + //Extract doc comments and add to test set, if option is selected |
| 61 | + JavadocProcessor javadocProcessor = new JavadocProcessor(options.getTestDataSourceDir(), options.getOutputDir()); |
| 62 | + javadocProcessor.run(dataset.getTestMethods(), options.getFeatureSet()); |
| 63 | + logger.info("Loaded {} methods from {}", dataset.getTestMethods().size(), options.getTestDataDir()); |
62 | 64 |
|
63 | 65 | //Initialize and populate features |
64 | 66 | FeatureSetSelector featureSetSelector = new FeatureSetSelector(); |
|
0 commit comments