Example #1
0
  public void setUp() throws Exception {
    super.setUp();
    theDaemon = getMockLockssDaemon();
    tempDir = getTempDir();
    String tempDirPath = tempDir.getAbsolutePath();
    System.setProperty("java.io.tmpdir", tempDirPath);

    Properties p = new Properties();
    p.setProperty(IdentityManager.PARAM_IDDB_DIR, tempDirPath + "iddb");
    p.setProperty(ConfigManager.PARAM_PLATFORM_DISK_SPACE_LIST, tempDirPath);
    p.setProperty(IdentityManager.PARAM_LOCAL_IP, "127.0.0.1");
    p.setProperty(V3LcapMessage.PARAM_REPAIR_DATA_THRESHOLD, "4096");
    ConfigurationUtil.setCurrentConfigFromProps(p);
    IdentityManager idmgr = theDaemon.getIdentityManager();
    idmgr.startService();
    mPollMgr = new MockPollManager();
    theDaemon.setPollManager(mPollMgr);
    try {
      m_testID = idmgr.stringToPeerIdentity("127.0.0.1");
    } catch (IOException ex) {
      fail("can't open test host 127.0.0.1: " + ex);
    }
    m_repairProps = new CIProperties();
    m_repairProps.setProperty("key1", "val1");
    m_repairProps.setProperty("key2", "val2");
    m_repairProps.setProperty("key3", "val3");

    m_testVoteBlocks = V3TestUtils.makeVoteBlockList(10);
    m_testMsg = this.makeTestVoteMessage(m_testVoteBlocks);
  }
  public void setUp() throws Exception {
    super.setUp();
    tempDirPath = getTempDir().getAbsolutePath() + File.separator;

    theDaemon = getMockLockssDaemon();
    theDaemon.getAlertManager();
    theDaemon.getPluginManager().setLoadablePluginsReady(true);
    theDaemon.getHashService();
    MockSystemMetrics metrics = new MyMockSystemMetrics();
    metrics.initService(theDaemon);
    theDaemon.setSystemMetrics(metrics);

    theDaemon.setDaemonInited(true);

    Properties props = new Properties();
    props.setProperty(SystemMetrics.PARAM_HASH_TEST_DURATION, "1000");
    props.setProperty(SystemMetrics.PARAM_HASH_TEST_BYTE_STEP, "1024");
    props.setProperty(ConfigManager.PARAM_PLATFORM_DISK_SPACE_LIST, tempDirPath);
    ConfigurationUtil.setCurrentConfigFromProps(props);

    pluginMgr = theDaemon.getPluginManager();
    pluginMgr.startService();
    theDaemon.getHashService().startService();
    metrics.startService();
    metrics.setHashSpeed(100);

    simPlugin = PluginTestUtil.findPlugin(SimulatedPlugin.class);
  }
 public void setUp() throws Exception {
   super.setUp();
   theDaemon = getMockLockssDaemon();
   mgr = new MyRepositoryManager();
   theDaemon.setRepositoryManager(mgr);
   mgr.initService(theDaemon);
 }
Example #4
0
  public void setUp() throws Exception {
    super.setUp();
    daemon = getMockLockssDaemon();

    historyRepo = new MyMockHistoryRepository();
    mplug = new MockPlugin(daemon);
    mau = new MockArchivalUnit(mplug);
  }
 public void tearDown() throws Exception {
   if (idmgr != null) {
     idmgr.stopService();
     idmgr = null;
   }
   repository.stopService();
   super.tearDown();
 }
 public void tearDown() throws Exception {
   theDaemon.getLockssRepository(sau1).stopService();
   theDaemon.getNodeManager(sau1).stopService();
   theDaemon.getPluginManager().stopService();
   theDaemon.getHashService().stopService();
   theDaemon.getSystemMetrics().stopService();
   theDaemon.stopDaemon();
   super.tearDown();
 }
Example #7
0
 public void setUp() throws Exception {
   super.setUp();
   log.setLevel(Logger.LEVEL_DEBUG);
   if (dig == null) {
     dig = MessageDigest.getInstance(hashAlgorithm);
   }
   mau = new MockArchivalUnit(new MockPlugin());
   cus = new MockCachedUrlSet(mau, null);
   cus.setHashItSource(Collections.EMPTY_LIST);
   TimeBase.setSimulated();
 }
Example #8
0
 public void setUp() throws Exception {
   super.setUp();
   TimeBase.setSimulated();
   ConfigurationUtil.setFromArgs(SortScheduler.PARAM_OVERHEAD_LOAD, "0");
   removedChunks = new ArrayList();
   removedTasks = new ArrayList();
   fact = new SchedFact(null);
   tr = new MyMockTaskRunner(fact);
   tr.initService(getMockLockssDaemon());
   tr.startService();
 }
Example #9
0
  protected void setUp() throws Exception {
    super.setUp();
    TimeBase.setSimulated();

    initRequiredServices();

    testau.setPlugin(new MockPlugin());

    initTestPeerIDs();
    initTestMsg();
    initTestPolls();
  }
