// check the attributes
assertEquals("application/xml", gr.getOutputFormat());
assertEquals("urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0", gr.getOutputSchema());
// the query
QueryType query = (QueryType) gr.getQuery();
List<QName> expected = new ArrayList<QName>();
String rimNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0";
expected.add(new QName(rimNamespace, "Service"));
expected.add(new QName(rimNamespace, "Classification"));
expected.add(new QName(rimNamespace, "Association"));
assertEquals(expected, query.getTypeNames());
// the element set name
ElementSetNameType esn = query.getElementSetName();
expected.clear();
expected.add(new QName(rimNamespace, "Service"));
assertEquals(expected, esn.getTypeNames());
assertEquals(ElementSetType.BRIEF, esn.getValue());
// the sort by properties
SortBy[] sorts = query.getSortBy();
assertEquals(2, sorts.length);
assertEquals("rim:foo", sorts[0].getPropertyName().getPropertyName());
assertEquals(SortOrder.ASCENDING, sorts[0].getSortOrder());
assertEquals("rim:bar", sorts[1].getPropertyName().getPropertyName());
assertEquals(SortOrder.DESCENDING, sorts[1].getSortOrder());