Package org.exoplatform.services.rest.impl

Examples of org.exoplatform.services.rest.impl.ContainerResponse


                  new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                           + HTTPBackupAgent.Constants.OperationType.CURRENT_BACKUPS_INFO), new URI(""), null,
                           new InputHeadersMap(headers));

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

         assertEquals(200, cres.getStatus());

         ShortInfoList infoList = (ShortInfoList) getObject(ShortInfoList.class, responseWriter.getBody());
         List<ShortInfo> list = new ArrayList<ShortInfo>(infoList.getBackups());

         ShortInfo info = getBackupInfo(list);
         assertNotNull(info);

         assertEquals(info.getRepositoryName(), "db6");
         assertEquals(info.getWorkspaceName(), "ws2");

         id = info.getBackupId();
      }

      MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
      ContainerRequestUserRole creq =
               new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                        + HTTPBackupAgent.Constants.OperationType.CURRENT_OR_COMPLETED_BACKUP_INFO + "/" + id),
                        new URI(""), null, new InputHeadersMap(headers));

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

      assertEquals(200, cres.getStatus());

      DetailedInfo info = (DetailedInfo) getObject(DetailedInfo.class, responseWriter.getBody());

      assertNotNull(info);
      assertEquals(BackupManager.FULL_AND_INCREMENTAL, info.getBackupType().intValue());
View Full Code Here


                  new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                           + HTTPBackupAgent.Constants.OperationType.CURRENT_AND_COMPLETED_BACKUPS_REPOSITORY_INFO),
                           new URI(""), null, new InputHeadersMap(headers));

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

         assertEquals(200, cres.getStatus());

         ShortInfoList infoList = (ShortInfoList) getObject(ShortInfoList.class, responseWriter.getBody());
         List<ShortInfo> list = new ArrayList<ShortInfo>(infoList.getBackups());

         ShortInfo info = getBackupInfo(list);
         assertNotNull(info);

         assertEquals(info.getRepositoryName(), "db6");

         id = info.getBackupId();
      }

      MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
      ContainerRequestUserRole creq =
               new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                        + HTTPBackupAgent.Constants.OperationType.CURRENT_OR_COMPLETED_BACKUP_REPOSITORY_INFO + "/"
                        + id), new URI(""), null, new InputHeadersMap(headers));

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

      assertEquals(200, cres.getStatus());

      DetailedInfo info = (DetailedInfo) getObject(DetailedInfo.class, responseWriter.getBody());

      assertNotNull(info);
      assertEquals(BackupManager.FULL_AND_INCREMENTAL, info.getBackupType().intValue());
View Full Code Here

                  new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                           + HTTPBackupAgent.Constants.OperationType.CURRENT_BACKUPS_INFO), new URI(""), null,
                           new InputHeadersMap(headers));

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

         assertEquals(200, cres.getStatus());

         ShortInfoList infoList = (ShortInfoList) getObject(ShortInfoList.class, responseWriter.getBody());
         List<ShortInfo> list = new ArrayList<ShortInfo>(infoList.getBackups());

         ShortInfo info = getBackupInfo(list);
         assertNotNull(info);

         assertEquals(info.getRepositoryName(), "db6");
         assertEquals(info.getWorkspaceName(), "ws2");

         id = info.getBackupId();
      }

      MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
      ContainerRequestUserRole creq =
               new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                        + HTTPBackupAgent.Constants.OperationType.STOP_BACKUP + "/" + id), new URI(""), null,
                        new InputHeadersMap(headers));

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

      assertEquals(200, cres.getStatus());
   }
View Full Code Here

                  new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                           + HTTPBackupAgent.Constants.OperationType.CURRENT_BACKUPS_REPOSITORY_INFO), new URI(""),
                           null, new InputHeadersMap(headers));

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

         assertEquals(200, cres.getStatus());

         ShortInfoList infoList = (ShortInfoList) getObject(ShortInfoList.class, responseWriter.getBody());
         List<ShortInfo> list = new ArrayList<ShortInfo>(infoList.getBackups());

         ShortInfo info = getBackupInfo(list);
         assertNotNull(info);

         assertEquals(info.getRepositoryName(), "db6");

         id = info.getBackupId();
      }

      MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
      ContainerRequestUserRole creq =
               new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                        + HTTPBackupAgent.Constants.OperationType.STOP_BACKUP_REPOSITORY + "/" + id), new URI(""),
                        null, new InputHeadersMap(headers));

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

      assertEquals(200, cres.getStatus());
   }
