Package be.pw999.jape.utils

Examples of be.pw999.jape.utils.TestScraperTest


            Settings.LIST_SIZE = Integer.parseInt(args[0]);
        }

        for (int k = 0; k < Settings.TEST_REPEAT; ++k) {
            try {
                JaPeClassLoader classLoader = new JaPeClassLoader(log.getClass().getClassLoader(), new URL[]{new File("./").toURI().toURL()});
                {
                    Class<?> runnerClazz = classLoader.loadClass("be.pw999.jape.TestRunner");
                    Class<?> settingsClass = classLoader.loadClass("be.pw999.jape.constants.Settings");
                    settingsClass.getDeclaredField("LIST_SIZE").setInt(null, Settings.LIST_SIZE * Double.valueOf(Math.pow(4.0, k)).intValue());

                    Object runner = runnerClazz.newInstance();
                    Method m = runnerClazz.getMethod("run");
                    m.invoke(runner);
                    //runner.run(args);
                    m = null;
                    runner = null;
                }
                classLoader.clear();
            } catch (ClassNotFoundException e) {
                log.error("Dang :", e);
            } catch (InstantiationException e) {
                log.error("Dang :", e);
            } catch (IllegalAccessException e) {
View Full Code Here


                }
            }
            fileOut = new FileOutputStream(fileName);
            wb.write(fileOut);
        } catch (IOException e) {
            throw new ExportException(e);
        } finally {
            if (fileOut != null) {
                try {
                    fileOut.close();
                } catch (IOException e) {
                    log.error("Failed to close filOut");
                    throw new ExportException(e);
                }
            }
        }
        log.info("Finished exporting to Excel");
        return f;
View Full Code Here

            baseMap = (T) getParametrisedClass().newInstance();
            for (int i = 0; i < Settings.LIST_SIZE; ++i) {
                baseMap.put(TestUtils.getTestString(i), new Double(i));
            }
        } catch (InstantiationException e) {
            throw new InitializationException(e);
        } catch (IllegalAccessException e) {
            throw new InitializationException(e);
        }
    }
View Full Code Here

            read.clear();
            write.clear();
            read.putAll(baseMap);
            write.putAll(baseMap);
        } catch (InstantiationException e) {
            throw new InitializationException(e);
        } catch (IllegalAccessException e) {
            throw new InitializationException(e);
        }
    }
View Full Code Here

    public AbstractStringTest() {
        try {
            write = (T) getParametrisedClass().newInstance();
            read = (T) getParametrisedClass().newInstance();
        } catch (InstantiationException e) {
            throw new InitializationException(e);
        } catch (IllegalAccessException e) {
            throw new InitializationException(e);
        }
    }
View Full Code Here

            baseList = (T) getParametrisedClass().newInstance();
            for (int i = 0; i < Settings.LIST_SIZE; ++i) {
                baseList.add(TestUtils.getTestString(i));
            }
        } catch (InstantiationException e) {
            throw new InitializationException(e);
        } catch (IllegalAccessException e) {
            throw new InitializationException(e);
        }
    }
View Full Code Here

            read.clear();
            write.clear();
            read.addAll(baseList);
            write.addAll(baseList);
        } catch (InstantiationException e) {
            throw new InitializationException(e);
        } catch (IllegalAccessException e) {
            throw new InitializationException(e);
        }
    }
View Full Code Here

                Type tType = ((ParameterizedType) (parameterizedType.getActualTypeArguments()[0])).getRawType();
                return (Class) tType;
            }

        } catch (Exception e) {
            throw new InitializationException(e);
        }
    }
View Full Code Here

                log.error("ClassNotFoundException on test " + clazz.getSimpleName() + ": " + e.getMessage(), e);
            }
        }

        //Loop finished, export to excel.
        ExcelExporter exporter = new ExcelExporter();
        exporter.export(results, sysInfo, "workbook_" + Settings.LIST_SIZE + ".xls");

        //Print result if log.trace is enabled
        printResults();

View Full Code Here

                log.error("IllegalAccessException on test " + clazz.getSimpleName() + ": " + e.getMessage(), e);
            } catch (ClassNotFoundException e) {
                log.error("ClassNotFoundException on test " + clazz.getSimpleName() + ": " + e.getMessage(), e);
            }
        }
        ExcelExporter e = new ExcelExporter();
        try {
            Result r = new Result(ITest.class, Object.class.getMethod("wait"), Long.MIN_VALUE);
        } catch (NoSuchMethodException z) {
            ;
        }
View Full Code Here

TOP

Related Classes of be.pw999.jape.utils.TestScraperTest

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.