• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TestWith类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.googlecode.zohhak.api.TestWith的典型用法代码示例。如果您正苦于以下问题:Java TestWith类的具体用法?Java TestWith怎么用?Java TestWith使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TestWith类属于com.googlecode.zohhak.api包,在下文中一共展示了TestWith类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: toJsonObject_whenMultiMapWithMultipleEntries_expectJsonObjectWithJsonArrays

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({
    "mapKey1:A,B,C;{\"mapKey1\":[\"A\",\"B\",\"C\"]}",
    "mapKey1:A,B,C,D;{\"mapKey1\":[\"A\",\"B\",\"C\",\"D\"]}",
    "mapKey1:A,B,C,D,E;{\"mapKey1\":[\"A\",\"B\",\"C\",\"D\",\"E\"]}",
    "mapKey1:A|mapKey2:B;{\"mapKey1\":[\"A\"],\"mapKey2\":[\"B\"]}",
    "mapKey1:A|mapKey2:B|mapKey3:C;{\"mapKey1\":[\"A\"],\"mapKey2\":[\"B\"],\"mapKey3\":[\"C\"]}",
    "mapKey1:A,B|mapKey2:C,D|mapKey3:E,F;{\"mapKey1\":[\"A\",\"B\"],\"mapKey2\":[\"C\",\"D\"],\"mapKey3\":[\"E\",\"F\"]}",
    "mapKey1:A,B,C|mapKey2:A,B,C|mapKey3:A,B,C;{\"mapKey1\":[\"A\",\"B\",\"C\"],\"mapKey2\":[\"A\",\"B\",\"C\"],\"mapKey3\":[\"A\",\"B\",\"C\"]}"
})
public void toJsonObject_whenMultiMapWithMultipleEntries_expectJsonObjectWithJsonArrays(
    MultiMap multiMap, String expectedJson) throws Exception {
  JsonObject jsonObject = MultiMapConverter.toJsonObject(multiMap);
  assertThat(
      jsonObject.toString(),
      sameJSONAs(expectedJson).allowingAnyArrayOrdering());
}
 
开发者ID:Cognifide,项目名称:knotx,代码行数:17,代码来源:MultiMapConverterTest.java


示例2: shouldParseToProperNamespaceAndPathObjects

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({
    "Facebook : Work /            | Facebook | Work/",
    "Standard Tags/               |          | Standard Tags/",
    "Facebook : Work / Employer / | Facebook | Work/Employer/",
    "                             |          | Standard Tags/",
    "null                         |          | Standard Tags/"
})
public void shouldParseToProperNamespaceAndPathObjects(String givenNamespaceAndPath,
    String expectedNamespace, String expectedPath) {
  // When
  NamespaceAndPath result = tested.getNamespaceAndPath(givenNamespaceAndPath);

  // Then
  assertEquals(expectedNamespace, result.getNamespace());
  assertEquals(expectedPath, result.getPath());
}
 
开发者ID:Cognifide,项目名称:bobcat,代码行数:17,代码来源:NamespaceAndPathSplitterTest.java


示例3: checkMultisetsIndices

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith("10, 5, 20, 6")
public void checkMultisetsIndices(int nbOfChar1, int nbOfPropagatedChar1, int nbOfChar2, int nbOfPropagatedChar2) throws IOException {
  // given
  ImageText imageText = new ImageText();
  imageText.setTextElements(buildTextElementsWithChars(CHAR_1, nbOfChar1, nbOfPropagatedChar1, CHAR_2, nbOfChar2, nbOfPropagatedChar2));
  MultiSetsBuilder multiSetsBuilder = new MultiSetsBuilder(true, CLASS_SIZE_MIN_DEFAULT);

  // when
  MultiSets multiSets = multiSetsBuilder.build(imageText);
  DigitalTypeIndices digitalTypeIndices1 = multiSets.get(0).getDigitalTypeIndices();
  DigitalTypeIndices digitalTypeIndices2 = multiSets.get(1).getDigitalTypeIndices();

  // then
  IntStream.range(0, nbOfChar1 + nbOfPropagatedChar1).forEach(i ->
          Assertions.assertThat(digitalTypeIndices1.get(i)).isEqualTo(i)
  );
  IntStream.range(0, nbOfChar2 + nbOfPropagatedChar2).forEach(i ->
          Assertions.assertThat(digitalTypeIndices2.get(i)).isEqualTo(i + nbOfChar1 + nbOfPropagatedChar1)
  );
}
 
