1 package org.drools.rule;
2
3 import org.drools.spi.ObjectType;
4 import org.drools.semantics.java.ClassObjectType;
5
6 import junit.framework.TestCase;
7
8 public class DeclarationTest extends TestCase
9 {
10 public DeclarationTest(String name)
11 {
12 super( name );
13 }
14
15 public void setUp()
16 {
17 }
18
19 public void tearDown()
20 {
21 }
22
23 public void testConstruct()
24 {
25 ClassObjectType type = new ClassObjectType( String.class );
26
27 Declaration decl = new Declaration( type,
28 "cheese" );
29
30 assertSame( type,
31 decl.getObjectType() );
32
33 assertEquals( "cheese",
34 decl.getIdentifier() );
35 }
36
37 public void testEquals()
38 {
39 Declaration decl1 = new Declaration( new ClassObjectType( String.class ),
40 "cheese" );
41
42 Declaration decl2 = new Declaration( new ClassObjectType( String.class ),
43 "cheese" );
44
45 Declaration decl3 = new Declaration( new ClassObjectType( Object.class ),
46 "cheese" );
47
48 assertTrue( decl1.equals( decl2 ) );
49
50 assertTrue( ! decl2.equals( decl3 ) );
51 }
52 }
This page was automatically generated by Maven