本文整理汇总了Java中org.custommonkey.xmlunit.XMLAssert.assertXpathExists方法的典型用法代码示例。如果您正苦于以下问题:Java XMLAssert.assertXpathExists方法的具体用法?Java XMLAssert.assertXpathExists怎么用?Java XMLAssert.assertXpathExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.custommonkey.xmlunit.XMLAssert
的用法示例。
在下文中一共展示了XMLAssert.assertXpathExists方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testWriteMods
import org.custommonkey.xmlunit.XMLAssert; //导入方法依赖的package包/类
@Test
public void testWriteMods() throws Exception {
LocalStorage storage = new LocalStorage();
LocalStorage.LocalObject local = storage.create();
ModsStreamEditor modsEditor = new ModsStreamEditor(local);
ModsDefinition mods = modsEditor.createPage(local.getPid(), "1", "[1]", "pageType");
String model = "model:page";
long timestamp = 0L;
DcStreamEditor instance = new DcStreamEditor(local);
instance.write(mods, model, timestamp, null);
local.flush();
DublinCoreRecord result = instance.read();
assertNotNull(result);
assertNotNull(result.getDc());
assertEquals(local.getPid(), result.getPid());
HashMap<String, String> namespaces = new HashMap<String, String>();
namespaces.put("oai_dc", DcStreamEditor.DATASTREAM_FORMAT_URI);
namespaces.put("dc", "http://purl.org/dc/elements/1.1/");
XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));
String toXml = DcUtils.toXml(result.getDc(), true);
XMLAssert.assertXpathExists("/oai_dc:dc/dc:title[text()='[1]']", toXml);
XMLAssert.assertXpathExists("/oai_dc:dc/dc:identifier[text()='" + local.getPid() +"']", toXml);
XMLAssert.assertXpathExists("/oai_dc:dc/dc:type[text()='" + model +"']", toXml);
}
示例2: testTransformation
import org.custommonkey.xmlunit.XMLAssert; //导入方法依赖的package包/类
@Test
public void testTransformation() throws Exception {
ModsDefinition mods = ModsUtils.unmarshalModsType(new StreamSource(DcStreamEditorTest.class.getResource("periodical.xml").toExternalForm()));
Transformer t = DcUtils.modsTransformer("model:periodical");
JAXBSource jaxbSource = new JAXBSource(ModsUtils.defaultMarshaller(false),
new ObjectFactory().createMods(mods));
StringWriter dump = new StringWriter();
t.transform(jaxbSource, new StreamResult(dump));
String toXml = dump.toString();
System.out.println(toXml);
HashMap<String, String> namespaces = new HashMap<String, String>();
namespaces.put("oai_dc", DcStreamEditor.DATASTREAM_FORMAT_URI);
namespaces.put("dc", "http://purl.org/dc/elements/1.1/");
XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));
XMLAssert.assertXpathExists("/oai_dc:dc/dc:title[text()='main']", toXml);
XMLAssert.assertXpathExists("/oai_dc:dc/dc:title[text()='key']", toXml);
XMLAssert.assertXpathExists("/oai_dc:dc/dc:title[text()='alternative']", toXml);
XMLAssert.assertXpathEvaluatesTo("3", "count(/oai_dc:dc/dc:title)", toXml);
XMLAssert.assertXpathExists("/oai_dc:dc/dc:creator[text()='Boleslav']", toXml);
XMLAssert.assertXpathExists("/oai_dc:dc/dc:description[text()='poznámka']", toXml);
XMLAssert.assertXpathExists("/oai_dc:dc/dc:identifier[text()='uuid:40d13cb2-811f-468c-a6d3-1ad6b01f06f7']", toXml);
XMLAssert.assertXpathExists("/oai_dc:dc/dc:identifier[text()='isbn:0eaa6730']", toXml);
XMLAssert.assertXpathExists("/oai_dc:dc/dc:identifier[text()='issn-l:idIssn-l']", toXml);
XMLAssert.assertXpathExists("/oai_dc:dc/dc:identifier[text()='idWitEmptyType']", toXml);
XMLAssert.assertXpathExists("/oai_dc:dc/dc:identifier[text()='idWithoutType']", toXml);
// XXX needs more test
}
示例3: testMarcAsMods_SubjectTopic_Issue185_Issue433
import org.custommonkey.xmlunit.XMLAssert; //导入方法依赖的package包/类
/**
* Tests mapping of field 653 indicator_9 $a to {@code subject/[email protected]}.
* See issue 185.
* See issue 433.
*/
@Test
public void testMarcAsMods_SubjectTopic_Issue185_Issue433() throws Exception {
InputStream xmlIS = TransformersTest.class.getResourceAsStream("marc_subject_65X_X9.xml");
assertNotNull(xmlIS);
StreamSource streamSource = new StreamSource(xmlIS);
Transformers mt = new Transformers();
try {
byte[] contents = mt.transformAsBytes(streamSource, Transformers.Format.MarcxmlAsMods3);
assertNotNull(contents);
String xmlResult = new String(contents, "UTF-8");
// System.out.println(xmlResult);
XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(new HashMap() {{
put("m", ModsConstants.NS);
}}));
// 653
XMLAssert.assertXpathExists("/m:mods/m:subject[not(@authority)]/m:topic[text()='kočky' and @lang='cze']", xmlResult);
XMLAssert.assertXpathExists("/m:mods/m:subject[not(@authority)]/m:topic[text()='cats' and @lang='eng']", xmlResult);
XMLAssert.assertXpathNotExists("/m:mods/m:subject/m:name/m:namePart[text()='kočky']", xmlResult);
XMLAssert.assertXpathNotExists("/m:mods/m:subject/m:name/m:namePart[text()='cats']", xmlResult);
validateMods(new StreamSource(new ByteArrayInputStream(contents)));
} finally {
close(xmlIS);
}
}
示例4: testMarcAsMods_AbstractLang_Issue434
import org.custommonkey.xmlunit.XMLAssert; //导入方法依赖的package包/类
/**
* Tests mapping of field 520 and subfield $9 to {@code [email protected]}.
* See issue 434.
*/
@Test
public void testMarcAsMods_AbstractLang_Issue434() throws Exception {
InputStream xmlIS = TransformersTest.class.getResourceAsStream("marc_subject_65X_X9.xml");
assertNotNull(xmlIS);
StreamSource streamSource = new StreamSource(xmlIS);
Transformers mt = new Transformers();
try {
byte[] contents = mt.transformAsBytes(streamSource, Transformers.Format.MarcxmlAsMods3);
assertNotNull(contents);
String xmlResult = new String(contents, "UTF-8");
// System.out.println(xmlResult);
XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(new HashMap() {{
put("m", ModsConstants.NS);
}}));
XMLAssert.assertXpathExists("/m:mods/m:abstract[@lang='cze' and @type='Abstract' and text()='Text cze']", xmlResult);
XMLAssert.assertXpathExists("/m:mods/m:abstract[@lang='eng' and @type='Abstract' and text()='Text eng']", xmlResult);
XMLAssert.assertXpathExists("/m:mods/m:abstract[not(@lang) and @type='Abstract' and text()='Text no lang']", xmlResult);
validateMods(new StreamSource(new ByteArrayInputStream(contents)));
} finally {
close(xmlIS);
}
}
示例5: testOaiResponseTransformation
import org.custommonkey.xmlunit.XMLAssert; //导入方法依赖的package包/类
@Test
public void testOaiResponseTransformation() throws Exception {
OaiCatalog c = new OaiCatalog("", "");
String srcUrl = OaiCatalogTest.class.getResource("oaiResponse.xml").toExternalForm();
StreamResult result = c.transformOaiResponse(new StreamSource(srcUrl), new StreamResult(new StringWriter()));
assertNotNull(result);
HashMap<String, String> namespaces = new HashMap<String, String>();
namespaces.put("marc", "http://www.loc.gov/MARC21/slim");
XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));
String marc = result.getWriter().toString();
XMLAssert.assertXpathExists("/marc:record", marc);
}
示例6: testMarcAsMods_SubjectAuthority_Issue182
import org.custommonkey.xmlunit.XMLAssert; //导入方法依赖的package包/类
/**
* Tests mapping of fields 600, 610, 611, 630, 648, 650, 651 indicator_9 $2 to {@code [email protected]}.
* See issue 182.
*/
@Test
public void testMarcAsMods_SubjectAuthority_Issue182() throws Exception {
InputStream xmlIS = TransformersTest.class.getResourceAsStream("marc_subject_65X_X9.xml");
assertNotNull(xmlIS);
StreamSource streamSource = new StreamSource(xmlIS);
Transformers mt = new Transformers();
try {
byte[] contents = mt.transformAsBytes(streamSource, Transformers.Format.MarcxmlAsMods3);
assertNotNull(contents);
String xmlResult = new String(contents, "UTF-8");
// System.out.println(xmlResult);
XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(new HashMap() {{
put("m", ModsConstants.NS);
}}));
// 600
XMLAssert.assertXpathExists("/m:mods/m:subject[@authority='czenas']/m:name[@type='personal']/m:namePart[text()='Novák, A. Jiří']", xmlResult);
// 650
XMLAssert.assertXpathExists("/m:mods/m:subject[@authority='czenas']/m:topic[text()='daňové delikty']", xmlResult);
XMLAssert.assertXpathExists("/m:mods/m:subject[@authority='eczenas']/m:topic[text()='tax delinquency']", xmlResult);
// 651
XMLAssert.assertXpathExists("/m:mods/m:subject[@authority='czenas']/m:geographic[text()='Česko']", xmlResult);
XMLAssert.assertXpathExists("/m:mods/m:subject[@authority='eczenas']/m:geographic[text()='Czechia']", xmlResult);
validateMods(new StreamSource(new ByteArrayInputStream(contents)));
} finally {
close(xmlIS);
}
}
示例7: testMarcAsMods_RelatedItemPartDetailNumber_Issue306
import org.custommonkey.xmlunit.XMLAssert; //导入方法依赖的package包/类
/**
* Tests mapping of field 510 $c to {@code part/detail/number}.
* See issue 306.
*/
@Test
public void testMarcAsMods_RelatedItemPartDetailNumber_Issue306() throws Exception {
InputStream xmlIS = TransformersTest.class.getResourceAsStream("marc_subject_65X_X9.xml");
assertNotNull(xmlIS);
StreamSource streamSource = new StreamSource(xmlIS);
Transformers mt = new Transformers();
try {
byte[] contents = mt.transformAsBytes(streamSource, Transformers.Format.MarcxmlAsMods3);
assertNotNull(contents);
String xmlResult = new String(contents, "UTF-8");
// System.out.println(xmlResult);
XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(new HashMap() {{
put("m", ModsConstants.NS);
}}));
// test 510 4# $a Knihopis 1 $c K01416
XMLAssert.assertXpathExists("/m:mods/m:relatedItem[@type='isReferencedBy']"
+ "/m:titleInfo/m:title[text()='Knihopis 1']", xmlResult);
XMLAssert.assertXpathEvaluatesTo("K01416", "/m:mods/m:relatedItem[@type='isReferencedBy']"
+ "/m:titleInfo/m:title[text()='Knihopis 1']/../../m:part/m:detail[@type='part']/m:number", xmlResult);
// test 510 0# $a Knihopis 2
XMLAssert.assertXpathExists("/m:mods/m:relatedItem[@type='isReferencedBy']"
+ "/m:titleInfo/m:title[text()='Knihopis 2']", xmlResult);
XMLAssert.assertXpathNotExists("/m:mods/m:relatedItem[@type='isReferencedBy']"
+ "/m:titleInfo/m:title[text()='Knihopis 2']/../../m:part", xmlResult);
validateMods(new StreamSource(new ByteArrayInputStream(contents)));
} finally {
close(xmlIS);
}
}
示例8: testMarcAsMods_AuthorityId_Issue305
import org.custommonkey.xmlunit.XMLAssert; //导入方法依赖的package包/类
/**
* Tests mapping of field 100,700 $7 to {@code [email protected]} and {@code [email protected]}.
* See issue 305.
*/
@Test
public void testMarcAsMods_AuthorityId_Issue305() throws Exception {
InputStream xmlIS = TransformersTest.class.getResourceAsStream("marc_subject_65X_X9.xml");
assertNotNull(xmlIS);
StreamSource streamSource = new StreamSource(xmlIS);
Transformers mt = new Transformers();
try {
byte[] contents = mt.transformAsBytes(streamSource, Transformers.Format.MarcxmlAsMods3);
assertNotNull(contents);
String xmlResult = new String(contents, "UTF-8");
// System.out.println(xmlResult);
XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(new HashMap() {{
put("m", ModsConstants.NS);
}}));
// test 100 1# $a Kocina, Jan, $d 1960- $4 aut $7 xx0113245
XMLAssert.assertXpathExists("/m:mods/m:name[@type='personal'"
+ " and @authorityURI='http://aut.nkp.cz'"
+ " and @valueURI='http://aut.nkp.cz/xx0113245']"
+ "/m:namePart[text()='Kocina, Jan']"
+ "/../m:namePart[@type='date' and text()='1960-']"
+ "/../m:role/m:roleTerm[text()='aut']", xmlResult);
// test 700 1# $a Honzík, Bohumil, $d 1972- $4 aut $7 jn20020422016
XMLAssert.assertXpathExists("/m:mods/m:name[@type='personal'"
+ " and @authorityURI='http://aut.nkp.cz'"
+ " and @valueURI='http://aut.nkp.cz/jn20020422016']"
+ "/m:namePart[text()='Honzík, Bohumil']"
+ "/../m:namePart[@type='date' and text()='1972-']"
+ "/../m:role/m:roleTerm[text()='aut']", xmlResult);
// test 700 1# $a Test Without AuthorityId $d 1972- $4 aut
XMLAssert.assertXpathExists("/m:mods/m:name[@type='personal'"
+ " and not(@authorityURI)"
+ " and not(@valueURI)]"
+ "/m:namePart[text()='Test Without AuthorityId']"
+ "/../m:namePart[@type='date' and text()='1972-']"
+ "/../m:role/m:roleTerm[text()='aut']", xmlResult);
validateMods(new StreamSource(new ByteArrayInputStream(contents)));
} finally {
close(xmlIS);
}
}
示例9: testExport
import org.custommonkey.xmlunit.XMLAssert; //导入方法依赖的package包/类
/**
* integration test
*/
@Test
public void testExport() throws Exception {
FedoraTestSupport fedora = new FedoraTestSupport();
fedora.cleanUp();
fedora.ingest(Kramerius4ExportTest.class.getResource("Kramerius4ExportTestPage.xml"));
MetaModelRepository.setInstance(config.getPlugins());
DigitalObjectManager.setDefault(new DigitalObjectManager(
config,
EasyMock.createNiceMock(ImportBatchManager.class),
fedora.getRemoteStorage(),
MetaModelRepository.getInstance(),
EasyMock.createNiceMock(UserManager.class)));
File output = temp.getRoot();
boolean hierarchy = true;
String[] pids = {"uuid:f74f3cf3-f3be-4cac-95da-8e50331414a2"};
RemoteStorage storage = fedora.getRemoteStorage();
Kramerius4Export instance = new Kramerius4Export(storage, config.getKramerius4Export());
File target = instance.export(output, hierarchy, "export status", pids);
assertNotNull(target);
// check datastreams with xpath
HashMap<String, String> namespaces = new HashMap<String, String>();
namespaces.put("dc", DcConstants.NS_PURL);
namespaces.put("f", "info:fedora/fedora-system:def/foxml#");
namespaces.put("kramerius", Kramerius4Export.KRAMERIUS_RELATION_NS);
namespaces.put("mods", ModsStreamEditor.DATASTREAM_FORMAT_URI);
namespaces.put("oai", Kramerius4Export.OAI_NS);
namespaces.put("proarc-rels", Relations.PROARC_RELS_NS);
XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));
File foxml = ExportUtils.pidAsXmlFile(target, pids[0]);
String foxmlSystemId = foxml.toURI().toASCIIString();
XMLAssert.assertXpathExists(streamXPath(ModsStreamEditor.DATASTREAM_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath(DcStreamEditor.DATASTREAM_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath(StringEditor.OCR_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath(RelationEditor.DATASTREAM_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath("IMG_FULL"), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath("IMG_PREVIEW"), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath("IMG_THUMB"), new InputSource(foxmlSystemId));
XMLAssert.assertXpathNotExists(streamXPath(BinaryEditor.RAW_ID), new InputSource(foxmlSystemId));
// check OAI ID
XMLAssert.assertXpathExists("//oai:itemID", new InputSource(foxmlSystemId));
// check kramerius:file
XMLAssert.assertXpathExists("//kramerius:file", new InputSource(foxmlSystemId));
// check exclusion of proarc-rels:hasDevice
XMLAssert.assertXpathNotExists("//proarc-rels:hasDevice", new InputSource(foxmlSystemId));
// check MODS starts with modsCollection
XMLAssert.assertXpathExists(streamXPath(ModsStreamEditor.DATASTREAM_ID) + "//f:xmlContent/mods:modsCollection/mods:mods", new InputSource(foxmlSystemId));
// check policy
XMLAssert.assertXpathEvaluatesTo("policy:private", streamXPath(DcStreamEditor.DATASTREAM_ID) + "//dc:rights", new InputSource(foxmlSystemId));
XMLAssert.assertXpathEvaluatesTo("policy:private", streamXPath(RelationEditor.DATASTREAM_ID) + "//kramerius:policy", new InputSource(foxmlSystemId));
// test export status
RelationEditor relationEditor = new RelationEditor(storage.find(pids[0]));
assertNotNull(relationEditor.getExportResult());
// test ingest of exported object
fedora.cleanUp();
fedora.ingest(foxml.toURI().toURL());
}
示例10: testConsume
import org.custommonkey.xmlunit.XMLAssert; //导入方法依赖的package包/类
@Test
public void testConsume() throws Exception {
temp.setDeleteOnExit(true);
File targetFolder = ImportProcess.createTargetFolder(temp.getRoot());
assertTrue(targetFolder.exists());
String mimetype = ImportProcess.findMimeType(tiff1);
assertNotNull(mimetype);
ImportOptions ctx = new ImportOptions(tiff1.getParentFile(),
"scanner:scanner1", true, junit, config.getImportConfiguration());
ctx.setTargetFolder(targetFolder);
Batch batch = new Batch();
batch.setId(1);
batch.setFolder(ibm.relativizeBatchFile(tiff1.getParentFile()));
ctx.setBatch(batch);
FileSet fileSet = ImportFileScanner.getFileSets(Arrays.asList(tiff1, ocr1, alto1, ac1, uc1)).get(0);
ctx.setJhoveContext(jhoveContext);
TiffImporter instance = new TiffImporter(ibm);
BatchItemObject result = instance.consume(fileSet, ctx);
String pid = result.getPid();
assertTrue(pid.startsWith("uuid"));
assertEquals(ObjectState.LOADED, result.getState());
File foxml = result.getFile();
assertTrue(foxml.toString(), foxml.exists());
File rootFoxml = new File(foxml.getParent(), ImportBatchManager.ROOT_ITEM_FILENAME);
assertTrue(rootFoxml.toString(), rootFoxml.exists());
File raw1 = new File(targetFolder, "img1.full.jpg");
assertTrue(raw1.exists() && raw1.length() > 0);
File preview1 = new File(targetFolder, "img1.preview.jpg");
assertTrue(preview1.exists() && preview1.length() > 0);
File thumb1 = new File(targetFolder, "img1.thumb.jpg");
assertTrue(thumb1.exists() && thumb1.length() > 0);
// validate FOXML
SchemaFactory sfactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
URL foxmlXsdUrl = ObjectFactory.class.getResource("/xsd/foxml/foxml1-1.xsd");
assertNotNull(foxmlXsdUrl);
Schema foxmlXsd = sfactory.newSchema(foxmlXsdUrl);
foxmlXsd.newValidator().validate(new StreamSource(foxml));
// check datastreams with xpath
HashMap<String, String> namespaces = new HashMap<String, String>();
namespaces.put("f", "info:fedora/fedora-system:def/foxml#");
XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));
String foxmlSystemId = foxml.toURI().toASCIIString();
XMLAssert.assertXpathExists(streamXPath(ModsStreamEditor.DATASTREAM_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath(DcStreamEditor.DATASTREAM_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath(StringEditor.OCR_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath(AltoDatastream.ALTO_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath(RelationEditor.DATASTREAM_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath(BinaryEditor.FULL_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath(BinaryEditor.PREVIEW_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath(BinaryEditor.THUMB_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath(BinaryEditor.RAW_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath(MixEditor.RAW_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath(BinaryEditor.NDK_ARCHIVAL_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath(BinaryEditor.NDK_USER_ID), new InputSource(foxmlSystemId));
XMLAssert.assertXpathExists(streamXPath(MixEditor.NDK_ARCHIVAL_ID), new InputSource(foxmlSystemId));
String rootSystemId = rootFoxml.toURI().toASCIIString();
XMLAssert.assertXpathExists(streamXPath(RelationEditor.DATASTREAM_ID), new InputSource(rootSystemId));
EasyMock.verify(toVerify.toArray());
}
示例11: testUnsecure
import org.custommonkey.xmlunit.XMLAssert; //导入方法依赖的package包/类
@Test
public void testUnsecure() throws Exception {
String response = invokeWorkService("http", 8080, "policy-security-wss-signencrypt", false, null);
XMLAssert.assertXpathExists("//faultcode", response);
}
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:6,代码来源:PolicySecurityWssSignencryptDemoQuickstartTest.java
示例12: testSecure
import org.custommonkey.xmlunit.XMLAssert; //导入方法依赖的package包/类
@Test
public void testSecure() throws Exception {
String response = invokeWorkService("https", 8443, "policy-security-wss-signencrypt", false, setupSSLContext());
XMLAssert.assertXpathExists("//faultcode", response);
}
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:6,代码来源:PolicySecurityWssSignencryptDemoQuickstartTest.java
示例13: testConfidentialAuthenticationFail
import org.custommonkey.xmlunit.XMLAssert; //导入方法依赖的package包/类
@Test
public void testConfidentialAuthenticationFail() throws Exception {
String response = invokeWorkService("https", 8443, "policy-security-wss-username", "misspiggy", setupSSLContext());
XMLAssert.assertXpathExists("//faultcode", response);
}
示例14: testAuthentication
import org.custommonkey.xmlunit.XMLAssert; //导入方法依赖的package包/类
@Test
public void testAuthentication() throws Exception {
String response = invokeWorkService("http", 8080, "policy-security-wss-username", "kermit", null);
XMLAssert.assertXpathExists("//faultcode", response);
}
示例15: testAuthenticationFail
import org.custommonkey.xmlunit.XMLAssert; //导入方法依赖的package包/类
@Test
public void testAuthenticationFail() throws Exception {
String response = invokeWorkService("http", 8080, "policy-security-wss-username", "misspiggy", null);
XMLAssert.assertXpathExists("//faultcode", response);
}