Examples of CommandFactory


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

Examples of net.sourceforge.clownfish.core.CommandFactory

    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

Examples of net.sourceforge.clownfish.core.CommandFactory

      */
    @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

Examples of net.sourceforge.clownfish.core.CommandFactory

     */
    @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

Examples of net.sourceforge.clownfish.core.CommandFactory

     /**
      *  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

Examples of net.sourceforge.clownfish.core.CommandFactory

    /**
     * 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

Examples of org.apache.ftpserver.command.CommandFactory

            final FtpRequest request) throws Exception {
        try {
            session.updateLastAccessTime();
           
            String commandName = request.getCommand();
            CommandFactory commandFactory = context.getCommandFactory();
            Command command = commandFactory.getCommand(commandName);

            // make sure the user is authenticated before he issues commands
            if (!session.isLoggedIn()
                    && !isCommandOkWithoutAuthentication(commandName)) {
                session.write(LocalizedFtpReply.translate(session, request,
View Full Code Here

Examples of org.apache.ftpserver.command.CommandFactory

*
*/
public class DefaultCommandFactoryTest extends TestCase {

    public void testReturnFromDefaultUpper() {
        CommandFactory factory = new CommandFactoryFactory().createCommandFactory();
        Command command = factory.getCommand("STOR");

        assertNotNull(command);
        assertTrue(command instanceof STOR);
    }
View Full Code Here

Examples of org.apache.ftpserver.command.CommandFactory

        assertNotNull(command);
        assertTrue(command instanceof STOR);
    }

    public void testReturnFromDefaultLower() {
        CommandFactory factory = new CommandFactoryFactory().createCommandFactory();
        Command command = factory.getCommand("stor");

        assertNotNull(command);
        assertTrue(command instanceof STOR);
    }
View Full Code Here

Examples of org.apache.ftpserver.command.CommandFactory

        assertNotNull(command);
        assertTrue(command instanceof STOR);
    }

    public void testReturnFromDefaultUnknown() {
        CommandFactory factory = new CommandFactoryFactory().createCommandFactory();
        Command command = factory.getCommand("dummy");

        assertNull(command);
    }
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.