开发者ID:Orange-OpenSource,项目名称:documentare-simdoc,代码行数:21,代码来源:MultiSetsBuilderTest.java


示例4: compute_graph_with_scut

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({"false, 3, 1, 2", "false, 1.96, 3, 3", "true, 3, 3, 3"})
public void compute_graph_with_scut(boolean sloop, float scut, int subGraphsNb, int clustersNb) {
  // given
  ClusteringItem[] clusteringItems = Item.buildClusteringItems(this, 6);
  ClusteringGraphBuilder clusteringGraphBuilder = new ClusteringGraphBuilder();
  ClusteringParameters parameters = sloop ?
    ClusteringParameters.builder().scut(scut).sloop().build() :
    ClusteringParameters.builder().scut(scut).build();

  // do
  ClusteringGraph clusteringGraph =
    clusteringGraphBuilder.buildGraphAndUpdateClusterIdAndCenter(clusteringItems, parameters);

  // then
  Map<Integer, SubGraph> subGraphs = clusteringGraph.getSubGraphs();
  Map<Integer, GraphCluster> clusters = clusteringGraph.getClusters();
  Assertions.assertThat(subGraphs).hasSize(subGraphsNb);
  Assertions.assertThat(clusters).hasSize(clustersNb);
}
 
开发者ID:Orange-OpenSource,项目名称:documentare-simdoc,代码行数:20,代码来源:ClusteringGraphBuilderScalpelTest.java


示例5: check_items_are_in_correct_cluster

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({"false, 1.96", "true, 3"})
public void check_items_are_in_correct_cluster(boolean sloop, float scut) {
  // given
  ClusteringItem[] clusteringItems = Item.buildClusteringItems(this, 6);
  ClusteringGraphBuilder clusteringGraphBuilder = new ClusteringGraphBuilder();
  ClusteringParameters parameters = sloop ?
    ClusteringParameters.builder().scut(scut).sloop().build() :
    ClusteringParameters.builder().scut(scut).build();

  // do
  clusteringGraphBuilder.buildGraphAndUpdateClusterIdAndCenter(clusteringItems, parameters);

  // then
  Assertions.assertThat(clusteringItems[0].getClusterId()).isEqualTo(1);
  Assertions.assertThat(clusteringItems[1].getClusterId()).isEqualTo(1);
  Assertions.assertThat(clusteringItems[2].getClusterId()).isEqualTo(1);
  Assertions.assertThat(clusteringItems[3].getClusterId()).isEqualTo(2);
  Assertions.assertThat(clusteringItems[4].getClusterId()).isEqualTo(3);
  Assertions.assertThat(clusteringItems[5].getClusterId()).isEqualTo(3);
}
 
开发者ID:Orange-OpenSource,项目名称:documentare-simdoc,代码行数:21,代码来源:ClusteringGraphBuilderScalpelTest.java


