Author: andrew.plotnikov
Date: 2012-01-23 09:58:14 -0500 (Mon, 23 Jan 2012)
New Revision: 5493
Removed:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/BaseGroovyScriptManager.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/ScriptKey.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/SimpleScriptKey.java
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryService.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyCompiler.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/NodeScriptKey.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/URLScriptKey.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryTest.java
Log:
EXOJCR-1723: Removed deprecated methods and classes
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryService.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryService.java 2012-01-23
07:59:44 UTC (rev 5492)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryService.java 2012-01-23
14:58:14 UTC (rev 5493)
@@ -86,105 +86,12 @@
public RESTRegistryService(RegistryService regService,
ThreadLocalSessionProviderService sessionProviderService)
throws Exception
{
-
this.regService = regService;
this.sessionProviderService = sessionProviderService;
}
@GET
@Produces(MediaType.APPLICATION_XML)
- @Path("/{repository}/")
- @Deprecated
- public Response getRegistry(@PathParam("repository") String repository,
@Context UriInfo uriInfo)
- {
- try
- {
- regService.getRepositoryService().setCurrentRepositoryName(repository);
- return getRegistry(uriInfo);
- }
- catch (Exception e)
- {
- log.error("Get registry failed", e);
- throw new WebApplicationException(e);
- }
- }
-
- @GET
- @Path("/{repository}/{entryPath:.+}/")
- @Produces(MediaType.APPLICATION_XML)
- @Deprecated
- public Response getEntry(@PathParam("repository") String repository,
@PathParam("entryPath") String entryPath)
- {
- try
- {
- regService.getRepositoryService().setCurrentRepositoryName(repository);
- return getEntry(entryPath);
- }
- catch (Exception e)
- {
- log.error("Get registry entry failed", e);
- throw new WebApplicationException(e);
- }
- }
-
- @POST
- @Path("/{repository}/{groupName:.+}/")
- @Consumes(MediaType.APPLICATION_XML)
- @Deprecated
- public Response createEntry(InputStream entryStream,
@PathParam("repository") String repository,
- @PathParam("groupName") String groupName, @Context UriInfo uriInfo)
- {
- try
- {
- regService.getRepositoryService().setCurrentRepositoryName(repository);
- return createEntry(entryStream, groupName, uriInfo);
- }
- catch (Exception e)
- {
- log.error("Create registry entry failed", e);
- throw new WebApplicationException(e);
- }
- }
-
- @PUT
- @Path("/{repository}/{groupName:.+}/")
- @Consumes(MediaType.APPLICATION_XML)
- @Deprecated
- public Response recreateEntry(InputStream entryStream,
@PathParam("repository") String repository,
- @PathParam("groupName") String groupName, @Context UriInfo
uriInfo,
- @QueryParam("createIfNotExist") boolean createIfNotExist)
- {
- try
- {
- regService.getRepositoryService().setCurrentRepositoryName(repository);
- return recreateEntry(entryStream, groupName, uriInfo, createIfNotExist);
- }
- catch (Exception e)
- {
- log.error("Re-create registry entry failed", e);
- throw new WebApplicationException(e);
- }
- }
-
- @DELETE
- @Path("/{repository}/{entryPath:.+}/")
- @Deprecated
- public Response removeEntry(@PathParam("repository") String repository,
@PathParam("entryPath") String entryPath)
- {
- try
- {
- regService.getRepositoryService().setCurrentRepositoryName(repository);
- return removeEntry(entryPath);
- }
- catch (Exception e)
- {
- log.error("Remove registry entry failed", e);
- throw new WebApplicationException(e);
- }
- }
-
- @GET
- @Produces(MediaType.APPLICATION_XML)
public Response getRegistry(@Context UriInfo uriInfo)
{
SessionProvider sessionProvider = sessionProviderService.getSessionProvider(null);
Deleted:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/BaseGroovyScriptManager.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/BaseGroovyScriptManager.java 2012-01-23
07:59:44 UTC (rev 5492)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/BaseGroovyScriptManager.java 2012-01-23
14:58:14 UTC (rev 5493)
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2010 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.script.groovy;
-
-import org.exoplatform.services.rest.ext.groovy.GroovyJaxrsPublisher;
-import org.exoplatform.services.rest.ext.groovy.ResourceId;
-import org.exoplatform.services.rest.impl.ResourcePublicationException;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.List;
-
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response;
-
-/**
- * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey
Parfonov</a>
- * @version $Id: BaseGroovyScriptManager.java 3720 2010-12-23 15:06:33Z
- * aparfonov $
- * @deprecated
- */
-// Contains all method what we do not need any more in GroovyScript2RestLoader
-// but need to keep for back compatibility.
-public abstract class BaseGroovyScriptManager
-{
- protected GroovyJaxrsPublisher groovyPublisher;
-
- public BaseGroovyScriptManager(GroovyJaxrsPublisher groovyPublisher)
- {
- this.groovyPublisher = groovyPublisher;
- }
-
- public boolean isLoaded(ScriptKey key)
- {
- return groovyPublisher.isPublished(key);
- }
-
- public boolean isLoaded(String key)
- {
- return isLoaded(new SimpleScriptKey(key));
- }
-
- public boolean isLoaded(URL url)
- {
- return isLoaded(new URLScriptKey(url));
- }
-
- public Response load(String repository, String workspace, String path, boolean state)
- {
- return load(repository, workspace, path, state, null);
- }
-
- public abstract Response load(String repository, String workspace, String path,
boolean state, List<String> sources,
- List<String> files, MultivaluedMap<String, String> properties);
-
- public Response load(String repository, String workspace, String path, boolean state,
- MultivaluedMap<String, String> properties)
- {
- return load(repository, workspace, path, state, null, null, properties);
- }
-
- public boolean loadScript(ScriptKey key, String name, InputStream stream) throws
IOException
- {
- try
- {
- groovyPublisher.publishPerRequest(stream, key, null);
- return true;
- }
- catch (ResourcePublicationException e)
- {
- return false;
- }
- }
-
- public boolean loadScript(String key, InputStream stream) throws IOException
- {
- return loadScript(key, null, stream);
- }
-
- public boolean loadScript(String key, String name, InputStream stream) throws
IOException
- {
- return loadScript(new SimpleScriptKey(key), name, stream);
- }
-
- public boolean loadScript(URL url) throws IOException
- {
- ResourceId key = new URLScriptKey(url);
- try
- {
- groovyPublisher.publishPerRequest(new BufferedInputStream(url.openStream()),
key, null);
- return true;
- }
- catch (ResourcePublicationException e)
- {
- return true;
- }
- }
-
- public boolean unloadScript(ScriptKey key)
- {
- return null != groovyPublisher.unpublishResource(key);
- }
-
- public boolean unloadScript(String key)
- {
- return unloadScript(new SimpleScriptKey(key));
- }
-
- public void unloadScript(URL url)
- {
- unloadScript(new URLScriptKey(url));
- }
-
- public Response validateScript(String name, final InputStream script)
- {
- return validateScript(name, script, null, null);
- }
-
- public abstract Response validateScript(String name, InputStream script,
List<String> sources, List<String> files);
-}
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java 2012-01-23
07:59:44 UTC (rev 5492)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java 2012-01-23
14:58:14 UTC (rev 5493)
@@ -98,8 +98,10 @@
*/
@SuppressWarnings("deprecation")
@Path("script/groovy")
-public class GroovyScript2RestLoader extends BaseGroovyScriptManager implements
Startable
+public class GroovyScript2RestLoader implements Startable
{
+ protected GroovyJaxrsPublisher groovyPublisher;
+
protected static class InnerGroovyJaxrsPublisher extends GroovyJaxrsPublisher
{
public InnerGroovyJaxrsPublisher(ResourceBinder binder, GroovyScriptInstantiator
instantiator,
@@ -192,7 +194,7 @@
ConfigurationManager configurationManager, RegistryService registryService,
GroovyJaxrsPublisher groovyPublisher,
org.exoplatform.services.jcr.ext.resource.jcr.Handler jcrUrlHandler, InitParams
params)
{
- super(groovyPublisher);
+ this.groovyPublisher = groovyPublisher;
this.binder = binder;
this.repositoryService = repositoryService;
this.configurationManager = configurationManager;
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyCompiler.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyCompiler.java 2012-01-23
07:59:44 UTC (rev 5492)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyCompiler.java 2012-01-23
14:58:14 UTC (rev 5493)
@@ -19,9 +19,6 @@
package org.exoplatform.services.jcr.ext.script.groovy;
-import groovy.lang.GroovyClassLoader;
-import groovy.lang.GroovyCodeSource;
-
import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.services.jcr.ext.resource.UnifiedNodeReference;
import
org.exoplatform.services.jcr.ext.script.groovy.JcrGroovyClassLoaderProvider.JcrGroovyClassLoader;
@@ -32,7 +29,6 @@
import org.picocontainer.Startable;
import java.io.IOException;
-import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.PrivilegedAction;
@@ -210,50 +206,6 @@
}
/**
- * @return get underling groovy class loader
- */
- @Deprecated
- public GroovyClassLoader getGroovyClassLoader()
- {
- return classLoaderProvider.getGroovyClassLoader();
- }
-
- /**
- * Set groovy class loader.
- *
- * @param gcl groovy class loader
- * @throws NullPointerException if <code>gcl == null</code>
- */
- @Deprecated
- public void setGroovyClassLoader(GroovyClassLoader gcl)
- {
- LOG.warn("Method setGroovyClassLoader is deprecated.");
- }
-
- /**
- * Create {@link GroovyCodeSource} from given stream and name. Code base
- * 'file:/groovy/script' (default code base used for all Groovy classes) will
- * be used.
- *
- * @param in groovy source code stream
- * @param name code source name
- * @return GroovyCodeSource
- */
- // Override this method if need other behavior.
- @Deprecated
- protected GroovyCodeSource createCodeSource(final InputStream in, final String name)
- {
- GroovyCodeSource gcs = SecurityHelper.doPrivilegedAction(new
PrivilegedAction<GroovyCodeSource>() {
- public GroovyCodeSource run()
- {
- return new GroovyCodeSource(in, name, "/groovy/script");
- }
- });
- gcs.setCachable(false);
- return gcs;
- }
-
- /**
* @see org.picocontainer.Startable#start()
*/
public void start()
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/NodeScriptKey.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/NodeScriptKey.java 2012-01-23
07:59:44 UTC (rev 5492)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/NodeScriptKey.java 2012-01-23
14:58:14 UTC (rev 5493)
@@ -19,6 +19,7 @@
package org.exoplatform.services.jcr.ext.script.groovy;
import org.exoplatform.services.rest.ext.groovy.BaseResourceId;
+import org.exoplatform.services.rest.ext.groovy.ResourceId;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
@@ -27,7 +28,7 @@
* @author <a href="mailto:andrew00x@gmail.com">Andrey
Parfonov</a>
* @version $Id: NodeScriptKey.java 34445 2009-07-24 07:51:18Z dkatayev $
*/
-public class NodeScriptKey extends BaseResourceId implements ScriptKey
+public class NodeScriptKey extends BaseResourceId implements ResourceId
{
private final String repositoryName;
Deleted:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/ScriptKey.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/ScriptKey.java 2012-01-23
07:59:44 UTC (rev 5492)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/ScriptKey.java 2012-01-23
14:58:14 UTC (rev 5493)
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.script.groovy;
-
-import org.exoplatform.services.rest.ext.groovy.ResourceId;
-
-/**
- * @author <a href="mailto:andrew00x@gmail.com">Andrey
Parfonov</a>
- * @version $Id: ScriptKey.java 34445 2009-07-24 07:51:18Z dkatayev $
- * @deprecated use {@link ResourceId} instead
- */
-public interface ScriptKey extends ResourceId
-{
-
-}
Deleted:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/SimpleScriptKey.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/SimpleScriptKey.java 2012-01-23
07:59:44 UTC (rev 5492)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/SimpleScriptKey.java 2012-01-23
14:58:14 UTC (rev 5493)
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.ext.script.groovy;
-
-import org.exoplatform.services.rest.ext.groovy.BaseResourceId;
-
-/**
- * @author <a href="mailto:andrew00x@gmail.com">Andrey
Parfonov</a>
- * @version $Id: SimpleScriptKey.java 34445 2009-07-24 07:51:18Z dkatayev $
- * @deprecated use {@link BaseResourceId} instead
- */
-public class SimpleScriptKey extends BaseResourceId implements ScriptKey
-{
- public SimpleScriptKey(String key)
- {
- super(key);
- }
-}
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/URLScriptKey.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/URLScriptKey.java 2012-01-23
07:59:44 UTC (rev 5492)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/URLScriptKey.java 2012-01-23
14:58:14 UTC (rev 5493)
@@ -19,6 +19,7 @@
package org.exoplatform.services.jcr.ext.script.groovy;
import org.exoplatform.services.rest.ext.groovy.BaseResourceId;
+import org.exoplatform.services.rest.ext.groovy.ResourceId;
import java.net.URL;
@@ -26,7 +27,7 @@
* @author <a href="mailto:andrew00x@gmail.com">Andrey
Parfonov</a>
* @version $Id: URLScriptKey.java 34445 2009-07-24 07:51:18Z dkatayev $
*/
-public class URLScriptKey extends BaseResourceId implements ScriptKey
+public class URLScriptKey extends BaseResourceId implements ResourceId
{
public URLScriptKey(URL url)
{
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryTest.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryTest.java 2012-01-23
07:59:44 UTC (rev 5492)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryTest.java 2012-01-23
14:58:14 UTC (rev 5493)
@@ -90,8 +90,10 @@
log.info("-----REST-----");
+ repositoryService.setCurrentRepositoryName("db1");
DummyContainerResponseWriter wr = new DummyContainerResponseWriter();
- URI reqUri = new URI(baseUri.toString() + "/registry/db1/");
+ URI reqUri = new URI(baseUri.toString() + "/registry/");
+
ContainerResponse cres =
request(handler, wr, "GET", reqUri, baseUri, null, new
InputHeadersMap(new MultivaluedMapImpl()));
assertEquals(200, cres.getStatus());
@@ -100,14 +102,14 @@
// request to exo:services/exo_service
// response status should be 404 (NOT_FOUND)
wr.reset();
- reqUri = new URI(baseUri.toString() + "/registry/db1/" +
RegistryService.EXO_SERVICES + "/exo_service");
+ reqUri = new URI(baseUri.toString() + "/registry/" +
RegistryService.EXO_SERVICES + "/exo_service");
cres = request(handler, wr, "GET", reqUri, baseUri, null, new
InputHeadersMap(new MultivaluedMapImpl()));
assertEquals(404, cres.getStatus());
assertNull(wr.getBody());
// create exo:services/exo_service
wr.reset();
- reqUri = new URI(baseUri.toString() + "/registry/db1/" +
RegistryService.EXO_SERVICES);
+ reqUri = new URI(baseUri.toString() + "/registry/" +
RegistryService.EXO_SERVICES);
cres =
request(handler, wr, "POST", reqUri, baseUri, SERVICE_XML.getBytes(),
new InputHeadersMap(
new MultivaluedMapImpl()));
@@ -116,14 +118,14 @@
// request to exo:services/exo_service
wr.reset();
- reqUri = new URI(baseUri.toString() + "/registry/db1/" +
RegistryService.EXO_SERVICES + "/exo_service");
+ reqUri = new URI(baseUri.toString() + "/registry/" +
RegistryService.EXO_SERVICES + "/exo_service");
cres = request(handler, wr, "GET", reqUri, baseUri, null, new
InputHeadersMap(new MultivaluedMapImpl()));
assertEquals(200, cres.getStatus());
log.info(new String(wr.getBody()));
// recreate exo:services/exo_service
wr.reset();
- reqUri = new URI(baseUri.toString() + "/registry/db1/" +
RegistryService.EXO_SERVICES);
+ reqUri = new URI(baseUri.toString() + "/registry/" +
RegistryService.EXO_SERVICES);
cres =
request(handler, wr, "PUT", reqUri, baseUri, SERVICE_XML.getBytes(),
new InputHeadersMap(
new MultivaluedMapImpl()));
@@ -132,14 +134,14 @@
// delete exo:services/exo_service
wr.reset();
- reqUri = new URI(baseUri.toString() + "/registry/db1/" +
RegistryService.EXO_SERVICES + "/exo_service");
+ reqUri = new URI(baseUri.toString() + "/registry/" +
RegistryService.EXO_SERVICES + "/exo_service");
cres = request(handler, wr, "DELETE", reqUri, baseUri, null, new
InputHeadersMap(new MultivaluedMapImpl()));
assertEquals(204, cres.getStatus());
// request to exo:services/exo_service
// request status should be 404 (NOT_FOUND)
wr.reset();
- reqUri = new URI(baseUri.toString() + "/registry/db1/" +
RegistryService.EXO_SERVICES + "/exo_service");
+ reqUri = new URI(baseUri.toString() + "/registry/" +
RegistryService.EXO_SERVICES + "/exo_service");
cres = request(handler, wr, "GET", reqUri, baseUri, null, new
InputHeadersMap(new MultivaluedMapImpl()));
assertEquals(404, cres.getStatus());
assertNull(wr.getBody());
@@ -153,40 +155,44 @@
ByteArrayOutputStream out = new ByteArrayOutputStream();
int rd = -1;
while ((rd = in.read()) != -1)
+ {
out.write(rd);
+ }
byte[] data = out.toByteArray();
+ repositoryService.setCurrentRepositoryName("db1");
+
// check for exo:services/group/test
// response status should be 404 (NOT_FOUND)
- URI reqUri = new URI(baseUri.toString() + "/registry/db1/" +
RegistryService.EXO_SERVICES + "/group/test");
+ URI reqUri = new URI(baseUri.toString() + "/registry/" +
RegistryService.EXO_SERVICES + "/group/test");
ContainerResponse cres =
request(handler, wr, "GET", reqUri, baseUri, null, new
InputHeadersMap(new MultivaluedMapImpl()));
assertEquals(404, cres.getStatus());
assertNull(wr.getBody());
// create exo:services/group/test
wr.reset();
- reqUri = new URI(baseUri.toString() + "/registry/db1/" +
RegistryService.EXO_SERVICES + "/group/");
+ reqUri = new URI(baseUri.toString() + "/registry/" +
RegistryService.EXO_SERVICES + "/group/");
cres = request(handler, wr, "POST", reqUri, baseUri, data, new
InputHeadersMap(new MultivaluedMapImpl()));
assertEquals(201, cres.getStatus());
assertEquals(new URI(reqUri + "test"),
wr.getHeaders().getFirst(HttpHeaders.LOCATION));
// check again for exo:services/group/test
wr.reset();
- reqUri = new URI(baseUri.toString() + "/registry/db1/" +
RegistryService.EXO_SERVICES + "/group/test");
+ reqUri = new URI(baseUri.toString() + "/registry/" +
RegistryService.EXO_SERVICES + "/group/test");
cres = request(handler, wr, "GET", reqUri, baseUri, null, new
InputHeadersMap(new MultivaluedMapImpl()));
assertEquals(200, cres.getStatus());
log.info(new String(wr.getBody()));
// remove
wr.reset();
- reqUri = new URI(baseUri.toString() + "/registry/db1/" +
RegistryService.EXO_SERVICES + "/group/");
+ reqUri = new URI(baseUri.toString() + "/registry/" +
RegistryService.EXO_SERVICES + "/group/");
cres = request(handler, wr, "DELETE", reqUri, baseUri, null, new
InputHeadersMap(new MultivaluedMapImpl()));
assertEquals(204, cres.getStatus());
// check for exo:services/group/test
// response status should be 404 (NOT_FOUND)
wr.reset();
- reqUri = new URI(baseUri.toString() + "/registry/db1/" +
RegistryService.EXO_SERVICES + "/group/test");
+ reqUri = new URI(baseUri.toString() + "/registry/" +
RegistryService.EXO_SERVICES + "/group/test");
cres = request(handler, wr, "GET", reqUri, baseUri, null, new
InputHeadersMap(new MultivaluedMapImpl()));
assertEquals(404, cres.getStatus());
assertNull(wr.getBody());