Package org.impalaframework.command.framework

Examples of org.impalaframework.command.framework.CommandPropertyValue


    return reload(commandState);
  }

  private boolean reload(CommandState commandState) {
   
    CommandPropertyValue commandPropertyValue = commandState.getProperties().get(MODULE_NAME);

    if (commandPropertyValue != null) {
      String moduleName = commandPropertyValue.getValue();
      reloadModule(moduleName, commandState);
      return true;
    } else {
      reloadRootModule();
      return true;
View Full Code Here


      actualModule = moduleToReload;
    }
    watch.stop();

    if (moduleToReload != null)
      commandState.addProperty(ACTUAL_MODULE_RELOADED, new CommandPropertyValue(moduleToReload));
    InteractiveCommandUtils.printReloadInfo(moduleToReload, actualModule, watch);
  }
View Full Code Here

  public void extractText(String[] text, CommandState commandState) {
    String name = text[0];
    if (name != null) {
      commandState.addProperty(MODULE_NAME,
          new CommandPropertyValue(name.trim(), "Module name"));
    }
  }
View Full Code Here

    Assert.notNull(moduleLocationResolver, "moduleLocationResolver cannot be null");
    this.moduleLocationResolver = moduleLocationResolver;
  }

  public boolean execute(CommandState commandState) {
    CommandPropertyValue suppliedValue = commandState.getProperties().get(DIRECTORY_NAME);
   
    //we can call this because the getCommandDefinition contract demands this
    Assert.notNull(suppliedValue);

    String candidateValue = suppliedValue.getValue();

    List<Resource> locations = moduleLocationResolver.getApplicationModuleClassLocations(candidateValue);

    boolean exists = false;
View Full Code Here

  }

  public void extractText(String[] text, CommandState commandState) {

    if (text.length > 0) {
      commandState.addProperty(DIRECTORY_NAME, new CommandPropertyValue(text[0]));
    }

  }
View Full Code Here

public class InteractiveTestCommandTest extends ManualInteractiveTestCommandTest {

    @Override
    public void testInteractive() throws Exception {
        super.testInteractive();
        CommandPropertyValue property = GlobalCommandState.getInstance().getProperty("lastCommand");
        assertEquals("run", property.getValue());
    }
View Full Code Here

        }
        assertNull(GlobalCommandState.getInstance().getValue(CommandStateConstants.DIRECTORY_NAME));
    }

    public final void testChangeDirectoryCommand() {
        commandState.addProperty(ChangeDirectoryCommand.DIRECTORY_NAME, new CommandPropertyValue("impala-core"));

        command.execute(commandState);
        assertEquals("impala-core", GlobalCommandState.getInstance().getValue(CommandStateConstants.DIRECTORY_NAME));
    }
View Full Code Here

        command.execute(commandState);
        assertEquals("impala-core", GlobalCommandState.getInstance().getValue(CommandStateConstants.DIRECTORY_NAME));
    }
   
    public final void testChangeDirectoryCommandDuffValue() {
        commandState.addProperty(ChangeDirectoryCommand.DIRECTORY_NAME, new CommandPropertyValue("duff-value"));

        command.execute(commandState);
        assertNull(GlobalCommandState.getInstance().getValue(CommandStateConstants.DIRECTORY_NAME));
    }
View Full Code Here

  public boolean execute(CommandState commandState) {

    Assert.notNull(classDirectories);

    Map<String, CommandPropertyValue> properties = commandState.getProperties();
    CommandPropertyValue classHolder = properties.get("class");

    String searchText = classHolder.getValue();

    ClassFindFileRecurseHandler handler = new ClassFindFileRecurseHandler(searchText);
    FileRecurser recurser = new FileRecurser();

    for (File directory : classDirectories) {
View Full Code Here

    }

    public boolean execute(CommandState commandState) {
        Map<String, CommandPropertyValue> properties = commandState.getProperties();
        System.out.println();
        CommandPropertyValue dob = properties.get("dateOfBirth");

        System.out.println("Name " + properties.get("name").getValue() + ", dob " + dob != null ? "unknown" : dob
                .getValue());
        return true;
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.command.framework.CommandPropertyValue

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.