@Test
public void testAttributes() {

    final ConversionResult result = new ConversionResult();
    final List<DataListener> listeners = new ArrayList<DataListener>();
    final GuidedDecisionTableGeneratorListener listener = new GuidedDecisionTableGeneratorListener(result,
                                                                                                   dmo);
    listeners.add(listener);
    //Convert
    final ExcelParser parser = new ExcelParser(listeners);
    final InputStream is = this.getClass().getResourceAsStream("Attributes.xls");
    try {
        parser.parseFile(is);
    } finally {
        try {
            is.close();
        } catch (IOException ioe) {
            fail(ioe.getMessage());
        }
    }
    //Check conversion results
    assertEquals(0,
                 result.getMessages().size());
    //Check basics
    List<GuidedDecisionTable52> dtables = listener.getGuidedDecisionTables();
    assertNotNull(dtables);
    assertEquals(1,
                 dtables.size());
    GuidedDecisionTable52 dtable = dtables.get(0);
    assertEquals("AttributesTest",
                 dtable.getTableName());
    assertEquals(GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY,
                 dtable.getTableFormat());
    //Check expanded columns
    List<BaseColumn> columns = dtable.getExpandedColumns();
    assertNotNull(columns);
    assertEquals(13,
                 columns.size());
    assertTrue(columns.get(0) instanceof RowNumberCol52);
    assertTrue(columns.get(1) instanceof RuleNameColumn);
    assertTrue(columns.get(2) instanceof DescriptionCol52);
    assertTrue(columns.get(3) instanceof AttributeCol52);
    assertTrue(columns.get(4) instanceof AttributeCol52);
    assertTrue(columns.get(5) instanceof AttributeCol52);
    assertTrue(columns.get(6) instanceof AttributeCol52);
    assertTrue(columns.get(7) instanceof AttributeCol52);
    assertTrue(columns.get(8) instanceof AttributeCol52);
    assertTrue(columns.get(9) instanceof AttributeCol52);
    assertTrue(columns.get(10) instanceof AttributeCol52);
    assertTrue(columns.get(11) instanceof AttributeCol52);
    assertTrue(columns.get(12) instanceof AttributeCol52);
    //Check individual attributes
    AttributeCol52 attrCol2 = ((AttributeCol52) columns.get(3));
    assertEquals(Attribute.SALIENCE.getAttributeName(),
                 attrCol2.getAttribute());
    assertFalse(attrCol2.isUseRowNumber());
    assertFalse(attrCol2.isReverseOrder());
    AttributeCol52 attrCol3 = ((AttributeCol52) columns.get(4));
    assertEquals(Attribute.ACTIVATION_GROUP.getAttributeName(),
                 attrCol3.getAttribute());
    AttributeCol52 attrCol4 = ((AttributeCol52) columns.get(5));
    assertEquals(Attribute.DURATION.getAttributeName(),
                 attrCol4.getAttribute());
    AttributeCol52 attrCol5 = ((AttributeCol52) columns.get(6));
    assertEquals(Attribute.TIMER.getAttributeName(),
                 attrCol5.getAttribute());
    AttributeCol52 attrCol6 = ((AttributeCol52) columns.get(7));
    assertEquals(Attribute.CALENDARS.getAttributeName(),
                 attrCol6.getAttribute());
    AttributeCol52 attrCol7 = ((AttributeCol52) columns.get(8));
    assertEquals(Attribute.NO_LOOP.getAttributeName(),
                 attrCol7.getAttribute());
    AttributeCol52 attrCol8 = ((AttributeCol52) columns.get(9));
    assertEquals(Attribute.LOCK_ON_ACTIVE.getAttributeName(),
                 attrCol8.getAttribute());
    AttributeCol52 attrCol9 = ((AttributeCol52) columns.get(10));
    assertEquals(Attribute.AUTO_FOCUS.getAttributeName(),
                 attrCol9.getAttribute());
    AttributeCol52 attrCol10 = ((AttributeCol52) columns.get(11));
    assertEquals(Attribute.AGENDA_GROUP.getAttributeName(),
                 attrCol10.getAttribute());
    AttributeCol52 attrCol11 = ((AttributeCol52) columns.get(12));
    assertEquals(Attribute.RULEFLOW_GROUP.getAttributeName(),
                 attrCol11.getAttribute());
    //Check data
    assertEquals(2,
                 dtable.getData().size());
    assertTrue(isRowEquivalent(new Object[]{1, "", "Specific rule 1", 1, "g1", 100l, "T1", "CAL1", true, true, true, "AG1", "RFG1"},
                               dtable.getData().get(0)));
    assertTrue(isRowEquivalent(new Object[]{2, "", "Specific rule 2", 2, "g2", 200l, "T2", "CAL2", false, false, false, "AG2", "RFG2"},
                               dtable.getData().get(1)));
}