Search in sources :

Example 1 with Initialize

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);
    }
}
Also used : HashMap(java.util.HashMap) Initialize(org.apache.airavata.replica.catalog.util.Initialize) ReplicaCatalogException(org.apache.airavata.registry.cpi.ReplicaCatalogException) BeforeClass(org.junit.BeforeClass)

Aggregations

HashMap (java.util.HashMap)1 ReplicaCatalogException (org.apache.airavata.registry.cpi.ReplicaCatalogException)1 Initialize (org.apache.airavata.replica.catalog.util.Initialize)1 BeforeClass (org.junit.BeforeClass)1