tests log

This commit is contained in:
Fabio Sinibaldi 2021-03-23 18:04:54 +01:00
parent 5d7d0a9d44
commit 9222f500b2
7 changed files with 40 additions and 14 deletions

18
pom.xml
View File

@ -29,7 +29,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>3.4.0</version>
<version>3.6.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@ -41,7 +41,7 @@
<dependency>
<groupId>org.gcube.spatial.data</groupId>
<artifactId>sdi-library</artifactId>
<version>[1.0.0,1.3.0)</version>
<version>[1.0.0,2.0.0)</version>
<!-- <exclusions> -->
<!-- <exclusion> -->
<!-- <groupId>com.fasterxml.jackson.core</groupId> -->
@ -67,6 +67,20 @@
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<!-- test -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -21,7 +21,6 @@ public class TokenSetter {
public static synchronized void set(String scope){
try{
if(props==null) {
props=new Properties();
try {
@ -30,12 +29,8 @@ public class TokenSetter {
throw new RuntimeException("YOU NEED TO SET TOKEN FILE IN CONFIGURATION");
}
}
if(!props.containsKey(scope)) throw new Exception("No token found for scope : "+scope);
if(!props.containsKey(scope)) throw new RuntimeException("No token found for scope : "+scope);
SecurityTokenProvider.instance.set(props.getProperty(scope));
}catch(Throwable e){
log.trace("Unable to set token for scope "+scope,e);
}
ScopeProvider.instance.set(scope);
}

View File

@ -14,10 +14,13 @@ import org.gcube.usecases.ws.thredds.model.SynchFolderConfiguration;
public class DTSynchUseCase {
public static void main(String[] args) throws WorkspaceInteractionException, InternalException, ProcessNotFoundException {
TokenSetter.set("/d4science.research-infrastructures.eu");
// TokenSetter.set("/d4science.research-infrastructures.eu");
// String folderId="a8cd78d3-69e8-4d02-ac90-681b2d16d84d";
TokenSetter.set("/gcube/devsec/devVRE");
String folderId="8ebe9ffb-e2cf-4b3e-ab91-cc6933d86625";
SyncEngine engine=SyncEngine.get();
String folderId="a8cd78d3-69e8-4d02-ac90-681b2d16d84d";
// String folderId="8a6f9749-68d7-4a9a-a475-bd645050c3fd"; // sub folder for faster tests

View File

@ -37,7 +37,7 @@ public class TestCommons {
private static Map<String,TestSet> configs=new HashMap<>();
private static String toUseConfig="default";
private static String toUseConfig="simple";
static {
@ -46,7 +46,7 @@ public class TestCommons {
// folderName="WS-Tests";
configs.put("simple", new TestSet("Simple label ","/gcube", "Test1","public/netcdf/simpleFolder","***REMOVED***","simple"));
configs.put("simple", new TestSet("Simple label ","/gcube/devsec/devVRE", "Test1","public/netcdf/simpleFolder","***REMOVED***","simple"));
configs.put("cmems", new TestSet("CMEMS","/gcube", "CMEMS","public/netcdf/CMEMS","***REMOVED***","cmems"));
configs.put("default", new TestSet("Default Tests","/gcube","Thredds Catalog","public/netcdf","***REMOVED***","main"));

View File

@ -1,6 +1,6 @@
# Root logger option
#log4j.rootLogger=INFO, SM
log4j.logger.org.gcube.usecases.ws=DEBUG,SM
log4j.rootLogger=DEBUG, SM
#log4j.logger.org.gcube.usecases.ws=DEBUG,SM

View File

@ -0,0 +1,14 @@
<configuration debug="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="debug">
<appender-ref ref="STDOUT" />
</root>
</configuration>