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

Java ElementSelectors类代码示例

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

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



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

示例1: sendBatchFileAndTestRouting

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
@Test
public void sendBatchFileAndTestRouting() throws Exception {
	testBuilder.addStep("a001putCustomerBatch")
			   .addSettings("[email protected]", SettingsBuilder
			                                                    .addMQHeader()
                   				                                .setMsgFormat("MQSTR")
                   ).execute();
	
	testBuilder.addStep("a002getCustomerBatch")
	           .sleep(1000)
	           .execute();

	testBuilder.addAssertion(
			new XMLFileAssertion("a002getCustomerBatch")
   				.withNodeMatcher(ElementSelectors.byNameAndText)
   				.ignoreAttrs(ImmutableList.of("number"))
   				.ignore(ImmutableList.of("startDate","endDate"))
   				.checkForSimilar()
	);
}
 
开发者ID:rockitconsulting,项目名称:test.rockitizer,代码行数:21,代码来源:SplitCustomerTestErrorHandling.java


示例2: compareXML

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
public static void compareXML(String expectedXML, String actualXML) throws SAXException, IOException {
    Diff xmlDiff = DiffBuilder.compare(expectedXML).withTest(actualXML)
                              .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byName))
                              .ignoreWhitespace().normalizeWhitespace()
                              .checkForSimilar()
                              .build();
    try {
        assertFalse("pieces of XML are not similar\n" + xmlDiff, xmlDiff.hasDifferences());
    } catch (AssertionError ae) {
        System.out.println("--------------- ActualXML ---------------");
        System.out.println(actualXML);
        System.out.println("=========================================");

        System.out.println("-------------- ExpectedXML --------------");
        System.out.println(expectedXML);
        System.out.println("=========================================");
        throw ae;
    }
}
 
开发者ID:fduminy,项目名称:jtestplatform,代码行数:20,代码来源:JUnitXMLReportWriterTest.java


示例3: testPerformExport

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
@Test
public final void testPerformExport() throws IOException, SaveException {
    String xmlFileName = filename.replace(".bib", ".xml");
    Path importFile = resourceDir.resolve(filename);

    List<BibEntry> entries = testImporter.importDatabase(importFile, StandardCharsets.UTF_8).getDatabase()
            .getEntries();

    msBibExportFormat.export(databaseContext, tempFile, charset, entries);

    Builder control = Input.from(Files.newInputStream(resourceDir.resolve(xmlFileName)));
    Builder test = Input.from(Files.newInputStream(tempFile));

    assertThat(test, CompareMatcher.isSimilarTo(control)
            .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)).throwComparisonFailure());
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:17,代码来源:MSBibExportFormatTestFiles.java


示例4: testPerformExport

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
@Test
public final void testPerformExport() throws IOException, SaveException {
    String xmlFileName = filename.replace(".bib", ".xml");
    Path importFile = resourceDir.resolve(filename);
    String tempFilename = tempFile.getCanonicalPath();

    List<BibEntry> entries = testImporter.importDatabase(importFile, StandardCharsets.UTF_8).getDatabase()
            .getEntries();

    bibtexmlExportFormat.export(databaseContext, tempFile.toPath(), charset, entries);

    Builder control = Input.from(Files.newInputStream(resourceDir.resolve(xmlFileName)));
    Builder test = Input.from(Files.newInputStream(Paths.get(tempFilename)));

    Assert.assertThat(test, CompareMatcher.isSimilarTo(control)
            .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)).throwComparisonFailure());
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:18,代码来源:BibTeXMLExporterTestFiles.java


示例5: testImportAsModsAndExportAsMods

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
@Test
public final void testImportAsModsAndExportAsMods() throws Exception {
    String xmlFileName = filename.replace(".bib", ".xml");
    String tempFilename = tempFile.getCanonicalPath();
    Path xmlFile = Paths.get(ModsExportFormatTestFiles.class.getResource(xmlFileName).toURI());

    List<BibEntry> entries = modsImporter.importDatabase(xmlFile, charset).getDatabase().getEntries();

    modsExportFormat.export(databaseContext, tempFile.toPath(), charset, entries);

    Builder control = Input.from(Files.newInputStream(xmlFile));
    Builder test = Input.from(Files.newInputStream(Paths.get(tempFilename)));

    Assert.assertThat(test, CompareMatcher.isSimilarTo(control)
            .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)).throwComparisonFailure());
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:17,代码来源:ModsExportFormatTestFiles.java


