|
|
|
@ -71,7 +71,6 @@ public class ItemTest extends ContextTest {
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void completeTest() throws IOException {
|
|
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
|
@ -85,7 +84,6 @@ public class ItemTest extends ContextTest {
|
|
|
|
|
JsonNode licenseJsonNode = licences.get(0);
|
|
|
|
|
String licenseID = licenseJsonNode.get(ID_KEY).asText();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put(NAME_KEY, NAME_VALUE);
|
|
|
|
|
map.put(TITLE_KEY, TITLE_VALUE);
|
|
|
|
@ -98,7 +96,6 @@ public class ItemTest extends ContextTest {
|
|
|
|
|
tags.add(tag);
|
|
|
|
|
map.put(TAGS_KEY, tags);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> extras = new ArrayList<>();
|
|
|
|
|
Map<String,Object> type = new HashMap<>();
|
|
|
|
|
type.put(KEY_KEY, TYPE_KEY_VALUE);
|
|
|
|
@ -134,11 +131,11 @@ public class ItemTest extends ContextTest {
|
|
|
|
|
Assert.assertTrue(gotTitle.compareTo(TITLE_VALUE) == 0);
|
|
|
|
|
|
|
|
|
|
boolean privateValue = jsonNode.get(PRIVATE_KEY).asBoolean();
|
|
|
|
|
Assert.assertTrue(privateValue==PRIVATE_VALUE);
|
|
|
|
|
Assert.assertTrue(privateValue == PRIVATE_VALUE);
|
|
|
|
|
|
|
|
|
|
String gotLicenseID = jsonNode.get(LICENSE_ID_KEY).asText();
|
|
|
|
|
Assert.assertTrue(gotLicenseID.compareTo(licenseID) == 0);
|
|
|
|
|
}catch (Throwable e) {
|
|
|
|
|
} catch(Throwable e) {
|
|
|
|
|
item.delete(NAME_VALUE, true);
|
|
|
|
|
throw e;
|
|
|
|
|
}
|
|
|
|
@ -154,8 +151,22 @@ public class ItemTest extends ContextTest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void safeTest() throws IOException {
|
|
|
|
|
public void listOnVOTest() throws Exception {
|
|
|
|
|
ContextTest.setContextByName("/gcube/devNext");
|
|
|
|
|
|
|
|
|
|
Item item = new Item();
|
|
|
|
|
String itemsString = item.list(10, 0, "bionym");
|
|
|
|
|
logger.debug("Got list {}", itemsString);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
|
|
JavaType listType = mapper.getTypeFactory().constructCollectionType(ArrayList.class, String.class);
|
|
|
|
|
List<String> items = mapper.readValue(itemsString, listType);
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void safeTest() throws Exception {
|
|
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
|
|
JavaType listType = mapper.getTypeFactory().constructCollectionType(ArrayList.class, String.class);
|
|
|
|
|
|
|
|
|
@ -181,7 +192,7 @@ public class ItemTest extends ContextTest {
|
|
|
|
|
Item item = new Item();
|
|
|
|
|
String itemsString = item.list(200, 0);
|
|
|
|
|
List<String> items = mapper.readValue(itemsString, listType);
|
|
|
|
|
while(items.size()>0) {
|
|
|
|
|
while(items.size() > 0) {
|
|
|
|
|
for(String itemName : items) {
|
|
|
|
|
item.purge(itemName);
|
|
|
|
|
Thread.sleep(50);
|
|
|
|
|