cleaned tests

This commit is contained in:
Luca Frosini 2024-03-01 09:51:23 +01:00
parent 5e8f31f384
commit 225b0aacb7
5 changed files with 9 additions and 20 deletions

View File

@ -37,7 +37,8 @@ public class ContextTest {
public static final String DEVSEC;
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;
@ -54,6 +55,7 @@ public class ContextTest {
DEVVRE = DEVSEC + "/devVRE";
ROOT_PROD = "/d4science.research-infrastructures.eu";
ROOT_PRE = "/pred4s";
DEFAULT_TEST_SCOPE = GCUBE;
@ -162,7 +164,7 @@ public class ContextTest {
@BeforeClass
public static void beforeClass() throws Exception {
setContextByName(ROOT_PROD);
setContextByName(DEFAULT_TEST_SCOPE);
}
@AfterClass

View File

@ -186,7 +186,6 @@ public class PostgreSQLConnectorTest extends ContextTest {
@Ignore
@Test
public void moveStatusFromSrcToDst() throws Exception {
ContextTest.setContextByName(ROOT_PROD);
AggregatorPersistenceStatusSrc apsSrc = AggregatorPersistenceFactory.getAggregatorPersistenceStatusSrc();
List<AggregationStatus> aggregationStatuses = apsSrc.getAll();
for(AggregationStatus aggregationStatus : aggregationStatuses) {

View File

@ -23,9 +23,7 @@ import org.slf4j.LoggerFactory;
public class AccountingAggregatorPluginTest extends ContextTest {
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,
Calendar aggregationEndCalendar, boolean forceRerun, boolean forceEarlyAggregation, boolean skipAggregation) throws Exception {
Map<String, Object> inputs = new HashMap<String, Object>();
@ -79,7 +77,7 @@ public class AccountingAggregatorPluginTest extends ContextTest {
}
@Ignore
// @Ignore
@Test
public void aggregateRecordDaily() throws Exception {
Set<String> types = new HashSet<>();
@ -92,8 +90,8 @@ public class AccountingAggregatorPluginTest extends ContextTest {
for(String recordType : types) {
AggregationType aggregationType = AggregationType.DAILY;
Calendar aggregationStartCalendar = Utility.getAggregationStartCalendar(2024, Calendar.FEBRUARY, 29);
Calendar end = Utility.getAggregationStartCalendar(2024, Calendar.MARCH, 1);
Calendar aggregationStartCalendar = Utility.getAggregationStartCalendar(2024, Calendar.MARCH, 1);
Calendar end = Utility.getAggregationStartCalendar(2024, Calendar.MARCH, 2);
while (aggregationStartCalendar.before(end)) {
Calendar aggregationEndCalendar = Utility.getEndCalendarFromStartCalendar(aggregationType, aggregationStartCalendar, 1);
aggregate(recordType, aggregationType, aggregationStartCalendar, aggregationEndCalendar, forceRestart, forceEarlyAggregation, false);
@ -185,9 +183,6 @@ public class AccountingAggregatorPluginTest extends ContextTest {
@Test
public void testRecovery() throws Exception {
ContextTest.setContextByName(GCUBE);
// ContextTest.setContextByName(ROOT_PROD);
Map<String, Object> inputs = new HashMap<String, Object>();
AggregationType aggregationType = AggregationType.DAILY;

View File

@ -6,7 +6,6 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.gcube.accounting.aggregator.ContextTest;
import org.gcube.accounting.aggregator.aggregation.AggregationInfo;
import org.gcube.accounting.aggregator.aggregation.AggregationType;
import org.gcube.accounting.aggregator.elaboration.Elaborator;
@ -267,13 +266,10 @@ public class MyTest {
Constant.DEFAULT_DATE_FORMAT.format(aggregationEndDate));
}
public static final String ROOT_PROD = "/d4science.research-infrastructures.eu";
@Ignore
@Test
public void testStorageHub() throws Exception {
ContextTest.setContextByName(ROOT_PROD);
FolderContainer destinationFolder = null;
StorageHubClient storageHubClient = new StorageHubClient();
FolderContainer parent = storageHubClient.getWSRoot();

View File

@ -9,9 +9,6 @@ public class WorkSpaceManagementTest extends ContextTest {
@Test
public void testCreatedirectory() throws Exception {
ContextTest.setContextByName(GCUBE);
//ContextTest.setContextByName(AccountingAggregatorPluginTest.ROOT_PROD);
WorkSpaceManagement workSpaceManagement = WorkSpaceManagement.getInstance();
FolderContainer root = workSpaceManagement.getWorkspaceRoot();