1 23 24 package com.rift.coad.lib.common; 25 26 import com.rift.coad.lib.common.*; 27 import junit.framework.*; 28 import java.lang.ClassLoader ; 29 import java.io.*; 30 import java.net.URL ; 31 32 36 public class ResourceReaderTest extends TestCase { 37 38 public ResourceReaderTest(String testName) { 39 super(testName); 40 } 41 42 protected void setUp() throws Exception { 43 } 44 45 protected void tearDown() throws Exception { 46 } 47 48 public static Test suite() { 49 TestSuite suite = new TestSuite(ResourceReaderTest.class); 50 51 return suite; 52 } 53 54 57 public void testGetPath() throws Exception { 58 System.out.println("getPath"); 59 60 ResourceReader instance = new ResourceReader( 61 "com/rift/coad/lib/common/coadunation-test.xml"); 62 63 String expResult = "com/rift/coad/lib/common/coadunation-test.xml"; 64 String result = instance.getPath(); 65 assertEquals(expResult, result); 66 67 68 } 69 70 71 74 public void testReader() throws Exception { 75 System.out.println("testReader"); 76 77 ResourceReader instance = new ResourceReader( 78 "com/rift/coad/lib/common/coadunation-test.xml"); 79 80 String result = instance.getDocument(); 81 if (!result.contains("\n")) { 82 fail("No ending lines were found"); 83 } 84 } 85 } 86 | Popular Tags |