From 2934458cb8602ca483755a129b95c2ab9fe35b1f Mon Sep 17 00:00:00 2001 From: "roberto.cirillo" Date: Thu, 12 Dec 2013 15:59:25 +0000 Subject: [PATCH] Initial import. git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vre-management/whn-manager@86890 82a268e6-3cf1-43bd-a215-b396298e98cf --- .classpath | 10 ++ .project | 23 +++ .settings/org.eclipse.core.resources.prefs | 5 + .settings/org.eclipse.jdt.core.prefs | 12 ++ .settings/org.eclipse.m2e.core.prefs | 5 + distro/INSTALL | 1 + distro/LICENSE | 6 + distro/MAINTAINERS | 2 + distro/README | 45 ++++++ distro/changelog.xml | 6 + distro/descriptor.xml | 37 +++++ distro/profile.xml | 29 ++++ distro/svnpath.txt | 0 pom.xml | 94 ++++++++++++ .../whnmanager/jaxws/ws/WhnManagerImpl.java | 125 ++++++++++++++++ .../whnmanager/utils/ValidationUtils.java | 139 ++++++++++++++++++ src/main/resources/META-INF/beans.xml | 6 + src/main/resources/META-INF/persistence.xml | 28 ++++ src/main/webapp/WEB-INF/gcube-app.xml | 8 + src/main/webapp/WEB-INF/sun-jaxws.xml | 9 ++ src/main/webapp/WEB-INF/web.xml | 48 ++++++ .../client/test/WhnManagerTest.java | 50 +++++++ src/test/resources/META-INF/beans.xml | 8 + src/test/resources/dataio.war | Bin 0 -> 1757 bytes src/test/resources/log4j.properties | 9 ++ 25 files changed, 705 insertions(+) create mode 100644 .classpath create mode 100644 .project create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 .settings/org.eclipse.m2e.core.prefs create mode 100644 distro/INSTALL create mode 100644 distro/LICENSE create mode 100644 distro/MAINTAINERS create mode 100644 distro/README create mode 100644 distro/changelog.xml create mode 100644 distro/descriptor.xml create mode 100644 distro/profile.xml create mode 100644 distro/svnpath.txt create mode 100644 pom.xml create mode 100644 src/main/java/org/gcube/vremanagement/whnmanager/jaxws/ws/WhnManagerImpl.java create mode 100644 src/main/java/org/gcube/vremanagement/whnmanager/utils/ValidationUtils.java create mode 100644 src/main/resources/META-INF/beans.xml create mode 100644 src/main/resources/META-INF/persistence.xml create mode 100644 src/main/webapp/WEB-INF/gcube-app.xml create mode 100644 src/main/webapp/WEB-INF/sun-jaxws.xml create mode 100644 src/main/webapp/WEB-INF/web.xml create mode 100644 src/test/java/org/gcube/vremanagement/whnmanager/client/test/WhnManagerTest.java create mode 100644 src/test/resources/META-INF/beans.xml create mode 100644 src/test/resources/dataio.war create mode 100644 src/test/resources/log4j.properties diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..0f53f3e --- /dev/null +++ b/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..c392512 --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ + + + Whn-Manager + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..dc1b414 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..107056a --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,12 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..598bb29 --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,5 @@ +#Tue Mar 12 12:32:51 CET 2013 +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/distro/INSTALL b/distro/INSTALL new file mode 100644 index 0000000..9ffa442 --- /dev/null +++ b/distro/INSTALL @@ -0,0 +1 @@ +Used as service in the gCube Framework \ No newline at end of file diff --git a/distro/LICENSE b/distro/LICENSE new file mode 100644 index 0000000..630ba97 --- /dev/null +++ b/distro/LICENSE @@ -0,0 +1,6 @@ +gCube System - License +------------------------------------------------------------ + +The gCube/gCore software is licensed as Free Open Source software conveying to the EUPL (http://ec.europa.eu/idabc/eupl). +The software and documentation is provided by its authors/distributors "as is" and no expressed or +implied warranty is given for its use, quality or fitness for a particular case. diff --git a/distro/MAINTAINERS b/distro/MAINTAINERS new file mode 100644 index 0000000..e729771 --- /dev/null +++ b/distro/MAINTAINERS @@ -0,0 +1,2 @@ +Roberto Cirillo (roberto.cirillo@isti.cnr.it), CNR Pisa, +Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo". diff --git a/distro/README b/distro/README new file mode 100644 index 0000000..8fa3294 --- /dev/null +++ b/distro/README @@ -0,0 +1,45 @@ +The gCube System - tabular data service + +------------------------------------------------------------ + +This work has been partially supported by the following European projects: DILIGENT (FP6-2003-IST-2), +D4Science (FP7-INFRA-2007-1.2.2), D4Science-II (FP7-INFRA-2008-1.2.2), iMarine (FP7-INFRASTRUCTURES-2011-2), +and EUBrazilOpenBio (FP7-ICT-2011-EU-Brazil). + + +Authors +------- + +* Roberto Cirillo (roberto.cirillo@isti.cnr.it), CNR Pisa, + Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo". + + +Version and Release Date +------------------------ + +v. 1.0.0 + * First release + + +Description +----------- + + + + Download information +-------------------- + + + +Documentation +------------- + + + +Licensing +--------- + +This software is licensed under the terms you may find in the file named "LICENSE" in this directory. + + + diff --git a/distro/changelog.xml b/distro/changelog.xml new file mode 100644 index 0000000..61dc09c --- /dev/null +++ b/distro/changelog.xml @@ -0,0 +1,6 @@ + + + first release + + + \ No newline at end of file diff --git a/distro/descriptor.xml b/distro/descriptor.xml new file mode 100644 index 0000000..4c080a2 --- /dev/null +++ b/distro/descriptor.xml @@ -0,0 +1,37 @@ + + servicearchive + + tar.gz + + / + + + ${distroDirectory} + / + true + + README + LICENSE + INSTALL + MAINTAINERS + changelog.xml + + 755 + true + + + + + target/${build.finalName}.war + /${artifactId} + + + ${distroDirectory}/svnpath.txt + /${artifactId} + true + + + \ No newline at end of file diff --git a/distro/profile.xml b/distro/profile.xml new file mode 100644 index 0000000..70ad93d --- /dev/null +++ b/distro/profile.xml @@ -0,0 +1,29 @@ + + + + Service + + ${description} + VREManagement + ${artifactId} + 1.0.0 + + + ${description} + ${artifactId} + ${version} + + ${groupId} + ${artifactId} + ${version} + + library + + ${build.finalName}.jar + + + + + + + diff --git a/distro/svnpath.txt b/distro/svnpath.txt new file mode 100644 index 0000000..e69de29 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..2875a6b --- /dev/null +++ b/pom.xml @@ -0,0 +1,94 @@ + + 4.0.0 + + org.gcube.tools + maven-parent + 1.0.0 + + org.gcube.resourcemanagement + whn-manager + 1.0.0-SNAPSHOT + war + + + + + org.gcube.distribution + maven-smartgears-bom + 1.0.0-SNAPSHOT + pom + import + + + + + + org.slf4j + slf4j-api + + + org.gcube.core + common-smartgears + + + javax.servlet + javax.servlet-api + 3.0.1 + provided + + + org.gcube.core + common-smartgears-app + + + com.sun.xml.ws + jaxws-rt + 2.1.7 + + + + org.jboss.weld.servlet + weld-servlet + 1.1.9.Final + + + junit + junit + 4.11 + test + + + org.gcube.resourcemanagement + whnmanager-api + [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) + + + org.gcube.core + common-jaxws-calls + 1.0.0-SNAPSHOT + test + + + + + + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + org.apache.maven.plugins + maven-war-plugin + + + whn-manager + src\main\webapp\WEB-INF\web.xml + + + + + \ No newline at end of file diff --git a/src/main/java/org/gcube/vremanagement/whnmanager/jaxws/ws/WhnManagerImpl.java b/src/main/java/org/gcube/vremanagement/whnmanager/jaxws/ws/WhnManagerImpl.java new file mode 100644 index 0000000..9c475f7 --- /dev/null +++ b/src/main/java/org/gcube/vremanagement/whnmanager/jaxws/ws/WhnManagerImpl.java @@ -0,0 +1,125 @@ +package org.gcube.vremanagement.whnmanager.jaxws.ws; + +import java.util.Arrays; +import java.util.Iterator; + +import javax.jws.WebService; +import org.gcube.smartgears.ContextProvider; +import org.gcube.smartgears.context.application.ApplicationContext; +import org.gcube.smartgears.context.container.ContainerContext; +import org.gcube.smartgears.handlers.container.lifecycle.ProfilePublisher; +import org.gcube.vremanagement.whnmanager.utils.ValidationUtils; +import org.gcube.common.resources.gcore.HostingNode; +import org.gcube.common.resources.gcore.ScopeGroup; +import org.gcube.common.scope.impl.ScopeBean; +import org.gcube.common.scope.impl.ScopeBean.Type; +import org.gcube.resourcemanagement.whnmanager.api.exception.GCUBEUnrecoverableException; +import org.gcube.resourcemanagement.whnmanager.api.WhnManager; +import org.gcube.resourcemanagement.whnmanager.api.types.AddScopeInputParams; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@WebService(portName = "WhnManagerIOPort", +serviceName = WhnManager.SERVICE_NAME, +targetNamespace = WhnManager.TNS, +endpointInterface = "org.gcube.resourcemanagement.whnmanager.api.WhnManager" ) +//@Singleton +public class WhnManagerImpl implements WhnManager{ + + + private static Logger logger=LoggerFactory.getLogger(WhnManagerImpl.class); + + + /** + * Add a scope to the ghn profile and publish it on IS + */ + @Override + public boolean addScope(AddScopeInputParams params) throws GCUBEUnrecoverableException { + logger.trace("WHNManager: addScope method invokation"); + String scope=params.getScope(); + ValidationUtils.valid("scope", scope); + ApplicationContext context = ContextProvider.get(); + if(context!=null){ + HostingNode ghn=context.container().profile(HostingNode.class); + if(new ScopeBean(scope).is(Type.VRE)){ + logger.debug("addScope operation on VRE scope. Check if present VO scope"); + scope=new ScopeBean(scope).enclosingScope().toString(); + logger.debug("VO scope: "+scope); + } + if(!ValidationUtils.isPresent(ghn, scope)){ + ValidationUtils.addEnclosingScopesOnResource(ghn, scope); + logger.debug("addScope method: add scope "+scope+" to resource with id: "+ghn.id()); + ghn.scopes().asCollection().add(scope); + ScopeGroup scopes=ghn.scopes(); + logger.debug(" resource will be published in scopes: "); + for(Iterator it=scopes.iterator(); it.hasNext();){ + String scopeFound=(String)it.next(); + logger.debug(" - "+scopeFound); + } + ContainerContext container=context.container(); + ProfilePublisher publisher= new ProfilePublisher(container); + publisher.update(); + }else{ + logger.warn("the scope "+scope+" is already present on ghn profile with id: "+ ghn.id()); + } + }else{ + logger.warn("addScope method: context is null"); + } + return true; + } + + /** + * Remove a scope from ghn profile and publish the new profile on IS + */ + @Override + public boolean removeScope(String scope) throws GCUBEUnrecoverableException { + logger.trace("WHN-Manager: removeScope method invokation"); + ValidationUtils.valid("scope", scope); + if(new ScopeBean(scope).is(Type.VRE)){ + logger.debug("this is a VRE scope. The request will be ignored "); + return true; + } + + ApplicationContext context = ContextProvider.get(); + if(context!=null){ + HostingNode ghn=context.container().profile(HostingNode.class); + if(ValidationUtils.isPresent(ghn, scope)){ + logger.debug("removeScope method: remove scope "+scope+" to resource with id: "+ghn.id()); + ContainerContext container=context.container(); + ProfilePublisher publisher= new ProfilePublisher(container); + publisher.removeFrom(Arrays.asList(scope)); + }else{ + logger.warn("scope is not present in the resource"); + } + }else{ + logger.warn("addScope method: context is null"); + } + return true; + } + +// @Override +// public boolean addRIToScope(ScopeRIParams params) throws GCUBEUnrecoverableException{ +// logger.debug("addRIToScope dummy method: Adding scope " + params.getScope() + " to RI <" + params.getClazz() +","+ params.getName() +">"); +// +// return true; +// } +// +// @Override +// public boolean activateRI(RIData ri) throws GCUBEUnrecoverableException{ +// logger.debug("dummy activereRI method with param "+ri); +// return true; +// } +// +// +// @Override +// public boolean deactivateRI(RIData ri) throws GCUBEUnrecoverableException{ +// logger.debug("dummy deactivateRI method with param "+ri); +// return true; +// } +// +// @Override +// public boolean removeRIFromScope(ScopeRIParams params) throws GCUBEUnrecoverableException{ +// logger.debug("dummy removeRIFromScope method with param "+params); +// return true; +// } +} diff --git a/src/main/java/org/gcube/vremanagement/whnmanager/utils/ValidationUtils.java b/src/main/java/org/gcube/vremanagement/whnmanager/utils/ValidationUtils.java new file mode 100644 index 0000000..a590ea7 --- /dev/null +++ b/src/main/java/org/gcube/vremanagement/whnmanager/utils/ValidationUtils.java @@ -0,0 +1,139 @@ +package org.gcube.vremanagement.whnmanager.utils; + +import java.util.Iterator; + +import org.gcube.common.resources.gcore.Resource; +import org.gcube.common.resources.gcore.ResourceMediator; +import org.gcube.common.resources.gcore.ScopeGroup; +import org.gcube.common.scope.impl.ScopeBean; +import org.gcube.common.scope.impl.ScopeBean.Type; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ValidationUtils { + + private static final Logger log = LoggerFactory.getLogger(ValidationUtils.class); + + public static void valid(String name, Object object){ + if (object==null) + throw new IllegalArgumentException(name+" is null"); + } + + public static < R extends Resource > boolean isPresent(R resource, String currentScope){ + ScopeGroup scopes=resource.scopes(); + boolean founded= false; + for(Iterator it=scopes.iterator(); it.hasNext();){ + String scope=it.next(); + if(scope.equals(currentScope)) + founded=true; + } + if(founded) + return true; + return false; + } + + + public static < R extends Resource > boolean isNotPresent(R resource, String currentScope){ + ScopeGroup scopes=resource.scopes(); + boolean found= false; + for(Iterator it=scopes.iterator(); it.hasNext();){ + String scope=it.next(); + if(scope.equals(currentScope)) + found=true; + } + if(!found) + return true; + return false; + } + + + /** + * If scope is a VRE scope and the VO and INFRA scopes are not present in the resource, this method add these scopes to the resource + * @param resource the resource + * @param scope a scope + */ + public static void addEnclosingScopesOnResource(T resource, String scope){ + log.trace("add enclosed scopes of "+scope+" to the resource with id: "+resource.id()); + if(new ScopeBean(scope).is(Type.VRE)){ + String voScope=new ScopeBean(scope).enclosingScope().toString(); + String infraScope=new ScopeBean(voScope).enclosingScope().toString(); +// The scope collection is a set, I can add scope without checking + log.debug("adding "+voScope+" to the resource "+resource.id()); + ResourceMediator.setScope(resource, voScope); + log.debug("adding "+infraScope+" to the resource "+resource.id()); + ResourceMediator.setScope(resource, infraScope); + }else if(new ScopeBean(scope).is(Type.VO)){ + String infraScope=new ScopeBean(scope).enclosingScope().toString(); + log.debug("adding "+infraScope+" to the resource "+resource.id()); +// The scope collection is a set, I can add scope without checking + ResourceMediator.setScope(resource, infraScope); + } + } + + public static boolean isTheLastScopeOnResource(T resource, String scope){ + if(resource.scopes().size() == 0) + return true; + if(new ScopeBean(scope).is(Type.VRE)){ + if(anotherBrotherVREOrVOOnResource(resource, scope)){ + return false; + }else return true; + }else if(new ScopeBean(scope).is(Type.VO)){ + if(anotherSonVREOnResource(resource, scope)){ + throw new IllegalArgumentException("the resource "+resource.id()+" have another scope defined in the same VO. The VO is "+scope); + }else return true; + }else{ // is a INFRA scope + if(anotherInfraScopeOnResource(resource, scope)){ + throw new IllegalArgumentException("the resource "+resource.id()+" have another scope defined in the same INFRA. The INFRA is "+scope); + }else return true; + } + } + + public static boolean anotherBrotherVREOrVOOnResource(T resource, String scope){ + if(!new ScopeBean(scope).is(Type.VRE)) + throw new IllegalArgumentException("anotherBrotherVREOrVOOnResource method: the input scope must be a VRE scope"); + String enclosedScope=new ScopeBean(scope).enclosingScope().toString(); + for(String s : resource.scopes()){ + if(isChildScope(enclosedScope, s)) return true; + } + return false; + } + + public static boolean anotherSonVREOnResource(T resource, String scope){ + if(!new ScopeBean(scope).is(Type.VO)) + throw new IllegalArgumentException("anotherSonVREOnResource method: the input scope must be a VO scope"); + for(String s : resource.scopes()){ + if(isChildScope(scope, s)) return true; + } + return false; + } + + public static boolean isChildScope(String fatherScope, String sonScope) { + ScopeBean currentEnclosedScope=new ScopeBean(sonScope).enclosingScope(); + if((currentEnclosedScope != null) && (currentEnclosedScope.toString().equals(fatherScope))){ + log.debug("check scope"+fatherScope+": found another son VRE scope "+sonScope); + return true; + }else return false; + } + + public static boolean anotherInfraScopeOnResource(T resource, String scope){ + if(!new ScopeBean(scope).is(Type.INFRASTRUCTURE)) + throw new IllegalArgumentException("anotherInfraScopeOnResource method: the input scope must be a INFRASTRUCTURE scope"); + String infraScopeFound=null; + for(String s : resource.scopes()){ + while(new ScopeBean(s).enclosingScope() != null){ + s=new ScopeBean(s).enclosingScope().toString(); + + } + infraScopeFound=s; + if(infraScopeFound.equals(scope)){ + log.debug("check scope"+scope+": found another scope on infra "+s); + return true; + } + } + return false; + } + + + +} + diff --git a/src/main/resources/META-INF/beans.xml b/src/main/resources/META-INF/beans.xml new file mode 100644 index 0000000..ad9ec2c --- /dev/null +++ b/src/main/resources/META-INF/beans.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..7e8dd0c --- /dev/null +++ b/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,28 @@ + + + + + + + + org.gcube.data.analysis.tabulardata.metadata.StoredTable + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/gcube-app.xml b/src/main/webapp/WEB-INF/gcube-app.xml new file mode 100644 index 0000000..059a356 --- /dev/null +++ b/src/main/webapp/WEB-INF/gcube-app.xml @@ -0,0 +1,8 @@ + + WhnManager + VREManagement + 1.0.0-SNAPSHOT + Web Hosting Node Service + + + diff --git a/src/main/webapp/WEB-INF/sun-jaxws.xml b/src/main/webapp/WEB-INF/sun-jaxws.xml new file mode 100644 index 0000000..87d03c5 --- /dev/null +++ b/src/main/webapp/WEB-INF/sun-jaxws.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..8832058 --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,48 @@ + + + + + + + + + + com.sun.xml.ws.transport.http.servlet.WSServletContextListener + + + + + whnmanager + com.sun.xml.ws.transport.http.servlet.WSServlet + + + + + whnmanager + /gcube/vremanagement/ws/whnmanager + + + + diff --git a/src/test/java/org/gcube/vremanagement/whnmanager/client/test/WhnManagerTest.java b/src/test/java/org/gcube/vremanagement/whnmanager/client/test/WhnManagerTest.java new file mode 100644 index 0000000..85f8245 --- /dev/null +++ b/src/test/java/org/gcube/vremanagement/whnmanager/client/test/WhnManagerTest.java @@ -0,0 +1,50 @@ +package org.gcube.vremanagement.whnmanager.client.test; + +import static org.junit.Assert.*; + +import java.net.URL; +import javax.xml.namespace.QName; + +import org.gcube.common.calls.jaxws.GcubeService; +import org.gcube.common.scope.api.ScopeProvider; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.net.MalformedURLException; +import javax.xml.ws.Service; + +import org.gcube.resourcemanagement.whnmanager.api.WhnManager; +import org.gcube.resourcemanagement.whnmanager.api.types.AddScopeInputParams; + + +public class WhnManagerTest { + + private Logger logger = LoggerFactory.getLogger(WhnManagerTest.class); + private final static String address="http://localhost:8080/whn-manager/gcube/vremanagement/ws/whnmanager"; + private URL url; + private WhnManager whn; + + @Before + public void setup() throws MalformedURLException{ + ScopeProvider.instance.set("/gcube/devsec"); + url = new URL(address); + QName qname = new QName(WhnManager.TNS, WhnManager.SERVICE_NAME); + GcubeService serviceManager = GcubeService.service().withName(qname).andInterface(WhnManager.class); + whn=org.gcube.common.calls.jaxws.StubFactory.stubFor(serviceManager).at(address); + + } +// @Test + public void addScopeTest() throws Exception{ + AddScopeInputParams params = new AddScopeInputParams("/gcube/devsec", ""); + assertTrue(whn.addScope(params)); + + } + +// @Test + public void removeScopeTest() throws Exception{ + assertTrue(whn.removeScope("/gcube/devsec")); + } + + +} diff --git a/src/test/resources/META-INF/beans.xml b/src/test/resources/META-INF/beans.xml new file mode 100644 index 0000000..513f9bb --- /dev/null +++ b/src/test/resources/META-INF/beans.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/src/test/resources/dataio.war b/src/test/resources/dataio.war new file mode 100644 index 0000000000000000000000000000000000000000..a14bf8c3bebd6588e3463c9dd4de7c754c9d526d GIT binary patch literal 1757 zcmWIWW@Zs#-~hscA~k0QB)|z|`?`iW>U#RQ=`%9~c(ZeWWSO8!0&r>+Le`j+nwVFt zSCO03>wlW>kb;2C?e!TuP6zFscuRkUy8gXcqMb)iT-u>gvyWwQ_}raml_$US7wf$J zCjW@F;qe_A4cc~rpPH9&%5||G3EdoKlI!UE`pmoA9-1e&Onq3_*c&7(^ZoI`GuIy9 z5_DJjoVn?8Os}CtkKP6O#c$8EToDg8*PQuNr!6h?#{R1hSwTLq`u*ug6VQE+ff%|CFuS2kL&0A zKdJsRq0N)o`cSu0(M_pv_bIP`B;;;PT9YYtt7h@CJDZ;-6(0X*lfUf|gQa@V;-^s# zGHmw^ffu&w^qzB!?h3fZrE~X- zDCh1~rE70qsP;O!v6{bczL`hvNmH?9Teg^1iv8Yux6HraE!yJN%tt51ofb)keP48o z@$8PLQ?l3H3$PN}w^~HMHlSqHm!E5||6lUb@$${{y~}<#e~Vkn@N2Qgls9#4GtHQt z?wmdPtFZFqznK~HoNw)#pq40pu<)91x8WD*73VmDEw&!%(*F6b_n*4aq}{%c`ug~J z)@X@p?${deYRXU3lw7^dlGayyg53@&Z`{ceY&@%Br`G%@pKhyWz5M5udfQ&RDE$AW zm5U5mZGJi&Iwr3dlz%fa`f&H^V}Eb`JolzWq=orG!@s}_-6w1J&N{pE!Igct<4?Yf z@I71)N>V#ZWY^wfWMJrE!auEO zmR&Da>8gm&cqPEHc+s*8x6LmHocOla{=YF-(5G__rG_6&qhwro?y-u@GVSHsuxQ@H zt(7OjS1fqaKOw5<&LlMpwh!|kbxmSd{(UUwn^*12U+eOh|Nb#2uRrpn{qmlpNt?V) z*1q0&@a?_h;T#(h!amJez%9@F!z|E!r36or(h~MSMg0iY>9aH|e|Z^y1LqmZ^Ty@# zfX;sk#JKYevImPx^K`QkE6Twcf9*s=|04!Gt>6E3X;mjDIK8+P?dM^>kzx1xtzChS zLOO%_>TEMhLktWQCTdoG`+aZnrrY!Pu1@djY~J$hR@}^4OZb^j-AUJ12+Qq_!7|3Ll+Wy{Y|^g`Eud z!|rK|v(-YDMg(jqO4!)IS8%d5@9y8dx6f!Ue%!zHLjBd6e|&$vAJ5NS5N&gnZ`=D< zc8s8eAazP{5h#ov0uw`kHzSh>18TtvD>*?0D=L5&v*_B8iz`sEiU5{CCR`i5kVV%I zQV+8hTzbO|_zh&iia2y#$SE3Bq#=MY&}%SV&;kx!GjeJHr3nP^V@7C3$pYv`AO|F> c5&A3$BTy1qfHx~J`!O)E0bv2ik*pvd0FB#s)&Kwi literal 0 HcmV?d00001 diff --git a/src/test/resources/log4j.properties b/src/test/resources/log4j.properties new file mode 100644 index 0000000..f1ebf00 --- /dev/null +++ b/src/test/resources/log4j.properties @@ -0,0 +1,9 @@ +log4j.rootCategory = WARN,ROOT + +log4j.appender.ROOT=org.apache.log4j.ConsoleAppender +log4j.appender.ROOT.layout=org.apache.log4j.PatternLayout +log4j.appender.ROOT.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p %c{2} [%t,%M:%L] %m%n + +log4j.category.org.gcube = TRACE,ROOT +log4j.additivity.org.gcube=false +