01: /*
02: * Copyright 2006 JBoss Inc
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.drools.reteoo;
18:
19: import junit.framework.TestCase;
20:
21: /**
22: * @author etirelli
23: *
24: */
25: public class BetaNodeTest extends TestCase {
26:
27: /* (non-Javadoc)
28: * @see junit.framework.TestCase#setUp()
29: */
30: protected void setUp() throws Exception {
31: super .setUp();
32: }
33:
34: /* (non-Javadoc)
35: * @see junit.framework.TestCase#tearDown()
36: */
37: protected void tearDown() throws Exception {
38: super .tearDown();
39: }
40:
41: /**
42: * Test method for {@link org.drools.reteoo.BetaNode#equals(java.lang.Object)}.
43: */
44: public void testEqualsObject() {
45: final TupleSource ts = new MockTupleSource(1);
46: final ObjectSource os = new MockObjectSource(2);
47:
48: final BetaNode j1 = new JoinNode(1, ts, os);
49: final BetaNode j2 = new JoinNode(2, ts, os);
50: final BetaNode n1 = new NotNode(3, ts, os);
51: final BetaNode n2 = new NotNode(4, ts, os);
52:
53: assertEquals(j1, j1);
54: assertEquals(j2, j2);
55: assertEquals(j1, j2);
56: assertEquals(n1, n1);
57: assertEquals(n2, n2);
58: assertEquals(n1, n2);
59:
60: assertFalse(j1.equals(n1));
61: assertFalse(j1.equals(n2));
62: assertFalse(n1.equals(j1));
63: assertFalse(n1.equals(j2));
64: }
65:
66: }
|