Package org.sourceforge.jsonedit.core.validation

Examples of org.sourceforge.jsonedit.core.validation.JsonTextValidator$Location


      // Create geographical targeting.
      GeoTargeting geoTargeting = new GeoTargeting();

      // Include the US, Quebec, Canada, and the B3P Canada postal code.
      Location countryLocation = new Location();
      countryLocation.setId(2840L);

      Location regionLocation = new Location();
      regionLocation.setId(20123L);

      Location postalCodeLocation = new Location();
      postalCodeLocation.setId(9000093L);

      geoTargeting.setTargetedLocations(new Location[] {countryLocation, regionLocation,
          postalCodeLocation});

      // Exclude Chicago and the New York metro area.
      Location cityLocation = new Location();
      cityLocation.setId(1016367L);

      Location metroLocation = new Location();
      metroLocation.setId(200501L);
      geoTargeting.setExcludedLocations(new Location[] {cityLocation, metroLocation});

      // Exclude domains that are not under the network's control.
      UserDomainTargeting userDomainTargeting = new UserDomainTargeting();
      userDomainTargeting.setDomains(new String[] {"usa.gov"});
View Full Code Here


  @Test(enabled = false)
  public void testShouldSetAndGetLocation() {
    //driver.get(pages.html5Page);

    LocationContext d = (LocationContext) new Augmenter().augment(driver);
    Location loc = new Location(40.714353, -74.005973, 0.056747);

    d.setLocation(loc);

    //driver.manage().timeouts().implicitlyWait(2000, MILLISECONDS);
View Full Code Here

          Map<Object, Object> map =
              (Map<Object, Object>) executeMethod.execute(DriverCommand.GET_LOCATION, null);
          double latitude = Long.valueOf((Long) map.get("latitude")).doubleValue();
          double longitude = Long.valueOf((Long) map.get("longitude")).doubleValue();
          double altitude = Long.valueOf((Long) map.get("altitude")).doubleValue();
          return new Location(latitude, longitude, altitude);
        } else if ("setLocation".equals(method.getName())) {
          return executeMethod.execute(DriverCommand.SET_LOCATION, ImmutableMap.of("location", args[0]));
        }
        return null;
      }
View Full Code Here

  @Test
  public void testFile1() throws Exception {
   
    File file = new File(System.getProperty("user.dir") + "/resources/testfiles/test1.json");
   
    JsonTextValidator jtop = new JsonTextValidator(file) {
     
      @Override
      public void reportProblem(String msg, Location loc, int violation, boolean isError) {
       
        Assert.fail();
      }
    };
   
    jtop.parse();

  }
View Full Code Here

  @Test
  public void testFile2() throws Exception {
   
    File file = new File(System.getProperty("user.dir") + "/resources/testfiles/test2.json");
   
    JsonTextValidator jtop = new JsonTextValidator(file){
     
      @Override
      public void reportProblem(String msg, Location loc, int violation, boolean isError) {
       
        Assert.fail();
      }
    };
   
    jtop.parse();

  }
View Full Code Here

  @Test
  public void testFile3() throws Exception {
   
    File file = new File(System.getProperty("user.dir") + "/resources/testfiles/test3.json");
   
    JsonTextValidator jtop = new JsonTextValidator(file) {
     
      @Override
      public void reportProblem(String msg, Location loc, int violation, boolean isError) {
       
        Assert.fail();
      }
    };
   
    jtop.parse();

  }
View Full Code Here

  @Test
  public void testFile4() throws Exception {
   
    File file = new File(System.getProperty("user.dir") + "/resources/testfiles/test4.json");
   
    JsonTextValidator jtop = new JsonTextValidator(file) {
     
      @Override
      public void reportProblem(String msg, Location loc, int violation, boolean isError) {
       
        Assert.fail();
      }
    };
   
    jtop.parse();

  }
View Full Code Here

  @Test
  public void testFile5() throws Exception {
   
    File file = new File(System.getProperty("user.dir") + "/resources/testfiles/test5.json");
   
    JsonTextValidator jtop = new JsonTextValidator(file) {
     
      @Override
      public void reportProblem(String msg, Location loc, int violation, boolean isError) {
       
        Assert.assertEquals(loc.charStart, 16);
      }
    };
   
    jtop.parse();
   
  }
View Full Code Here

  @Test
  public void testFile6() throws Exception {
   
    File file = new File(System.getProperty("user.dir") + "/resources/testfiles/test6.json");
   
    JsonTextValidator jtop = new JsonTextValidator(file) {
     
      @Override
      public void reportProblem(String msg, Location loc, int violation, boolean isError) {
       
        Assert.assertEquals(loc.charStart, 19);
      }
    };
   
    jtop.parse();
 
  }
View Full Code Here

  @Test
  public void testFile7() throws Exception {
   
    File file = new File(System.getProperty("user.dir") + "/resources/testfiles/test7.json");
   
    JsonTextValidator jtop = new JsonTextValidator(file) {
     
      @Override
      public void reportProblem(String msg, Location loc, int violation, boolean isError) {
       
        Assert.assertEquals(loc.charStart, 20);
      }
    };
   
    jtop.parse();
   
  }
View Full Code Here

TOP

Related Classes of org.sourceforge.jsonedit.core.validation.JsonTextValidator$Location

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.