package nl.tudelft.simulation.event.ref; import java.rmi.MarshalledObject; import junit.framework.Assert; import junit.framework.TestCase; /** * The test script for the reference package. All classes in this package are tested with this test *
* (c) copyright 2002-2005-2004 Delft University of Technology , the
* Netherlands.
* See for project information www.simulation.tudelft.nl
* License of use: Lesser General Public License (LGPL) , no
* warranty.
* @author Peter Jacobs
* @version $Revision: 1.2 $ $Date: 2010/08/10 11:38:12 $
* @since 1.5
*/
public class EventRefTest extends TestCase
{
/** TEST_METHOD is the name of the test method. */
public static final String TEST_METHOD = "test";
/**
* constructs a new EventIteratorTest.
*/
public EventRefTest()
{
this(TEST_METHOD);
}
/**
* constructs a new EventIteratorTest.
* @param method the name of the test method
*/
public EventRefTest(final String method)
{
super(method);
}
/**
* tests the classes in the reference class.
*/
public void test()
{
try
{
// Test 1: We since we have a pointer to referent, gc should not
// clean the weakReference
Object referent = new String("EventIteratorTest");
/*
* It is absolutely amazing what you see if you replace the above with the following: Object referent =
* "EventIteratorTest";
*/
Reference