rec.setField("ID_COLOR", value0.printText(foreignKeyDef.getIndexType().getName()));
String idColor = value0.printText(foreignKeyDef.getIndexType().getName()); assertEquals("0", idColor); rec.setField("ID_COLOR", idColor);
	public void testSetRecordInsert() {		try {			DBTable tab = db.getTable("TABLE1");			int numberOfRecords = tab.getNumberOfRecords(null);			assertEquals(500, numberOfRecords);			Record rec = tab.getEmptyRecord();			rec.setField("TEXT", "Ein neuer Text mit Nummer 254");			rec.setField("DATUM", "14.02.1964");			rec.setField("ZAHL", "9999");			TypeDefinition fieldDef = rec.getTable().getFieldDef("ID_COLOR");			if (fieldDef instanceof TypeDefinitionForeignKey) {				TypeDefinitionForeignKey foreignKeyDef = (TypeDefinitionForeignKey) fieldDef;				List possibleValues = foreignKeyDef.getPossibleValues();				Record value0 = (Record) possibleValues.get(0);				assertEquals("rot", value0.printText(foreignKeyDef.getReferenceType().getName()));				rec.setField("ID_COLOR", value0.printText(foreignKeyDef.getIndexType().getName()));			} else {				fail("Spalte ist Foreign Key!");			}			tab.setRecord(rec);			numberOfRecords = tab.getNumberOfRecords(null);			assertEquals(501, numberOfRecords);			IWhereClause where = new WhereClause();			where.addWhereLikeLeft("TEXT", "Ein neuer Text");			assertEquals(1, tab.getNumberOfRecords(where));		} catch (DatabaseException e) {			fail(e.getMessage());		}	}