Examples of DeploymentHandler


Examples of org.apache.ace.agent.DeploymentHandler

    private void waitForInstalledVersion(Version version) throws Exception {
        ServiceReference reference = m_bundleContext.getServiceReference(AgentControl.class.getName());

        try {
            AgentControl control = (AgentControl) m_bundleContext.getService(reference);
            DeploymentHandler deploymentHandler = control.getDeploymentHandler();

            int timeout = 100;
            while (!deploymentHandler.getInstalledVersion().equals(version)) {
                Thread.sleep(100);
                if (timeout-- <= 0) {
                    fail("Timed out while waiting for deployment " + version);
                }
            }
View Full Code Here

Examples of org.apache.ace.agent.DeploymentHandler

        expect(future.get()).andReturn(downloadResult).anyTimes();

        DownloadHandle downloadHandle = addTestMock(DownloadHandle.class);
        expect(downloadHandle.start(isNull(DownloadProgressListener.class))).andReturn(future).anyTimes();

        DeploymentHandler deploymentHandler = addTestMock(DeploymentHandler.class);
        expect(deploymentHandler.getInstalledVersion()).andReturn(m_version2).anyTimes();
        expect(deploymentHandler.getAvailableVersions()).andReturn(m_availableVersions).anyTimes();
        expect(deploymentHandler.getDownloadHandle(eq(m_version3), eq(true))).andReturn(downloadHandle).once();
        deploymentHandler.install(notNull(InputStream.class));
        expectLastCall().once();

        m_agentContext = mockAgentContext();
        m_agentContext.setHandler(DeploymentHandler.class, deploymentHandler);
        replayTestMocks();
View Full Code Here

Examples of org.apache.ace.agent.DeploymentHandler

        clearTestMocks();
    }

    @Test
    public void testCurrentVersion() throws Exception {
        DeploymentHandler deploymentHandler = m_agentContext.getHandler(DeploymentHandler.class);
        Version current = deploymentHandler.getInstalledVersion();
        assertNotNull(current);
        assertEquals(current, m_version2);
    }
View Full Code Here

Examples of org.apache.ace.agent.DeploymentHandler

        assertEquals(current, m_version2);
    }

    @Test
    public void testAvailableVersions() throws Exception {
        DeploymentHandler deploymentHandler = m_agentContext.getHandler(DeploymentHandler.class);
        SortedSet<Version> expected = new TreeSet<Version>();
        expected.add(m_version1);
        expected.add(m_version2);
        expected.add(m_version3);
        SortedSet<Version> available = deploymentHandler.getAvailableVersions();
        assertNotNull(available);
        assertFalse(available.isEmpty());
        assertEquals(available, expected);
    }
View Full Code Here

Examples of org.apache.ace.agent.DeploymentHandler

        assertEquals(available, expected);
    }

    @Test
    public void testPackageSize() throws Exception {
        DeploymentHandler deploymentHandler = m_agentContext.getHandler(DeploymentHandler.class);
        long packageSize = deploymentHandler.getSize(m_version1, true);
        assertEquals(packageSize, m_remotePackageSize);
    }
View Full Code Here

Examples of org.apache.ace.agent.DeploymentHandler

        assertEquals(packageSize, m_remotePackageSize);
    }

    @Test
    public void testDeployPackage() throws Exception {
        DeploymentHandler deploymentHandler = m_agentContext.getHandler(DeploymentHandler.class);
        InputStream inputStream = deploymentHandler.getInputStream(m_version3, true);
        try {
            deploymentHandler.install(inputStream);
        }
        finally {
            inputStream.close();
        }
    }
View Full Code Here

Examples of org.apache.ace.agent.DeploymentHandler

            m_servlet.addPackage(m_package1);
            m_servlet.addPackage(m_package2);
            m_servlet.addPackage(m_package6);
        }

        DeploymentHandler deploymentHandler = control.getDeploymentHandler();
        // the size is (major-version # - 2)...
        assertEquals(4, deploymentHandler.getSize(V6_0_0, false));
        assertEquals(0, deploymentHandler.getSize(V2_0_0, false));
        assertEquals(-1, deploymentHandler.getSize(V1_0_0, false));
    }
View Full Code Here

Examples of org.jclouds.azure.management.xml.DeploymentHandler

   public void test() {
      InputStream is = getClass().getResourceAsStream("/deployment.xml");

      Deployment expected = expected();

      DeploymentHandler handler = injector.getInstance(DeploymentHandler.class);
      Deployment result = factory.create(handler).parse(is);

      assertEquals(result.toString(), expected.toString());

   }
View Full Code Here

Examples of org.jclouds.azure.management.xml.DeploymentHandler

   public void test() {
      InputStream is = getClass().getResourceAsStream("/deployment.xml");

      Deployment expected = expected();

      DeploymentHandler handler = injector.getInstance(DeploymentHandler.class);
      Deployment result = factory.create(handler).parse(is);

      assertEquals(result.toString(), expected.toString());

   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.