Anyone? J unit test cases

profilecompSci
heaptest.java

import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; /** * HeapTest tests Heap * @author tai-lanhirabayashi * */ public class HeapTest { Heap h; /** * SetUp initializes a heap with the values (1,2,3,4,5) * insert and heap() are assumed to be working in order for the other functions to work */ @Before public void setUp(){ h=new Heap(); h.Heap(10); System.out.println("this is 1"); h.insert(1); System.out.println(h.h[0]); System.out.println("this is 2"); h.insert(2); System.out.println(h.h[0] + ","+h.h[1]); System.out.println("this is 3"); h.insert(3); System.out.println(h.h[0] + ","+h.h[1] + ","+h.h[2]); System.out.println("this is 4"); h.insert(4); System.out.println(h.h[0] + ","+h.h[1] + ","+h.h[2] + ","+h.h[3]); System.out.println("this is 5"); h.insert(5); System.out.println(h.h[0] + ","+h.h[1] + ","+h.h[2] + ","+h.h[3] + ","+h.h[4]); } /** * testFindMax tests the findMax function of heap */ @Test public void testFindMax() { assertEquals(5, h.findMax()); } /** * testSize tests the size function of heap */ @Test public void testSize() { assertEquals(5, h.size()); } /** * testRemoveMax tests the remove max function of heap. */ @Test public void testRemoveMax() { h.removeMax(); assertEquals(4, h.findMax()); } /** * testNegative tests how heap handles negative numbers. */ @Test public void testNegative(){ h=new Heap(); h.Heap(10); h.insert(0); h.insert(-1); h.insert(-2); assertEquals(0, h.findMax()); } }