@Test
  public void testPreservesOptions() {
    Fixture.fakePhase(PhaseId.READ_DATA);
    when(adapter.getFlavor()).thenReturn(NeedsPositionFlavor.CONTINUOUS);
    GeolocationOptions options =
        new GeolocationOptions().setFrequency(10).enableHighAccuracy().setMaximumAge(10);
    when(adapter.getOptions()).thenReturn(options);

    synchronizer.preserveValues(object);

    assertNotNull(
        RWT.getServiceStore()
            .getAttribute(
                synchronizer.getObjectId()
                    + "."
                    + GeolocationSynchronizer.PROP_ENABLE_HIGH_ACCURACY));
    assertNotNull(
        RWT.getServiceStore()
            .getAttribute(
                synchronizer.getObjectId() + "." + GeolocationSynchronizer.PROP_FREQUENCY));
    assertNotNull(
        RWT.getServiceStore()
            .getAttribute(
                synchronizer.getObjectId() + "." + GeolocationSynchronizer.PROP_MAXIMUM_AGE));
  }
 public String getInitialWindowPerspectiveId() {
   HttpServletRequest request = RWT.getRequest();
   String opiPath = request.getParameter("mode"); // $NON-NLS-1$
   if (opiPath != null && opiPath.equals("standalone")) // $NON-NLS-1$
   return StandaloneRuntimePerspective.ID;
   return OPIRunnerPerspective.ID;
 }
 private int getRequestCounter() {
   String version = RWTRequestVersionControl.class + ".Version";
   Integer result = (Integer) RWT.getServiceStore().getAttribute(version);
   if (result == null) {
     result = new Integer(0);
   } else {
     result = new Integer(result.intValue() + 1);
   }
   return result.intValue();
 }
  @Test
  public void testPreservesValues() {
    Fixture.fakePhase(PhaseId.READ_DATA);
    when(adapter.getFlavor()).thenReturn(NeedsPositionFlavor.CONTINUOUS);
    synchronizer.preserveValues(object);

    assertNotNull(
        RWT.getServiceStore()
            .getAttribute(
                synchronizer.getObjectId() + "." + GeolocationSynchronizer.PROP_NEEDS_POSITION));
  }