TestPropertyValueObject.java :  » Web-Framework » rife-1.6.1 » com » uwyn » rife » ioc » Java Open Source

Java Open Source » Web Framework » rife 1.6.1 
rife 1.6.1 » com » uwyn » rife » ioc » TestPropertyValueObject.java
/*
 * 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());
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.