示例6: testIgnoreSuccess

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
@Test
public void testIgnoreSuccess() {
	String control = "<root><test>2</test><ignore>cvc</ignore><sim>4</sim></root>";
	String test = "<root><test>4bxbcxcbx</test><ignore>cvkkkkc</ignore><sim>4</sim></root>";

	xmlFileAssertion.ignore(ImmutableList.of("test", "ignore"))
			.compare(Input.fromString(control), Input.fromString(test)).checkForSimilar()
			.withNodeMatcher(ElementSelectors.byNameAndText).build();

}
 
开发者ID:rockitconsulting,项目名称:test.rockitizer,代码行数:11,代码来源:XMLFileAssertionTest.java


示例7: testIgnoreException

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
@Test(expected = AssertionError.class)
public void testIgnoreException() {
	String control = "<root><test>2</test><ignore>cvc</ignore><sim>4</sim></root>";
	String test = "<root><test>4bxbcxcbx</test><ignore>cvkkkkc</ignore><sim>4</sim></root>";

	xmlFileAssertion.ignore(ImmutableList.of("test")).compare(Input.fromString(control), Input.fromString(test))
			.checkForSimilar().withNodeMatcher(ElementSelectors.byNameAndText).build();
}
 
开发者ID:rockitconsulting,项目名称:test.rockitizer,代码行数:9,代码来源:XMLFileAssertionTest.java


示例8: checkLogStructureWithIgnore

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
@Test
public void checkLogStructureWithIgnore() {
	String control = "<root><_shards><total>3</total><failed>0</failed><successful>3</successful></_shards><hits><hits><_index>log_idx</_index><_type>runtime</_type><_source><dateTime>2016-11-16 15:12:40.872</dateTime><bulkSize>349630</bulkSize><create_ms>219</create_ms><clientName>ROCKIT3</clientName><total_ms>649</total_ms><elastic_ms>430</elastic_ms></_source><_id>AVhte4MPWQ1XWbkTBg0f</_id><sort>1479309160872</sort><_score>null</_score></hits><total>791</total><max_score>null</max_score></hits><took>2</took><timed_out>false</timed_out></root>";
	String test = "<root><_shards><total>3</total><failed>0</failed><successful>3</successful></_shards><hits><hits><_index>log_idx</_index><_type>runtime</_type><_source><dateTime>2016-11-16 16:04:16.048</dateTime><bulkSize>349630</bulkSize><create_ms>229</create_ms><clientName>ROCKIT3</clientName><total_ms>715</total_ms><elastic_ms>486</elastic_ms></_source><_id>AVhtqr3YWQ1XWbkTBg09</_id><sort>1479312256048</sort><_score>null</_score></hits><total>809</total><max_score>null</max_score></hits><took>1</took><timed_out>false</timed_out></root>";
	
	xmlFileAssertion.ignore(ImmutableList.of("dateTime", "create_ms", "total_ms", "elastic_ms", "_id", "sort", "total","took"))
			.compare(Input.fromString(control), Input.fromString(test))
			.withNodeMatcher(ElementSelectors.byNameAndText).checkForSimilar().build();
}
 
开发者ID:rockitconsulting,项目名称:test.rockitizer,代码行数:10,代码来源:XMLFileAssertionTest.java