示例6: updateDigitalTypesClusterId

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({
        "/latin_segmentation.reference.json.gz, /latin_segmentation_with_cluster_id.reference.json.gz, latin_segmentation_distances_built_with_cluster_id.json.gz, false, false",
        "/latin_segmentation_with_distances.reference.json.gz, /latin_segmentation_with_cluster_id_and_distances.reference.json.gz, latin_segmentation_with_cluster_id.json.gz, true, true"
})
public void updateDigitalTypesClusterId(String segmentationInput, String withCLusterIdRef, String withClusterIdOutput, boolean distancesAvailable, boolean keepDistances) throws IOException {
  // given
  ImageSegmentation imageSegmentation = loadSegmentationTest(segmentationInput);
  DigitalTypes digitalTypes = imageSegmentation.getDigitalTypes();
  DigitalTypesClustering digitalTypesClustering = new DigitalTypesClustering();
  digitalTypesClustering.setProgressListener(this);
  digitalTypesClustering.setComputeDistances(!distancesAvailable);
  digitalTypesClustering.setClearDistances(!keepDistances);
  ClusteringParameters parameters = clusteringParameters();
  String outputReference = loadReference(withCLusterIdRef);

  // when
  digitalTypesClustering.computeClusterIdsOf(digitalTypes, parameters);
  imageSegmentation.setDistancesAvailable(keepDistances);
  imageSegmentation.setClustersAvailable(true);

  String outputReloaded = saveAndReloadOutput(imageSegmentation, withClusterIdOutput);

  // then
  Assertions.assertThat(outputReloaded).isEqualTo(outputReference);
}
 
开发者ID:Orange-OpenSource,项目名称:documentare-simdoc,代码行数:26,代码来源:DigitalTypesClusteringTest.java


示例7: doSegmentation

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({
        "/latin.png, /latin_segmentation.reference.json.gz, latin_segmentation.json.gz, latin_segmentation.png"
})
public void doSegmentation(String image, String refFileResource, String OutputJson, String outputImage) throws IOException {
  // given
  JsonGenericHandler jsonGenericHandler = new JsonGenericHandler(true);
  File ref = new File(getClass().getResource(refFileResource).getFile());
  String refJson = Gzip.getStringFromGzipFile(ref);
  Segmenter segmenter = new Segmenter(new File(getClass().getResource(image).getFile()));
  File outputFileImage = new File(outputImage);
  File OutputFileJson = new File(OutputJson);

  // when
  segmenter.doSegmentation();
  segmenter.drawSegmentation(outputFileImage);
  jsonGenericHandler.writeObjectToJsonGzipFile(segmenter.getImageSegmentation(), OutputFileJson);
  String outputJson = Gzip.getStringFromGzipFile(OutputFileJson);

  // then
  Assertions.assertThat(outputJson).isEqualTo(refJson);
}
 
开发者ID:Orange-OpenSource,项目名称:documentare-simdoc,代码行数:22,代码来源:SegmenterIntegrationTest.java


示例8: detectConnectedComponentsOnImage

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({
        "/latin.png, /latin_connected_components_ref.json.gz, latin_connected_components.json.gz, /latin.png, latin_connected_components.png"
})
public void detectConnectedComponentsOnImage(String image, String refFileResource, String OutputFile, String inputImage, String outputImage) throws IOException {
  // given
  JsonGenericHandler jsonGenericHandler = new JsonGenericHandler(true);
  File ccRefFile = new File(getClass().getResource(refFileResource).getFile());
  String ccRefJsonString = Gzip.getStringFromGzipFile(ccRefFile);
  File imageFile = new File(getClass().getResource(image).getFile());
  ConnectedComponentsDetector connectedComponentsDetector = new ConnectedComponentsDetector();
  File outputFile = new File(OutputFile);

  // when
  ConnectedComponents connectedComponents = connectedComponentsDetector.detect(imageFile);
  TestDrawer.draw(new File(getClass().getResource(inputImage).getFile()), new File(outputImage), new Lines(), connectedComponents);

  jsonGenericHandler.writeObjectToJsonGzipFile(connectedComponents, outputFile);
  String ccTestJsonString = Gzip.getStringFromGzipFile(outputFile);

  // then
  Assertions.assertThat(ccTestJsonString).isEqualTo(ccRefJsonString);
}
 
开发者ID:Orange-OpenSource,项目名称:documentare-simdoc,代码行数:23,代码来源:ConnectedComponentsDetectorIntegrationTest.java


示例9: buildSubColumns

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({
        "/latin_raw_lines_ref.json.gz, /latin_lines_with_columns_ref.json.gz, latin_lines_with_columns.json.gz, /latin.png, latin_lines_with_columns.png"
})
public void buildSubColumns(String linesFileResource, String refFileResource, String outputLines, String inputImage, String outputImage) throws IOException {
  // given
  JsonGenericHandler jsonGenericHandler = new JsonGenericHandler(true);
  File linesFile = new File(getClass().getResource(linesFileResource).getFile());
  Lines rawLines = (Lines) jsonGenericHandler.getObjectFromJsonGzipFile(Lines.class, linesFile);

  File ccRefFile = new File(getClass().getResource(refFileResource).getFile());
  String ccRefJsonString = Gzip.getStringFromGzipFile(ccRefFile);

  SubColumnsBuilder subColumnsBuilder = new SubColumnsBuilder();
  File outputFile = new File(outputLines);

  // when
  Lines linesWithColumns = subColumnsBuilder.build(rawLines, false);
  TestDrawer.drawLines(new File(getClass().getResource(inputImage).getFile()), new File(outputImage), linesWithColumns);

  jsonGenericHandler.writeObjectToJsonGzipFile(linesWithColumns, outputFile);
  String ccTestJsonString = Gzip.getStringFromGzipFile(outputFile);

  // then
  Assertions.assertThat(ccTestJsonString).isEqualTo(ccRefJsonString);
}
 
开发者ID:Orange-OpenSource,项目名称:documentare-simdoc,代码行数:26,代码来源:SubColumnsBuilderTest.java


示例10: buildRawLines

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({
        "/latin_connected_components_ref.json.gz, /latin_raw_lines_ref.json.gz, latin_raw_lines.json.gz, /latin.png, latin_raw_lines.png"
})
public void buildRawLines(String connectedComponentsFileResource, String refFileResource, String outputLines, String inputImage, String outputImage) throws IOException {
  // given
  JsonGenericHandler jsonGenericHandler = new JsonGenericHandler(true);
  File connectedComponentsFile = new File(getClass().getResource(connectedComponentsFileResource).getFile());
  ConnectedComponents connectedComponents = (ConnectedComponents) jsonGenericHandler.getObjectFromJsonGzipFile(ConnectedComponents.class, connectedComponentsFile);

  File ccRefFile = new File(getClass().getResource(refFileResource).getFile());
  String ccRefJsonString = Gzip.getStringFromGzipFile(ccRefFile);

  RawLinesBuilder rawLinesBuilder = new RawLinesBuilder(Integer.MAX_VALUE);
  File outputFile = new File(outputLines);

  // when
  Lines rawlines = rawLinesBuilder.build(connectedComponents);
  TestDrawer.drawLines(new File(getClass().getResource(inputImage).getFile()), new File(outputImage), rawlines);

  jsonGenericHandler.writeObjectToJsonGzipFile(rawlines, outputFile);
  String ccTestJsonString = Gzip.getStringFromGzipFile(outputFile);

  // then
  Assertions.assertThat(ccTestJsonString).isEqualTo(ccRefJsonString);
}
 
开发者ID:Orange-OpenSource,项目名称:documentare-simdoc,代码行数:26,代码来源:RawLinesBuilderTest.java


示例11: supported_image_extension

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({
        "file.pnG, true",
        "file.jpG, true",
        "file.jpEg, true",
        "file.tiF, true",
        "file.tiFf, true",
        "file.pDf, true",

        "png.f, false",
        "jpg.f, false",
        "jpeg.f, false",
        "tif.f, false",
        "tiff.f, false",
        "pdf.f, false"
})
public void supported_image_extension(String filename, boolean expectedSupported) throws IOException {
  // when
  boolean supported = Thumbnail.canCreateThumbnail(new File(filename));
  // then
  Assertions.assertThat(supported).isEqualTo(expectedSupported);
}
 
开发者ID:Orange-OpenSource,项目名称:documentare-simdoc,代码行数:22,代码来源:ThumbnailTest.java


