cleaned tests
This commit is contained in:
parent
5e8f31f384
commit
225b0aacb7
|
@ -37,7 +37,8 @@ public class ContextTest {
|
||||||
public static final String DEVSEC;
|
public static final String DEVSEC;
|
||||||
public static final String DEVVRE;
|
public static final String DEVVRE;
|
||||||
|
|
||||||
public static final String ROOT_PROD;
|
private static final String ROOT_PROD;
|
||||||
|
private static final String ROOT_PRE;
|
||||||
|
|
||||||
protected static final Properties properties;
|
protected static final Properties properties;
|
||||||
|
|
||||||
|
@ -54,6 +55,7 @@ public class ContextTest {
|
||||||
DEVVRE = DEVSEC + "/devVRE";
|
DEVVRE = DEVSEC + "/devVRE";
|
||||||
|
|
||||||
ROOT_PROD = "/d4science.research-infrastructures.eu";
|
ROOT_PROD = "/d4science.research-infrastructures.eu";
|
||||||
|
ROOT_PRE = "/pred4s";
|
||||||
|
|
||||||
DEFAULT_TEST_SCOPE = GCUBE;
|
DEFAULT_TEST_SCOPE = GCUBE;
|
||||||
|
|
||||||
|
@ -162,7 +164,7 @@ public class ContextTest {
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void beforeClass() throws Exception {
|
public static void beforeClass() throws Exception {
|
||||||
setContextByName(ROOT_PROD);
|
setContextByName(DEFAULT_TEST_SCOPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
|
|
|
@ -186,7 +186,6 @@ public class PostgreSQLConnectorTest extends ContextTest {
|
||||||
@Ignore
|
@Ignore
|
||||||
@Test
|
@Test
|
||||||
public void moveStatusFromSrcToDst() throws Exception {
|
public void moveStatusFromSrcToDst() throws Exception {
|
||||||
ContextTest.setContextByName(ROOT_PROD);
|
|
||||||
AggregatorPersistenceStatusSrc apsSrc = AggregatorPersistenceFactory.getAggregatorPersistenceStatusSrc();
|
AggregatorPersistenceStatusSrc apsSrc = AggregatorPersistenceFactory.getAggregatorPersistenceStatusSrc();
|
||||||
List<AggregationStatus> aggregationStatuses = apsSrc.getAll();
|
List<AggregationStatus> aggregationStatuses = apsSrc.getAll();
|
||||||
for(AggregationStatus aggregationStatus : aggregationStatuses) {
|
for(AggregationStatus aggregationStatus : aggregationStatuses) {
|
||||||
|
|
|
@ -24,8 +24,6 @@ public class AccountingAggregatorPluginTest extends ContextTest {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(AccountingAggregatorPluginTest.class);
|
private static Logger logger = LoggerFactory.getLogger(AccountingAggregatorPluginTest.class);
|
||||||
|
|
||||||
public static final String ROOT_PROD = "/d4science.research-infrastructures.eu";
|
|
||||||
|
|
||||||
private void aggregate(String recordType, AggregationType aggregationType, Calendar aggregationStartCalendar,
|
private void aggregate(String recordType, AggregationType aggregationType, Calendar aggregationStartCalendar,
|
||||||
Calendar aggregationEndCalendar, boolean forceRerun, boolean forceEarlyAggregation, boolean skipAggregation) throws Exception {
|
Calendar aggregationEndCalendar, boolean forceRerun, boolean forceEarlyAggregation, boolean skipAggregation) throws Exception {
|
||||||
Map<String, Object> inputs = new HashMap<String, Object>();
|
Map<String, Object> inputs = new HashMap<String, Object>();
|
||||||
|
@ -79,7 +77,7 @@ public class AccountingAggregatorPluginTest extends ContextTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
// @Ignore
|
||||||
@Test
|
@Test
|
||||||
public void aggregateRecordDaily() throws Exception {
|
public void aggregateRecordDaily() throws Exception {
|
||||||
Set<String> types = new HashSet<>();
|
Set<String> types = new HashSet<>();
|
||||||
|
@ -92,8 +90,8 @@ public class AccountingAggregatorPluginTest extends ContextTest {
|
||||||
|
|
||||||
for(String recordType : types) {
|
for(String recordType : types) {
|
||||||
AggregationType aggregationType = AggregationType.DAILY;
|
AggregationType aggregationType = AggregationType.DAILY;
|
||||||
Calendar aggregationStartCalendar = Utility.getAggregationStartCalendar(2024, Calendar.FEBRUARY, 29);
|
Calendar aggregationStartCalendar = Utility.getAggregationStartCalendar(2024, Calendar.MARCH, 1);
|
||||||
Calendar end = Utility.getAggregationStartCalendar(2024, Calendar.MARCH, 1);
|
Calendar end = Utility.getAggregationStartCalendar(2024, Calendar.MARCH, 2);
|
||||||
while (aggregationStartCalendar.before(end)) {
|
while (aggregationStartCalendar.before(end)) {
|
||||||
Calendar aggregationEndCalendar = Utility.getEndCalendarFromStartCalendar(aggregationType, aggregationStartCalendar, 1);
|
Calendar aggregationEndCalendar = Utility.getEndCalendarFromStartCalendar(aggregationType, aggregationStartCalendar, 1);
|
||||||
aggregate(recordType, aggregationType, aggregationStartCalendar, aggregationEndCalendar, forceRestart, forceEarlyAggregation, false);
|
aggregate(recordType, aggregationType, aggregationStartCalendar, aggregationEndCalendar, forceRestart, forceEarlyAggregation, false);
|
||||||
|
@ -185,9 +183,6 @@ public class AccountingAggregatorPluginTest extends ContextTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testRecovery() throws Exception {
|
public void testRecovery() throws Exception {
|
||||||
ContextTest.setContextByName(GCUBE);
|
|
||||||
// ContextTest.setContextByName(ROOT_PROD);
|
|
||||||
|
|
||||||
Map<String, Object> inputs = new HashMap<String, Object>();
|
Map<String, Object> inputs = new HashMap<String, Object>();
|
||||||
|
|
||||||
AggregationType aggregationType = AggregationType.DAILY;
|
AggregationType aggregationType = AggregationType.DAILY;
|
||||||
|
|
|
@ -6,7 +6,6 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.gcube.accounting.aggregator.ContextTest;
|
|
||||||
import org.gcube.accounting.aggregator.aggregation.AggregationInfo;
|
import org.gcube.accounting.aggregator.aggregation.AggregationInfo;
|
||||||
import org.gcube.accounting.aggregator.aggregation.AggregationType;
|
import org.gcube.accounting.aggregator.aggregation.AggregationType;
|
||||||
import org.gcube.accounting.aggregator.elaboration.Elaborator;
|
import org.gcube.accounting.aggregator.elaboration.Elaborator;
|
||||||
|
@ -268,12 +267,9 @@ public class MyTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final String ROOT_PROD = "/d4science.research-infrastructures.eu";
|
|
||||||
|
|
||||||
@Ignore
|
@Ignore
|
||||||
@Test
|
@Test
|
||||||
public void testStorageHub() throws Exception {
|
public void testStorageHub() throws Exception {
|
||||||
ContextTest.setContextByName(ROOT_PROD);
|
|
||||||
FolderContainer destinationFolder = null;
|
FolderContainer destinationFolder = null;
|
||||||
StorageHubClient storageHubClient = new StorageHubClient();
|
StorageHubClient storageHubClient = new StorageHubClient();
|
||||||
FolderContainer parent = storageHubClient.getWSRoot();
|
FolderContainer parent = storageHubClient.getWSRoot();
|
||||||
|
|
|
@ -9,9 +9,6 @@ public class WorkSpaceManagementTest extends ContextTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreatedirectory() throws Exception {
|
public void testCreatedirectory() throws Exception {
|
||||||
ContextTest.setContextByName(GCUBE);
|
|
||||||
//ContextTest.setContextByName(AccountingAggregatorPluginTest.ROOT_PROD);
|
|
||||||
|
|
||||||
WorkSpaceManagement workSpaceManagement = WorkSpaceManagement.getInstance();
|
WorkSpaceManagement workSpaceManagement = WorkSpaceManagement.getInstance();
|
||||||
|
|
||||||
FolderContainer root = workSpaceManagement.getWorkspaceRoot();
|
FolderContainer root = workSpaceManagement.getWorkspaceRoot();
|
||||||
|
|
Loading…
Reference in New Issue