示例9: checkMonStructureWithIgnore

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
@Test
public void checkMonStructureWithIgnore() {
	String control = "<root><_shards><total>3</total><failed>0</failed><successful>3</successful></_shards><hits><hits><_index>cfg_idx</_index><_type>broker</_type><_source><date>2016-11-16 15:12:40.438</date><app>elasticSearchBulk</app><running>true</running><eg>RuntimeMonitoring</eg><modified>false</modified><type>flow</type><broker>IB9NODE</broker><flow>RuntimeMonitoringFlow</flow><group>zahoorapp</group><attrs>DeploytimePropertyFolder/barFileName=C:/Temp/gradle_build/elasticSearchBulk.zahoor/bar.target/elasticSearchBulk.bar</attrs><attrs>DeploytimePropertyFolder/deployTime=2016-11-11 16:49:10.555 +0100</attrs><attrs>DeploytimePropertyFolder/modifyTime=2016-11-11 16:49:08.000 +0100</attrs><attrs>MessageFlowRuntimeProperty/This/additionalInstances=0</attrs><attrs>MessageFlowRuntimeProperty/This/commitCount=1</attrs><attrs>MessageFlowRuntimeProperty/This/commitInterval=0</attrs><attrs>MessageFlowRuntimeProperty/This/coordinatedTransaction=no</attrs><attrs>MessageFlowRuntimeProperty/This/label=RuntimeMonitoringFlow</attrs><attrs>MessageFlowRuntimeProperty/This/runMode=running</attrs><attrs>MessageFlowRuntimeProperty/This/startMode=Maintained</attrs><attrs>MessageFlowRuntimeProperty/This/traceLevel=none</attrs><attrs>MessageFlowRuntimeProperty/This/userTraceLevel=none</attrs><attrs>MessageFlowRuntimeProperty/This/uuid=11101454-5801-0000-0080-8af24ab77390</attrs><attrs>deployed.as.source=true</attrs><attrs>lastupdate.user=rockit3lp</attrs><attrs>messageflow.additionalinstances=0</attrs><attrs>messageflow.commitcount=1</attrs><attrs>messageflow.commitinterval=0</attrs><attrs>messageflow.coordinatedtransaction=no</attrs><attrs>messageflow.deploytime=2016-11-11 16:49:10.555 +0100</attrs><attrs>messageflow.keywords=$MQSIBAR=C:/Temp/gradle_build/elasticSearchBulk.zahoor/bar.target/elasticSearchBulk.barMQSI$</attrs><attrs>messageflow.modifytime=2016-11-11 16:49:08.000 +0100</attrs><attrs>messageflow.node.1=&lt;ComIbmMQInputNode uuid=RuntimeMonitoringFlow#FCMComposite_1_1 userTraceLevel=none traceLevel=none label=MQ Input messageDomainProperty= messageSetProperty= messageTypeProperty= messageFormatProperty= messageEncodingProperty=0 messageCodedCharSetIdProperty=0 topicProperty= validate=no rootParserClassName=MQROOT additionalInstances=0 queueName=RUNTIMEMONITORING.TRIGGER.ZH transactionMode=yes orderMode=default logicalOrder=yes allMsgsAvailable=no matchMsgId=no matchCorrelId=no browse=no resetBrowseTimeout=-1 convert=no convertEncoding=546 convertCodedCharSetId=0 commitByMessageGroup=no tempDynamicQueue=no/&gt;</attrs><attrs>messageflow.node.2=&lt;ComIbmJavaComputeNode uuid=RuntimeMonitoringFlow#FCMComposite_1_2 userTraceLevel=none traceLevel=none label=BuildPerformanceStat javaClass=RuntimeMonitoringFlow_BuildPerformanceStat javaClassLoader=/&gt;</attrs><attrs>messageflow.node.3=&lt;ComIbmJavaComputeNode uuid=RuntimeMonitoringFlow#FCMComposite_1_3 userTraceLevel=none traceLevel=none label=BuildBulk javaClass=RuntimeConfigReader_BuildBulk javaClassLoader=/&gt;</attrs><attrs>messageflow.node.4=&lt;ComIbmWSRequestNode uuid=RuntimeMonitoringFlow#FCMComposite_1_4 userTraceLevel=none traceLevel=none label=SavePerformance messageDomainProperty= messageSetProperty= messageTypeProperty= messageFormatProperty= messageEncodingProperty=0 messageCodedCharSetIdProperty=0 topicProperty= URLSpecifier=http://linux-wmnh:9200/log_idx/runtime/ timeoutForServer=120 useWholeInputMsgAsRequest=no requestMsgLocationInTree=InputRoot.JSON.Data replaceInputMsgWithWSResponse=yes responseMsgLocationInTree=OutputRoot generateDefaultHttpHeaders=yes replaceInputMsgWithHTTPError=yes errorMsgLocationInTree=OutputRoot httpProxyLocation= followRedirection=no/&gt;</attrs><attrs>messageflow.node.5=&lt;ComIbmWSRequestNode uuid=RuntimeMonitoringFlow#FCMComposite_1_5 userTraceLevel=none traceLevel=none label=SaveBulk messageDomainProperty=BLOB messageSetProperty= messageTypeProperty= messageFormatProperty= messageEncodingProperty=0 messageCodedCharSetIdProperty=0 topicProperty= URLSpecifier=http://linux-wmnh:9200/cfg_idx/broker/_bulk timeoutForServer=120 useWholeInputMsgAsRequest=no requestMsgLocationInTree=InputRoot.BLOB replaceInputMsgWithWSResponse=yes responseMsgLocationInTree=OutputRoot generateDefaultHttpHeaders=yes replaceInputMsgWithHTTPError=yes errorMsgLocationInTree=OutputRoot httpProxyLocation= followRedirection=no protocol=TLS httpVersion=1.1 acceptCompressedResponses=yes/&gt;</attrs><attrs>messageflow.node.6=&lt;ComIbmTimeoutNotificationNode uuid=RuntimeMonitoringFlow#FCMComposite_1_7 userTraceLevel=none traceLevel=none label=Timeout Notification uniqueIdentifier=TriggerMon transactionMode=automatic operationMode=automatic timeoutInterval=600/&gt;</attrs><attrs>messageflow.node.last=6</attrs><attrs>messageflow.nodeconnection.1=RuntimeMonitoringFlow#FCMComposite_1_1,out,RuntimeMonitoringFlow#FCMComposite_1_3,in</attrs><attrs>messageflow.nodeconnection.2=RuntimeMonitoringFlow#FCMComposite_1_2,out,RuntimeMonitoringFlow#FCMComposite_1_4,in</attrs><attrs>messageflow.nodeconnection.3=RuntimeMonitoringFlow#FCMComposite_1_3,out,RuntimeMonitoringFlow#FCMComposite_1_5,in</attrs><attrs>messageflow.nodeconnection.4=RuntimeMonitoringFlow#FCMComposite_1_5,out,RuntimeMonitoringFlow#FCMComposite_1_2,in</attrs><attrs>messageflow.nodeconnection.5=RuntimeMonitoringFlow#FCMComposite_1_7,out,RuntimeMonitoringFlow#FCMComposite_1_3,in</attrs><attrs>messageflow.nodeconnection.last=5</attrs><attrs>messageflow.nodetypes=ComIbmMQInputNode,ComIbmJavaComputeNode,ComIbmWSRequestNode,ComIbmTimeoutNotificationNode</attrs><attrs>messageflow.queuenames=RUNTIMEMONITORING.TRIGGER.ZH</attrs><attrs>messageflow.usertrace=none</attrs><attrs>name=RuntimeMonitoringFlow</attrs><attrs>object.runstate=running</attrs><attrs>parent.type=Application</attrs><attrs>parent.uuid=370f1454-5801-0000-0080-8af24ab77390</attrs><attrs>type=MessageProcessingNodeType</attrs><attrs>uuid=11101454-5801-0000-0080-8af24ab77390</attrs></_source><_id>IB9NODE-RuntimeMonitoring-elasticSearchBulk-RuntimeMonitoringFlow</_id><sort>1479309160438</sort><_score>null</_score></hits><total>42</total><max_score>null</max_score></hits><took>2</took><timed_out>false</timed_out></root>";
	String test = "<root><_shards><total>3</total><failed>0</failed><successful>3</successful></_shards><hits><hits><_index>cfg_idx</_index><_type>broker</_type><_source><date>2016-11-16 15:57:17.952</date><app>elasticSearchBulk</app><running>true</running><eg>RuntimeMonitoring</eg><modified>false</modified><type>flow</type><broker>IB9NODE</broker><flow>RuntimeMonitoringFlow</flow><group>zahoorapp</group><attrs>DeploytimePropertyFolder/barFileName=C:/Temp/gradle_build/elasticSearchBulk.zahoor/bar.target/elasticSearchBulk.bar</attrs><attrs>DeploytimePropertyFolder/deployTime=2016-11-11 16:49:10.555 +0100</attrs><attrs>DeploytimePropertyFolder/modifyTime=2016-11-11 16:49:08.000 +0100</attrs><attrs>MessageFlowRuntimeProperty/This/additionalInstances=0</attrs><attrs>MessageFlowRuntimeProperty/This/commitCount=1</attrs><attrs>MessageFlowRuntimeProperty/This/commitInterval=0</attrs><attrs>MessageFlowRuntimeProperty/This/coordinatedTransaction=no</attrs><attrs>MessageFlowRuntimeProperty/This/label=RuntimeMonitoringFlow</attrs><attrs>MessageFlowRuntimeProperty/This/runMode=running</attrs><attrs>MessageFlowRuntimeProperty/This/startMode=Maintained</attrs><attrs>MessageFlowRuntimeProperty/This/traceLevel=none</attrs><attrs>MessageFlowRuntimeProperty/This/userTraceLevel=none</attrs><attrs>MessageFlowRuntimeProperty/This/uuid=11101454-5801-0000-0080-8af24ab77390</attrs><attrs>deployed.as.source=true</attrs><attrs>lastupdate.user=rockit3lp</attrs><attrs>messageflow.additionalinstances=0</attrs><attrs>messageflow.commitcount=1</attrs><attrs>messageflow.commitinterval=0</attrs><attrs>messageflow.coordinatedtransaction=no</attrs><attrs>messageflow.deploytime=2016-11-11 16:49:10.555 +0100</attrs><attrs>messageflow.keywords=$MQSIBAR=C:/Temp/gradle_build/elasticSearchBulk.zahoor/bar.target/elasticSearchBulk.barMQSI$</attrs><attrs>messageflow.modifytime=2016-11-11 16:49:08.000 +0100</attrs><attrs>messageflow.node.1=&lt;ComIbmMQInputNode uuid=RuntimeMonitoringFlow#FCMComposite_1_1 userTraceLevel=none traceLevel=none label=MQ Input messageDomainProperty= messageSetProperty= messageTypeProperty= messageFormatProperty= messageEncodingProperty=0 messageCodedCharSetIdProperty=0 topicProperty= validate=no rootParserClassName=MQROOT additionalInstances=0 queueName=RUNTIMEMONITORING.TRIGGER.ZH transactionMode=yes orderMode=default logicalOrder=yes allMsgsAvailable=no matchMsgId=no matchCorrelId=no browse=no resetBrowseTimeout=-1 convert=no convertEncoding=546 convertCodedCharSetId=0 commitByMessageGroup=no tempDynamicQueue=no/&gt;</attrs><attrs>messageflow.node.2=&lt;ComIbmJavaComputeNode uuid=RuntimeMonitoringFlow#FCMComposite_1_2 userTraceLevel=none traceLevel=none label=BuildPerformanceStat javaClass=RuntimeMonitoringFlow_BuildPerformanceStat javaClassLoader=/&gt;</attrs><attrs>messageflow.node.3=&lt;ComIbmJavaComputeNode uuid=RuntimeMonitoringFlow#FCMComposite_1_3 userTraceLevel=none traceLevel=none label=BuildBulk javaClass=RuntimeConfigReader_BuildBulk javaClassLoader=/&gt;</attrs><attrs>messageflow.node.4=&lt;ComIbmWSRequestNode uuid=RuntimeMonitoringFlow#FCMComposite_1_4 userTraceLevel=none traceLevel=none label=SavePerformance messageDomainProperty= messageSetProperty= messageTypeProperty= messageFormatProperty= messageEncodingProperty=0 messageCodedCharSetIdProperty=0 topicProperty= URLSpecifier=http://linux-wmnh:9200/log_idx/runtime/ timeoutForServer=120 useWholeInputMsgAsRequest=no requestMsgLocationInTree=InputRoot.JSON.Data replaceInputMsgWithWSResponse=yes responseMsgLocationInTree=OutputRoot generateDefaultHttpHeaders=yes replaceInputMsgWithHTTPError=yes errorMsgLocationInTree=OutputRoot httpProxyLocation= followRedirection=no/&gt;</attrs><attrs>messageflow.node.5=&lt;ComIbmWSRequestNode uuid=RuntimeMonitoringFlow#FCMComposite_1_5 userTraceLevel=none traceLevel=none label=SaveBulk messageDomainProperty=BLOB messageSetProperty= messageTypeProperty= messageFormatProperty= messageEncodingProperty=0 messageCodedCharSetIdProperty=0 topicProperty= URLSpecifier=http://linux-wmnh:9200/cfg_idx/broker/_bulk timeoutForServer=120 useWholeInputMsgAsRequest=no requestMsgLocationInTree=InputRoot.BLOB replaceInputMsgWithWSResponse=yes responseMsgLocationInTree=OutputRoot generateDefaultHttpHeaders=yes replaceInputMsgWithHTTPError=yes errorMsgLocationInTree=OutputRoot httpProxyLocation= followRedirection=no protocol=TLS httpVersion=1.1 acceptCompressedResponses=yes/&gt;</attrs><attrs>messageflow.node.6=&lt;ComIbmTimeoutNotificationNode uuid=RuntimeMonitoringFlow#FCMComposite_1_7 userTraceLevel=none traceLevel=none label=Timeout Notification uniqueIdentifier=TriggerMon transactionMode=automatic operationMode=automatic timeoutInterval=600/&gt;</attrs><attrs>messageflow.node.last=6</attrs><attrs>messageflow.nodeconnection.1=RuntimeMonitoringFlow#FCMComposite_1_1,out,RuntimeMonitoringFlow#FCMComposite_1_3,in</attrs><attrs>messageflow.nodeconnection.2=RuntimeMonitoringFlow#FCMComposite_1_2,out,RuntimeMonitoringFlow#FCMComposite_1_4,in</attrs><attrs>messageflow.nodeconnection.3=RuntimeMonitoringFlow#FCMComposite_1_3,out,RuntimeMonitoringFlow#FCMComposite_1_5,in</attrs><attrs>messageflow.nodeconnection.4=RuntimeMonitoringFlow#FCMComposite_1_5,out,RuntimeMonitoringFlow#FCMComposite_1_2,in</attrs><attrs>messageflow.nodeconnection.5=RuntimeMonitoringFlow#FCMComposite_1_7,out,RuntimeMonitoringFlow#FCMComposite_1_3,in</attrs><attrs>messageflow.nodeconnection.last=5</attrs><attrs>messageflow.nodetypes=ComIbmMQInputNode,ComIbmJavaComputeNode,ComIbmWSRequestNode,ComIbmTimeoutNotificationNode</attrs><attrs>messageflow.queuenames=RUNTIMEMONITORING.TRIGGER.ZH</attrs><attrs>messageflow.usertrace=none</attrs><attrs>name=RuntimeMonitoringFlow</attrs><attrs>object.runstate=running</attrs><attrs>parent.type=Application</attrs><attrs>parent.uuid=370f1454-5801-0000-0080-8af24ab77390</attrs><attrs>type=MessageProcessingNodeType</attrs><attrs>uuid=11101454-5801-0000-0080-8af24ab77390</attrs></_source><_id>IB9NODE-RuntimeMonitoring-elasticSearchBulk-RuntimeMonitoringFlow</_id><sort>1479311837952</sort><_score>null</_score></hits><total>42</total><max_score>null</max_score></hits><took>2</took><timed_out>false</timed_out></root>";
	
	xmlFileAssertion.ignore(ImmutableList.of("hits"))
			.compare(Input.fromString(control), Input.fromString(test))
			.withNodeMatcher(ElementSelectors.byNameAndText).checkForSimilar().build();
}
 
开发者ID:rockitconsulting,项目名称:test.rockitizer,代码行数:10,代码来源:XMLFileAssertionTest.java


示例10: checkIgnoreAttributes

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
@Test
public void checkIgnoreAttributes() {
	String control = "<root><took>2</took><timed_out ignore=\"fdfdf\">false</timed_out></root>";
	String test = "<root><took>2</took><timed_out ignore=\"xdf\">false</timed_out></root>";
	
	xmlFileAssertion.ignore(ImmutableList.of("hits")).ignoreAttrs(ImmutableList.of("ignore"))
			.compare(Input.fromString(control), Input.fromString(test))
			.withNodeMatcher(ElementSelectors.byNameAndText).checkForSimilar().build();
}
 
开发者ID:rockitconsulting,项目名称:test.rockitizer,代码行数:10,代码来源:XMLFileAssertionTest.java


示例11: checkIgnoreAttributesFail

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
@Test(expected = AssertionError.class)
public void checkIgnoreAttributesFail() {
	String control = "<root><took>2</took><timed_out ignore=\"fdfdf\">false</timed_out></root>";
	String test = "<root><took>2</took><timed_out ignore=\"xdf\">false</timed_out></root>";
	
	xmlFileAssertion.ignore(ImmutableList.of("hits")).ignoreAttrs(ImmutableList.of("ignore2"))
			.compare(Input.fromString(control), Input.fromString(test))
			.withNodeMatcher(ElementSelectors.byNameAndText).checkForSimilar().build();
}
 
