Package net.sf.uadetector.datareader

Examples of net.sf.uadetector.datareader.XmlDataReader$XmlParser


    AbstractDataStore.readData(new XmlDataReader(), null, CHARSET);
  }

  @Test
  public void readData_failsAndReturnsEMPTY() {
    final Data data = AbstractDataStore.readData(new XmlDataReader(), UNREACHABLE_URL, CHARSET);
    assertThat(data).isEqualTo(Data.EMPTY);
  }
View Full Code Here


    AbstractDataStore.readData(null, DATA_URL, CHARSET);
  }

  @Test
  public void readData_successful() {
    final Data data = AbstractDataStore.readData(new XmlDataReader(), DATA_URL, CHARSET);
    assertThat(data.getVersion()).isEqualTo(TestXmlDataStore.VERSION_OLDER);
  }
View Full Code Here

    assertThat(data.getVersion()).isEqualTo(TestXmlDataStore.VERSION_OLDER);
  }

  @Test(expected = IllegalStateException.class)
  public void setData_EMPTY() {
    new TestDataStore(Data.EMPTY, new XmlDataReader(), CHARSET, DATA_URL, VERSION_URL);
  }
View Full Code Here

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

  @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().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

TOP

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

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.