Package net.sf.uadetector.datareader

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


  }

  @Test(expected = IllegalNullArgumentException.class)
  public void construct_fallback_isNull() throws MalformedURLException {
    final URL url = new URL("http://localhost");
    new TestDataStore(new XmlDataReader(), CHARSET, url, url, null);
  }
View Full Code Here


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

  @Test
  public void construct_successful() throws Exception {
    final DataReader reader = new XmlDataReader();
    final TestDataStore store = new TestDataStore(reader, CHARSET, DATA_URL, VERSION_URL, FALLBACK);
    assertThat(store.getData().getVersion()).isEqualTo(FALLBACK.getData().getVersion());
    store.getUpdateOperation().call();
    assertThat(store.getData().getVersion()).isEqualTo(UrlUtil.read(VERSION_URL, CHARSET));
    assertThat(store.getDataReader()).isEqualTo(reader);
View Full Code Here

  }

  @Test(expected = IllegalNullArgumentException.class)
  public void construct_versionUrl_isNull() throws MalformedURLException {
    final URL url = new URL("http://localhost");
    new TestDataStore(new XmlDataReader(), CHARSET, url, null, FALLBACK);
  }
View Full Code Here

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

  @Test(expected = IllegalNullArgumentException.class)
  public void construct_charset_null() throws MalformedURLException {
    final URL url = new URL("http://localhost");
    new TestDataStore(Data.EMPTY, new XmlDataReader(), null, url, url);
  }
View Full Code Here

  }

  @Test(expected = IllegalNullArgumentException.class)
  public void construct_data_null() throws MalformedURLException {
    final URL url = new URL("http://localhost");
    new TestDataStore((Data) null, new XmlDataReader(), CHARSET, url, url);
  }
View Full Code Here

  }

  @Test(expected = IllegalNullArgumentException.class)
  public void construct_dataUrl_null() throws MalformedURLException {
    final URL url = new URL("http://localhost");
    new TestDataStore(Data.EMPTY, new XmlDataReader(), CHARSET, null, url);
  }
View Full Code Here

  }

  @Test
  public void construct_successful() {
    final Data data = new DataBlueprint().version("test-version").build();
    final DataReader reader = new XmlDataReader();
    final TestDataStore store = new TestDataStore(data, reader, CHARSET, DATA_URL, VERSION_URL);

    assertThat(store.getData().getVersion()).isEqualTo("test-version");
    assertThat(store.getData()).isSameAs(data);
    assertThat(store.getDataReader()).isEqualTo(reader);
View Full Code Here

  }

  @Test(expected = IllegalNullArgumentException.class)
  public void construct_versionUrl_null() throws MalformedURLException {
    final URL url = new URL("http://localhost");
    new TestDataStore(Data.EMPTY, new XmlDataReader(), CHARSET, url, null);
  }
View Full Code Here

    new TestDataStore(Data.EMPTY, new XmlDataReader(), CHARSET, url, null);
  }

  @Test(expected = IllegalNullArgumentException.class)
  public void readData_charset_null() {
    AbstractDataStore.readData(new XmlDataReader(), DATA_URL, null);
  }
View Full Code Here

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

  @Test(expected = IllegalNullArgumentException.class)
  public void readData_dataUrl_null() {
    AbstractDataStore.readData(new XmlDataReader(), null, CHARSET);
  }
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.