use of org.apache.airavata.replica.catalog.util.Initialize in project airavata by apache.
the class ReplicaCatalogTest method setUp.
@BeforeClass
public static void setUp() {
try {
System.out.println("********** SET UP ************");
initialize = new Initialize("replicacatalog-derby.sql");
initialize.initializeDB();
replicacatalog = RegistryFactory.getReplicaCatalog();
dataProductModel = new DataProductModel();
dataProductModel.setProductName("test-file.txt");
dataProductModel.setOwnerName("scnakandala");
dataProductModel.setGatewayId("default");
dataProductModel.setDataProductType(DataProductType.FILE);
HashMap<String, String> resMetadata = new HashMap<>();
resMetadata.put("name", "name");
dataProductModel.setProductMetadata(resMetadata);
replicaLocationModel = new DataReplicaLocationModel();
replicaLocationModel.setReplicaName("1-st-replica");
replicaLocationModel.setReplicaLocationCategory(ReplicaLocationCategory.COMPUTE_RESOURCE);
replicaLocationModel.setReplicaPersistentType(ReplicaPersistentType.PERSISTENT);
HashMap<String, String> rMetadata = new HashMap<>();
rMetadata.put("name", "name");
replicaLocationModel.setReplicaMetadata(rMetadata);
dataProductModel.addToReplicaLocations(replicaLocationModel);
} catch (ReplicaCatalogException e) {
logger.error(e.getMessage(), e);
}
}
Aggregations