Removed old tests
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/private/luca.frosini/infrastructure-tests@166939 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
197c1e3677
commit
961a63d1c5
|
@ -54,29 +54,24 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped
|
|||
|
||||
private Map<String, Object> getAggregateInputs() throws Exception {
|
||||
Map<String, Object> inputs = new HashMap<String, Object>();
|
||||
inputs.put(AccountingAggregatorPlugin.AGGREGATION_TYPE_INPUT_PARAMETER, AggregationType.DAILY.name());
|
||||
|
||||
inputs.put(AccountingAggregatorPlugin.AGGREGATION_TYPE_INPUT_PARAMETER, AggregationType.MONTHLY.name());
|
||||
|
||||
inputs.put(AccountingAggregatorPlugin.ELABORATION_TYPE_INPUT_PARAMETER, ElaborationType.AGGREGATE.name());
|
||||
|
||||
|
||||
inputs.put(AccountingAggregatorPlugin.PERSIST_START_TIME_INPUT_PARAMETER, Utility.getPersistTimeParameter(3, 0));
|
||||
inputs.put(AccountingAggregatorPlugin.PERSIST_END_TIME_INPUT_PARAMETER, Utility.getPersistTimeParameter(19, 00));
|
||||
|
||||
inputs.put(AccountingAggregatorPlugin.RECORD_TYPE_INPUT_PARAMETER,
|
||||
ServiceUsageRecord.class.newInstance().getRecordType());
|
||||
|
||||
Calendar aggregationStartCalendar = Utility.getAggregationStartCalendar(2017, Calendar.SEPTEMBER, 17);
|
||||
inputs.put(AccountingAggregatorPlugin.RECORD_TYPE_INPUT_PARAMETER, StorageUsageRecord.class.newInstance().getRecordType());
|
||||
|
||||
Calendar aggregationStartCalendar = Utility.getAggregationStartCalendar(2016, Calendar.FEBRUARY, 1);
|
||||
String aggregationStartDate = AccountingAggregatorPlugin.AGGREGATION_START_DATE_DATE_FORMAT.format(aggregationStartCalendar.getTime());
|
||||
logger.trace("{} : {}", AccountingAggregatorPlugin.AGGREGATION_START_DATE_INPUT_PARAMETER, aggregationStartDate);
|
||||
inputs.put(AccountingAggregatorPlugin.AGGREGATION_START_DATE_INPUT_PARAMETER, aggregationStartDate);
|
||||
|
||||
/*
|
||||
Calendar aggregationEndCalendar = Utility.getAggregationStartCalendar(2017, Calendar.SEPTEMBER, 23);
|
||||
String aggregationEndDate = AccountingAggregatorPlugin.AGGREGATION_START_DATE_DATE_FORMAT.format(aggregationEndCalendar.getTime());
|
||||
logger.trace("{} : {}", AccountingAggregatorPlugin.AGGREGATION_START_DATE_INPUT_PARAMETER, aggregationEndDate);
|
||||
inputs.put(AccountingAggregatorPlugin.AGGREGATION_END_DATE_INPUT_PARAMETER, aggregationEndDate);
|
||||
*/
|
||||
|
||||
inputs.put(AccountingAggregatorPlugin.RESTART_FROM_LAST_AGGREGATION_DATE_INPUT_PARAMETER, false);
|
||||
inputs.put(AccountingAggregatorPlugin.RESTART_FROM_LAST_AGGREGATION_DATE_INPUT_PARAMETER, true);
|
||||
|
||||
return inputs;
|
||||
}
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
package org.gcube.resourceregistry;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.gcube.common.scope.impl.ScopeBean;
|
||||
import org.gcube.context.ContextElaborator;
|
||||
import org.gcube.informationsystem.impl.entity.ContextImpl;
|
||||
import org.gcube.informationsystem.impl.utils.ISMapper;
|
||||
import org.gcube.informationsystem.model.entity.Context;
|
||||
import org.gcube.informationsystem.resourceregistry.context.ContextManagement;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
public class ContextCreator extends ContextElaborator {
|
||||
|
||||
protected Map<String, UUID> contexts;
|
||||
|
||||
protected ContextManagement contextManagement;
|
||||
|
||||
public ContextCreator() {
|
||||
super();
|
||||
contexts = new HashMap<>();
|
||||
contextManagement = new ContextManagement();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void elaborateContext(ScopeBean scopeBean) throws Exception {
|
||||
UUID parentUUID = null;
|
||||
switch(scopeBean.type()) {
|
||||
case INFRASTRUCTURE:
|
||||
parentUUID = null;
|
||||
break;
|
||||
|
||||
default:
|
||||
parentUUID = getParentUUID(scopeBean);
|
||||
break;
|
||||
}
|
||||
|
||||
Context context = new ContextImpl(scopeBean.name());
|
||||
context.setParent(parentUUID);
|
||||
contextManagement.setJSON(ISMapper.marshal(context));
|
||||
String created = contextManagement.create();
|
||||
context = ISMapper.unmarshal(Context.class, created);
|
||||
contexts.put(scopeBean.toString(), context.getHeader().getUUID());
|
||||
}
|
||||
|
||||
private UUID getParentUUID(ScopeBean scopeBean) {
|
||||
String parent = scopeBean.toString().replace("/" + scopeBean.name(), "");
|
||||
return contexts.get(parent);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package org.gcube.resourceregistry;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class ContextCreatorTest extends org.gcube.ScopedTest {
|
||||
|
||||
@Test
|
||||
public void createAll() throws Exception {
|
||||
File src = new File("src");
|
||||
File test = new File(src, "test");
|
||||
File resources = new File(test, "resources");
|
||||
|
||||
File voFile = new File(resources, "scopedata.xml");
|
||||
|
||||
ContextCreator contextCreator = new ContextCreator();
|
||||
contextCreator.all(voFile);
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue