/** * Create a suite for {@code classes}, building Runners with {@code builder}. * Throws an InitializationError if Runner construction fails */ public Runner getSuite(final RunnerBuilder builder, Class<?>[] classes) throws InitializationError { return new Suite(new RunnerBuilder() { @Override public Runner runnerForClass(Class<?> testClass) throws Throwable { return getRunner(builder, testClass); } }, classes); }
/** * Returns an empty suite. */ public static Runner emptySuite() { try { return new Suite((Class<?>) null, new Class<?>[0]); } catch (InitializationError e) { throw new RuntimeException("This shouldn't be possible"); } }
/** * Returns an empty suite. */ public static Runner emptySuite() { try { return new Suite((Class<?>) null, new Class<?>[0]); } catch (InitializationError e) { throw new RuntimeException("This shouldn't be possible"); } }
/** * Create a suite for {@code classes}, building Runners with {@code builder}. * Throws an InitializationError if Runner construction fails */ public Runner getSuite(final RunnerBuilder builder, Class<?>[] classes) throws InitializationError { return new Suite(new RunnerBuilder() { @Override public Runner runnerForClass(Class<?> testClass) throws Throwable { return getRunner(builder, testClass); } }, classes); }
/** * Returns an empty suite. */ public static Runner emptySuite() { try { return new Suite((Class<?>) null, new Class<?>[0]); } catch (InitializationError e) { throw new RuntimeException("This shouldn't be possible"); } }
/** * Create a suite for {@code classes}, building Runners with {@code builder}. * Throws an InitializationError if Runner construction fails */ public Runner getSuite(final RunnerBuilder builder, Class<?>[] classes) throws InitializationError { return new Suite(new RunnerBuilder() { @Override public Runner runnerForClass(Class<?> testClass) throws Throwable { return getRunner(builder, testClass); } }, classes); }
/** * Create a suite for {@code classes}, building Runners with {@code builder}. * Throws an InitializationError if Runner construction fails */ public Runner getSuite(final RunnerBuilder builder, Class<?>[] classes) throws InitializationError { return new Suite(new RunnerBuilder() { @Override public Runner runnerForClass(Class<?> testClass) throws Throwable { return getRunner(builder, testClass); } }, classes); }
/** * Create a suite for {@code classes}, building Runners with {@code builder}. * Throws an InitializationError if Runner construction fails */ public Runner getSuite(final RunnerBuilder builder, Class<?>[] classes) throws InitializationError { return new Suite(new RunnerBuilder() { @Override public Runner runnerForClass(Class<?> testClass) throws Throwable { return getRunner(builder, testClass); } }, classes); }
/** * Create a suite for {@code classes}, building Runners with {@code builder}. * Throws an InitializationError if Runner construction fails */ public Runner getSuite(final RunnerBuilder builder, Class<?>[] classes) throws InitializationError { return new Suite(new RunnerBuilder() { @Override public Runner runnerForClass(Class<?> testClass) throws Throwable { return getRunner(builder, testClass); } }, classes); }
/** * Returns an empty suite. */ public static Runner emptySuite() { try { return new Suite((Class<?>) null, new Class<?>[0]); } catch (InitializationError e) { throw new RuntimeException("This shouldn't be possible"); } }
/** * Returns an empty suite. */ public static Runner emptySuite() { try { return new Suite((Class<?>) null, new Class<?>[0]); } catch (InitializationError e) { throw new RuntimeException("This shouldn't be possible"); } }
/** * Returns an empty suite. */ public static Runner emptySuite() { try { return new Suite((Class<?>) null, new Class<?>[0]); } catch (InitializationError e) { throw new RuntimeException("This shouldn't be possible"); } }
/** * Returns an empty suite. */ public static Runner emptySuite() { try { return new Suite((Class<?>) null, new Class<?>[0]); } catch (InitializationError e) { throw new RuntimeException("This shouldn't be possible"); } }
public class Main { public static void main(String[] args) { Suite suite = new Suite(10); suite.displayRoom(); } }
private static Runner getClassesRunner(String testClasses) throws ClassNotFoundException, InitializationError { Runner r; String[] split = testClasses.split(":"); List<Class<?>> classes = new ArrayList<Class<?>>(); for (String className : split) { try { Class<?> clazz = Class.forName(className); classes.add(clazz); } catch (ClassNotFoundException e) { if (className.trim().length() == 0) { throw new RuntimeException("Classname with length 0.", e); } throw new RuntimeException("Class not found: " + className, e); } catch (VerifyError e) { throw new RuntimeException("Verrify error for " + className, e); } } r = new Suite(new AllDefaultPossibilitiesBuilder(true), classes.toArray(new Class[0])); return r; }
private static Runner getMethodsRunner(String testMethods) throws ClassNotFoundException, InitializationError { String[] testMethodsSplit = testMethods.split(":"); final Multimap<String, String> methods = getMethodMap(testMethodsSplit); RunnerBuilder runnerBuilder = new RunnerBuilder() { @Override public Runner runnerForClass(Class<?> testClass) throws Throwable { Request aClass = Request.aClass(testClass); final Collection<String> methodNames = methods.get(testClass .getName()); Request filtered = aClass.filterWith(new Filter() { @Override public String describe() { return "Javalanche test filter"; } @Override public boolean shouldRun(Description description) { String name = description.getClassName() + "." + description.getMethodName(); logger.debug("Testname: " + name); boolean var = methodNames.contains(name); return var; } }); return filtered.getRunner(); } }; Class<?>[] classes = getClasses(methods); return new Suite(runnerBuilder, classes); }
DecimalFormat fmt = new DecimalFormat("0.##"); Hotel run = new Hotel(); int quantity, sale,night; Register family = new Family(); Register suite = new Suite(); Scanner input = new Scanner(System.in); System.out.println("Enter customer's name:"); String name = input.next(); quantity = run.enterItems(); Register deluxe = new Deluxe(quantity,0,0); // entering the default value for the other two parameters like the empty constructor would leave them. if(run.count != 0) { System.out.println("\nHotel Reservation Payment"); System.out.println("============================"); System.out.println("Customer name: " + name); deluxe.displayInfo(); //supposed to print the details family.displayInfo(); //supposed to print the details suite.displayInfo(); //supposed to print the details System.out.println("The final total is RM" + fmt.format(run.calcTotal())); } else { System.out.println("No items entered."); run.enterItems(); }
r = new Suite(forName, new AllDefaultPossibilitiesBuilder( true));
public static void run(Configuration configuration, Class<?> clazz, String methodName) { try { Request request = null; if (clazz!=null && methodName!=null) { request = Request.method(clazz, methodName); } else { Suite suite = new Suite(new JUnit4Builder(), API_TEST_CLASSES); request = Request.runner(suite); } Configuration originalConfiguration = WorkflowTest.cachedConfiguration; WorkflowTest.cachedConfiguration = configuration; JUnitCore junitCore = new JUnitCore(); Result result = junitCore.run(request); WorkflowTest.cachedConfiguration = originalConfiguration; checkResult(result); } catch (Exception e) { throw new RuntimeException(e); } }