public void testGetAuConstructsProperAu() throws ArchivalUnit.ConfigurationException, MalformedURLException { Properties props = new Properties(); props.setProperty(BASE_URL_KEY, "http://extra.shu.ac.uk/emls/"); props.setProperty(VOL_KEY, "3"); DefinableArchivalUnit au = makeAuFromProps(props); assertEquals( "Early Modern Literary Studies Plugin, Base URL http://extra.shu.ac.uk/emls/, Volume 3", au.getName()); }
public void testGetAuHandlesBadUrl() throws ArchivalUnit.ConfigurationException, MalformedURLException { Properties props = new Properties(); props.setProperty(BASE_URL_KEY, "blah"); props.setProperty(VOL_KEY, "3"); try { DefinableArchivalUnit au = makeAuFromProps(props); fail("Didn't throw InstantiationException when given a bad url"); } catch (ArchivalUnit.ConfigurationException auie) { ConfigParamDescr.InvalidFormatException murle = (ConfigParamDescr.InvalidFormatException) auie.getCause(); assertNotNull(auie.getCause()); } }