Package lib

Examples of lib.TestParameters


    public static void main(String[] args) {
       
        DynamicClassLoader dcl = new DynamicClassLoader();

        // get a class for test parameters
        TestParameters param = new TestParameters();
       
        ClParser cli = new ClParser();       
       
        //parse the commandline arguments if an ini-parameter is given       
        String iniFile = cli.getIniPath(args);
       
        //initialize cfgParser with ini-path
        CfgParser ini = new CfgParser(iniFile);
               
        //parse ConfigFile
        ini.getIniParameters(param);               
       
        //parse the commandline arguments
        cli.getCommandLineParameter(param,args);
       
        Object tj = param.get("TestJob");
       
        if (tj==null) {
            System.out.println("==========================================================================");
            System.out.println("No TestJob given, please make sure that you ");
            System.out.println("a.) called the OOoRunner with the paramter -o <job> or -sce <scenarioFile>");
            System.out.println("or");
            System.out.println("b.) have an entry called TestJob in your used properties file");
            System.out.println("==========================================================================");
            System.exit(-1);
        }
       
        System.out.println("TestJob: "+tj);
       
        TestBase toExecute = (TestBase) dcl.getInstance("base."+
                                            (String)param.get("TestBase"));

        boolean worked = toExecute.executeTest(param);
       
        if (!worked) {
            System.out.println("Job "+param.get("TestJob")+" failed");
            System.exit(-1);
        } else {
            System.out.println("Job "+param.get("TestJob")+" done");
            System.exit(0);
        }
    }   
View Full Code Here


            arguments[i*2] = args[i].Name;
            Object o = args[i].Value;
            arguments[i*2+1] = o.toString();
        }

        TestParameters param = new TestParameters();
        DynamicClassLoader dcl = new DynamicClassLoader();

       
        // take the standard log writer
        String standardLogWriter = param.LogWriter;
        String standardOutProducer = param.OutProducer;

        ClParser cli = new ClParser();

        //parse the arguments if an ini-parameter is given
        String iniFile = cli.getIniPath(arguments);

        //initialize cfgParser with ini-path
        CfgParser ini = new CfgParser(iniFile);

        //parse ConfigFile
        ini.getIniParameters(param);

        //parse the commandline arguments
        cli.getCommandLineParameter(param,arguments);
       
        // now compare the standard log writer with the parameters:
        // if we have a new one, use the new, else use the internal
        // log writer
        if (((String)param.get("LogWriter")).equals(standardLogWriter))
            param.put("LogWriter", "stats.InternalLogWriter");
        if (((String)param.get("OutProducer")).equals(standardOutProducer))
            param.put("OutProducer", "stats.InternalLogWriter");
        LogWriter log = (LogWriter) dcl.getInstance(
                                            (String)param.get("LogWriter"));
       
        param.put("ServiceFactory", xMSF);

        param.ServiceFactory = xMSF; //(XMultiServiceFactory)
                                     //       appProvider.getManager(param);

        log.println("TestJob: "+param.get("TestJob"));

        TestBase toExecute = (TestBase)dcl.getInstance("base.java_fat_service");

        boolean worked = toExecute.executeTest(param);
        if (!worked)
View Full Code Here

        setStartTime(getTime());

        DynamicClassLoader dcl = new DynamicClassLoader();

        // get a class for test parameters
        TestParameters param = new TestParameters();

        ClParser cli = new ClParser();

        //parse the commandline arguments if an ini-parameter is given
        String iniFile = cli.getIniPath(args);

        //initialize cfgParser with ini-path
        CfgParser ini = new CfgParser(iniFile);

        //parse ConfigFile
        ini.getIniParameters(param);


        //parse the commandline arguments if an runnerprops-parameter is given
        String runnerIniFile = cli.getRunnerIniPath(args);

        //initialize cfgParser with ini-path
        CfgParser runnerIni = new CfgParser(runnerIniFile);

        //parse ConfigFile
        runnerIni.getIniParameters(param);

        //parse the commandline arguments
        // TODO: no right error message, if no parameter given!
        cli.getCommandLineParameter(param, args);

        Object tj = param.get("TestJob");

        if (tj == null)
        {
            System.out.println("==========================================================================");
            System.out.println("No TestJob given, please make sure that you ");
            System.out.println("a.) called the OOoRunner with the paramter -o <job> or -sce <scenarioFile>");
            System.out.println("or");
            System.out.println("b.) have an entry called TestJob in your used properties file");
            System.out.println("==========================================================================");
            System.exit(-1);
        }

        System.out.println("TestJob: " + tj);
        String sName = "base." + (String) param.get("TestBase");
        TestBase toExecute = (TestBase) dcl.getInstance(sName);

        checkAllVariablesForCygwinPath(param);

        boolean worked = toExecute.executeTest(param);
        long nTime = meanTime(getRunnerStartTime());
        String sBeautifyTime = beautifyTime(nTime);

        System.out.println("Job run took: " + nTime + "ms " + " [" + sBeautifyTime + "]");

        if (!worked)
        {
            System.out.println("Job " + param.get("TestJob") + " failed");
            System.exit(-1);
        }
        else
        {
            System.out.println("Job " + param.get("TestJob") + " done");
            System.exit(0);
        }
    }
