Fixing tests

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/private/luca.frosini/infrastructure-tests@152640 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2017-09-04 13:43:32 +00:00
parent 886009490d
commit 0d5da0bc19
3 changed files with 8 additions and 7 deletions

View File

@ -61,7 +61,7 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped
ServiceUsageRecord.class.newInstance().getRecordType());
// Start Aggregation Date
Calendar aggregationStartCalendar = Utility.getAggregationStartCalendar(2017, Calendar.JUNE,
Calendar aggregationStartCalendar = Utility.getAggregationStartCalendar(2017, Calendar.APRIL,
1);
String aggregationStartDate = AccountingAggregatorPlugin.AGGREGATION_START_DATE_DATE_FORMAT
.format(aggregationStartCalendar.getTime());
@ -69,7 +69,7 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped
aggregationStartDate);
inputs.put(AccountingAggregatorPlugin.AGGREGATION_START_DATE_INPUT_PARAMETER, aggregationStartDate);
inputs.put(AccountingAggregatorPlugin.RESTART_FROM_LAST_AGGREGATION_DATE_INPUT_PARAMETER, true);
inputs.put(AccountingAggregatorPlugin.RESTART_FROM_LAST_AGGREGATION_DATE_INPUT_PARAMETER, false);
return inputs;
}
@ -92,12 +92,12 @@ public class AggregatorAccountingPluginSmartExecutorSchedulerTest extends Scoped
public void aggregate() throws Exception {
// Every 15 minutes
CronExpression cronExpression = new CronExpression("0 0/15 * 1/1 * ? *");
Scheduling scheduling = new Scheduling(cronExpression, false);
Scheduling scheduling = new Scheduling(cronExpression, true);
scheduling.setGlobal(false);
Map<String, Object> inputs = getAggregateInputs();
launch(scheduling, inputs);
launch(null, inputs);
}

View File

@ -1,10 +1,11 @@
package org.gcube.accounting.analytics.persistence.couchbase;
import java.text.SimpleDateFormat;
import java.text.DateFormat;
import java.util.Calendar;
import java.util.concurrent.TimeUnit;
import org.gcube.accounting.aggregator.aggregation.AggregationType;
import org.gcube.accounting.aggregator.utility.Utility;
import org.gcube.accounting.analytics.persistence.AccountingPersistenceBackendQueryConfiguration;
import org.gcube.testutility.ScopedTest;
import org.junit.Test;
@ -43,7 +44,7 @@ public class RemoveOldRecords extends ScopedTest {
AccountingPersistenceQueryCouchBase accountingPersistenceQueryCouchBase = new AccountingPersistenceQueryCouchBase();
accountingPersistenceQueryCouchBase.prepareConnection(configuration);
SimpleDateFormat format = new SimpleDateFormat(AggregationType.DAILY.getDateFormatPattern());
DateFormat format = Utility.getUTCDateFormat(AggregationType.DAILY.getDateFormatPattern());
Calendar start = Calendar.getInstance();
start.set(Calendar.YEAR, 1970);

View File

@ -203,7 +203,7 @@ public class TestUsageRecord {
inputParameters.put(TEST_NESTED_MAP, parameter);
usageRecord.setInputParameters(inputParameters);
//usageRecord.setInputParameters(inputParameters);
} catch (InvalidValueException e) {
logger.error(" ------ You SHOULD NOT SEE THIS MESSAGE. Error Creating a test Usage Record", e);