示例12: evaluate_whenOnlyOneSuite_expectFalseNoMatterConditions

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({
    //1 suite, remove all but last version in all cases
    "A-1 ; null ; 1 ; A-1 ; 10",
    "A-1 ; null ; null ; A-1 ; 10",
    "A-1 ; 100 ; 1 ; A-1; 10",
    "A-1 ; 100 ; null ; A-1 ; 10"
})
public void evaluate_whenOnlyOneSuite_expectFalseNoMatterConditions(String allSuitesVersions,
    Long removeOlderThan,
    Long keepNVersions, String evaluatedSuite, Integer createdDaysAgo) throws Exception {
  final List<Suite> suites = SUITES_LIST_COERCER.toList(allSuitesVersions);

  SuiteRemoveCondition condition = new SuiteRemoveCondition(suites,
      mockRemoveConditions(removeOlderThan, keepNVersions));
  final boolean remove = condition
      .evaluate(mockSuiteVersionAndCreatedDate(evaluatedSuite, createdDaysAgo));
  assertFalse(remove);
}
 
开发者ID:Cognifide,项目名称:aet,代码行数:19,代码来源:SuiteRemoveConditionTest.java


示例13: evaluate_when8SuitesKeepNewerThan_expectFalse

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({
    //8 suites, keep newer than 4 days
    "A-1,A-2,B-3,B-4,C-5,C-6,D-7,E-8 ; 4 ; null ; C-6 ; 3",
    "A-1,A-2,B-3,B-4,C-5,C-6,D-7,E-8 ; 4 ; null ; D-7 ; 2",
    "A-1,A-2,B-3,B-4,C-5,C-6,D-7,E-8 ; 4 ; null ; E-8 ; 1",
    //8 suites, remove older than 1 day but keep at least one version
    "A-1,A-2,B-3,B-4,C-5,C-6,D-7,E-8 ; 1 ; null ; E-8 ; 1"
})
public void evaluate_when8SuitesKeepNewerThan_expectFalse(String allSuitesVersions, Long
    removeOlderThan, Long keepNVersions, String evaluatedSuite, Integer createdDaysAgo)
    throws Exception {
  final List<Suite> suites = SUITES_LIST_COERCER.toList(allSuitesVersions);

  SuiteRemoveCondition condition = new SuiteRemoveCondition(suites,
      mockRemoveConditions(removeOlderThan, keepNVersions));
  final boolean remove = condition
      .evaluate(mockSuiteVersionAndCreatedDate(evaluatedSuite, createdDaysAgo));
  assertFalse(remove);
}
 
开发者ID:Cognifide,项目名称:aet,代码行数:20,代码来源:SuiteRemoveConditionTest.java


示例14: evaluate_when8SuitesKeepNewerThanAndAtLeastXVersions_expectTrue

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({
    //8 suites, keep newer than 4 days but at least 4 last versions
    "A-1,A-2,B-3,B-4,C-5,C-6,D-7,E-8 ; 4 ; 4 ; A-1 ; 8",
    "A-1,A-2,B-3,B-4,C-5,C-6,D-7,E-8 ; 4 ; 4 ; A-2 ; 7",
    "A-1,A-2,B-3,B-4,C-5,C-6,D-7,E-8 ; 4 ; 4 ; B-3 ; 6",
    "A-1,A-2,B-3,B-4,C-5,C-6,D-7,E-8 ; 4 ; 4 ; B-4 ; 5"
})
public void evaluate_when8SuitesKeepNewerThanAndAtLeastXVersions_expectTrue(
    String allSuitesVersions, Long
    removeOlderThan, Long keepNVersions, String evaluatedSuite, Integer createdDaysAgo)
    throws Exception {
  final List<Suite> suites = SUITES_LIST_COERCER.toList(allSuitesVersions);

  SuiteRemoveCondition condition = new SuiteRemoveCondition(suites,
      mockRemoveConditions(removeOlderThan, keepNVersions));
  final boolean remove = condition
      .evaluate(mockSuiteVersionAndCreatedDate(evaluatedSuite, createdDaysAgo));
  assertTrue(remove);
}
 
开发者ID:Cognifide,项目名称:aet,代码行数:20,代码来源:SuiteRemoveConditionTest.java


