Example usage for javax.xml.registry.infomodel RegistryPackage getRegistryObjects

List of usage examples for javax.xml.registry.infomodel RegistryPackage getRegistryObjects

Introduction

In this page you can find the example usage for javax.xml.registry.infomodel RegistryPackage getRegistryObjects.

Prototype

Set getRegistryObjects() throws JAXRException;

Source Link

Document

Gets the collection of member RegistryObjects of this RegistryPackage.

Usage

From source file:it.cnr.icar.eric.client.xml.registry.infomodel.RegistryPackageTest.java

/** Test query of a RegistryPackage and member
 *  Services  **//*w  w w .  ja v a 2  s  . c om*/
@SuppressWarnings("rawtypes")
public void testQuery() throws Exception {
    // -- Get the Registry Package
    RegistryPackage pkg = (RegistryPackage) getBQM().getRegistryObject(pkgId);
    Assert.assertNotNull("RegistryPackage was not found when queried by id.", pkg);

    // -- Get the Member Services
    java.util.Set members = pkg.getRegistryObjects();
    Assert.assertNotNull("RegistryPackage must not have null for members.", members);

    Assert.assertEquals("The RegistryPackage does not have expected number of members.", 1, members.size());

    java.util.Iterator itr = members.iterator();
    RegistryObject service = (RegistryObject) itr.next();

    Assert.assertEquals("The member does not have the expected id.", serviceId, service.getKey().getId());

}