Fixed GRSF utility
This commit is contained in:
parent
ff7b8d7399
commit
08312a1a19
|
@ -518,6 +518,13 @@ public class CKANPackage extends CKAN implements Moderated {
|
|||
offset = 0;
|
||||
}
|
||||
parameters.put(START_KEY, String.valueOf(offset));
|
||||
|
||||
// This filter by type
|
||||
// StringWriter qStringWriter = new StringWriter();
|
||||
// qStringWriter.append("extras_systemtype:");
|
||||
// qStringWriter.append("");
|
||||
// parameters.put(GCatConstants.Q_KEY, qStringWriter.toString());
|
||||
|
||||
return list(parameters);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.gcube.gcat.persistence.ckan.CKANPackageTest;
|
|||
import org.gcube.gcat.persistence.ckan.CKANUser;
|
||||
import org.gcube.gcat.persistence.ckan.CKANUtility;
|
||||
import org.junit.Assert;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -46,14 +46,14 @@ public class GRSFUtilities extends ContextTest {
|
|||
|
||||
public static final String PREPROD_GRSF_PRE = "/pred4s/preprod/GRSF_Pre";
|
||||
|
||||
@BeforeClass
|
||||
@Before
|
||||
public void before() throws Exception {
|
||||
ContextTest.setContextByName(PREPROD_GRSF_PRE);
|
||||
//
|
||||
// ContextTest.setContextByName(PRODUCTION_GRSF);
|
||||
// ContextTest.setContextByName(PREPROD_GRSF_PRE);
|
||||
|
||||
ContextTest.setContextByName(PRODUCTION_GRSF);
|
||||
// ContextTest.setContextByName(PRODUCTION_GRSF_ADMIN);
|
||||
// ContextTest.setContextByName(PRODUCTION_GRSF_PRE);
|
||||
|
||||
|
||||
logger.debug(SecretManagerProvider.instance.get().getUser().getUsername());
|
||||
logger.debug(SecretManagerProvider.instance.get().getContext());
|
||||
}
|
||||
|
@ -273,22 +273,19 @@ public class GRSFUtilities extends ContextTest {
|
|||
logger.debug("Going to purge record with name {}", name);
|
||||
ckanPackage.setName(name);
|
||||
try {
|
||||
// ckanPackage.purgeNoCheckNoDeleteFiles();
|
||||
if(go) {
|
||||
break;
|
||||
}
|
||||
ckanPackage.purgeNoCheckNoDeleteFiles();
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
logger.error("Unable to purge record with name {}", name, e);
|
||||
}
|
||||
Thread.sleep(500);
|
||||
}
|
||||
Thread.sleep(500);
|
||||
}else {
|
||||
go=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @Test
|
||||
@Test
|
||||
public void purgeAllGRSFRecords() throws Exception {
|
||||
purgeGRSFRecords(100, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue