Package org.nanocontainer.deployer

Examples of org.nanocontainer.deployer.Deployer


    public void testZipWithDeploymentScriptAndClassesCanBeDeployed() throws FileSystemException, MalformedURLException, ClassNotFoundException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, InstantiationException {
        DefaultFileSystemManager manager = new DefaultFileSystemManager();
        FileObject applicationArchive = getApplicationArchive(manager, jarsDir + "/successful-deploy.jar");

        Deployer deployer = new NanoContainerDeployer(manager);
        ObjectReference containerRef = deployer.deploy(applicationArchive, getClass().getClassLoader(), null);
        PicoContainer pico = (PicoContainer) containerRef.get();
        Object zap = pico.getComponentInstance("zap");
        assertEquals("Groovy Started", zap.toString());
    }
View Full Code Here


      DefaultFileSystemManager manager = new DefaultFileSystemManager();
      FileObject applicationFolder = getApplicationArchive(manager,  jarsDir + "/badscript-deploy.jar");

      try {
        Deployer deployer = new NanoContainerDeployer(manager);
        ObjectReference containerRef= deployer.deploy(applicationFolder, getClass().getClassLoader(), null);
        fail("Deployment should have thrown FileSystemException for bad script file name.  Instead got:" + containerRef.toString() + " built.");
      }
      catch (FileSystemException ex) {
        //a-ok
      }
View Full Code Here

    public void testMalformedDeployerArchiveThrowsFileSystemException() throws ClassNotFoundException, FileSystemException {
      DefaultFileSystemManager manager = new DefaultFileSystemManager();
      FileObject applicationFolder = getApplicationArchive(manager,  jarsDir + "/malformed-deploy.jar");

      try {
        Deployer deployer = new NanoContainerDeployer(manager);
        ObjectReference containerRef= deployer.deploy(applicationFolder, getClass().getClassLoader(), null);
        fail("Deployment should have thrown FileSystemException for badly formed archive. Instead got:" + containerRef.toString() + " built.");
      }
      catch (FileSystemException ex) {
        //a-ok
      }
View Full Code Here

    public void testFolderWithDeploymentScriptAndClassesCanBeDeployed() throws FileSystemException, MalformedURLException, ClassNotFoundException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, InstantiationException {
        DefaultFileSystemManager manager = new DefaultFileSystemManager();
        FileObject applicationFolder = getApplicationFolder(manager, folderPath);

        try {
            Deployer deployer = null;
            deployer = new NanoContainerDeployer(manager);
            ObjectReference containerRef = deployer.deploy(applicationFolder, getClass().getClassLoader(), null);
            PicoContainer pico = (PicoContainer) containerRef.get();
            Object zap = pico.getComponentInstance("zap");
            assertEquals("Groovy Started", zap.toString());

        } catch (Exception e) {
View Full Code Here

        Mock deployerMock = mock(Deployer.class);
        deployerMock.expects(once())
                    .method("deploy")
                    .with(same(folder), isA(ClassLoader.class), ANYTHING)
                    .will(returnValue(null));
        Deployer deployer = (Deployer)deployerMock.proxy();
        DifferenceAnalysingFolderContentHandler handler = null;
        DeployingFolderListener deployingFolderListener = new DeployingFolderListener(deployer, handler);

        deployingFolderListener.folderAdded(folder);
    }
View Full Code Here

TOP

Related Classes of org.nanocontainer.deployer.Deployer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.