示例15: evaluate_when8SuitesKeepNewerThanAndAtLeastXVersions_expectFalse

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({
    //8 suites, keep newer than 4 days but at least 4 last versions
    "A-1,A-2,B-3,B-4,C-5,C-6,D-7,E-8 ; 4 ; 4 ; C-5 ; 4",
    "A-1,A-2,B-3,B-4,C-5,C-6,D-7,E-8 ; 4 ; 4 ; C-6 ; 3",
    "A-1,A-2,B-3,B-4,C-5,C-6,D-7,E-8 ; 4 ; 4 ; D-7 ; 2",
    "A-1,A-2,B-3,B-4,C-5,C-6,D-7,E-8 ; 4 ; 4 ; E-8 ; 1"
})
public void evaluate_when8SuitesKeepNewerThanAndAtLeastXVersions_expectFalse(
    String allSuitesVersions,
    Long removeOlderThan, Long keepNVersions, String evaluatedSuite, Integer createdDaysAgo)
    throws Exception {
  final List<Suite> suites = SUITES_LIST_COERCER.toList(allSuitesVersions);

  SuiteRemoveCondition condition = new SuiteRemoveCondition(suites,
      mockRemoveConditions(removeOlderThan, keepNVersions));
  final boolean remove = condition
      .evaluate(mockSuiteVersionAndCreatedDate(evaluatedSuite, createdDaysAgo));
  assertFalse(remove);
}
 
开发者ID:Cognifide,项目名称:aet,代码行数:20,代码来源:SuiteRemoveConditionTest.java


示例16: evaluate_whenDuplicatedVersion_expectKeepNewestVersion

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({
    //1 suite, remove all but last version in all cases
    "A-1,A-2,B-2 ; null ; 1 ; A-2 ; 10",
    "A-1,A-2,B-2 ; null ; 1 ; B-2 ; 10"
})
public void evaluate_whenDuplicatedVersion_expectKeepNewestVersion(String allSuitesVersions,
    Long removeOlderThan,
    Long keepNVersions, String evaluatedSuite, Integer createdDaysAgo) throws Exception {
  final List<Suite> suites = SUITES_LIST_COERCER.toList(allSuitesVersions);

  SuiteRemoveCondition condition = new SuiteRemoveCondition(suites,
      mockRemoveConditions(removeOlderThan, keepNVersions));
  final boolean remove = condition
      .evaluate(mockSuiteVersionAndCreatedDate(evaluatedSuite, createdDaysAgo));
  assertFalse(remove);
}
 
开发者ID:Cognifide,项目名称:aet,代码行数:17,代码来源:SuiteRemoveConditionTest.java


示例17: merge_checkNewCollectStepAddedAndOldRemoved

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({"conversion/pattern.json;conversion/current.json"})
public void merge_checkNewCollectStepAddedAndOldRemoved(String patternResource,
    String currentResource)
    throws Exception {
  final Suite pattern = readSuite(patternResource);
  final Suite current = readSuite(currentResource);
  final Suite merged = SuiteMergeStrategy.merge(current, pattern);

  final Test test = merged.getTests().get(0);
  final Url url = test.getUrls().iterator().next();

  final List<Step> steps = url.getSteps();
  assertThat(steps.size(), is(5));

  final Step desktopMobileNewStep = steps.get(4);
  assertThat(desktopMobileNewStep.getType(), is("screen"));
  assertNull(desktopMobileNewStep.getPattern());
}
 
开发者ID:Cognifide,项目名称:aet,代码行数:19,代码来源:SuiteMergeStrategyTest.java


示例18: testSuccess

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({"testMetaDataAll", "testMetaDataPristine", "testMetaDataCorrupt"})
public void testSuccess(TestMetaData testMetaData) throws Exception {

  // Construct the driver
  Driver driver = new Driver(dfs.getConf());

  // Execute the driver, asserting a successful return
  assertEquals(SUCCESS, driver.runner(dfs.getPath(DATASET_DIR).toString()));

  // Assert the expected counters are collated in the driver
  assertCounterEquals(testMetaData, driver.getCounters());

  // Assert the expected partitions were created within HDFS
  assertCounterEquals(testMetaData, Driver.class.getName(), FILES_OUT,
    dfs.listFilesDfs(DATASET_DIR_OUTPUT).length);

}
 