开发者ID:rockitconsulting,项目名称:test.rockitizer,代码行数:10,代码来源:XMLFileAssertionTest.java


示例12: valueCompositeXmlEquality

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
@Test
public void valueCompositeXmlEquality()
{
    // START SNIPPET: xml-serialization
    try( UnitOfWork uow = unitOfWorkFactory.newUnitOfWork() )
    {
        Some valueInstance = buildSomeValue( moduleInstance, uow, "42" );

        // Serialize using injected service
        String serializedXml = xmlSerialization.serialize( valueInstance );
        System.out.println( serializedXml );

        // Deserialize using Module API
        Some valueFromSerializedState = moduleInstance.newValueFromSerializedState( Some.class, serializedXml );
        assertThat( "Deserialized Value equality", valueInstance, equalTo( valueFromSerializedState ) );
        // END SNIPPET: xml-serialization

        // value.toString()
        // Need to loosely compare because of HashMaps not retaining order
        String valueXmlWithoutTypeInfo = xmlSerialization.serialize( Serializer.Options.NO_TYPE_INFO, valueFromSerializedState );
        assertThat( "value.toString() XML equality",
                    valueFromSerializedState.toString(),
                    isSimilarTo( valueXmlWithoutTypeInfo )
                        .withNodeMatcher( new DefaultNodeMatcher( ElementSelectors.byNameAndAllAttributes ) ) );
        // START SNIPPET: xml-serialization
    }
    // END SNIPPET: xml-serialization
}
 
