01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: TestPropertyValueObject.java 3669 2007-02-26 13:51:23Z gbevin $
07: */
08: package com.uwyn.rife.ioc;
09:
10: import junit.framework.TestCase;
11:
12: public class TestPropertyValueObject extends TestCase {
13: public TestPropertyValueObject(String name) {
14: super (name);
15: }
16:
17: public void testInstantiation() {
18: Integer value = new Integer(25);
19:
20: PropertyValueObject object = new PropertyValueObject(value);
21: assertNotNull(object);
22: assertTrue(object.isStatic());
23: }
24:
25: public void testGetValue() {
26: Integer value = new Integer(25);
27:
28: PropertyValueObject object = new PropertyValueObject(value);
29: assertSame(value, object.getValue());
30: }
31:
32: public void testGetValueString() {
33: Integer value = new Integer(25);
34:
35: PropertyValueObject object = new PropertyValueObject(value);
36: assertEquals("25", object.getValueString());
37: }
38:
39: public void testToString() {
40: Integer value = new Integer(25);
41:
42: PropertyValueObject object = new PropertyValueObject(value);
43: assertEquals("25", object.toString());
44: }
45:
46: public void testIsNeglectable() {
47: assertFalse(new PropertyValueObject("lhkjkj").isNeglectable());
48: assertTrue(new PropertyValueObject(" ").isNeglectable());
49: assertTrue(new PropertyValueObject("").isNeglectable());
50: assertTrue(new PropertyValueObject(null).isNeglectable());
51: }
52: }
|