Luca Frosini 7 years ago
parent 2cec592c63
commit 7a77bc501e

@ -169,6 +169,13 @@
</dependency>
-->
<dependency>
<groupId>org.gcube.information-system</groupId>
<artifactId>resource-registry-api</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>

@ -58,7 +58,7 @@ public class ISSweeperPluginSmartExecutorSchedulerTest extends ScopedTest {
@Test
public void cronExpPreviousMustBeTerminated() throws Exception {
CronExpression cronExpression = new CronExpression("0 */10 * * * ?"); // every 10 minutes starting from now
Scheduling scheduling = new Scheduling(cronExpression, true);
Scheduling scheduling = new Scheduling(cronExpression);
scheduling.setGlobal(true);
UUID uuid = scheduleTest(scheduling);

@ -3,6 +3,7 @@
*/
package org.gcube.test;
import java.io.IOException;
import java.io.StringWriter;
import java.util.LinkedList;
import java.util.List;
@ -15,6 +16,9 @@ import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.informationsystem.publisher.RegistryPublisherFactory;
import org.gcube.informationsystem.publisher.ScopedPublisher;
import org.gcube.informationsystem.publisher.exception.RegistryNotFoundException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.ExceptionMapper;
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.EntityAlreadyPresentException;
import org.gcube.testutility.ScopedTest;
import org.junit.Test;
import org.slf4j.Logger;
@ -80,19 +84,33 @@ public class TempTest extends ScopedTest {
}
}
@Test
public void exceptionSerilizationTest() throws IOException{
//ResourceRegistryException rre = new ResourceRegistryException("Test");
ResourceRegistryException rre = new EntityAlreadyPresentException("Aux");
String jsonString = ExceptionMapper.marshal(rre);
logger.debug(jsonString);
rre = ExceptionMapper.unmarshal(ResourceRegistryException.class, jsonString);
logger.debug("Unmarshalled exception is ", rre);
}
public static final String SERVICE_ENDPOINT_CATEGORY = "Database";
public static final String SERVICE_ENDPOINT_NAME = "TwitterMonitorDatabase";
public static final String ENTRY_NAME = "postgress";
@Test
public void testTWMonitorDiscovery() throws Exception {
ScopedTest.setContext(GCUBE_DEVSEC);
public void testTwitterMonitorDatabaseDiscovery() throws Exception{
DatabaseDiscovery databaseDiscovery = new DatabaseDiscovery(SERVICE_ENDPOINT_CATEGORY, SERVICE_ENDPOINT_NAME, ENTRY_NAME);
logger.debug("Username : {}", databaseDiscovery.getUsername());
logger.debug("Password : {}", databaseDiscovery.getPassword());
logger.debug("URL : {}", databaseDiscovery.getURL());
logger.info("{}", databaseDiscovery.getUsername());
logger.info("{}", databaseDiscovery.getPassword());
logger.info("{}", databaseDiscovery.getURL());
}
}

Loading…
Cancel
Save