Exemplo n.º 1
0
 public void testGetResourceElementByHREF4() throws Exception {
   loadContentPackage1();
   // Should be Null if not searching on Resources Element
   Element element =
       cpCore.getResourceElementByHREF("www.reload.ac.uk", cpCore.getRootManifestElement());
   assertNull("Element should be null", element);
 }
Exemplo n.º 2
0
 public void testGetResourceElementByHREF2() throws Exception {
   loadContentPackage1();
   // %20
   Element resources = cpCore.getResourcesElement(cpCore.getRootManifestElement());
   Element element = cpCore.getResourceElementByHREF("Another%20File.txt", resources);
   assertEquals(
       "Wrong Resource Element",
       element.getAttributeValue(CP_Core.IDENTIFIER),
       CP_Package1.RESOURCE2_ID);
 }
Exemplo n.º 3
0
 public void testGetResourceElementByHREF3() throws Exception {
   loadContentPackage1();
   // URL
   Element resources = cpCore.getResourcesElement(cpCore.getRootManifestElement());
   Element element = cpCore.getResourceElementByHREF("www.reload.ac.uk", resources);
   assertEquals(
       "Wrong Resource Element",
       element.getAttributeValue(CP_Core.IDENTIFIER),
       CP_Package1.RESOURCE3_ID);
 }
Exemplo n.º 4
0
 public void testGetResourceElementByHREF1() throws Exception {
   loadContentPackage1();
   // Normal
   Element resources = cpCore.getResourcesElement(cpCore.getRootManifestElement());
   Element element = cpCore.getResourceElementByHREF("zappa/0-intro.html", resources);
   assertEquals(
       "Wrong Resource Element",
       element.getAttributeValue(CP_Core.IDENTIFIER),
       CP_Package1.RESOURCE1_ID);
 }