Package net.sf.uadetector.datastore

Examples of net.sf.uadetector.datastore.SimpleXmlDataStore


  /**
   * Constructs an {@code OnlineXmlDataStore} by reading <em>UAS data</em> by the specified default URL
   * {@link DataStore#DEFAULT_DATA_URL} (in XML format).
   */
  public OnlineXmlDataStore() {
    super(DEFAULT_DATA_READER, DATA_URL, VERSION_URL, DEFAULT_CHARSET, new SimpleXmlDataStore(DATA_URL, VERSION_URL));
  }
View Full Code Here


    versionOut.close();
  }

  private static final DataStore determineDataStore(final String argument) {
    final boolean isOffline = argument != null && argument.toLowerCase().equals("offline");
    final DataStore fallback = new SimpleXmlDataStore(DATA_URL, VERSION_URL);
    return isOffline ? fallback : new OnlineXmlDataStore();
  }
View Full Code Here

  public static final URL DATA_URL = TestDataStoreFactory.class.getClassLoader().getResource("samples/uas.xml");

  public static final URL VERSION_URL = TestDataStoreFactory.class.getClassLoader().getResource("samples/uas.version");

  public static DataStore produce() {
    return new SimpleXmlDataStore(DATA_URL, VERSION_URL);
  }
View Full Code Here

    return JsonConverter.serialize(data, SerDeOption.PRETTY_PRINTING).getJson();
  }

  @Test
  public void test() {
    final DataStore dataStore = new SimpleXmlDataStore(DATA_URL, VERSION_URL);
    final String json = JsonConverter.serialize(dataStore.getData(), SerDeOption.PRETTY_PRINTING).getJson();
    String redo = json;
    for (int i = 0; i < 100; i++) {
      redo = toJson(fromJson(redo));
      assertThat(redo).isEqualTo(json);
    }
View Full Code Here

TOP

Related Classes of net.sf.uadetector.datastore.SimpleXmlDataStore

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.