开发者ID:ggear,项目名称:cloudera-framework,代码行数:18,代码来源:DriverTest.java


示例19: testStream

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
/**
 * Test dataset stream
 */
@java.lang.SuppressWarnings("unchecked")
@TestWith({"testMetaDataCsvBatch", "testMetaDataXmlBatch"})
public void testStream(TestMetaData testMetaData) throws IOException, EventDeliveryException, InterruptedException {
  assertEquals(((Integer) testMetaData.getParameters()[2].get(KEY_FLUME_PROCESS_FILE_COUNT)).intValue(),
    flumeServer.crankPipeline(FLUME_SUBSTITUTIONS, FLUME_CONFIG_FILE, testMetaData.getParameters()[0], testMetaData.getParameters()[1],
      FLUME_AGENT_NAME, (String) testMetaData.getParameters()[2].get(KEY_FLUME_SOURCE_NAME),
      (String) testMetaData.getParameters()[2].get(KEY_FLUME_SINK_NAME), new com.cloudera.framework.example.one.stream.Stream(),
      new HDFSEventSink(), (String) testMetaData.getParameters()[2].get(KEY_FLUME_OUTPUT_DIR),
      (Integer) testMetaData.getParameters()[2].get(KEY_FLUME_PROCESS_ITERATIONS), iterations -> 1));
  Driver driverStage = new Stage(dfsServer.getConf());
  assertEquals(SUCCESS, driverStage.runner(
    dfsServer.getPath(DIR_ABS_MYDS_RAW_CANONICAL).toString(), dfsServer.getPath(DIR_ABS_MYDS_STAGED).toString()));
  assertCounterEquals(testMetaData, driverStage.getCounters());
  Driver driverPartition = new Partition(dfsServer.getConf());
  assertEquals(SUCCESS, driverPartition.runner(dfsServer.getPath(DIR_ABS_MYDS_STAGED_CANONICAL).toString(),
    dfsServer.getPath(DIR_ABS_MYDS_PARTITIONED).toString()));
  assertCounterEquals(testMetaData, 1, driverPartition.getCounters());
  Driver driverProcess = new Cleanse(dfsServer.getConf());
  assertEquals(SUCCESS, driverProcess.runner(dfsServer.getPath(DIR_ABS_MYDS_PARTITIONED_CANONICAL).toString(), dfsServer.getPath
    (DIR_ABS_MYDS_CLEANSED).toString()));
  assertCounterEquals(testMetaData, 2, driverProcess.getCounters());
}
 
开发者ID:ggear,项目名称:cloudera-framework,代码行数:26,代码来源:Stream.java


示例20: from_whenFragmentContainsOneService_expectFragmentContextWithExtractedParamsParams

import com.googlecode.zohhak.api.TestWith; //导入依赖的package包/类
@TestWith({
    "snippet_one_service_no_params.txt;{}",
    "snippet_one_service_invalid_params_bound.txt;{}",
    "snippet_one_service_one_param.txt;{\"path\":\"/overridden/path\"}",
    "snippet_one_service_many_params.txt;{\"path\":\"/overridden/path\",\"anotherParam\":\"someValue\"}"
})
public void from_whenFragmentContainsOneService_expectFragmentContextWithExtractedParamsParams(
    Fragment fragment, String expectedParameters) throws Exception {

  final FragmentContext fragmentContext = FragmentContext.from(fragment);
  final ServiceEntry serviceEntry = fragmentContext.services.get(0);
  assertThat(serviceEntry.getParams().toString(), sameJSONAs(expectedParameters));
}
 
开发者ID:Cognifide,项目名称:knotx,代码行数:14,代码来源:FragmentContextTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ProcessorContext类代码示例发布时间:2022-05-22
下一篇:
Java SkeletonData类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap