KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > resource > FileResourceTest


1 package org.sapia.resource;
2
3 import java.io.File JavaDoc;
4
5 import junit.framework.TestCase;
6
7 public class FileResourceTest extends TestCase {
8
9   public FileResourceTest(String JavaDoc arg0) {
10     super(arg0);
11   }
12
13   protected void setUp() throws Exception JavaDoc {
14     super.setUp();
15   }
16
17   protected void tearDown() throws Exception JavaDoc {
18     super.tearDown();
19   }
20
21   public void testGetInputStream() throws Exception JavaDoc{
22     Resource res = new FileResource(new File JavaDoc("etc/testFileResource.txt"));
23     res.getInputStream().close();
24   }
25   
26   public void testGetRelative() throws Exception JavaDoc{
27     Resource parent = new FileResource(new File JavaDoc("etc/testFileResource.txt"));
28     Resource child = parent.getRelative("testRelativeFileResource.txt");
29     child.getInputStream().close();
30   }
31 }
32
Popular Tags