Package net.sourceforge.clownfish.core.conf

Examples of net.sourceforge.clownfish.core.conf.Command


    public void execute() throws MojoExecutionException {
       
        try {
            super.execute();
           
            Command command = getCommand();
            initLocalProperties();
            postExecute();
           
            if (command.isVerbose() && getLog().isInfoEnabled()) {
                showMessage(command);
            }
           
            Clownfish clownfish = getClownfish();
View Full Code Here


    protected void overrideCommandWithConfigurationFile() {
       
        super.overrideCommandWithConfigurationFile();
        if (!hasValidConfigurationFile()) return;
       
        Command command = getCommand();
        Properties props = command.getProperties();
       
        // props should never be null
        assert props != null;
       
        if (props.containsKey(ARTIFACT_TYPES_PROP_KEY)) {
            List<String> artifactTypeList = getClownfishHelper().parseString(
                    props.getProperty(ARTIFACT_TYPES_PROP_KEY));
            command.setArtifactTypeList(artifactTypeList);
        }
    }
View Full Code Here

    @Test
    public void testExecuteSuccess() throws MojoExecutionException {
           
        RedeployMojo redeployMojo = new RedeployMojo();
   
        Command command = new Command();
        command.setVerbose(true);

        EasyMock.expect(log.isInfoEnabled()).andReturn(false).times(2);

        EasyMock.expect(clownfishFactory.createClownfish(
                command, clownfishHelper, progressListenerFactory,
View Full Code Here

    @Test(expected = MojoExecutionException.class)
    public void testExecuteFail() throws MojoExecutionException{

        RedeployMojo redeployMojo = new RedeployMojo();

        Command command = new Command();
        command.setVerbose(true);
       
        Exception exception = new RuntimeException("test mock exception");

        EasyMock.expect(log.isInfoEnabled()).andReturn(false).once();
View Full Code Here

    public void execute() throws MojoExecutionException {
             
        try {
            super.execute();
           
            Command command = getCommand();
            postExecute();
           
            if (command.isVerbose() && getLog().isInfoEnabled()) {
                logMessage(REDEPLOY_MSG, command.getTargetList());
            }
           
            Clownfish clownfish = getClownfish();

            if (!clownfish.redeploy()) {
View Full Code Here

        baseMojo.setDeploymentPlan(new File("deploymentPlan"));

        CommandFactoryImpl commandFactory = new CommandFactoryImpl();

        Command command = commandFactory.createCommand(baseMojo);

        Assert.assertNotNull(command);
        Assert.assertEquals("artifact", command.getArtifact());
        Assert.assertEquals(new File("deploymentPlan"), command.getDeploymentPlan());
        Assert.assertEquals("deploymentFactoryManagerClassName",
                command.getDeploymentFactoryManagerClassName());
        Assert.assertEquals("deploymentManagerUri", command.getDeploymentManagerURI());
        Assert.assertEquals("password", command.getPassword());
        Assert.assertEquals("username", command.getUsername());
        Assert.assertTrue(command.isVerbose());

        Assert.assertEquals(3, command.getTargetList().size());
        Assert.assertEquals("server1", command.getTargetList().get(0));
        Assert.assertEquals("server2", command.getTargetList().get(1));
        Assert.assertEquals("server3", command.getTargetList().get(2));
        Assert.assertEquals("ear", command.getModuleType());


        // test null module type
        baseMojo.setModuleType(null);
        command = commandFactory.createCommand(baseMojo);
        Assert.assertNull(command.getModuleType());


        // test empty module type
        baseMojo.setModuleType("");
        command = commandFactory.createCommand(baseMojo);
        Assert.assertNull(command.getModuleType());
    }
View Full Code Here

    public void execute() throws MojoExecutionException {
       
        try {
            super.execute();
           
            Command command = getCommand();
            postExecute();
           
            if (command.isVerbose() && getLog().isInfoEnabled()) {
                logMessage(UNDEPLOY_MSG, command.getTargetList());
            }
           
            Clownfish clownfish = getClownfish();

            if (!clownfish.undeploy()) {
View Full Code Here

    public void execute() throws MojoExecutionException {
       
        try {
            super.execute();
           
            Command command = getCommand();
            postExecute();
           
            if (command.isVerbose() && getLog().isInfoEnabled()) {
                logMessage(START_MSG, command.getTargetList());
            }
           
            Clownfish clownfish = getClownfish();

            if (!clownfish.start()) {
View Full Code Here

    public void execute() throws MojoExecutionException {
       
        try {
            super.execute();
           
            Command command = getCommand();
            initLocalProperties();
            postExecute();
           
           
            if (command.isVerbose() && getLog().isInfoEnabled()) {
                logMessage(DEPLOYING_ARTIFACT_MSG, command.getTargetList());
            }
           
            Clownfish clownfish = getClownfish();
           
            if (!clownfish.deploy()) {
View Full Code Here

       
        super.overrideCommandWithConfigurationFile();
       
        if (!hasValidConfigurationFile()) return;
       
        Command command = getCommand();
        Properties props = command.getProperties();
       
        // props should never be null
        assert props != null;
       
        if (props.containsKey(AUTOSTART_PROP_KEY)) {
            boolean autostartValue = Boolean.parseBoolean(
                    props.getProperty(AUTOSTART_PROP_KEY));
            command.setAutostart(autostartValue);
        }
       
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.clownfish.core.conf.Command

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.