/* * Runs the test case. */ void runTest() { Document doc; DocumentType docType; NamedNodeMap entities; Node entityNode; String entityName; doc = (Document) baseT::load("staff", false); docType = doc.getDoctype(); baseT::assertNotNull(docType, __LINE__, __FILE__); entities = docType.getEntities(); baseT::assertNotNull(entities, __LINE__, __FILE__); entityNode = entities.getNamedItem(SA::construct_from_utf8("ent1")); baseT::assertNotNull(entityNode, __LINE__, __FILE__); entityName = entityNode.getNodeName(); baseT::assertEquals("ent1", entityName, __LINE__, __FILE__); }
/* * Runs the test case. */ void runTest() { Document doc; DocumentType docType; NamedNodeMap entities; Node entityNode; String entityValue; doc = (Document) baseT::load("staff", true); docType = doc.getDoctype(); baseT::assertNotNull(docType, __LINE__, __FILE__); entities = docType.getEntities(); baseT::assertNotNull(entities, __LINE__, __FILE__); entityNode = entities.getNamedItem(SA::construct_from_utf8("ent1")); baseT::assertNotNull(entityNode, __LINE__, __FILE__); entityNode.setNodeValue(SA::construct_from_utf8("This should have no effect")); entityValue = entityNode.getNodeValue(); baseT::assertNull(entityValue, __LINE__, __FILE__); }
/* * Runs the test case. */ void runTest() { Document doc; DocumentType docType; NamedNodeMap entityList; Node entity; doc = (Document) baseT::load("staff", false); docType = doc.getDoctype(); baseT::assertNotNull(docType, __LINE__, __FILE__); entityList = docType.getEntities(); baseT::assertNotNull(entityList, __LINE__, __FILE__); entity = entityList.getNamedItem(SA::construct_from_utf8("ent5")); baseT::skipIfNull(entity); if (("image/svg+xml" == baseT::getContentType())) { baseT::assertSize(7, entityList, __LINE__, __FILE__); } else { baseT::assertSize(5, entityList, __LINE__, __FILE__); } }
/* * Runs the test case. */ void runTest() { Document doc; DocumentType docType; NamedNodeMap entityList; Entity entityNode; String publicId; String systemId; String notation; doc = (Document) baseT::load("staff", false); docType = doc.getDoctype(); baseT::assertNotNull(docType, __LINE__, __FILE__); entityList = docType.getEntities(); baseT::assertNotNull(entityList, __LINE__, __FILE__); entityNode = (Entity) entityList.getNamedItem(SA::construct_from_utf8("ent5")); baseT::skipIfNull(entityNode); publicId = entityNode.getPublicId(); baseT::assertEquals("entityURI", publicId, __LINE__, __FILE__); systemId = entityNode.getSystemId(); baseT::assertURIEquals("systemId", "", "", "", "entityFile", "", "", "", false, systemId); notation = entityNode.getNotationName(); baseT::assertEquals("notation1", notation, __LINE__, __FILE__); }