Package org.openqa.selenium.io

Examples of org.openqa.selenium.io.Zip


  @Test
  public void testToJson() throws IOException, JSONException {
    profile = new OperaProfile(existingProfile);

    String json = profile.toJson().getString(OperaProfile.BASE64_JSON_KEY);
    new Zip().unzip(json, temporaryProfile);
    OperaProfile extractedProfile = new OperaProfile(temporaryProfile.getPath());

    assertThat(profile, matchesProfile(extractedProfile));
  }
View Full Code Here


  }

  private static class TestOperaProfile extends OperaProfile {

    public static OperaProfile fromJson(File directory, String json) throws IOException {
      new Zip().unzip(json, directory);
      return new OperaProfile(directory);
    }
View Full Code Here

   *
   * @return the JSON representation of this profile
   * @throws IOException if an I/O error occurs
   */
  public JSONObject toJson() throws IOException {
    String base64 = new Zip().zip(getDirectory());
    Map<String, String> map = ImmutableMap.of(
      "className", this.getClass().getName(),
      BASE64_JSON_KEY, base64);
   
    return new JSONObject(map);
View Full Code Here

   * @return a new profile representation
   * @throws IOException if an I/O error occurs
   */
  public static OperaProfile fromJson(String json) throws IOException {
    File directory = TemporaryFilesystem.getDefaultTmpFS().createTempDir("opera", "duplicate");
    new Zip().unzip(json, directory);
    return new OperaProfile(directory);
  }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.io.Zip

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.