    1   /*
    2    * Copyright (c) 2003
    3    * Information Desire GmbH
    4    * All rights reserved.
    5    */
    6   package com.infodesire.infobit.dao;
    7   import junit.framework.TestCase;
    8   import junit.framework.TestSuite;
    9
    10  /***
    11   * DOCUMENT CLASS - {0}
    12   *
    13   * @author    konstantin
    14   * @created   August 20, 2003
    15   * @version   $Revision: 1.1 $
    16   */
    17  public class EqualityTest extends TestCase {
    18
    19      /***
    20       * Constructor for the EqualityTest object
    21       *
    22       * @param name  Description of Parameter
    23       */
    24      public EqualityTest(String name) {
    25          super(name);
    26      }
    27
    28
    29      /***
    30       * A unit test for JUnit
    31       *
    32       * @exception Exception  Description of Exception
    33       */
    34      public void testBaseEntityEquality() throws Exception {
    35          Integer id = new Integer(0);
    36          AclImpl acl1 = new AclImpl();
    37          AclImpl acl2 = new AclImpl();
    38          acl1.setId(id);
    39          acl2.setId(id);
    40          InfobitImpl ib1 = new InfobitImpl();
    41          InfobitImpl ib2 = new InfobitImpl();
    42          ib1.setId(id);
    43          ib2.setId(id);
    44
    45          assertTrue(acl1.equals(acl2));
    46          assertFalse(acl1.equals(ib1));
    47          assertFalse(acl1.equals(null));
    48          assertTrue(acl2.equals(acl1));
    49
    50          assertEquals(acl1.hashCode(), acl2.hashCode());
    51
    52          assertTrue(ib1.equals(ib2));
    53
    54      }
    55  }

This page was automatically generated by Maven