1   package org.apache.maven.werkz;
2   
3   import java.util.ArrayList;
4   import java.util.List;
5   
6   import junit.framework.Assert;
7   
8   /* ====================================================================
9    *   Licensed to the Apache Software Foundation (ASF) under one or more
10   *   contributor license agreements.  See the NOTICE file distributed with
11   *   this work for additional information regarding copyright ownership.
12   *   The ASF licenses this file to You under the Apache License, Version 2.0
13   *   (the "License"); you may not use this file except in compliance with
14   *   the License.  You may obtain a copy of the License at
15   *
16   *       http://www.apache.org/licenses/LICENSE-2.0
17   *
18   *   Unless required by applicable law or agreed to in writing, software
19   *   distributed under the License is distributed on an "AS IS" BASIS,
20   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21   *   See the License for the specific language governing permissions and
22   *   limitations under the License.
23   * ====================================================================
24   */
25  
26  public class GoalTracker
27      extends Assert
28  {
29      private List expectedGoals;
30  
31      private List firedGoals;
32  
33      public GoalTracker()
34      {
35          this.expectedGoals = new ArrayList();
36          this.firedGoals = new ArrayList();
37      }
38  
39      public void addExpectedGoal( Goal goal )
40      {
41          this.expectedGoals.add( goal );
42      }
43  
44      public void addFiredGoal( Goal goal )
45      {
46          this.firedGoals.add( goal );
47      }
48  
49      public void clear()
50      {
51          this.expectedGoals.clear();
52          this.firedGoals.clear();
53      }
54  
55      public void verify()
56      {
57          assertEquals( this.expectedGoals, this.firedGoals );
58      }
59  }