Using new if-model APIs

This commit is contained in:
Luca Frosini 2023-02-02 13:34:57 +01:00
parent f1f17cdfb1
commit 1cfbcd8529
1 changed files with 2 additions and 19 deletions

View File

@ -1,10 +1,8 @@
package org.gcube.informationsystem.model.discovery;
import java.util.ArrayList;
import java.util.List;
import java.util.ServiceLoader;
import org.gcube.informationsystem.base.reference.AccessType;
import org.gcube.informationsystem.base.reference.Element;
import org.gcube.informationsystem.base.reference.entities.EntityElement;
import org.gcube.informationsystem.base.reference.properties.PropertyElement;
@ -16,6 +14,7 @@ import org.gcube.informationsystem.types.reference.properties.PropertyDefinition
import org.gcube.informationsystem.types.reference.properties.PropertyType;
import org.gcube.informationsystem.types.reference.relations.RelationType;
import org.gcube.informationsystem.utils.ElementMapper;
import org.gcube.informationsystem.utils.discovery.Discovery;
import org.gcube.informationsystem.utils.discovery.ElementSpecilizationDiscovery;
import org.gcube.informationsystem.utils.discovery.RegistrationProvider;
import org.gcube.informationsystem.utils.discovery.SchemaAction;
@ -61,23 +60,7 @@ public class EntityDiscoveryTest {
}
};
List<Package> packages = new ArrayList<Package>();
Class<Type> tdClz = Type.class;
packages.add(tdClz.getPackage());
AccessType[] accessTypes = AccessType.values();
for(AccessType accessType : accessTypes) {
Class<Element> clz = accessType.getTypeClass();
packages.add(clz.getPackage());
}
ServiceLoader<? extends RegistrationProvider> regsitrationProviders = ServiceLoader
.load(RegistrationProvider.class);
for(RegistrationProvider registrationProvider : regsitrationProviders) {
packages.addAll(registrationProvider.getPackagesToRegister());
}
ElementSpecilizationDiscovery.manageISM(schemaAction, packages);
Discovery.discover(schemaAction);
}
@Test