package net.sf.clirr.ant;

import junit.framework.TestCase;
import net.sf.clirr.event.ApiDifference;
import net.sf.clirr.event.Severity;

public class ChangeCounterTest extends TestCase
{
  public void testCorrectCounting()
  {
      ChangeCounter counter = new ChangeCounter();
      counter.reportDiff(new ApiDifference("blah", Severity.WARNING, "Test", null, null));
      counter.reportDiff(new ApiDifference("blah", Severity.ERROR, "Test", null, null));
      counter.reportDiff(new ApiDifference("blah", Severity.INFO, "Test", null, null));
      counter.reportDiff(new ApiDifference("blah", Severity.ERROR, "Test", null, null));
      counter.reportDiff(new ApiDifference("blah", Severity.ERROR, "Test", null, null));
      counter.reportDiff(new ApiDifference("blah", Severity.WARNING, "Test", null, null));
      assertEquals("number of expected errors", 3, counter.getBinErrors());
      assertEquals("number of expected warnings", 2, counter.getBinWarnings());
      assertEquals("number of expected infos", 1, counter.getBinInfos());
  }
}
@@ -129,16 +129,51 @@
 everity;
+%0Aimport net.sf.clirr.event.Message;
 %0A%0Apublic
@@ -256,16 +256,92 @@
 g()%0A  %7B%0A
+      // a dummy message object%0A      Message msg = new Message(0, false);%0A%0A
       Ch
@@ -418,38 +418,35 @@
 w ApiDifference(
-%22blah%22
+msg
 , Severity.WARNI
@@ -454,32 +454,38 @@
 G, %22Test%22, null,
+ null,
  null));%0A      c
@@ -512,38 +512,35 @@
 w ApiDifference(
-%22blah%22
+msg
 , Severity.ERROR
@@ -546,32 +546,38 @@
 R, %22Test%22, null,
+ null,
  null));%0A      c
@@ -604,38 +604,35 @@
 w ApiDifference(
-%22blah%22
+msg
 , Severity.INFO,
@@ -637,32 +637,38 @@
 O, %22Test%22, null,
+ null,
  null));%0A      c
@@ -695,38 +695,35 @@
 w ApiDifference(
-%22blah%22
+msg
 , Severity.ERROR
@@ -729,32 +729,38 @@
 R, %22Test%22, null,
+ null,
  null));%0A      c
@@ -787,38 +787,35 @@
 w ApiDifference(
-%22blah%22
+msg
 , Severity.ERROR
@@ -821,32 +821,38 @@
 R, %22Test%22, null,
+ null,
  null));%0A      c
@@ -891,14 +891,11 @@
 nce(
-%22blah%22
+msg
 , Se
@@ -919,24 +919,30 @@
 Test%22, null,
+ null,
  null));%0A   

Use dummy Message object to be compatible with new ApiDifference API