Package org.exoplatform.services.jcr.ext.backup

Examples of org.exoplatform.services.jcr.ext.backup.ContainerRequestUserRole


   }

   public void testRepositoriesList() throws Exception
   {
      MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
      ContainerRequestUserRole creq =
         new ContainerRequestUserRole("GET", new URI(REST_REPOSITORY_SERVICE_PATH
            + RestRepositoryService.Constants.OperationType.REPOSITORIES_LIST), new URI(""), null, new InputHeadersMap(
            headers));

      ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
      ContainerResponse cres = new ContainerResponse(responseWriter);
View Full Code Here


   public void testWorkspacesList() throws Exception
   {
      String repoName = repositoryService.getConfig().getDefaultRepositoryName();

      MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
      ContainerRequestUserRole creq =
         new ContainerRequestUserRole("GET", new URI(REST_REPOSITORY_SERVICE_PATH
            + RestRepositoryService.Constants.OperationType.WORKSPACES_LIST + "/" + repoName + "/"), new URI(""), null,
            new InputHeadersMap(headers));

      ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
      ContainerResponse cres = new ContainerResponse(responseWriter);
View Full Code Here

   public void testGetDefaultWorkspaceConfig() throws Exception
   {
      String repoName = repositoryService.getConfig().getDefaultRepositoryName();

      MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
      ContainerRequestUserRole creq =
         new ContainerRequestUserRole("GET", new URI(REST_REPOSITORY_SERVICE_PATH
            + RestRepositoryService.Constants.OperationType.DEFAULT_WS_CONFIG + "/" + repoName + "/"), new URI(""),
            null, new InputHeadersMap(headers));

      ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
      ContainerResponse cres = new ContainerResponse(responseWriter);
View Full Code Here

   }

   public void testGetRepositoryServiceConfiguration() throws Exception
   {
      MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
      ContainerRequestUserRole creq =
         new ContainerRequestUserRole("GET", new URI(REST_REPOSITORY_SERVICE_PATH
            + RestRepositoryService.Constants.OperationType.REPOSITORY_SERVICE_CONFIGURATION), new URI(""), null,
            new InputHeadersMap(headers));

      ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
      ContainerResponse cres = new ContainerResponse(responseWriter);
View Full Code Here

      JsonValue json = generatorImpl.createJsonObject(rEntry);

      MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
      headers.putSingle("Content-Type", "application/json; charset=UTF-8");

      ContainerRequestUserRole creq =
         new ContainerRequestUserRole("POST", new URI(REST_REPOSITORY_SERVICE_PATH
            + RestRepositoryService.Constants.OperationType.CREATE_REPOSITORY), new URI(""), new ByteArrayInputStream(
            json.toString().getBytes("UTF-8")), new InputHeadersMap(headers));

      System.out.print("testCreateRepository  : " + json.toString());
View Full Code Here

      JsonValue json = generatorImpl.createJsonObject(rEntry);

      MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
      headers.putSingle("Content-Type", "application/json; charset=UTF-8");

      ContainerRequestUserRole creq =
         new ContainerRequestUserRole("POST", new URI(REST_REPOSITORY_SERVICE_PATH
            + RestRepositoryService.Constants.OperationType.CREATE_REPOSITORY), new URI(""), new ByteArrayInputStream(
            json.toString().getBytes("UTF-8")), new InputHeadersMap(headers));

      System.out.print("testCreateRepository  : " + json.toString());
View Full Code Here

      JsonValue json = generatorImpl.createJsonObject(wEntry);

      MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
      headers.putSingle("Content-Type", "application/json; charset=UTF-8");

      ContainerRequestUserRole creq =
         new ContainerRequestUserRole("POST", new URI(REST_REPOSITORY_SERVICE_PATH
            + RestRepositoryService.Constants.OperationType.CREATE_WORKSPACE + "/" + rName), new URI(""),
            new ByteArrayInputStream(json.toString().getBytes("UTF-8")), new InputHeadersMap(headers));

      System.out.print("testCreateWorkspace  : " + json.toString());
View Full Code Here

      assertNotNull(session);
      assertNotNull(session.getRootNode());

      MultivaluedMap<String, String> headers = new MultivaluedMapImpl();

      ContainerRequestUserRole creq =
         new ContainerRequestUserRole("POST", new URI(REST_REPOSITORY_SERVICE_PATH
            + RestRepositoryService.Constants.OperationType.REMOVE_WORKSPACE + "/" + rName + "/" + wsName + "/false/"),
            new URI(""), null, new InputHeadersMap(headers));

      ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
      ContainerResponse cres = new ContainerResponse(responseWriter);
      handler.handleRequest(creq, cres);

      assertEquals(409, cres.getStatus());

      //remove with prepare close sessions
      creq =
         new ContainerRequestUserRole("POST", new URI(REST_REPOSITORY_SERVICE_PATH
            + RestRepositoryService.Constants.OperationType.REMOVE_WORKSPACE + "/" + rName + "/" + wsName + "/true/"),
            new URI(""), null, new InputHeadersMap(headers));

      responseWriter = new ByteArrayContainerResponseWriter();
      cres = new ContainerResponse(responseWriter);
View Full Code Here

      assertNotNull(session);
      assertNotNull(session.getRootNode());

      MultivaluedMap<String, String> headers = new MultivaluedMapImpl();

      ContainerRequestUserRole creq =
         new ContainerRequestUserRole("GET", new URI(REST_REPOSITORY_SERVICE_PATH
            + RestRepositoryService.Constants.OperationType.REMOVE_REPOSITORY + "/" + repoName + "/false/"),
            new URI(""), null, new InputHeadersMap(headers));

      ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
      ContainerResponse cres = new ContainerResponse(responseWriter);
      handler.handleRequest(creq, cres);

      assertEquals(409, cres.getStatus());

      //remove with prepare close sessions
      creq =
         new ContainerRequestUserRole("GET", new URI(REST_REPOSITORY_SERVICE_PATH
            + RestRepositoryService.Constants.OperationType.REMOVE_REPOSITORY + "/" + repoName + "/true/"),
            new URI(""), null, new InputHeadersMap(headers));

      responseWriter = new ByteArrayContainerResponseWriter();
      cres = new ContainerResponse(responseWriter);
View Full Code Here

   }

   public void testInfo() throws Exception
   {
      MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
      ContainerRequestUserRole creq =
               new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                        + HTTPBackupAgent.Constants.OperationType.BACKUP_SERVICE_INFO), new URI(""), null,
                        new InputHeadersMap(headers));

      ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
      ContainerResponse cres = new ContainerResponse(responseWriter);
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.ext.backup.ContainerRequestUserRole

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.