@Test(enabled = true) public void test09() throws Exception { URL u = new URL("http://www.oracle.com/"); outImpl.writeURL(u); SerialDatalink sdl = (SerialDatalink) results.get(0); URL u2 = sdl.getDatalink(); assertTrue(u2.equals(u)); assertTrue(u2.sameFile(u)); }
@Test public void test03() throws Exception { SerialDatalink dl2 = (SerialDatalink) dl.clone(); assertTrue(dl.equals(dl2)); SerialDatalink dl3 = new SerialDatalink(u1); assertFalse(dl2.equals(dl3)); }
@Test public void test04() throws Exception { SerialDatalink dl2 = serializeDeserializeObject(dl); SerialDatalink dl3 = new SerialDatalink(u); assertTrue(dl.equals(dl2)); assertTrue(dl3.equals(dl2)); }
/** * Validate that a SerialDatalink that is serialized & deserialized is not equal * to to a SerialDatalink created using a different URL */ @Test public void test05() throws Exception { SerialDatalink dl2 = serializeDeserializeObject(dl); SerialDatalink d3 = new SerialDatalink(u1); assertFalse(d3.equals(dl2)); }
public void testConstructor() throws Exception { URL url = new URL("http://www.someurl.com"); new SerialDatalink(url); try { new SerialDatalink(null); fail("should throw SerialException"); } catch (SerialException e) { // expected } }
public void testGetDatalink() throws Exception { URL url = new URL("http://www.someurl.com"); SerialDatalink sdl = new SerialDatalink(url); URL dataLink = sdl.getDatalink(); assertEquals(url, dataLink); assertNotSame(url, dataLink); }
/** * @tests {@link javax.sql.rowset.serial.SQLOutputImpl#writeURL(URL)} */ public void test_writeURLLjava_net_URL() throws MalformedURLException, SQLException { URL url = new URL("http://www.apache.org"); impl.writeURL(url); assertEquals(1, attr.size()); assertTrue(attr.get(0) instanceof SerialDatalink); assertEquals(url, ((SerialDatalink) attr.get(0)).getDatalink()); impl.writeURL(null); assertNull(attr.get(1)); }
@BeforeMethod public void setUpMethod() throws Exception { u = new URL("http://www.oracle.com/"); u1 = new URL("http://www.usatoday.com/"); dl = new SerialDatalink(u); }
@Test(expectedExceptions = SerialException.class) public void test() throws Exception { SerialDatalink dl1 = new SerialDatalink(null); }