thrown exception to test
This commit is contained in:
parent
bfbf0e4c65
commit
81a0a81e1e
|
@ -118,8 +118,9 @@ public class MetadataProfileReader implements MetadataProfileDiscovery {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read namespaces.
|
* Read namespaces.
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private void readNamespaces() {
|
private void readNamespaces() throws Exception {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (namespaceCategories == null || namespaceCategories.isEmpty()) {
|
if (namespaceCategories == null || namespaceCategories.isEmpty()) {
|
||||||
|
@ -132,6 +133,7 @@ public class MetadataProfileReader implements MetadataProfileDiscovery {
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.debug("An error occurred during read namespaces for categories: ", e);
|
logger.debug("An error occurred during read namespaces for categories: ", e);
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,40 +27,37 @@ public class TestDataCatalogueMetadataFormatReader {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test.
|
* Test.
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void test() {
|
public void test() throws Exception {
|
||||||
try {
|
|
||||||
|
|
||||||
// String scopeString = "/gcube/devsec/devVRE";
|
// String scopeString = "/gcube/devsec/devVRE";
|
||||||
// String grMetadataProfileSecondaryType = "DataCatalogueMetadata";
|
// String grMetadataProfileSecondaryType = "DataCatalogueMetadata";
|
||||||
|
|
||||||
String scopeString = "/gcube/devsec/devVRE";
|
String scopeString = "/gcube/devsec/devVRE";
|
||||||
String grMetadataProfileSecondaryType = "GeoNaMetadata";
|
String grMetadataProfileSecondaryType = "GeoNaMetadata";
|
||||||
|
|
||||||
ScopeProvider.instance.set(scopeString);
|
ScopeProvider.instance.set(scopeString);
|
||||||
MetadataProfileReader reader = new MetadataProfileReader(grMetadataProfileSecondaryType);
|
MetadataProfileReader reader = new MetadataProfileReader(grMetadataProfileSecondaryType);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
List<NamespaceCategory> categs = reader.getListOfNamespaceCategories();
|
List<NamespaceCategory> categs = reader.getListOfNamespaceCategories();
|
||||||
for (NamespaceCategory namespaceCategory : categs) {
|
for (NamespaceCategory namespaceCategory : categs) {
|
||||||
logger.trace("\n\n "+ ++i +".) Category: "+namespaceCategory);
|
logger.trace("\n\n "+ ++i +".) Category: "+namespaceCategory);
|
||||||
}
|
|
||||||
|
|
||||||
i = 0;
|
|
||||||
for (MetadataProfile mt : reader.getListOfMetadataProfiles()) {
|
|
||||||
|
|
||||||
if(mt==null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
MetadataFormat metadataFormat = reader.getMetadataFormatForMetadataProfile(mt);
|
|
||||||
logger.trace("\n\n "+ ++i +".) Metadata source: "+metadataFormat.getMetadataSource().substring(0, 100));
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
for (MetadataProfile mt : reader.getListOfMetadataProfiles()) {
|
||||||
|
|
||||||
|
if(mt==null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
MetadataFormat metadataFormat = reader.getMetadataFormatForMetadataProfile(mt);
|
||||||
|
logger.trace("\n\n "+ ++i +".) Metadata source: "+metadataFormat.getMetadataSource().substring(0, 100));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue