Examples of CommandResponse


Examples of org.geomajas.command.CommandResponse

        ((GeomajasSecurityException) error).getExceptionCode());
  }

  @Test
  public void testNullToken() {
    CommandResponse response = commandDispatcher.execute("test.SecurityTestCommand", null, null, null);
    Assert.assertEquals(1, response.getErrors().size());
    Throwable error = response.getErrors().get(0);
    Assert.assertTrue(error instanceof GeomajasSecurityException);
    Assert.assertEquals(ExceptionCode.CREDENTIALS_MISSING_OR_INVALID,
        ((GeomajasSecurityException) error).getExceptionCode());
  }
View Full Code Here

Examples of org.geomajas.command.CommandResponse

      public void run() {
        Assert.assertEquals("someToken", securityContext.getToken());
      }

    });
    CommandResponse response = commandDispatcher.execute("test.SecurityTestCommand", null, "someToken", null);
    Assert.assertEquals(0, response.getErrors().size());
  }
View Full Code Here

Examples of org.geomajas.command.CommandResponse

   * Execute a GWT RPC command request, and return the response. These request come from the client, and the response
   * is sent back to the client. We use a {@link CommandDispatcher} to actually execute the command.
   */
  public CommandResponse execute(Command request) {
    if (request != null) {
      CommandResponse result = null;
      result = commandDispatcher.execute(request.getCommandName(), request.getCommandRequest(),
          request.getUserToken(), request.getLocale());
      return result;
    }
    return null;
View Full Code Here

Examples of org.geomajas.command.CommandResponse

  }

  @Test
  public void testInvalidRequest() throws Exception {
    SearchByPointRequest request = new SearchByPointRequest();
    CommandResponse response = dispatcher.execute(SearchByPointRequest.COMMAND, request, null, "en");
    Assert.assertTrue(response.isError());
    List<Throwable> errors = response.getErrors();
    Assert.assertNotNull(errors);
    Assert.assertEquals(1, errors.size());
    Throwable error = errors.get(0);
    Assert.assertTrue(error instanceof GeomajasException);
    Assert.assertEquals(ExceptionCode.PARAMETER_MISSING, ((GeomajasException) error).getExceptionCode());
View Full Code Here

Examples of org.geomajas.command.CommandResponse

    request.setBbox(new Bbox(-3211986.0066263545, 98246.25012821658, 1.065471024672729E7, 3365675.229452881));
    request.setCrs("EPSG:900913");
    request.setLayerIds(new String[] {layer});
    request.setLocation(new Coordinate(672238.022713162, 2554015.0948743597));
    request.setScale(1.022083167709322E-4);
    CommandResponse response = dispatcher.execute(SearchByPointRequest.COMMAND, request, null, "en");
    Assert.assertFalse(response.isError());
    Assert.assertTrue(response instanceof SearchByPointResponse);
    SearchByPointResponse sbp = (SearchByPointResponse) response;
    Map<String, List<Feature>> map = sbp.getFeatureMap();
    Assert.assertNotNull(map);
    List<Feature> features = map.get(layer);
View Full Code Here

Examples of org.geomajas.command.CommandResponse

  public void expandPointTest() throws Exception {
    GetLocationForStringRequest request = new GetLocationForStringRequest();
    request.setCrs("EPSG:900913");
    request.setLocation("booischot");

    CommandResponse commandResponse = commandDispatcher.execute(GetLocationForStringRequest.COMMAND, request, null,
        "en");
    Assert.assertNotNull(commandResponse);
    Assert.assertTrue(commandResponse instanceof GetLocationForStringResponse);
    GetLocationForStringResponse response = (GetLocationForStringResponse)commandResponse;
    Assert.assertTrue(response.isLocationFound());
View Full Code Here

Examples of org.geomajas.command.CommandResponse

  public void crsTest() throws Exception {
    GetLocationForStringRequest request = new GetLocationForStringRequest();
    request.setCrs("EPSG:4326");
    request.setLocation("Booischot");

    CommandResponse commandResponse = commandDispatcher.execute(GetLocationForStringRequest.COMMAND, request, null,
        "en");
    Assert.assertNotNull(commandResponse);
    Assert.assertTrue(commandResponse instanceof GetLocationForStringResponse);
    GetLocationForStringResponse response = (GetLocationForStringResponse)commandResponse;
    Assert.assertTrue(response.isLocationFound());
View Full Code Here

Examples of org.geomajas.command.CommandResponse

  public void secondServiceTest() throws Exception {
    GetLocationForStringRequest request = new GetLocationForStringRequest();
    request.setCrs("EPSG:900913");
    request.setLocation("second");

    CommandResponse commandResponse = commandDispatcher.execute(GetLocationForStringRequest.COMMAND, request, null,
        "en");
    Assert.assertNotNull(commandResponse);
    Assert.assertTrue(commandResponse instanceof GetLocationForStringResponse);
    GetLocationForStringResponse response = (GetLocationForStringResponse)commandResponse;
    Assert.assertTrue(response.isLocationFound());
View Full Code Here

Examples of org.geomajas.command.CommandResponse

  public void bboxTest() throws Exception {
    GetLocationForStringRequest request = new GetLocationForStringRequest();
    request.setCrs("EPSG:900913");
    request.setLocation("bbox");

    CommandResponse commandResponse = commandDispatcher.execute(GetLocationForStringRequest.COMMAND, request, null,
        "en");
    Assert.assertNotNull(commandResponse);
    Assert.assertTrue(commandResponse instanceof GetLocationForStringResponse);
    GetLocationForStringResponse response = (GetLocationForStringResponse)commandResponse;
    Assert.assertTrue(response.isLocationFound());
View Full Code Here

Examples of org.geomajas.command.CommandResponse

  public void combineBboxTest() throws Exception {
    GetLocationForStringRequest request = new GetLocationForStringRequest();
    request.setCrs("EPSG:900913");
    request.setLocation("bla");

    CommandResponse commandResponse = commandDispatcher.execute(GetLocationForStringRequest.COMMAND, request, null,
        "en");
    Assert.assertNotNull(commandResponse);
    Assert.assertTrue(commandResponse instanceof GetLocationForStringResponse);
    GetLocationForStringResponse response = (GetLocationForStringResponse)commandResponse;
    Assert.assertTrue(response.isLocationFound());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.