View Full Code Here

               new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                        + HTTPBackupAgent.Constants.OperationType.COMPLETED_BACKUPS_INFO), new URI(""), null,
                        new InputHeadersMap(headers));

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

      assertEquals(200, cres.getStatus());

      ShortInfoList infoList = (ShortInfoList) getObject(ShortInfoList.class, responseWriter.getBody());
      List<ShortInfo> list = new ArrayList<ShortInfo>(infoList.getBackups());

      ShortInfo info = getBackupInfo(list);
View Full Code Here

               new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                        + HTTPBackupAgent.Constants.OperationType.COMPLETED_BACKUPS_REPOSITORY_INFO), new URI(""),
                        null, new InputHeadersMap(headers));

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

      assertEquals(200, cres.getStatus());

      ShortInfoList infoList = (ShortInfoList) getObject(ShortInfoList.class, responseWriter.getBody());
      List<ShortInfo> list = new ArrayList<ShortInfo>(infoList.getBackups());

      ShortInfo info = getBackupInfo(list);
View Full Code Here

                  new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                           + HTTPBackupAgent.Constants.OperationType.COMPLETED_BACKUPS_INFO), new URI(""), null,
                           new InputHeadersMap(headers));

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

         assertEquals(200, cres.getStatus());

         ShortInfoList infoList = (ShortInfoList) getObject(ShortInfoList.class, responseWriter.getBody());
         List<ShortInfo> list = new ArrayList<ShortInfo>(infoList.getBackups());

         assertEquals(1, list.size());

         ShortInfo info = list.get(0);

         assertEquals(info.getRepositoryName(), "db6");
         assertEquals(info.getWorkspaceName(), "ws2");

         id = info.getBackupId();
      }

      MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
      ContainerRequestUserRole creq =
               new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                        + HTTPBackupAgent.Constants.OperationType.CURRENT_OR_COMPLETED_BACKUP_INFO + "/" + id),
                        new URI(""), null, new InputHeadersMap(headers));

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

      assertEquals(200, cres.getStatus());

      DetailedInfo info = (DetailedInfo) getObject(DetailedInfo.class, responseWriter.getBody());

      assertNotNull(info);
      assertEquals(BackupManager.FULL_AND_INCREMENTAL, info.getBackupType().intValue());
View Full Code Here

               new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                        + HTTPBackupAgent.Constants.OperationType.GET_DEFAULT_WORKSPACE_CONFIG), new URI(""), null,
                        new InputHeadersMap(headers));

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

      assertEquals(200, cres.getStatus());

      WorkspaceEntry defEntry = (WorkspaceEntry) getObject(WorkspaceEntry.class, responseWriter.getBody());

      assertEquals(repository.getConfiguration().getDefaultWorkspaceName(), defEntry.getName());
   }
View Full Code Here

               new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                        + HTTPBackupAgent.Constants.OperationType.GET_DEFAULT_REPOSITORY_CONFIG), new URI(""), null,
                        new InputHeadersMap(headers));

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

      assertEquals(200, cres.getStatus());

      RepositoryEntry defEntry = (RepositoryEntry) getObject(RepositoryEntry.class, responseWriter.getBody());

      assertEquals(repository.getConfiguration().getName(), defEntry.getName());
   }
View Full Code Here

                  new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
                           + HTTPBackupAgent.Constants.OperationType.GET_DEFAULT_WORKSPACE_CONFIG), new URI(""), null,
                           new InputHeadersMap(headers));

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

         assertEquals(200, cres.getStatus());
         defEntry = (WorkspaceEntry) getObject(WorkspaceEntry.class, responseWriter.getBody());
      }

      WorkspaceEntry wEntry = makeWorkspaceEntry(defEntry, "db6", "ws3", "jdbcjcr24");
View Full Code Here

TOP

Related Classes of org.exoplatform.services.rest.impl.ContainerResponse

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.