}
final ClientImportProcessor importProcessor = new ClientImportProcessor();
importProcessor.setNewName("" + System.currentTimeMillis());
try {
final ImportResult ir = DataImportService.getInstance().importClientData(importProcessor,
false, new StringReader(xml));
xml = null;
if (ir.getException() != null) {
throw new OBException(ir.getException());
}
if (ir.getErrorMessages() != null) {
fail(ir.getErrorMessages());
}
// none should be updated!
assertEquals(0, ir.getUpdatedObjects().size());
String newClientId = null;
// and never insert anything in client 0
for (final BaseOBObject bob : ir.getInsertedObjects()) {
if (bob instanceof ClientEnabled) {
final ClientEnabled ce = (ClientEnabled) bob;
assertNotNull(ce.getClient());
assertTrue(!ce.getClient().getId().equals("0"));
newClientId = ce.getClient().getId();