开发者ID:apache,项目名称:polygene-java,代码行数:29,代码来源:JavaxXmlValueCompositeSerializationTest.java


示例13: compareXml

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
public static void compareXml(String content, String reEncoded) {
	Diff d = DiffBuilder.compare(Input.fromString(content))
		.withTest(Input.fromString(reEncoded))
		.withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))
		.checkForSimilar()
		.ignoreWhitespace() // this is working with newest Saxon 9.8.0-2 (not worked with 9.7.0-15
		.ignoreComments() // this is not working even with newest Saxon 9.8.0-2
		.withComparisonController(ComparisonControllers.Default)
		.build();

	assertTrue(d.toString(), !d.hasDifferences());
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:13,代码来源:XmlParserDstu3Test.java


示例14: compareXml

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
public static void compareXml(String content, String reEncoded) {
	Diff d = DiffBuilder.compare(Input.fromString(content))
			.withTest(Input.fromString(reEncoded))
			.withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))
			.checkForSimilar()
			.ignoreWhitespace()
			.ignoreComments()
			.withComparisonController(ComparisonControllers.Default)
			.build();

	assertTrue(d.toString(), !d.hasDifferences());
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:13,代码来源:XmlParserDstu2_1Test.java


示例15: testPerformExport

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
@Test
public final void testPerformExport() throws Exception {
    String xmlFileName = filename.replace(".bib", ".xml");
    String tempFilename = tempFile.getCanonicalPath();
    List<BibEntry> entries = bibtexImporter.importDatabase(importFile, charset).getDatabase().getEntries();
    Path xmlFile = Paths.get(ModsExportFormatTestFiles.class.getResource(xmlFileName).toURI());

    modsExportFormat.export(databaseContext, tempFile.toPath(), charset, entries);

    Builder control = Input.from(Files.newInputStream(xmlFile));
    Builder test = Input.from(Files.newInputStream(Paths.get(tempFilename)));

    Assert.assertThat(test, CompareMatcher.isSimilarTo(control)
            .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)).throwComparisonFailure());
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:16,代码来源:ModsExportFormatTestFiles.java


