Examples of GetLocationForStringRequest


Examples of org.geomajas.plugin.geocoder.command.dto.GetLocationForStringRequest

  @Autowired
  private CommandDispatcher commandDispatcher;

  @Test
  public void testApplyLimit() throws Exception {
    GetLocationForStringRequest request = new GetLocationForStringRequest();
    request.setCrs("EPSG:4326");
    request.setLocation("london");
    request.setMaxAlternatives(COUNT);

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

Examples of org.geomajas.plugin.geocoder.command.dto.GetLocationForStringRequest

  @Autowired
  private CommandDispatcher commandDispatcher;

  @Test
  public void testDefault() 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);
View Full Code Here

Examples of org.geomajas.plugin.geocoder.command.dto.GetLocationForStringRequest

    Assert.assertNull(response.getUserData()); // null when two results
  }

  @Test
  public void testAlt1() throws Exception {
    GetLocationForStringRequest request = new GetLocationForStringRequest();
    request.setCrs("EPSG:900913");
    request.setLocation("bla");
    request.setServicePattern("alt1");

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

Examples of org.geomajas.plugin.geocoder.command.dto.GetLocationForStringRequest

    Assert.assertEquals("alt1", ((UserDataTestInfo)response.getUserData()).getValue());
  }

  @Test
  public void testAlt2() throws Exception {
    GetLocationForStringRequest request = new GetLocationForStringRequest();
    request.setCrs("EPSG:900913");
    request.setLocation("bla");
    request.setServicePattern(".?.?.?2");

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

Examples of org.geomajas.plugin.geocoder.command.dto.GetLocationForStringRequest

    Assert.assertEquals("alt2", ((UserDataTestInfo)response.getUserData()).getValue());
  }

  @Test
  public void testBoth() throws Exception {
    GetLocationForStringRequest request = new GetLocationForStringRequest();
    request.setCrs("EPSG:900913");
    request.setLocation("bla");
    request.setServicePattern("alt.?");

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

Examples of org.geomajas.plugin.geocoder.command.dto.GetLocationForStringRequest

    Assert.assertNull(response.getUserData());
  }

  @Test
  public void testNone() throws Exception {
    GetLocationForStringRequest request = new GetLocationForStringRequest();
    request.setCrs("EPSG:900913");
    request.setLocation("bla");
    request.setServicePattern("a");

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

Examples of org.geomajas.plugin.geocoder.command.dto.GetLocationForStringRequest

  @Autowired
  private CommandDispatcher commandDispatcher;

  @Test
  public void oneBboxTest() throws Exception {
    GetLocationForStringRequest request = new GetLocationForStringRequest();
    request.setCrs("EPSG:900913");
    request.setLocation("one");

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

Examples of org.geomajas.plugin.geocoder.command.dto.GetLocationForStringRequest

    Assert.assertEquals("static-regex", response.getGeocoderName());
  }

  @Test
  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);
View Full Code Here

Examples of org.geomajas.plugin.geocoder.command.dto.GetLocationForStringRequest

    geocoderWidget.setValue("");
  }

  public void goToLocation(final String location) {
    GwtCommand command = new GwtCommand(GetLocationForStringRequest.COMMAND);
    GetLocationForStringRequest request = new GetLocationForStringRequest();
    request.setCrs(map.getMapModel().getCrs());
    request.setLocation(location);
    request.setServicePattern(servicePattern);
    if (GWT.isClient()) {
      // causes NPE when run as junit test
      String locale = LocaleInfo.getCurrentLocale().getLocaleName();
      if (!"default".equals(locale)) {
        request.setLocale(locale);
      }
    }
    command.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
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.