1   /*
2    * GenericResourceTest.java
3    * JUnit based test
4    *
5    * Created on December 21, 2004, 3:18 PM
6    */
7   
8   package gov.noaa.eds.xapi.generic;
9   
10  import java.io.InputStream;
11  import javax.xml.parsers.DocumentBuilder;
12  import javax.xml.parsers.DocumentBuilderFactory;
13  import junit.framework.*;
14  
15  
16  import org.apache.crimson.jaxp.DocumentBuilderFactoryImpl;
17  import org.w3c.dom.Document;
18  
19  /***
20   *
21   * @author tns
22   */
23  public class GenericResourceTest extends TestCase {
24      
25      GenericResourceImpl resource = null;
26      
27      
28      public GenericResourceTest(String testName) {
29          super(testName);
30      }
31  
32      protected void setUp() throws java.lang.Exception {
33          resource = new GenericResourceImpl();
34      }
35  
36      protected void tearDown() throws java.lang.Exception {
37      }
38  
39      public static junit.framework.Test suite() {
40          junit.framework.TestSuite suite = new junit.framework.TestSuite(GenericResourceTest.class);
41          
42          return suite;
43      }
44  
45   
46  
47      /***
48       * Test of getId method, of class gov.noaa.eds.xapi.generic.GenericResource.
49       */
50      public void testGetId() throws Exception {
51          System.out.println("testGetId");
52          
53          // TODO add your test code below by replacing the default call to fail.
54          resource.setId("id");
55          assertEquals("unexpected id","id",resource.getId());
56      }
57  
58      /***
59       * Test of setId method, of class gov.noaa.eds.xapi.generic.GenericResource.
60       */
61      public void testSetId() {
62          System.out.println("testSetId");
63          
64          // TODO add your test code below by replacing the default call to fail.
65          resource.setId("id");
66      }
67  
68  
69      /***
70       * Generated implementation of abstract class gov.noaa.eds.xapi.generic.GenericResource. Please fill dummy bodies of generated methods.
71       */
72      private class GenericResourceImpl extends GenericResource {
73  
74          GenericResourceImpl() {
75              super();
76          }
77  
78          public java.lang.String getProperty(java.lang.String p0) {
79              // TODO fill the body in order to provide useful implementation
80              
81              return null;
82          }
83  
84          public void setProperty(java.lang.String p0, java.lang.String p1) {
85              // TODO fill the body in order to provide useful implementation
86              
87          }
88  
89          public org.xmldb.api.base.Collection getParentCollection() {
90              // TODO fill the body in order to provide useful implementation
91              
92              return null;
93          }
94  
95          public java.lang.String getResourceType() {
96              // TODO fill the body in order to provide useful implementation
97              
98              return null;
99          }
100 
101         public java.lang.Object getContent() {
102             // TODO fill the body in order to provide useful implementation
103             
104             return null;
105         }
106 
107         public void setContent(java.lang.Object p0) {
108             // TODO fill the body in order to provide useful implementation
109             
110         }
111     }
112     
113     public static Document loadTestResource() throws Exception {
114         InputStream is = GenericResourceTest.class.getClassLoader().getResourceAsStream("testXmlResource.xml");
115         DocumentBuilderFactory factory = new DocumentBuilderFactoryImpl();
116         DocumentBuilder builder = factory.newDocumentBuilder();
117         return builder.parse(is);
118     }
119 
120     
121     // TODO add test methods here. The name must begin with 'test'. For example:
122     // public void testHello() {}
123     
124 }