assertEquals("b", rm.attributes[1].value);
}
public void testMetaData() {
GuidedDTDRLPersistence p = new GuidedDTDRLPersistence();
String[] row = new String[] {"1", "desc", "bar", ""};
List<MetadataCol> metadataCols = new ArrayList<MetadataCol>();
RuleModel rm = new RuleModel();
RuleMetadata[] orig = rm.metadataList;
// RuleAttribute[] orig = rm.attributes;
p.doMetadata(metadataCols, row, rm);
// p.doAttribs(0,metadataCols, row, rm);
assertSame(orig, rm.metadataList);
MetadataCol col1 = new MetadataCol();
col1.attr = "foo";
MetadataCol col2 = new MetadataCol();
col2.attr = "foo2";
metadataCols.add(col1);
metadataCols.add(col2);
p.doMetadata(metadataCols, row, rm);
// p.doAttribs(0, metadataCols, row, rm);
assertEquals(1, rm.metadataList.length);
assertEquals("foo", rm.metadataList[0].attributeName);
assertEquals("bar", rm.metadataList[0].value);
row = new String[] {"1", "desc", "bar1", "bar2"};
p.doMetadata(metadataCols, row, rm);
assertEquals(2, rm.metadataList.length);
assertEquals("foo", rm.metadataList[0].attributeName);
assertEquals("bar1", rm.metadataList[0].value);
assertEquals("foo2", rm.metadataList[1].attributeName);
assertEquals("bar2", rm.metadataList[1].value);