Package net.sourceforge.clownfish.core

Examples of net.sourceforge.clownfish.core.CommandFactory


    /**
     * Test dependencies.
     */
    public void testDependencies() {
       
        CommandFactory commandFactory = (CommandFactory)
                applicationContext.getBean("commandFactory");
        assertNotNull(commandFactory);
       
       
        ClownfishFactory clownfishFactory = (ClownfishFactory)
View Full Code Here


    public void testDependencies() {
   
    ApplicationContext applicationContext =
      new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
       
        CommandFactory commandFactory = (CommandFactory)
                applicationContext.getBean("commandFactory");
        Assert.assertNotNull(commandFactory);
       
       
        ClownfishFactory clownfishFactory = (ClownfishFactory)
View Full Code Here

      */
    @Test
    public void testOverrideCommandWithConfigurationFileMockedProperty()
    throws MojoExecutionException {
       
        CommandFactory commandFactory = EasyMock.createMock(
                CommandFactory.class);
       
        final String mojoArtifactTypes = "ear";
        final String artifactTypes = "war,ejb,rar,car";
       
        ListMojo listMojo = new ListMojo();
        listMojo.setArtifactTypes(mojoArtifactTypes);
       
        Command command = new Command();
        command.setVerbose(true);
        command.setTargetList(Arrays.asList("target1"));

        EasyMock.expect(maven2WrapperLog
                .isInfoEnabled()).andReturn(false).anyTimes();
       
       
        EasyMock.expect(clownfishFactory.createClownfish(
                command, clownfishHelper, progressListenerFactory,
                maven2WrapperLog))
                .andReturn(clownfish);
       
        Properties properties = new Properties();
        properties.put("clownfish.artifactTypes", artifactTypes);
        EasyMock.expect(commandFactory.getConfigurationProperties(listMojo,
                maven2WrapperLog)).andReturn(properties);
       
        Target target = EasyMock.createMock(Target.class);
        TargetModuleID targetModuleId = EasyMock.createMock(
                TargetModuleID.class);
View Full Code Here

     */
    @Test
    public void testOverrideCommandWithConfigurationFileMockedProperty()
    throws MojoExecutionException {
       
        CommandFactory commandFactory = EasyMock.createMock(
                CommandFactory.class);
       
        Command command = new Command();
        DeployMojo deployMojo = new DeployMojo();
        deployMojo.setAutostart(false);
       
        EasyMock.expect(log.isInfoEnabled()).andReturn(false).anyTimes();
        EasyMock.expect(maven2WrapperLog
                .isInfoEnabled()).andReturn(false).anyTimes();
       
        EasyMock.expect(clownfishFactory.createClownfish(
                command, clownfishHelper, progressListenerFactory,
                maven2WrapperLog))
                .andReturn(clownfish);
       
        // property file with autostart not defined
        Properties properties = new Properties();
        EasyMock.expect(commandFactory.getConfigurationProperties(
                deployMojo, maven2WrapperLog)).andReturn(properties);

        EasyMock.expect(clownfish.deploy()).andReturn(true);

        clownfish.destroy();
View Full Code Here

     /**
      *  Test override command with configuration file with mocked property.
      */
    public void testOverrideCommandWithConfigurationFileMockedProperty() {
       
        CommandFactory commandFactory = EasyMock.createMock(
                CommandFactory.class);
       
        try {
            final String mojoArtifactTypes = "ear";
            final String artifactTypes = "war,ejb,rar,car";
           
            ListMojo listMojo = new ListMojo();
            listMojo.setArtifactTypes(mojoArtifactTypes);
           
            Command command = new Command(null);
            command.setVerbose(true);
            command.setTargetList(Arrays.asList("target1"));

            EasyMock.expect(maven2WrapperLog
                    .isInfoEnabled()).andReturn(false).anyTimes();
           
           
            List<String> mojoArtifactTypeList = Arrays.asList("ear");
            EasyMock.expect(clownfishHelper.parseString(mojoArtifactTypes))
                    .andReturn(mojoArtifactTypeList);
           
           
            List<String> artifactTypeList = Arrays.asList("war", "ejb",
                    "rar", "car");
            EasyMock.expect(clownfishHelper.parseString(artifactTypes))
                    .andReturn(artifactTypeList);
           
           
            EasyMock.expect(clownfishFactory.createClownfish(
                    command, clownfishHelper, progressListenerFactory,
                    maven2WrapperLog))
                    .andReturn(clownfish);
           
            Properties properties = new Properties();
            properties.put("clownfish.artifactTypes", artifactTypes);
            EasyMock.expect(commandFactory.getConfigurationProperties(listMojo,
                    maven2WrapperLog)).andReturn(properties);
           
            Target target = EasyMock.createMock(Target.class);
            TargetModuleID targetModuleId = EasyMock.createMock(
                    TargetModuleID.class);
View Full Code Here

    /**
     * Test override command with configuration file with mocked property.
     */
    public void testOverrideCommandWithConfigurationFileMockedProperty() {
       
        CommandFactory commandFactory = EasyMock.createMock(
                CommandFactory.class);
       
        try {
            Command command = new Command(null);
            DeployMojo deployMojo = new DeployMojo();
            deployMojo.setAutostart(false);
           
            EasyMock.expect(log.isInfoEnabled()).andReturn(false).anyTimes();
            EasyMock.expect(maven2WrapperLog
                    .isInfoEnabled()).andReturn(false).anyTimes();
           
            EasyMock.expect(clownfishFactory.createClownfish(
                    command, clownfishHelper, progressListenerFactory,
                    maven2WrapperLog))
                    .andReturn(clownfish);
           
            // property file with autostart not defined
            Properties properties = new Properties();
            EasyMock.expect(commandFactory.getConfigurationProperties(
                    deployMojo, maven2WrapperLog)).andReturn(properties);

            EasyMock.expect(clownfish.deploy()).andReturn(true);

            clownfish.destroy();
View Full Code Here

TOP

Related Classes of net.sourceforge.clownfish.core.CommandFactory

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.