diff --git a/geoportal-client/src/test/java/org/gcube/application/geoportal/clients/legacy/StatelessClientTests.java b/geoportal-client/src/test/java/org/gcube/application/geoportal/clients/legacy/StatelessClientTests.java index a9f9f0b..a230674 100644 --- a/geoportal-client/src/test/java/org/gcube/application/geoportal/clients/legacy/StatelessClientTests.java +++ b/geoportal-client/src/test/java/org/gcube/application/geoportal/clients/legacy/StatelessClientTests.java @@ -1,48 +1,45 @@ -package org.gcube.application.geoportal.clients; +package org.gcube.application.geoportal.clients.legacy; -import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.mongoConcessioni; -import static org.junit.Assert.*; -import static org.junit.Assume.assumeTrue; - -import java.io.File; -import java.io.FileInputStream; -import java.nio.charset.Charset; -import java.util.Collections; -import java.util.Iterator; -import java.util.concurrent.atomic.AtomicLong; -import java.util.stream.Collectors; - -import com.sun.corba.se.spi.orbutil.threadpool.Work; -import org.bson.Document; import org.gcube.application.cms.tests.model.concessioni.TestConcessioniFilters; import org.gcube.application.cms.tests.model.concessioni.TestConcessioniModel; import org.gcube.application.cms.tests.model.concessioni.TestConcessioniQueries; import org.gcube.application.geoportal.client.utils.ConcessioniUtils; import org.gcube.application.geoportal.client.utils.Queries; import org.gcube.application.geoportal.client.utils.Serialization; +import org.gcube.application.geoportal.clients.BasicVreTests; import org.gcube.application.geoportal.common.model.legacy.*; import org.gcube.application.geoportal.common.model.legacy.Concessione.Paths; import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport.ValidationStatus; import org.gcube.application.geoportal.common.model.rest.AddSectionToConcessioneRequest; -import org.gcube.application.geoportal.common.model.rest.QueryRequest; import org.gcube.application.geoportal.common.rest.MongoConcessioni; import org.gcube.application.geoportal.common.utils.FileSets; -import org.gcube.application.geoportal.common.utils.Files; import org.gcube.application.geoportal.common.utils.StorageUtils; +import org.gcube.application.geoportal.common.utils.tests.GCubeTest; import org.junit.Test; -public class StatelessClientTests extends BasicVreTests{ +import java.io.File; +import java.util.Iterator; +import java.util.concurrent.atomic.AtomicLong; +import java.util.stream.Collectors; - - private MongoConcessioni client=mongoConcessioni().build(); +import static org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin.mongoConcessioni; +import static org.junit.Assert.*; +import static org.junit.Assume.assumeTrue; + +public class StatelessClientTests extends BasicVreTests { + + + private final MongoConcessioni client=mongoConcessioni().build(); @Test public void getConfiguration() throws Exception { + assumeTrue(GCubeTest.isTestInfrastructureEnabled()); System.out.println(client.getCurrentConfiguration()); } @Test public void searches() throws Exception { + assumeTrue(GCubeTest.isTestInfrastructureEnabled()); TestConcessioniFilters.filters.forEach((k, v)->{ try { System.out.println("Count for " + k + "\t" + count(client.search(v))); @@ -57,7 +54,7 @@ public class StatelessClientTests extends BasicVreTests{ @Test public void query() throws Exception { - + assumeTrue(GCubeTest.isTestInfrastructureEnabled()); System.out.println("FRA "+ count(client.query( Queries.parse(TestConcessioniQueries.queries.get("emptyresult.json"))))); @@ -95,6 +92,7 @@ public class StatelessClientTests extends BasicVreTests{ @Test public void testList() throws Exception { + assumeTrue(GCubeTest.isTestInfrastructureEnabled()); final AtomicLong counter=new AtomicLong(); long before=System.currentTimeMillis(); client.getList().forEachRemaining((Concessione c)-> {counter.addAndGet(1);}); @@ -103,6 +101,7 @@ public class StatelessClientTests extends BasicVreTests{ @Test public void testCreateNew() throws Exception { + assumeTrue(GCubeTest.isTestInfrastructureEnabled()); Concessione c= client.createNew(TestConcessioniModel.prepareEmptyConcessione()); assertNotNull(c); assertNotNull(c.getMongo_id()); @@ -112,7 +111,9 @@ public class StatelessClientTests extends BasicVreTests{ @Test public void testClone() throws Exception { - Concessione c= prepare(); + assumeTrue(GCubeTest.isTestInfrastructureEnabled()); + //Concessione c= prepare(); + Concessione c = client.getById("6165af0102ad3d60e1d26edd"); Concessione copied = ConcessioniUtils.clone(client,c.getMongo_id()); assertEquals(copied.getNome(),c.getNome()); checkCopied(copied.getRelazioneScavo(),c.getRelazioneScavo()); @@ -124,6 +125,13 @@ public class StatelessClientTests extends BasicVreTests{ assertEquals(copied.getImmaginiRappresentative().size(),c.getImmaginiRappresentative().size()); for(int i=0;i