/*
* Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
* Distributed under the terms of either:
* - the common development and distribution license (CDDL), v1.0; or
* - the GNU Lesser General Public License, v2.1 or later
* $Id: TestPropertyValueObject.java 3669 2007-02-26 13:51:23Z gbevin $
*/
package com.uwyn.rife.ioc;
import junit.framework.TestCase;
public class TestPropertyValueObject extends TestCase
{
public TestPropertyValueObject(String name)
{
super(name);
}
public void testInstantiation()
{
Integer value = new Integer(25);
PropertyValueObject object = new PropertyValueObject(value);
assertNotNull(object);
assertTrue(object.isStatic());
}
public void testGetValue()
{
Integer value = new Integer(25);
PropertyValueObject object = new PropertyValueObject(value);
assertSame(value, object.getValue());
}
public void testGetValueString()
{
Integer value = new Integer(25);
PropertyValueObject object = new PropertyValueObject(value);
assertEquals("25", object.getValueString());
}
public void testToString()
{
Integer value = new Integer(25);
PropertyValueObject object = new PropertyValueObject(value);
assertEquals("25", object.toString());
}
public void testIsNeglectable()
{
assertFalse(new PropertyValueObject("lhkjkj").isNeglectable());
assertTrue(new PropertyValueObject(" ").isNeglectable());
assertTrue(new PropertyValueObject("").isNeglectable());
assertTrue(new PropertyValueObject(null).isNeglectable());
}
}
|