public void testValidateDataNodes() throws Exception {
// should succeed
DataDomain d1 = new DataDomain("abc");
DataNode n1 = new DataNode("1");
n1.setAdapter(new JdbcAdapter());
n1.setDataSourceFactory("123");
n1.setDataSourceLocation("qqqq");
d1.addNode(n1);
validator.reset();
new DataNodeValidator().validateObject(new ProjectPath(new Object[] { project, d1, n1 }), validator);
assertValidator(ValidationInfo.VALID);
// should complain about no location
DataNode n2 = new DataNode("2");
n2.setAdapter(new JdbcAdapter());
n2.setDataSourceFactory("123");
d1.addNode(n2);
validator.reset();
new DataNodeValidator().validateObject(new ProjectPath(new Object[] { project, d1, n2 }), validator);
assertValidator(ValidationInfo.ERROR);
// should complain about duplicate name
DataNode n3 = new DataNode("3");
n3.setAdapter(new JdbcAdapter());
n3.setDataSourceFactory("123");
d1.addNode(n3);
n3.setName(n1.getName());
validator.reset();