[jboss-cvs] JBossCache/tests-50/functional/org/jboss/cache/pojo ...
Ben Wang
bwang at jboss.com
Sat Aug 5 00:14:05 EDT 2006
User: bwang
Date: 06/08/05 00:14:05
Added: tests-50/functional/org/jboss/cache/pojo ArrayTest.java
Log:
Test for array
Revision Changes Path
1.1 date: 2006/08/05 04:14:05; author: bwang; state: Exp;JBossCache/tests-50/functional/org/jboss/cache/pojo/ArrayTest.java
Index: ArrayTest.java
===================================================================
/*
* JBoss, Home of Professional Open Source
*
* Distributable under LGPL license.
* See terms of license at gnu.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.ArrayObject;
/**
* Basic PojoCache test case.
*
* @author Ben Wang
*/
public class ArrayTest extends TestCase
{
Log log = LogFactory.getLog(ArrayTest.class);
PojoCache cache_;
public ArrayTest(String name)
{
super(name);
}
protected void setUp() throws Exception
{
super.setUp();
log.info("setUp() ....");
String configFile = "META-INF/local-service.xml";
cache_ = PojoCacheFactory.createInstance(configFile);
cache_.start();
}
protected void tearDown() throws Exception
{
super.tearDown();
cache_.stop();
}
public void testSimple() throws Exception
{
log.info("testSimple() ....");
ArrayObject ao = new ArrayObject();
Person joe = new Person();
joe.setName("Joe");
joe.setAge(19);
Person ben = new Person();
ben.setName("Ben");
ben.setAge(19);
ao.setPerson(0, joe);
cache_.attach("ao", ao);
// TODO This should trigger a write on team but instead it does a read only. Why?
ao.setPerson(1, ben);
}
public static Test suite() throws Exception
{
return new TestSuite(ArrayTest.class);
}
public static void main(String[] args) throws Exception
{
junit.textui.TestRunner.run(ArrayTest.suite());
}
}
More information about the jboss-cvs-commits
mailing list