예제 #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);
 }
예제 #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);
 }
예제 #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);
 }
예제 #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);
 }