示例16: ElementNameAndAttributeQualifier

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
/**
 * Extended constructor for multiple qualifying attribute names
 * @param attrNames the array of values to use to qualify whether two
 * elements can be compared further for differences
 */
public ElementNameAndAttributeQualifier(String[] attrNames) {
    this.qualifyingAttrNames = new String[attrNames.length];
    System.arraycopy(attrNames, 0, qualifyingAttrNames, 0,
                     attrNames.length);
    selector = matchesAllAttributes(attrNames)
        ? ElementSelectors.byNameAndAllAttributes
        : ElementSelectors.byNameAndAttributesControlNS(attrNames);
}
 
开发者ID:xmlunit,项目名称:xmlunit,代码行数:14,代码来源:ElementNameAndAttributeQualifier.java


示例17: testIsIdenticalTo_withAssertionErrorForElementOrder_throwsReadableMessage

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
@Test
public void testIsIdenticalTo_withAssertionErrorForElementOrder_throwsReadableMessage() {
    // Expected Exception
    expect(AssertionError.class);
    expectMessage("Expected child nodelist sequence '0' but was '1'");
    expectMessage("comparing <b...> at /a[1]/b[1] to <b...> at /a[1]/b[1]");

    // run test:
    assertThat("<a><c/><b/></a>", isIdenticalTo("<a><b/><c/></a>")
        .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)));
}
 
