RegistryService rs = connection.getRegistryService();
BusinessQueryManager bqm = rs.getBusinessQueryManager();
blm = rs.getBusinessLifeCycleManager();
InternationalString is;
BulkResponse br;
Key key;
Locale locale = Locale.GERMAN;
// create Organization
Organization organization = (Organization) blm.createObject(BusinessLifeCycleManager.ORGANIZATION);
is = getIString(locale, "Apache Scout Org");
is.setValue(Locale.JAPANESE, "Apache Scoot Org");
organization.setName(is);
is = getIString(locale, "This is the org for Apache Scout Test");
is.setValue(Locale.JAPANESE, "This is the org for Apache Scout Test");
organization.setDescription(is);
Collection<Organization> organizations = new ArrayList<Organization>();
organizations.add(organization);
br = blm.saveOrganizations(organizations);
checkResponse(br);
assertEquals(1, br.getCollection().size());
key = (Key) br.getCollection().iterator().next();
Organization organization1 = (Organization) bqm.getRegistryObject(key.getId(), LifeCycleManager.ORGANIZATION);
System.out.println(organization1.getName().getValue() + " " + organization1.getDescription().getValue());
assertEquals(organization.getName().getValue(locale),
organization1.getName().getValue(locale));
assertEquals(organization.getName().getValue(Locale.JAPANESE),
organization1.getName().getValue(Locale.JAPANESE));
assertEquals(organization.getDescription().getValue(locale),
organization1.getDescription().getValue(locale));
assertEquals(organization.getDescription().getValue(Locale.JAPANESE),
organization1.getDescription().getValue(Locale.JAPANESE));
// create Service
Service service = (Service) blm.createObject(BusinessLifeCycleManager.SERVICE);
is = getIString(locale, "Apache Scout Service");
is.setValue(Locale.JAPANESE, "Apache Scoot Service");
service.setName(is);
is = getIString(locale, "This is the service for Apache Scout Test");
is.setValue(Locale.JAPANESE, "This is the service for Apache Scoot Test");
service.setDescription(is);
organization1.addService(service);
Collection<Service> services = new ArrayList<Service>();
services.add(service);
br = blm.saveServices(services);
checkResponse(br);
assertEquals(1, br.getCollection().size());
key = (Key) br.getCollection().iterator().next();
Service service1 = (Service) bqm.getRegistryObject(key.getId(), LifeCycleManager.SERVICE);
System.out.println(service1.getName().getValue() + " " + service1.getDescription().getValue());