FileDocCategorySizeDatePackage
SingletonTest.javaAPI DocExample643Tue Nov 25 11:29:28 GMT 2003None

SingletonTest

public class SingletonTest extends TestCase
Some JUnit test cases for the Singleton demo.
version
$Id: SingletonTest.java,v 1.2 2003/11/25 17:29:27 ian Exp $

Fields Summary
Singleton
d1
Singleton
d2
Constructors Summary
public SingletonTest(String name)
constructor plumbing for junit

		super(name);
	
Methods Summary
public voidsetUp()
setup method

		d1 = Singleton.getInstance();
		d2 = Singleton.getInstance();
	
public voidtestCorrectClass()

		assertTrue(d1 instanceof Singleton);
	
public voidtestDemoMethod()

		assertEquals(d1.demoMethod(), "demo");
	
public voidtestSingleness()

 
		assertTrue(d1 == d2);