开发者ID:xmlunit,项目名称:xmlunit,代码行数:12,代码来源:CompareMatcherTest.java


示例18: testIsSimilarTo_withAssertionErrorForElementOrder_throwsReadableMessage

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
@Test
public void testIsSimilarTo_withAssertionErrorForElementOrder_throwsReadableMessage() {
    // run test:
    assertThat("<a><c/><b/></a>", isSimilarTo("<a><b/><c/></a>")
        .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText)));
}
 
开发者ID:xmlunit,项目名称:xmlunit,代码行数:7,代码来源:CompareMatcherTest.java


示例19: canBeCombinedWithPassingMatcher

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
@Test
public void canBeCombinedWithPassingMatcher() {
    assertThat("<a><c/><b/></a>", both(not(isEmptyString()))
               .and(isSimilarTo("<a><b/><c/></a>")
                    .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))));
}
 
开发者ID:xmlunit,项目名称:xmlunit,代码行数:7,代码来源:CompareMatcherTest.java


示例20: qualifyForComparison

import org.xmlunit.diff.ElementSelectors; //导入依赖的package包/类
/**
 * Determine whether two elements qualify for further Difference comparison.
 * @param control
 * @param test
 * @return true if the two elements qualify for further comparison based on 
 *  their  similar namespace URI and non-namespaced tag name, 
 *  false otherwise
 */
public boolean qualifyForComparison(Element control, Element test) {
    return ElementSelectors.byName.canBeCompared(control, test);
}
 
开发者ID:xmlunit,项目名称:xmlunit,代码行数:12,代码来源:ElementNameQualifier.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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