1   package uba.db.table;
2   
3   import junit.framework.TestCase;
4   import uba.db.column.CharColumnSpecification;
5   import uba.db.column.IntegerColumnSpecification;
6   import uba.db.impl.memory.MemoryTable;
7   import uba.db.testhelpers.TestUtils;
8   
9   /***
10   * @version $Revision: 1.2 $
11   */
12  public class RowTest extends TestCase {
13      /***
14       * Test de igualdad entre dos instancias.
15       */
16      public void testEquals() throws Exception {
17          TableSchema schema = new TableSchemaBuilder("prueba")
18                  .addColumn(new IntegerColumnSpecification("id"))
19                  .addColumn(new CharColumnSpecification("nombre", 20)).build();
20          Table table = new MemoryTable(schema);
21          Row row = new Row(table, new Object[] { new Integer(1), "a" });
22          Row sameRow = new Row(table, new Object[] { new Integer(1), "a" });
23          Row otherRow = new Row(table, new Object[] { new Integer(2), "b" });
24  
25          TestUtils.assertEqualsImplementation(row, sameRow, otherRow);
26      }
27  }