[jboss-cvs] JBossCache/tests-50/functional/org/jboss/cache/pojo ...

Ben Wang bwang at jboss.com
Wed Nov 1 04:27:18 EST 2006


  User: bwang   
  Date: 06/11/01 04:27:18

  Added:       tests-50/functional/org/jboss/cache/pojo 
                        CachedTypeTest.java
  Log:
  Added byte field as primitve.
  
  Revision  Changes    Path
  1.1      date: 2006/11/01 09:27:18;  author: bwang;  state: Exp;JBossCache/tests-50/functional/org/jboss/cache/pojo/CachedTypeTest.java
  
  Index: CachedTypeTest.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source.
   * Copyright 2006, Red Hat Middleware LLC, and individual contributors
   * as indicated by the @author tags. See the copyright.txt file in the
   * distribution for a full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
   * the License, or (at your option) any later version.
   *
   * This software is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this software; if not, write to the Free
   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   */
  
  package org.jboss.cache.pojo;
  
  import junit.framework.TestCase;
  import junit.framework.Test;
  import junit.framework.TestSuite;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.jboss.cache.pojo.test.Person;
  import org.jboss.cache.pojo.test.Address;
  import org.jboss.cache.pojo.test.Student;
  import org.jboss.aop.proxy.ClassProxy;
  
  import java.util.List;
  import java.util.Map;
  import java.util.HashMap;
  import java.util.ArrayList;
  import java.util.Set;
  import java.util.HashSet;
  
  /**
   * Basic CachedType test case.
   *
   * @author Ben Wang
   */
  
  public class CachedTypeTest extends TestCase
  {
     Log log = LogFactory.getLog(CachedTypeTest.class);
  
     public CachedTypeTest(String name)
     {
        super(name);
     }
  
     protected void setUp() throws Exception
     {
        super.setUp();
        log.info("setUp() ....");
     }
  
     protected void tearDown() throws Exception
     {
        super.tearDown();
     }
  
     public void testInteger() throws Exception
     {
        CachedType t = new CachedType(int.class);
        assertTrue("Int ", t.isImmediate());
  
        t = new CachedType(Integer.class);
        assertTrue("Int ", t.isImmediate());
     }
  
     public void testShort() throws Exception
     {
        CachedType t = new CachedType(short.class);
        assertTrue("Short ", t.isImmediate());
  
        t = new CachedType(Short.class);
        assertTrue("Short ", t.isImmediate());
     }
  
     public void testString() throws Exception
     {
        CachedType t = new CachedType(String.class);
        assertTrue("String ", t.isImmediate());
     }
  
     public void testDouble() throws Exception
     {
        CachedType t = new CachedType(double.class);
        assertTrue("Double ", t.isImmediate());
  
        t = new CachedType(Double.class);
        assertTrue("Double ", t.isImmediate());
     }
  
     public void testChar() throws Exception
     {
        CachedType t = new CachedType(Character.class);
        assertTrue("Character ", t.isImmediate());
  
        t = new CachedType(Character.class);
        assertTrue("Character ", t.isImmediate());
     }
  
     public void testBoolean() throws Exception
     {
        CachedType t = new CachedType(boolean.class);
        assertTrue("Boolean ", t.isImmediate());
  
        t = new CachedType(Boolean.class);
        assertTrue("Boolean ", t.isImmediate());
     }
  
     public void testLong() throws Exception
     {
        CachedType t = new CachedType(long.class);
        assertTrue("Long ", t.isImmediate());
  
        t = new CachedType(Long.class);
        assertTrue("Long ", t.isImmediate());
     }
  
     public void testByte() throws Exception
     {
        CachedType t = new CachedType(byte.class);
        assertTrue("Byte ", t.isImmediate());
  
        t = new CachedType(Short.class);
        assertTrue("Byte ", t.isImmediate());
     }
  
     public static Test suite() throws Exception
     {
        return new TestSuite(CachedTypeTest.class);
     }
  
  
     public static void main(String[] args) throws Exception
     {
        junit.textui.TestRunner.run(suite());
     }
  
  }
  
  
  



More information about the jboss-cvs-commits mailing list