|
3 | 3 | import es.us.isa.restest.configuration.pojos.TestConfigurationObject;
|
4 | 4 | import es.us.isa.restest.coverage.CoverageGatherer;
|
5 | 5 | import es.us.isa.restest.coverage.CoverageMeter;
|
6 |
| -import es.us.isa.restest.generators.ARTestCaseGenerator; |
7 |
| -import es.us.isa.restest.generators.AbstractTestCaseGenerator; |
8 |
| -import es.us.isa.restest.generators.ConstraintBasedTestCaseGenerator; |
9 |
| -import es.us.isa.restest.generators.FuzzingTestCaseGenerator; |
10 |
| -import es.us.isa.restest.generators.RandomTestCaseGenerator; |
| 6 | +import es.us.isa.restest.util.generators.ARTestCaseGenerator; |
| 7 | +import es.us.isa.restest.util.generators.AbstractTestCaseGenerator; |
| 8 | +import es.us.isa.restest.util.generators.ConstraintBasedTestCaseGenerator; |
| 9 | +import es.us.isa.restest.util.generators.FuzzingTestCaseGenerator; |
| 10 | +import es.us.isa.restest.util.generators.RandomTestCaseGenerator; |
11 | 11 | import es.us.isa.restest.reporting.AllureReportManager;
|
12 | 12 | import es.us.isa.restest.reporting.StatsReportManager;
|
13 | 13 | import es.us.isa.restest.runners.RESTestRunner;
|
14 | 14 | import es.us.isa.restest.specification.OpenAPISpecification;
|
15 |
| -import es.us.isa.restest.testcases.writers.IWriter; |
16 |
| -import es.us.isa.restest.testcases.writers.RESTAssuredWriter; |
| 15 | +import es.us.isa.restest.writers.IWriter; |
| 16 | +import es.us.isa.restest.writers.restassured.RESTAssuredWriter; |
17 | 17 | import es.us.isa.restest.util.*;
|
18 | 18 | import org.apache.logging.log4j.Level;
|
19 | 19 | import org.apache.logging.log4j.LogManager;
|
@@ -72,15 +72,6 @@ public class TestGenerationAndExecution {
|
72 | 72 | private static String similarityMetric; // The algorithm to measure the similarity between test cases
|
73 | 73 | private static Integer numberCandidates; // Number of candidate test cases per AR iteration
|
74 | 74 |
|
75 |
| - // ARTE |
76 |
| - private static Boolean learnRegex; // Set to 'true' if you want RESTest to automatically generate Regular expressions that filter the semantically generated input data |
77 |
| - private static boolean secondPredicateSearch; |
78 |
| - private static int maxNumberOfPredicates; // MaxNumberOfPredicates = AdditionalPredicates + 1 |
79 |
| - private static int minimumValidAndInvalidValues; |
80 |
| - private static String metricToUse; |
81 |
| - private static Double minimumValueOfMetric; |
82 |
| - private static int maxNumberOfTriesToGenerateRegularExpression; |
83 |
| - |
84 | 75 | private static Logger logger = LogManager.getLogger(TestGenerationAndExecution.class.getName());
|
85 | 76 |
|
86 | 77 | public static void main(String[] args) throws RESTestException {
|
@@ -262,9 +253,7 @@ private static StatsReportManager createStatsReportManager() {
|
262 | 253 | CoverageMeter coverageMeter = enableInputCoverage || enableOutputCoverage ? new CoverageMeter(new CoverageGatherer(spec)) : null;
|
263 | 254 |
|
264 | 255 | return new StatsReportManager(testDataDir, coverageDataDir, enableCSVStats, enableInputCoverage,
|
265 |
| - enableOutputCoverage, coverageMeter, secondPredicateSearch, maxNumberOfPredicates, |
266 |
| - minimumValidAndInvalidValues, metricToUse, minimumValueOfMetric, |
267 |
| - maxNumberOfTriesToGenerateRegularExpression); |
| 256 | + enableOutputCoverage, coverageMeter); |
268 | 257 | }
|
269 | 258 |
|
270 | 259 | private static void generateTimeReport(Integer iterations) {
|
@@ -394,35 +383,7 @@ private static void readParameterValues() {
|
394 | 383 | faultyDependencyRatio = Float.parseFloat(readParameterValue("faulty.dependency.ratio"));
|
395 | 384 | logger.info("Faulty dependency ratio: {}", faultyDependencyRatio);
|
396 | 385 |
|
397 |
| - // ARTE |
398 |
| - if (readParameterValue("learnRegex") != null) |
399 |
| - learnRegex = Boolean.parseBoolean(readParameterValue("learnRegex")); |
400 |
| - logger.info("Learn Regular expressions: {}", learnRegex); |
401 |
| - |
402 |
| - if (readParameterValue("secondPredicateSearch") != null) |
403 |
| - secondPredicateSearch = Boolean.parseBoolean(readParameterValue("secondPredicateSearch")); |
404 |
| - logger.info("Second Predicate Search: {}", secondPredicateSearch); |
405 |
| - |
406 |
| - if (readParameterValue("maxNumberOfPredicates") != null) |
407 |
| - maxNumberOfPredicates = Integer.parseInt(readParameterValue("maxNumberOfPredicates")); |
408 |
| - logger.info("Maximum number of predicates: {}", maxNumberOfPredicates); |
409 |
| - |
410 |
| - if (readParameterValue("minimumValidAndInvalidValues") != null) |
411 |
| - minimumValidAndInvalidValues = Integer.parseInt(readParameterValue("minimumValidAndInvalidValues")); |
412 |
| - logger.info("Minimum valid and invalid values: {}", minimumValidAndInvalidValues); |
413 | 386 |
|
414 |
| - if (readParameterValue("metricToUse") != null) |
415 |
| - metricToUse = readParameterValue("metricToUse"); |
416 |
| - logger.info("Metric to use: {}", metricToUse); |
417 |
| - |
418 |
| - if (readParameterValue("minimumValueOfMetric") != null) |
419 |
| - minimumValueOfMetric = Double.parseDouble(readParameterValue("minimumValueOfMetric")); |
420 |
| - logger.info("Minimum value of metric: {}", minimumValueOfMetric); |
421 |
| - |
422 |
| - if (readParameterValue("maxNumberOfTriesToGenerateRegularExpression") != null) |
423 |
| - maxNumberOfTriesToGenerateRegularExpression = Integer.parseInt(readParameterValue("maxNumberOfTriesToGenerateRegularExpression")); |
424 |
| - logger.info("Maximum number of tries to generate a regular expression: {}", maxNumberOfTriesToGenerateRegularExpression); |
425 |
| - |
426 | 387 | }
|
427 | 388 |
|
428 | 389 | // Read the parameter value from: 1) CLI; 2) the local .properties file; 3) the global .properties file (config.properties)
|
|
0 commit comments