Package siena.base.test.model

Examples of siena.base.test.model.SampleModelMultipleKeys


import junit.framework.TestCase;

public class ModelTest extends TestCase {
 
  public void testEqualsAndHashCode() {
    SampleModelMultipleKeys a = new SampleModelMultipleKeys();
    SampleModelMultipleKeys b = new SampleModelMultipleKeys();
   
    a.id = 1l;
    b.id = 1l;
   
    a.key = "foo";
    b.key = "foo";
   
    assertFalse(a.equals(null));
    assertFalse(a.equals("xxx"));
   
    assertFalse(a == b);
    assertTrue(a.equals(b));
    assertEquals(a.hashCode(), b.hashCode());
   
    b.id = 2L;
    assertFalse(a.equals(b));
    assertNotSame(a.hashCode(), b.hashCode());
  }
View Full Code Here

TOP

Related Classes of siena.base.test.model.SampleModelMultipleKeys

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.