Package net.sf.uadetector.datareader

Examples of net.sf.uadetector.datareader.XmlDataReader


    new TestDataStore(new XmlDataReader(), null, VERSION_URL, CHARSET);
  }

  @Test
  public void construct_successful() {
    final DataReader reader = new XmlDataReader();
    final DataStore store = new TestDataStore(reader, DATA_URL, VERSION_URL, CHARSET);

    assertThat(!store.getData().getVersion().isEmpty()).isTrue();
    assertThat(store.getDataReader()).isEqualTo(reader);
    assertThat(store.getDataUrl().toExternalForm()).isEqualTo(DATA_URL);
View Full Code Here


    assertThat(store.getVersionUrl().toExternalForm()).isEqualTo(VERSION_URL);
  }

  @Test(expected = IllegalStateException.class)
  public void construct_unreachable_url() {
    final DataReader reader = new XmlDataReader();
    final String unreachable = "http://unreachable.local";
    new TestDataStore(reader, unreachable, unreachable, CHARSET);
  }
View Full Code Here

    new TestDataStore(reader, unreachable, unreachable, CHARSET);
  }

  @Test(expected = IllegalNullArgumentException.class)
  public void construct_versionUrl_null() throws MalformedURLException {
    new TestDataStore(new XmlDataReader(), DATA_URL, null, CHARSET);
  }
View Full Code Here

        return Data.EMPTY;
      }

      @Override
      public DataReader getDataReader() {
        return new XmlDataReader();
      }

      @Override
      public URL getDataUrl() {
        try {
View Full Code Here

   */
  private static final URL VERSION_URL = AbstractDataStoreTest2.class.getClassLoader().getResource("uas_newer.version");

  @Test(expected = IllegalNullArgumentException.class)
  public void construct_charset_null() throws MalformedURLException {
    new TestDataStore(new XmlDataReader(), DATA_URL, VERSION_URL, null);
  }
View Full Code Here

    new TestDataStore(null, DATA_URL, VERSION_URL, CHARSET);
  }

  @Test(expected = IllegalNullArgumentException.class)
  public void construct_dataUrl_null() throws MalformedURLException {
    new TestDataStore(new XmlDataReader(), null, VERSION_URL, CHARSET);
  }
View Full Code Here

    new TestDataStore(new XmlDataReader(), null, VERSION_URL, CHARSET);
  }

  @Test
  public void construct_successful() {
    final DataReader reader = new XmlDataReader();
    final DataStore store = new TestDataStore(reader, DATA_URL, VERSION_URL, CHARSET);

    assertThat(store.getData().getVersion()).isEqualTo(TestXmlDataStore.VERSION_NEWER);
    assertThat(store.getDataReader()).isEqualTo(reader);
    assertThat(store.getDataUrl()).isEqualTo(DATA_URL);
View Full Code Here

    assertThat(store.getVersionUrl()).isEqualTo(VERSION_URL);
  }

  @Test(expected = IllegalNullArgumentException.class)
  public void construct_versionUrl_null() throws MalformedURLException {
    new TestDataStore(new XmlDataReader(), DATA_URL, null, CHARSET);
  }
View Full Code Here

TOP

Related Classes of net.sf.uadetector.datareader.XmlDataReader

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.