Package util

Examples of util.DynamicClassLoader


                    System.out.println(errorMessage);
                    return null;
                }
                bAppExecutionHasWarning = !errorMessage.equals("OK");

                final DynamicClassLoader dcl = new DynamicClassLoader();
                final LogWriter log = (LogWriter) dcl.getInstance(
                        (String) param.get("LogWriter"));

                //create empty entry
                final DescEntry Entry = new DescEntry();
                Entry.entryName = "office";
View Full Code Here


            DescEntry entry = entries[l];

            //get some helper classes
            Summarizer sumIt = new Summarizer();
            DynamicClassLoader dcl = new DynamicClassLoader();

            TestCase tCase = null;

            tCase = (TestCase) new BasicTestCase(entry);

            if (tCase == null)
            {
                sumIt.summarizeDown(entry, entry.ErrorMsg);

                LogWriter sumObj = OutProducerFactory.createOutProducer(param);
                sumObj.initialize(entry, true);
                sumObj.summary(entry);

                continue;
            }

            System.out.println("Creating: " + tCase.getObjectName());

            LogWriter log = (LogWriter) dcl.getInstance(
                    (String) param.get("LogWriter"));
            log.initialize(entry, true);
            entry.UserDefinedParams = param;
            tCase.setLogWriter((PrintWriter) log);

            try
            {
                tCase.initializeTestCase(param);
            }
            catch (RuntimeException e)
            {
                helper.ProcessHandler ph = (helper.ProcessHandler) param.get(
                        "AppProvider");

                if (ph != null)
                {
                    OfficeWatcher ow = (OfficeWatcher) param.get("Watcher");

                    if ((ow != null) && ow.isAlive())
                    {
                        ow.finish = true;
                    }

                    ph.kill();
                    shortWait(5000);
                }

                continue;
            }

            TestEnvironment tEnv = tCase.getTestEnvironment(param);

            if (tEnv == null)
            {
                sumIt.summarizeDown(entry, "Unable to create testcase");

                LogWriter sumObj = OutProducerFactory.createOutProducer(param);
                sumObj.initialize(entry, true);
                sumObj.summary(entry);

                helper.ProcessHandler ph = (helper.ProcessHandler) param.get(
                        "AppProvider");

                if (ph != null)
                {
                    OfficeWatcher ow = (OfficeWatcher) param.get("Watcher");

                    if ((ow != null) && ow.isAlive())
                    {
                        ow.finish = true;
                    }

                    ph.kill();
                    shortWait(5000);
                }

                continue;
            }

            System.out.println("created " + tCase.getObjectName());

            for (int j = 0; j < entry.SubEntryCount; j++)
            {
                if (!entry.SubEntries[j].isToTest)
                {
                    Summarizer.summarizeDown(entry.SubEntries[j],
                            "not part of the job");

                    continue;
                }

                if ((exclusions != null) &&
                        (exclusions.contains(entry.SubEntries[j].longName)))
                {
                    Summarizer.summarizeDown(entry.SubEntries[j],
                            "known issue");

                    continue;
                }

                System.out.println("running: " +
                        entry.SubEntries[j].entryName);

                LogWriter ifclog = (LogWriter) dcl.getInstance(
                        (String) param.get("LogWriter"));
                ifclog.initialize(entry.SubEntries[j], true);
                entry.SubEntries[j].UserDefinedParams = param;
                entry.SubEntries[j].Logger = ifclog;
View Full Code Here

        return true;
    }

    protected TestEnvironment getEnv(DescEntry entry, TestParameters param)
    {
        DynamicClassLoader dcl = new DynamicClassLoader();
        String officeProviderName = (String) param.get("OfficeProvider");
        AppProvider office = (AppProvider) dcl.getInstance(officeProviderName);

        if (office == null)
        {
            System.out.println("ERROR: Wrong parameter 'OfficeProvider', " +
                    " it cannot be instantiated.");
            System.exit(-1);
        }

        XMultiServiceFactory msf = (XMultiServiceFactory) office.getManager(
                param);

        if (msf == null)
        {
            return null;
        }

        param.put("ServiceFactory", msf);

        TestCase tCase = (TestCase) new BasicTestCase(entry);

        System.out.println("Creating: " + tCase.getObjectName());

        LogWriter log = (LogWriter) dcl.getInstance(
                (String) param.get("LogWriter"));
        log.initialize(entry, true);
        entry.UserDefinedParams = param;
        tCase.setLogWriter((PrintWriter) log);
View Full Code Here

    {
        System.out.println("OOoRunner Main() version from 20100323 (yyyymmdd)");

        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());
View Full Code Here

            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)
            log.println("Test did not execute correctly.");
       
View Full Code Here

    public boolean executeTest(lib.TestParameters _aParams)
        {
            m_aParams = _aParams;

            m_aDynamicClassLoader = new DynamicClassLoader();

            DescGetter dg = new APIDescGetter();
            String job = (String) m_aParams.get("TestJob");
            String ExclusionFile = (String) m_aParams.get("ExclusionList");
            Vector exclusions = null;
View Full Code Here

    private AppProvider startOffice(lib.TestParameters param)
        {

            if (m_aDynamicClassLoader == null)
            {
                m_aDynamicClassLoader = new DynamicClassLoader();
            }

            String officeProviderName = (String) param.get("OfficeProvider");
            AppProvider office = (AppProvider) m_aDynamicClassLoader.getInstance(officeProviderName);
View Full Code Here

TOP

Related Classes of util.DynamicClassLoader

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.