/** * Test method for {@link org.apache.ace.connectionfactory.impl.ConnectionFactoryImpl#createConnection(java.net.URL, org.osgi.service.useradmin.User)}. */ @Test() public void testCreateConnectionOk() throws Exception { URLConnection conn = new ConnectionFactoryImpl().createConnection(new URL("file:///tmp/foo")); assert conn != null : "Expected valid connection to be created!"; }
/** * Test method for {@link org.apache.ace.connectionfactory.impl.ConnectionFactoryImpl#createConnection(java.net.URL, org.osgi.service.useradmin.User)}. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testCreateConnectionNullUserFail() throws Exception { new ConnectionFactoryImpl().createConnection(new URL("file:///tmp/foo"), null); }
/** * Test method for {@link org.apache.ace.connectionfactory.impl.ConnectionFactoryImpl#createConnection(java.net.URL)}. */ @Test(expectedExceptions = IllegalArgumentException.class) public void testCreateConnectionNullUrlFail() throws Exception { new ConnectionFactoryImpl().createConnection(null); }