Example #10
0
 /**
  * tearDown method for test case
  *
  * @throws Exception if removePoll failed
  */
 public void tearDown() throws Exception {
   pollmanager.stopService();
   theDaemon.getLockssRepository(testau).stopService();
   theDaemon.getHashService().stopService();
   theDaemon.getDatagramRouterManager().stopService();
   theDaemon.getRouterManager().stopService();
   theDaemon.getSystemMetrics().stopService();
   TimeBase.setReal();
   for (int i = 0; i < testV1msg.length; i++) {
     if (testV1msg[i] != null) pollmanager.removePoll(testV1msg[i].getKey());
   }
   super.tearDown();
 }
  public void setUp() throws Exception {
    super.setUp();
    String tempDirPath = getTempDir().getAbsolutePath() + File.separator;
    ConfigurationUtil.setFromArgs(LockssRepositoryImpl.PARAM_CACHE_LOCATION, tempDirPath);
    theDaemon = getMockLockssDaemon();
    theDaemon.getAlertManager();
    theDaemon.getPluginManager().setLoadablePluginsReady(true);
    theDaemon.setDaemonInited(true);
    theDaemon.getPluginManager().startService();
    theDaemon.getCrawlManager();

    sau = PluginTestUtil.createAndStartSimAu(simAuConfig(tempDirPath));
    nau = PluginTestUtil.createAndStartAu(PLUGIN_NAME, natureAuConfig());
  }
Example #12
0
 /* Inherit documentation */
 public void setUp() throws Exception {
   super.setUp();
   ConfigurationUtil.addFromArgs(
       "org.lockss.log.IcpManager.level",
       "debug3",
       "org.lockss.log.IcpSocketImpl.level",
       "debug3");
   setEnabled(false, BAD_PORT);
   setConfigCalled = false;
   mockLockssDaemon = getMockLockssDaemon();
   testableIcpManager = new TestableIcpManager();
   mockLockssDaemon.setIcpManager(testableIcpManager);
   testableIcpManager.initService(mockLockssDaemon);
   mockLockssDaemon.setDaemonInited(true);
   testableIcpManager.startService();
 }
  public void setUp() throws Exception {
    super.setUp();
    setUpDiskSpace();
    daemon = getMockLockssDaemon();
    pollerId = findPeerIdentity(localPeerKey);

    id1 = new MockPeerIdentity("TCP:[127.0.0.1]:8990");
    id2 = new MockPeerIdentity("TCP:[127.0.0.1]:8991");
    id3 = new MockPeerIdentity("TCP:[127.0.0.1]:8992");

    v3Poller = makeV3Poller("testing poll key");

    participant1 = new ParticipantUserData(id1, v3Poller, null);
    participant2 = new ParticipantUserData(id2, v3Poller, null);
    participant3 = new ParticipantUserData(id3, v3Poller, null);
  }
 public void setUp() throws Exception {
   super.setUp();
   theDaemon = getMockLockssDaemon();
   theDaemon.startDaemon();
   mau = new MockArchivalUnit(new MockPlugin(theDaemon));
   tempDirPath = getTempDir().getAbsolutePath() + File.separator;
   configHistoryParams(tempDirPath);
   repository = (HistoryRepositoryImpl) HistoryRepositoryImpl.createNewHistoryRepository(mau);
   repository.initService(theDaemon);
   repository.startService();
   if (idmgr == null) {
     idmgr = theDaemon.getIdentityManager();
     idmgr.startService();
   }
   testID1 = idmgr.stringToPeerIdentity("127.1.2.3");
   testID2 = idmgr.stringToPeerIdentity("127.4.5.6");
 }
  public void setUp() throws Exception {
    super.setUp();
    setUpDiskSpace(); // you need this to have startService work properly...

    theDaemon = getMockLockssDaemon();
    theDaemon.getAlertManager();
    theDaemon.getPluginManager().setLoadablePluginsReady(true);
    theDaemon.setDaemonInited(true);
    theDaemon.getPluginManager().startService();
    theDaemon.getCrawlManager();

    // in this directory this is file "test_baseatypon.tdb" but it becomes xml
    ConfigurationUtil.addFromUrl(getResource("test_baseatypon.xml"));
    Tdb tdb = ConfigManager.getCurrentConfig().getTdb();

    TdbAu tdbau1 = tdb.getTdbAusLikeName(goodJournal + " Volume " + goodVolume).get(0);
    assertNotNull("Didn't find named TdbAu", tdbau1);
    bau1 = PluginTestUtil.createAndStartAu(tdbau1);
    assertNotNull(bau1);
    TypedEntryMap auConfig = bau1.getProperties();
    assertEquals(BASE_URL, auConfig.getString(BASE_URL_KEY));
  }
Example #16
0
 public void tearDown() throws Exception {
   TimeBase.setReal();
   tr.stopService();
   super.tearDown();
 }
 public void setUp() throws Exception {
   super.setUp();
   tempDirPath = setUpDiskSpace();
   startMockDaemon();
   iau = createAu();
 }
 public void setUp() throws Exception {
   super.setUp();
   mau = new MockArchivalUnit();
   extractor = new GoslingHtmlLinkExtractor();
   cb = new MyLinkExtractorCallback();
 }
 public void tearDown() throws Exception {
   theDaemon.stopDaemon();
   super.tearDown();
 }
 public void tearDown() throws Exception {
   sau.deleteContentTree();
   theDaemon.stopDaemon();
   super.tearDown();
 }
 public void tearDown() throws Exception {
   super.tearDown();
 }
Example #22
0
 public void tearDown() throws Exception {
   TimeBase.setReal();
   super.tearDown();
 }
Example #23
0
 public void setUp() throws Exception {
   super.setUp();
   TimeBase.setSimulated();
 }
 public void setUp() throws Exception {
   super.setUp();
   fact = new IOPScienceHtmlHashFilterFactory();
   mau = new MockArchivalUnit();
 }
 public void setUp() throws Exception {
   super.setUp();
   fact = new TaylorAndFrancisJavaScriptLinkRewriterFactory();
 }