@Test public void testGetResourceSummaries() { MapEntryQueryServiceRestrictions restrictions = new MapEntryQueryServiceRestrictions(); NameOrURI mapVersion = ModelUtils.nameOrUriFromName("MappingSample-1.0"); restrictions.setMapVersion(mapVersion); MapEntryQueryImpl mapEntryQueryImpl = new MapEntryQueryImpl(null, null, null, restrictions); SortCriteria sortCriteria = null; Page page = new Page(); DirectoryResult<MapEntryDirectoryEntry> list = this.service.getResourceSummaries(mapEntryQueryImpl, sortCriteria, page); assertNotNull(list); assertEquals(6, list.getEntries().size()); }
@Test public void testGetResourceSummariesValidXml() throws Exception { MapEntryQueryServiceRestrictions restrictions = new MapEntryQueryServiceRestrictions(); NameOrURI mapVersion = ModelUtils.nameOrUriFromName("MappingSample-1.0"); restrictions.setMapVersion(mapVersion); MapEntryQueryImpl mapEntryQueryImpl = new MapEntryQueryImpl(null, null, null, restrictions); SortCriteria sortCriteria = null; Page page = new Page(); DirectoryResult<MapEntryDirectoryEntry> list = this.service.getResourceSummaries(mapEntryQueryImpl, sortCriteria, page); assertNotNull(list); assertEquals(6, list.getEntries().size()); for (MapEntryDirectoryEntry entry : list.getEntries()) { this.marshaller.marshal(entry, new StreamResult(new StringWriter())); } }
@Test public void testGetResourceSummariesTargetRestriction() throws Exception { MapEntryQueryServiceRestrictions restrictions = new MapEntryQueryServiceRestrictions(); NameOrURI mapVersion = ModelUtils.nameOrUriFromName("MappingSample-1.0"); restrictions.setMapVersion(mapVersion); EntityNameOrURI target = new EntityNameOrURI(); target.setEntityName(ModelUtils.createScopedEntityName("E0001", "GermanMadePartsNamespace")); restrictions.getTargetEntities().add(target); MapEntryQueryImpl mapEntryQueryImpl = new MapEntryQueryImpl(null, null, null, restrictions); SortCriteria sortCriteria = null; Page page = new Page(); DirectoryResult<MapEntryDirectoryEntry> list = this.service.getResourceSummaries(mapEntryQueryImpl, sortCriteria, page); assertNotNull(list); assertEquals(3, list.getEntries().size()); }