View Full Code Here

            arguments[i*2] = args[i].Name;
            Object o = args[i].Value;
            arguments[i*2+1] = o.toString();
        }

        TestParameters param = new TestParameters();
        DynamicClassLoader dcl = new DynamicClassLoader();

       
        // take the standard log writer
        String standardLogWriter = param.LogWriter;
        String standardOutProducer = param.OutProducer;

        ClParser cli = new ClParser();

        //parse the arguments if an ini-parameter is given
        String iniFile = cli.getIniPath(arguments);

        //initialize cfgParser with ini-path
        CfgParser ini = new CfgParser(iniFile);

        //parse ConfigFile
        ini.getIniParameters(param);


        //parse the commandline arguments if an runnerprops-parameter is given
        String runnerIniFile = cli.getRunnerIniPath(arguments);

        //initialize cfgParser with ini-path
        CfgParser runnerIni = new CfgParser(runnerIniFile);

        //parse ConfigFile
        runnerIni.getIniParameters(param);

        //parse the commandline arguments
        cli.getCommandLineParameter(param,arguments);
       
        // now compare the standard log writer with the parameters:
        // if we have a new one, use the new, else use the internal
        // log writer
        if (((String)param.get("LogWriter")).equals(standardLogWriter))
            param.put("LogWriter", "stats.InternalLogWriter");
        if (((String)param.get("OutProducer")).equals(standardOutProducer))
            param.put("OutProducer", "stats.InternalLogWriter");
        LogWriter log = (LogWriter) dcl.getInstance(
                                            (String)param.get("LogWriter"));
       
        param.put("ServiceFactory", xMSF);

        param.ServiceFactory = xMSF; //(XMultiServiceFactory)
                                     //       appProvider.getManager(param);

        log.println("TestJob: "+param.get("TestJob"));

        TestBase toExecute = (TestBase)dcl.getInstance("base.java_fat_service");

        boolean worked = toExecute.executeTest(param);
        if (!worked)
