コード例 #1
0
 /**
  * Test method for {@link
  * org.sakaiproject.kernel.component.core.ComponentLoaderServiceImpl#load(java.lang.String,
  * boolean)} .
  *
  * @throws KernelConfigurationException
  * @throws ComponentSpecificationException
  * @throws IOException
  */
 @Test
 public void testLoad()
     throws IOException, ComponentSpecificationException, KernelConfigurationException {
   MockComponentManager cm = new MockComponentManager();
   Maven2ArtifactResolver dependencyResolver = new Maven2ArtifactResolver();
   ComponentLoaderServiceImpl cl = new ComponentLoaderServiceImpl(cm, dependencyResolver);
   cl.load(baseFile.getPath(), false);
   ComponentSpecification[] specs = cm.getStartedComponents();
   assertEquals(2, specs.length);
 }
コード例 #2
0
  /**
   * Test method for {@link
   * org.sakaiproject.kernel.component.core.ComponentLoaderServiceImpl#load(java.lang.String,
   * boolean)} .
   *
   * @throws KernelConfigurationException
   * @throws ComponentSpecificationException
   * @throws IOException
   */
  @Test
  public void testLoadSingle()
      throws IOException, ComponentSpecificationException, KernelConfigurationException {
    MockComponentManager cm = new MockComponentManager();
    Maven2ArtifactResolver dependencyResolver = new Maven2ArtifactResolver();
    ComponentLoaderServiceImpl cl = new ComponentLoaderServiceImpl(cm, dependencyResolver);
    File singleJar = new File(baseFile, "testfile1.jar");
    createComponent(singleJar, COMPONENT1);

    cl.load(singleJar.getPath(), false);
    ComponentSpecification[] specs = cm.getStartedComponents();
    assertEquals(1, specs.length);
  }