Package net.raymanoz.migrate

Examples of net.raymanoz.migrate.ScriptList


  public void execute(String[] args) {
    execute();
  }

  public void execute() {
    ScriptList scriptList = getScriptList();
    if(scriptList.size() == 0) {
      System.out.println("No migrate actions found");
    } else {
      for(Script script : scriptList) {
        System.out.println(script.getPatch() + " - " + script.getFileName());
      }
View Full Code Here


    version = version();
    repository.validateNoOtherLaterActivity(version);

    for (long dbver = version.getDBVersion(); dbver <= configuration.getLatestDBVersion(); dbver++) {
      File scriptsDir = configuration.getScriptDirectory(dbver);
      ScriptList scriptlist = assembler.newScriptList(scriptsDir.listFiles(), dbver);
      scripts.add(scriptlist);
    }
    return scripts;
  }
View Full Code Here

  private List<Script> mockScripts(long dbVersion, ScriptStatus ... scriptStatus){
    return mockScripts(dbVersion, false, scriptStatus);
  }
 
  private ScriptList mockScriptList(List<Script> scripts){
    ScriptList result = mock(ScriptList.class);
    when(result.iterator()).thenReturn(scripts.iterator());
    when(result.size()).thenReturn(scripts.size());
    return result;
  }
View Full Code Here

  }

  private ScriptList mockScripts(final long dbVersion, final String ...scriptNames){
    List<Script> scripts = new ArrayList<Script>();
    long scriptNo = 0L;
    ScriptList result = mock(ScriptList.class);
    for (String scriptName: scriptNames){
      scriptNo++;
      Script script = mock(Script.class);
      when(script.getDBVersion()).thenReturn(dbVersion);
      when(script.getFileName()).thenReturn(scriptName);
      when(script.getPatch()).thenReturn(scriptNo);
     
      when(script.condtionStatus()).thenReturn("Test");
      when(script.execute(any(UserInteractionStrategy.class))).thenThrow(new RuntimeException("TBI"));
      when(script.compareTo(any(Script.class))).thenThrow(new RuntimeException("TBI"));
      scripts.add(script);
      when(result.get((int)scriptNo)).thenReturn(script);
    }
    when(result.iterator()).thenReturn(scripts.iterator());
    when(result.size()).thenReturn(scripts.size());

    when(result.nextScriptName(anyString())).thenThrow(new RuntimeException("TBI"));
    when(result.maxScriptVersion()).thenReturn(scriptNo);
    return result;
  }
View Full Code Here

TOP

Related Classes of net.raymanoz.migrate.ScriptList

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.