当前位置: 首页>>代码示例>>Java>>正文


Java TestUtils.listFiles方法代码示例

本文整理汇总了Java中osmo.common.TestUtils.listFiles方法的典型用法代码示例。如果您正苦于以下问题:Java TestUtils.listFiles方法的具体用法?Java TestUtils.listFiles怎么用?Java TestUtils.listFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osmo.common.TestUtils的用法示例。


在下文中一共展示了TestUtils.listFiles方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generate4

import osmo.common.TestUtils; //导入方法依赖的package包/类
@Test
  public void generate4() throws Exception {
    Thread.sleep(100);
    MultiOSMO mosmo = new MultiOSMO(4);
    OSMOConfiguration config = mosmo.getConfig();
    config.setSequenceTraceRequested(true);
    config.setFactory(new MyModelFactory());
    config.setTestEndCondition(new Length(10));
    config.setSuiteEndCondition(new Time(2));
    mosmo.generate(new Time(1), 444);
//    List<String> reports = TestUtils.listFiles(OUTPUT_FOLDER, ".csv", false);
//    assertEquals("Number of reports generated", 4, reports.size());
    List<String> traces = TestUtils.listFiles(OUTPUT_FOLDER, ".html", false);
    assertEquals("Number of HTML traces generated", 4, traces.size());
    List<String> xmls = TestUtils.listFiles(OUTPUT_FOLDER, ".xml", false);
    assertEquals("Number of XML traces generated", 4, xmls.size());
  }
 
开发者ID:mukatee,项目名称:osmo,代码行数:18,代码来源:MultiOSMOTests.java

示例2: loadTests

import osmo.common.TestUtils; //导入方法依赖的package包/类
public List<TestScript> loadTests(String dir) {
  List<TestScript> scripts = new ArrayList<>();
  List<String> files = TestUtils.listFiles(dir, "tc", true);
  for (String file : files) {
    String scriptText = TestUtils.readFile(file, "UTF8");
    TestScript script = parse(scriptText);
    scripts.add(script);
  }
  return scripts;
}
 
开发者ID:mukatee,项目名称:osmo,代码行数:11,代码来源:TestLoader.java

示例3: generate4times3

import osmo.common.TestUtils; //导入方法依赖的package包/类
@Ignore
@Test
public void generate4times3() {
  MultiOSMO mosmo = new MultiOSMO(4);
  OSMOConfiguration config = mosmo.getConfig();
  config.setSequenceTraceRequested(true);
  config.setFactory(new MyModelFactory());
  config.setTestEndCondition(new Length(10));
  config.setSuiteEndCondition(new Time(2));
  mosmo.generate(new Time(6), 444);
  List<String> reports = TestUtils.listFiles(OUTPUT_FOLDER, ".csv", false);
  assertEquals("Number of reports generated", 5, reports.size());
  List<String> traces = TestUtils.listFiles(OUTPUT_FOLDER, ".html", false);
  assertEquals("Number of traces generated", 4, traces.size());
}
 
开发者ID:mukatee,项目名称:osmo,代码行数:16,代码来源:MultiOSMOTests.java

示例4: probableModel

import osmo.common.TestUtils; //导入方法依赖的package包/类
@Test
public void probableModel() throws Exception {
  TestUtils.recursiveDelete(REDUCER_FOLDER);
  ReducerConfig config = new ReducerConfig(111);
  config.setParallelism(1);
  Reducer reducer = new Reducer(config);
  OSMOConfiguration osmoConfig = reducer.getOsmoConfig();
  osmoConfig.setFactory(new ReflectiveModelFactory(ErrorModelProbability.class));
  config.setInitialTime(TimeUnit.SECONDS, 5);
  config.setFuzzTime(TimeUnit.SECONDS, 5);
  config.setShorteningTime(TimeUnit.SECONDS, 5);
  config.setPopulationSize(50);
  config.setLength(10);
  config.setTestMode(true);
  ReducerState state = reducer.search();
  List<TestCase> tests = state.getTests();
  assertEquals("Number of tests", 1, tests.size());
  TestCase test1 = tests.get(0);
  assertEquals("Final test length", 1, test1.getAllStepNames().size());
  assertEquals("Iteration lengths", "[]", state.getLengths().toString());
  String report = TestUtils.readFile(REDUCER_FOLDER + "/reducer-final.txt", "UTF8");
  String expected = TestUtils.getResource(ReducerTests.class, "expected-reducer.txt");
  report = TestUtils.unifyLineSeparators(report, "\n");
  expected = TestUtils.unifyLineSeparators(expected, "\n");
  assertEquals("Reducer report", expected, report);
  List<String> files = TestUtils.listFiles(REDUCER_FOLDER, ".html", false);
  assertEquals("Generated report files", "[final-tests.html]", files.toString());
}
 
开发者ID:mukatee,项目名称:osmo,代码行数:29,代码来源:ReducerTests.java

示例5: model10

import osmo.common.TestUtils; //导入方法依赖的package包/类
@Test
public void model10() throws Exception {
  TestUtils.recursiveDelete(REDUCER_FOLDER);
  ReducerConfig config = new ReducerConfig(111);
  config.setStrictReduction(false);
  config.setParallelism(1);
  //changed here on 8apr15
  config.setInitialTime(TimeUnit.SECONDS, 10);
  config.setFuzzTime(TimeUnit.SECONDS, 10);
  config.setShorteningTime(TimeUnit.SECONDS, 10);
  Reducer reducer = new Reducer(config);
  OSMOConfiguration osmoConfig = reducer.getOsmoConfig();
  osmoConfig.setFactory(new ReflectiveModelFactory(Model10Debug.class));
  //TODO: move this to config object
  reducer.setDeleteOldOutput(true);
  // config.setTotalTime(TimeUnit.SECONDS, 1);
  //TODO: length asettaa siis oikeasti sen pituuden ja jos osmo-config on mitään asetettu pitäisi herjata
  config.setPopulationSize(1500);
  config.setLength(50);
  config.setTestMode(true);
  ReducerState state = reducer.search();
  List<TestCase> tests = state.getTests();
  // assertEquals("Number of tests", 230, tests.size());
  TestCase test1 = tests.get(0);
  //this does not produce multiple tests as the initial fuzz only stores the shortest of all found failures
  //since finding equally short failing tests by fuzzing is very unlikely, we end up with just one
  //although it would be possible to have others as well..
  // assertEquals("Final test length", 11, test1.getAllStepNames().size());
  // assertEquals("Iteration lengths", "[25, 22, 17, 14, 13, 12, 11]", state.getLengths().toString());
  String report = TestUtils.readFile(REDUCER_FOLDER + "/reducer-final.txt", "UTF8");
  String expected = TestUtils.getResource(ReducerTests.class, "expected-reducer3.txt");
  report = TestUtils.unifyLineSeparators(report, "\n");
  expected = TestUtils.unifyLineSeparators(expected, "\n");
  String[] replaced = TestUtils.replace("##", expected, report);
  report = replaced[0];
  expected = replaced[1];
  assertEquals("Reducer report", expected, report);
  List<String> files = TestUtils.listFiles(REDUCER_FOLDER, ".html", false);
  assertEquals("Generated report files", "[final-tests.html]", files.toString());
}
 
开发者ID:mukatee,项目名称:osmo,代码行数:41,代码来源:ReducerTests.java


注:本文中的osmo.common.TestUtils.listFiles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。