use of eu.europeana.metis.schema.jibx.BitRate in project metis-framework by europeana.
the class DereferenceUtilsTest method testWebResourceListExtractedValues.
@Test
void testWebResourceListExtractedValues() {
RDF rdf = new RDF();
ProxyType proxy = new ProxyType();
ArrayList<ProxyType> proxyList = new ArrayList<>();
proxyList.add(proxy);
rdf.setProxyList(proxyList);
WebResourceType webResource = new WebResourceType();
Created created = new Created();
Resource resource1 = new Resource();
resource1.setResource("http://dummy1.dum");
created.setResource(resource1);
ArrayList<Created> createdList = new ArrayList<>();
createdList.add(created);
webResource.setCreatedList(createdList);
Extent extent = new Extent();
Resource resource2 = new Resource();
resource2.setResource("http://dummy2.dum");
extent.setResource(resource2);
ArrayList<Extent> extentList = new ArrayList<>();
extentList.add(extent);
webResource.setExtentList(extentList);
Format format = new Format();
ResourceOrLiteralType.Resource resource3 = new ResourceOrLiteralType.Resource();
resource3.setResource("http://dummy3.dum");
format.setResource(resource3);
ArrayList<Format> formatList = new ArrayList<>();
formatList.add(format);
webResource.setFormatList(formatList);
HasPart hasPart = new HasPart();
Resource resource4 = new Resource();
resource4.setResource("http://dummy4.dum");
hasPart.setResource(resource4);
ArrayList<HasPart> hasPartList = new ArrayList<>();
hasPartList.add(hasPart);
webResource.setHasPartList(hasPartList);
IsFormatOf isFormatOf = new IsFormatOf();
Resource resource5 = new Resource();
resource5.setResource("http://dummy5.dum");
isFormatOf.setResource(resource5);
ArrayList<IsFormatOf> isFormatOfList = new ArrayList<>();
isFormatOfList.add(isFormatOf);
webResource.setIsFormatOfList(isFormatOfList);
Issued issued = new Issued();
Resource resource6 = new Resource();
resource6.setResource("http://dummy6.dum");
issued.setResource(resource6);
ArrayList<Issued> issuedList = new ArrayList<>();
issuedList.add(issued);
webResource.setIssuedList(issuedList);
// Should be rejected
BitRate bitRate = new BitRate();
bitRate.setDatatype("Data Type");
webResource.setBitRate(bitRate);
ArrayList<WebResourceType> webResourceList = new ArrayList<>();
webResourceList.add(webResource);
rdf.setWebResourceList(webResourceList);
Set<String> result = DereferenceUtils.extractReferencesForDereferencing(rdf);
assertNotNull(result);
assertEquals(5, result.size());
assertTrue(result.contains("http://dummy1.dum"));
assertTrue(result.contains("http://dummy2.dum"));
assertTrue(result.contains("http://dummy3.dum"));
assertTrue(result.contains("http://dummy5.dum"));
assertTrue(result.contains("http://dummy6.dum"));
}
Aggregations