cleaned test cases

This commit is contained in:
Francesco Mangiacrapa 2021-05-11 12:51:09 +02:00
parent 23de9f1abb
commit d972d8e2f3
4 changed files with 7 additions and 19 deletions

View File

@ -121,7 +121,7 @@ public class SyncronizeWithThredds {
* @throws ItemNotSynched the item not synched
* @throws Exception the exception
*/
public ThSyncFolderDescriptor isItemSynched(String folderId) throws ItemNotSynched, Exception {
public ThSyncFolderDescriptor isItemSynched(String folderId) throws ItemNotSynched {
ThSyncFolderDescriptor config = null;
try {
config = workspaceThreddsSynchronize.getConfiguration(folderId);

View File

@ -1,17 +1,8 @@
package org.gcube.portlets.widgets.wsthreddssync;
import org.gcube.portal.wssynclibrary.thredds.WorkspaceThreddsSynchronize;
import org.gcube.portlets.widgets.wsthreddssync.server.SyncronizeWithThredds;
import org.gcube.usecases.ws.thredds.SyncEngine;
import org.gcube.usecases.ws.thredds.engine.impl.ProcessDescriptor;
import org.gcube.usecases.ws.thredds.engine.impl.ProcessStatus;
import org.gcube.usecases.ws.thredds.faults.WorkspaceLockedException;
import org.gcube.usecases.ws.thredds.faults.WorkspaceNotSynchedException;
import org.gcube.usecases.ws.thredds.model.SyncOperationCallBack;
import org.gcube.usecases.ws.thredds.model.SynchFolderConfiguration;
// TODO: Auto-generated Javadoc
/**
* The Class TestWsThreddsEngine.
*

View File

@ -5,8 +5,6 @@ import java.util.Map;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.common.storagehubwrapper.server.StorageHubWrapper;
import org.gcube.common.storagehubwrapper.server.tohl.Workspace;
import org.gcube.common.storagehubwrapper.shared.tohl.Properties;
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceFolder;
import org.gcube.portal.wssynclibrary.shared.ItemNotSynched;
public class TestWsThreddsQuery {

View File

@ -5,7 +5,6 @@ package org.gcube.portlets.widgets.wsthreddssync;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.scope.api.ScopeProvider;
@ -15,8 +14,8 @@ import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem;
import org.gcube.common.storagehubwrapper.shared.tohl.exceptions.InternalErrorException;
import org.gcube.common.storagehubwrapper.shared.tohl.exceptions.ItemNotFoundException;
import org.gcube.common.storagehubwrapper.shared.tohl.exceptions.WorkspaceFolderNotFoundException;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor;
import org.gcube.portlets.widgets.wsthreddssync.server.SyncronizeWithThredds;
import org.gcube.usecases.ws.thredds.Constants;
@ -30,7 +29,7 @@ public class UnSyncThreddsFolders {
public static String DEFAULT_SCOPE = "/gcube"; //DEV
public static String TEST_USER = "francesco.mangiacrapa";
public static String TEST_USER_TOKEN = "0e2c7963-8d3e-4ea6-a56d-ffda530dd0fa-98187548"; //token user: Francesco Mangiacrapa - /gcube (root)
public static String TEST_USER_TOKEN = "TOKEN";
private static List<String> lstUnSynchedItem = new ArrayList<String>();
private static List<String> lstUnSynchedFailedItem = new ArrayList<String>();
@ -146,13 +145,13 @@ public class UnSyncThreddsFolders {
return;
try{
boolean synched = syncService.isItemSynched(workspaceItem.getId(), DEFAULT_SCOPE, TEST_USER);
ScopeProvider.instance.set(DEFAULT_SCOPE);
SecurityTokenProvider.instance.set(TEST_USER_TOKEN);
ThSyncFolderDescriptor synched = syncService.isItemSynched(workspaceItem.getId());
System.out.println("Is the workspace item: "+workspaceItem.getId() + " synched? "+synched +", Is folder? "+workspaceItem.isFolder());
if(synched && workspaceItem.isFolder()){
if(synched != null){
//Boolean unsynched = syncService.doUnSync(workspaceItem.getId(), false, DEFAULT_SCOPE, TEST_USER_TOKEN);
ScopeProvider.instance.set(DEFAULT_SCOPE);
SecurityTokenProvider.instance.set(TEST_USER_TOKEN);
Workspace ws = getWorkspace();
cleanItem(workspaceItem, ws);
totalAttempts++;