View Full Code Here

    @Before public void before()
    {
        try {
            XMultiServiceFactory xMSF = getMSF();
            param = new TestParameters();
            param.put("ServiceFactory", xMSF);

            assertNotNull("could not create MultiServiceFactory.", xMSF);
            XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xMSF);
            Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext");
View Full Code Here

    {
        final XMultiServiceFactory xMSF = UnoRuntime.queryInterface(
                XMultiServiceFactory.class,
                connection.getComponentContext().getServiceManager());
        assertNotNull("could not create MultiServiceFactory.", xMSF);
        m_params = new TestParameters();
        m_params.put("ServiceFactory", xMSF);
        XPropertySet xPropertySet =
            UnoRuntime.queryInterface(XPropertySet.class, xMSF);
        m_xContext = UnoRuntime.queryInterface(XComponentContext.class,
                xPropertySet.getPropertyValue("DefaultContext"));
View Full Code Here

            arguments[i*2] = args[i].Name;
            Object o = args[i].Value;
            arguments[i*2+1] = o.toString();
        }

        TestParameters param = new TestParameters();
        DynamicClassLoader dcl = new DynamicClassLoader();

       
        // take the standard log writer
        String standardLogWriter = param.LogWriter;
        String standardOutProducer = param.OutProducer;

        ClParser cli = new ClParser();

        //parse the arguments if an ini-parameter is given
        String iniFile = cli.getIniPath(arguments);

        //initialize cfgParser with ini-path
        CfgParser ini = new CfgParser(iniFile);

        //parse ConfigFile
        ini.getIniParameters(param);


        //parse the commandline arguments if an runnerprops-parameter is given
        String runnerIniFile = cli.getRunnerIniPath(arguments);

        //initialize cfgParser with ini-path
        CfgParser runnerIni = new CfgParser(runnerIniFile);

        //parse ConfigFile
        runnerIni.getIniParameters(param);

        //parse the commandline arguments
        cli.getCommandLineParameter(param,arguments);
       
        // now compare the standard log writer with the parameters:
        // if we have a new one, use the new, else use the internal
        // log writer
        if (((String)param.get("LogWriter")).equals(standardLogWriter))
            param.put("LogWriter", "stats.InternalLogWriter");
        if (((String)param.get("OutProducer")).equals(standardOutProducer))
            param.put("OutProducer", "stats.InternalLogWriter");
        LogWriter log = (LogWriter) dcl.getInstance(
                                            (String)param.get("LogWriter"));
       
        param.put("ServiceFactory", xMSF);

        param.ServiceFactory = xMSF; //(XMultiServiceFactory)
                                     //       appProvider.getManager(param);

        log.println("TestJob: "+param.get("TestJob"));

        TestBase toExecute = (TestBase)dcl.getInstance("base.java_fat_service");

        boolean worked = toExecute.executeTest(param);
        if (!worked)
View Full Code Here

        setStartTime(getTime());

        DynamicClassLoader dcl = new DynamicClassLoader();

        // get a class for test parameters
        TestParameters param = new TestParameters();

        ClParser cli = new ClParser();

        //parse the commandline arguments if an ini-parameter is given
        String iniFile = cli.getIniPath(args);

        //initialize cfgParser with ini-path
        CfgParser ini = new CfgParser(iniFile);

        //parse ConfigFile
        ini.getIniParameters(param);


        //parse the commandline arguments if an runnerprops-parameter is given
        String runnerIniFile = cli.getRunnerIniPath(args);

        //initialize cfgParser with ini-path
        CfgParser runnerIni = new CfgParser(runnerIniFile);

        //parse ConfigFile
        runnerIni.getIniParameters(param);

        //parse the commandline arguments
        // TODO: no right error message, if no parameter given!
        cli.getCommandLineParameter(param, args);

        Object tj = param.get("TestJob");

        if (tj == null)
        {
            System.out.println("==========================================================================");
            System.out.println("No TestJob given, please make sure that you ");
            System.out.println("a.) called the OOoRunner with the paramter -o <job> or -sce <scenarioFile>");
            System.out.println("or");
            System.out.println("b.) have an entry called TestJob in your used properties file");
            System.out.println("==========================================================================");
            System.exit(-1);
        }

        System.out.println("TestJob: " + tj);
        String sName = "base." + (String) param.get("TestBase");
        TestBase toExecute = (TestBase) dcl.getInstance(sName);

        checkAllVariablesForCygwinPath(param);

        boolean worked = toExecute.executeTest(param);
        long nTime = meanTime(getRunnerStartTime());
        String sBeautifyTime = beautifyTime(nTime);

        System.out.println("Job run took: " + nTime + "ms " + " [" + sBeautifyTime + "]");

        if (!worked)
        {
            System.out.println("Job " + param.get("TestJob") + " failed");
        }
        else
        {
            System.out.println("Job " + param.get("TestJob") + " done");
        }
        return worked;
    }
View Full Code Here

            final XMultiServiceFactory xMsf = getMSF();

            SOfficeFactory SOF = SOfficeFactory.getFactory(xMsf);

            // some Tests need the qadevOOo TestParameters, it is like a Hashmap for Properties.
            param = new TestParameters();
            param.put("ServiceFactory", xMsf); // some qadevOOo functions need the ServiceFactory

            return true;
        }
View Full Code Here

    @Before public void before()
    {
        try {

            xMSF = getMSF();
            param = new TestParameters();
            param.put("ServiceFactory", xMSF)// important for param.getMSF()

            assertNotNull("could not create MultiServiceFactory.", xMSF);
            XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xMSF);
            Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext");
View Full Code Here

TOP

Related Classes of lib.TestParameters

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.