Package org.restlet.data

Examples of org.restlet.data.Status


    TestContainer.getInstance().getTestContext().setUsername(TEST_USER_NAME);
    TestContainer.getInstance().getTestContext().setPassword(TEST_USER_PASSWORD);

    String repoId = this.getTestRepositoryId();
    String uriPart = RepositoryMessageUtil.SERVICE_PART + "/" + repoId + "/content/";
    final Status status = RequestFacade.doGetForStatus(uriPart);
    assertThat(status, isSuccess());
  }
View Full Code Here


    TestContainer.getInstance().getTestContext().setUsername(TEST_USER_NAME);
    TestContainer.getInstance().getTestContext().setPassword(TEST_USER_PASSWORD);

    String repoId = this.getTestRepositoryId();
    String uriPart = RepositoryMessageUtil.SERVICE_PART + "/" + repoId + "/index_content/";
    final Status status = RequestFacade.doGetForStatus(uriPart);
    assertThat(status, isSuccess());
  }
View Full Code Here

      description.appendText("redirecting");
    }

    @Override
    protected boolean matchesSafely(Response item) {
      Status status = item.getStatus();
      assertThat(status, notNullValue());
      return status.isRedirection();
    }
View Full Code Here

  }

  public void scheduleTasks()
      throws Exception
  {
    Status status = TaskScheduleUtil.create(getTaskScheduled());
    Assert.assertTrue(status.isSuccess());

    assertTasks();
  }
View Full Code Here

    E scheduledTask = getTaskScheduled();
    ScheduledServiceListResource task = TaskScheduleUtil.getTask(scheduledTask.getName());

    scheduledTask.setId(task.getId());
    updateTask(scheduledTask);
    Status status = TaskScheduleUtil.update(scheduledTask);
    Assert.assertTrue(status.isSuccess());

    assertTasks();
  }
View Full Code Here

    }
    catch (ResourceException e) {
      // NEXUS-4238, NEXUS-4290
      // if it's server error based on HTTP Code, but NOT when Nexus throws a known 503
      // (see org.sonatype.nexus.rest.AbstractResourceStoreContentPlexusResource.handleException(Request, Response, Exception))
      final Status status = e.getStatus();
      if (status == null) {
        handleError(e);
      }
      else {
        final int code = status.getCode();
        if (Status.isServerError(code) && Status.SERVER_ERROR_SERVICE_UNAVAILABLE.getCode() != code) {
          handleError(e);
        }
      }
View Full Code Here

      taskManual.setEnabled(true);
      taskManual.setTypeId(scheduledTask.getTypeId());
      taskManual.setProperties(scheduledTask.getProperties());
      taskManual.setSchedule("manual");

      Status status = TaskScheduleUtil.update(taskManual);
      Assert.assertTrue(status.isSuccess());

    }
    else {
      ScheduledServiceOnceResource updatedTask = new ScheduledServiceOnceResource();
      updatedTask.setId(task.getId());
      updatedTask.setName(scheduledTask.getName());
      updatedTask.setEnabled(task.isEnabled());
      updatedTask.setTypeId(scheduledTask.getTypeId());
      updatedTask.setProperties(scheduledTask.getProperties());
      updatedTask.setSchedule("once");
      Date startDate = DateUtils.addDays(new Date(), 10);
      startDate = DateUtils.round(startDate, Calendar.DAY_OF_MONTH);
      updatedTask.setStartDate(String.valueOf(startDate.getTime()));
      updatedTask.setStartTime("03:30");

      Status status = TaskScheduleUtil.update(updatedTask);
      Assert.assertTrue(status.isSuccess());
    }

    assertTasks();
  }
View Full Code Here

  public void deleteTasks()
      throws Exception
  {
    ScheduledServiceListResource task = TaskScheduleUtil.getTask(getTaskScheduled().getName());
    Status status = TaskScheduleUtil.deleteTask(task.getId());
    Assert.assertTrue(status.isSuccess());

    // delete is not working, see NEXUS-572
    // This is not true anymore, since NEXUS-3977, cancel() does NOT remove task from config, as this IT originally
    // checked,
    // that is left to DefaultScheduledTask upon exiting from call() method.
View Full Code Here

    // sanity check
    Assert.assertTrue(storageDir.isDirectory());
    Assert.assertTrue(artifactFile.isFile());

    String uri = "service/local/repositories/nexus970-default";
    Status status = RequestFacade.sendMessage(uri, Method.DELETE).getStatus();
    Assert.assertTrue("Unable to delete nexus970-default repository", status.isSuccess());

    // give a chance to wait for task to start
    Thread.sleep(1500);
    getEventInspectorsUtil().waitForCalmPeriod();
    TaskScheduleUtil.waitForAllTasksToStop();
View Full Code Here

  private Status getStatus(final Status status, final Exception e) {
    if (e == null || e.getMessage() == null) {
      return status;
    }
    return new Status(status, e.getMessage());
  }
View Full Code Here

TOP

Related Classes of org.restlet.data.Status

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.