FileDocCategorySizeDatePackage
Clone1Test.javaAPI DocExample568Fri Sep 12 10:10:30 BST 2003None

Clone1Test

public class Clone1Test extends TestCase

Fields Summary
Clone1
c
Clone1
d
Constructors Summary
public Clone1Test(String name)
Constructor needed by junit

 super(name); 
Methods Summary
public voidsetUp()

 
		c = new Clone1();
		c.x = 100;
		c.y = 200;
	
public voidtestClone()
Test that clone() method returns OK.

		d = (Clone1)c.clone();
		// If we get here it didn't throw an exception.
		System.out.println("c=" + c);
		System.out.println("d=" + d);
		/* Test that data gets cloned correctly */
		assertEquals(c.x, d.x);
		assertEquals(c.y, d.y);