Package com.softsizo.data

Examples of com.softsizo.data.ConfigParameters


   
    public static void main(String[] args) throws Exception {
        Logger.getRootLogger().setLevel(Level.ALL);
        RepositoryExplorer explorer = new RepositoryExplorer();
        explorer.setSvnClientProvider(new SvnkitSvnClientProvider());
        ExtractedData data = explorer.explore(new ConfigParameters()
            .setRepoUrl("http://soft-sizo.svn.sourceforge.net/svnroot/soft-sizo/trunk")
            .setToRevision(3));
        Collection<VersionedFile> files = data.getFiles();
        int initialLoc = 0;
        int currentLoc = 0;
View Full Code Here


    @Test
    public void testBuildConfigParameters() throws Exception {
        Options options = ConsoleFrontEnd.buildOptions();
       
        CommandLineParser parser = new GnuParser();
        ConfigParameters configParameters;
        CommandLine commandLine;
       
        commandLine = parser.parse(options, testArgs);
        configParameters = frontEnd
                .buildConfigParameters(commandLine, options);
        assertEquals(15, configParameters.getFromRevision());
        assertEquals(25, configParameters.getToRevision());
        assertEquals("serge", configParameters.getUsername());
        assertEquals("secret", configParameters.getPassword());
        assertEquals("out-dir", configParameters.getOutputDirectory());
        assertEquals("http://myrepo.com", configParameters.getRepoUrl());
        assertEquals("include-me", configParameters.getInclude());
        assertEquals("exclude-me", configParameters.getExclude());
    }
View Full Code Here

    @Test
    public void testPrintVersionFromCommandLine() throws Exception {
        Options options = ConsoleFrontEnd.buildOptions();
       
        CommandLineParser parser = new GnuParser();
        ConfigParameters configParameters;
        CommandLine commandLine;
        String [] args = { "-v" };
        commandLine = parser.parse(options, args);
        configParameters = frontEnd
                .buildConfigParameters(commandLine, options);
View Full Code Here

    @Test
    public void testPrintHelpFromCommandLine() throws Exception {
        Options options = ConsoleFrontEnd.buildOptions();
       
        CommandLineParser parser = new GnuParser();
        ConfigParameters configParameters;
        CommandLine commandLine;
        String [] args = { "-h" };
        commandLine = parser.parse(options, args);
        configParameters = frontEnd
                .buildConfigParameters(commandLine, options);
View Full Code Here

    public void buildConfigParametersDefaultValues() throws Exception{
      String[] args = { "-r", "http://project/svn/trunk" };
      Options options = ConsoleFrontEnd.buildOptions();
       
        CommandLineParser parser = new GnuParser();
        ConfigParameters configParameters;
        CommandLine commandLine;
       
        commandLine = parser.parse(options, args);
        configParameters = frontEnd
                .buildConfigParameters(commandLine, options);
        assertEquals(ConfigParameters.INITIAL_REVISION, configParameters.getFromRevision());
        assertEquals(ConfigParameters.HEAD_REVISION, configParameters.getToRevision());
        assertNull(configParameters.getUsername());
        assertEquals("", configParameters.getPassword());
        assertEquals(ConfigParameters.OUTPUT_DIRECTORY_DEFAULT,
            configParameters.getOutputDirectory());
        assertEquals("http://project/svn/trunk", configParameters.getRepoUrl());       
    }
View Full Code Here

        Logger.getRootLogger().setLevel(Level.OFF);
    }
   
    @Before
    public void setConfigParameters() {
        config = new ConfigParameters()
            .setRepoUrl("http://project.com/svnroot/trunk/src")
            .setFromRevision(30)
            .setToRevision(40);   
    }
View Full Code Here

      return null;
    }else if(cmd.hasOption("v")){
      printVersion();
      return null;
    }
    ConfigParameters config = new ConfigParameters();
    if(cmd.hasOption("f")){
      config.setFromRevision(new Integer(options.getOption("f").getValue()));
    }
    if(cmd.hasOption("t")){
      config.setToRevision(new Integer(options.getOption("t").getValue()));
    }
    if(cmd.hasOption("u")){
      config.setUsername(options.getOption("u").getValue());
    }
    if(cmd.hasOption("p")){
      config.setPassword(options.getOption("p").getValue());
    }
    if(cmd.hasOption("o")){
      config.setOutputDirectory(options.getOption("o").getValue());
    }
    if(cmd.hasOption("e")){
            config.setExclude(options.getOption("e").getValue());
        }
    if(cmd.hasOption("i")){
            config.setInclude(options.getOption("i").getValue());
        }
    config.setRepoUrl(options.getOption("r").getValue());
    return config;
  }
View Full Code Here

TOP

Related Classes of com.softsizo.data.ConfigParameters

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.