From b3cbeb7ce29e0e9c9164389524dced9efc76e0d6 Mon Sep 17 00:00:00 2001 From: Manuele Simi Date: Fri, 3 Dec 2010 15:45:29 +0000 Subject: [PATCH] Properties collection does not need to exist at startup time, test-suite fixings git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/information-system/gCubeIS/Collector@33050 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../collector/impl/xmlstorage/exist/State.java | 7 ++++++- .../stubs/testsuite/wsdaix/AddDocumentsTester.java | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/org/gcube/informationsystem/collector/impl/xmlstorage/exist/State.java b/src/org/gcube/informationsystem/collector/impl/xmlstorage/exist/State.java index b649fe3..97fcecc 100755 --- a/src/org/gcube/informationsystem/collector/impl/xmlstorage/exist/State.java +++ b/src/org/gcube/informationsystem/collector/impl/xmlstorage/exist/State.java @@ -3,6 +3,7 @@ package org.gcube.informationsystem.collector.impl.xmlstorage.exist; import org.gcube.common.core.utils.logging.GCUBELog; import org.gcube.informationsystem.collector.impl.contexts.ICServiceContext; import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorage.STATUS; +import org.gcube.informationsystem.collector.impl.xmlstorage.exist.XMLStorage.XMLStorageNotAvailableException; import org.gcube.informationsystem.collector.impl.resources.GCUBEInstanceStateResource; import org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource; @@ -59,7 +60,11 @@ public class State { if (Boolean.valueOf((String) ICServiceContext.getContext().getProperty("deleteRPsOnStartup", true))) { // cleanup the RPs collection logger.info("Deleting all RPs..."); - State.dataManager.deleteCollection(new GCUBEInstanceStateResource().getCollectionName()); + try { + State.dataManager.deleteCollection(new GCUBEInstanceStateResource().getCollectionName()); + } catch (XMLStorageNotAvailableException e) { + logger.warn("Unable to delete the properties's collection"); + } } else { logger.info("All RPs previously stored are kept in the storage"); } diff --git a/src/org/gcube/informationsystem/collector/stubs/testsuite/wsdaix/AddDocumentsTester.java b/src/org/gcube/informationsystem/collector/stubs/testsuite/wsdaix/AddDocumentsTester.java index 7217254..d25b9e0 100644 --- a/src/org/gcube/informationsystem/collector/stubs/testsuite/wsdaix/AddDocumentsTester.java +++ b/src/org/gcube/informationsystem/collector/stubs/testsuite/wsdaix/AddDocumentsTester.java @@ -54,7 +54,7 @@ public class AddDocumentsTester { try { AddDocumentsResponse r = addDocuments(portTypeURI,GCUBEScope.getScope(args[2]), new org.apache.axis.types.URI ("gcube://testResourceName"), - new org.apache.axis.types.URI(args[6]), args[5], + new org.apache.axis.types.URI("gcube://InstanceState"), args[5], new String[] { args[3] }, new Document[] {TestDocuments.loadDocument(args[4])} ); logger.info("Number of response wrappers "+ r.getAddDocumentResponseWrapper().length ); @@ -66,7 +66,7 @@ public class AddDocumentsTester { } } } catch (Exception e ) { - logger.error(e.toString()); + logger.error("",e); } }