@Test public void testMissingPrefix() throws DataSourceException { source = new NetworkVehicleInterface(getContext(), missingPrefixUri); } }
@Test public void testValidUri() throws DataSourceException { source = new NetworkVehicleInterface(getContext(), goodUri); }
@Test public void testUriWithBadScheme() throws DataSourceException { try { source = new NetworkVehicleInterface(getContext(), incorrectSchemeUri); } catch(DataSourceResourceException e) { return; } Assert.fail("Expected a DataSourceResourceException"); }
@Test public void testMalformedUri() throws DataSourceException { try { source = new NetworkVehicleInterface(getContext(), missingPortUri); } catch(DataSourceResourceException e) { return; } Assert.fail("Expected a DataSourceResourceException"); }
@Test public void testInvalidPort() throws DataSourceException { try { source = new NetworkVehicleInterface(getContext(), "http://localhost:70000"); } catch(DataSourceResourceException e) { return; } Assert.fail("Expected a DataSourceResourceException"); }
@Test public void testResourceChanged() throws DataSourceException { source = new NetworkVehicleInterface(getContext(), goodUri); assertTrue(source.setResource(missingPrefixUri)); }
@Test public void testResourceMatching() throws DataSourceException { source = new NetworkVehicleInterface(getContext(), goodUri); assertFalse(source.setResource(goodUri)); }
@Test public void testResourceMatchingMassaged() throws DataSourceException { source = new NetworkVehicleInterface(getContext(), missingPrefixUri); assertFalse(source.setResource(missingPrefixUri)); }