Esempio n. 1
0
 public void testGetAuNullConfig() throws ArchivalUnit.ConfigurationException {
   try {
     plugin.configureAu(null, null);
     fail("Didn't throw ArchivalUnit.ConfigurationException");
   } catch (ArchivalUnit.ConfigurationException e) {
   }
 }
Esempio n. 2
0
 @Override
 public void setUp() throws Exception {
   super.setUp();
   setUpDiskSpace();
   theDaemon = getMockLockssDaemon();
   plugin = new DefinablePlugin();
   plugin.initPlugin(getMockLockssDaemon(), "org.lockss.plugin.highwire.HighWireDrupalPlugin");
 }
Esempio n. 3
0
  public void testHandles500Result() throws Exception {
    Properties props = new Properties();
    props.setProperty(VOL_KEY, "322");
    props.setProperty(BASE_URL_KEY, "http://www.example.com/");

    String starturl = "http://www.example.com/lockss-manifest/vol_322_manifest.html";
    DefinableArchivalUnit au = makeAuFromProps(props);
    MockLockssUrlConnection conn = new MockLockssUrlConnection();
    conn.setURL("http://uuu17/");
    CacheException exc =
        ((HttpResultMap) plugin.getCacheResultMap()).mapException(au, conn, 500, "foo");
    assertClass(CacheException.RetryDeadLinkException.class, exc);

    conn.setURL(starturl);
    exc = ((HttpResultMap) plugin.getCacheResultMap()).mapException(au, conn, 500, "foo");
    assertClass(CacheException.RetrySameUrlException.class, exc);
  }
Esempio n. 4
0
 public void testGetAuConfigProperties() {
   for (Iterator iter = plugin.getLocalAuConfigDescrs().iterator(); iter.hasNext(); ) {
     ConfigParamDescr desc = (ConfigParamDescr) iter.next();
     if (desc.equals(ConfigParamDescr.BASE_URL)) {
       continue;
     }
     if (desc.equals(ConfigParamDescr.VOLUME_NUMBER)) {
       continue;
     }
     if ("issues".equals(desc.getKey())) {
       assertEquals(ConfigParamDescr.TYPE_SET, desc.getType());
       assertFalse(desc.isDefinitional());
       continue;
     }
     fail("Unexpected config param: " + desc.getKey());
   }
 }
Esempio n. 5
0
 public void testGetPluginId() {
   assertEquals("org.lockss.plugin.emls.EmlsPlugin", plugin.getPluginId());
 }
Esempio n. 6
0
 private DefinableArchivalUnit makeAuFromProps(Properties props)
     throws ArchivalUnit.ConfigurationException {
   Configuration config = ConfigurationUtil.fromProps(props);
   return (DefinableArchivalUnit) plugin.configureAu(config, null);
 }
Esempio n. 7
0
 public void setUp() throws Exception {
   super.setUp();
   plugin = new DefinablePlugin();
   plugin.initPlugin(getMockLockssDaemon(), "org.lockss.plugin.emls.EmlsPlugin");
 }
Esempio n. 8
0
 public void testGetAuConfigProperties() {
   assertEquals(
       ListUtil.list(ConfigParamDescr.BASE_URL, ConfigParamDescr.VOLUME_NAME),
       plugin.getLocalAuConfigDescrs());
 }
Esempio n. 9
0
 public void testGetPluginId() {
   assertEquals("org.lockss.plugin.highwire.HighWireDrupalPlugin", plugin.getPluginId());
 }