Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/acs/damsel/srvr/asset/TestAssetDescriptor.java


1   package org.acs.damsel.srvr.asset;
2   
3   import junit.framework.*;
4   
5   public class TestAssetDescriptor
6       extends TestCase {
7     private AssetDescriptor assetDescriptor = null;
8   
9     public TestAssetDescriptor(String name) {
10      super(name);
11    }
12  
13    protected void setUp() throws Exception {
14      super.setUp();
15      assetDescriptor = new AssetDescriptor(null, null);
16    }
17  
18    /* Test the constructor */
19    public void testCreate() {
20      /* Test that the constructor creates the object */
21      assetDescriptor = new AssetDescriptor("blah", "blah");
22      this.assertNotNull(assetDescriptor);
23  
24      /* Test that the constructor populates the bean */
25      assetDescriptor = new AssetDescriptor("one", "two");
26      String tag = assetDescriptor.getTag();
27      String value = assetDescriptor.getValue();
28      this.assertTrue(tag.equals("one"));
29      this.assertTrue(value.equals("two"));
30    }
31  
32    /* Test the setters */
33    public void testSetters() {
34      assetDescriptor.setTag("blah1");
35      assetDescriptor.setValue("blah2");
36      String tag = assetDescriptor.getTag();
37      String value = assetDescriptor.getValue();
38      this.assertTrue(tag.equals("blah1"));
39      this.assertTrue(value.equals("blah2"));
40    }
41  }