test/java/util/Collection/BiggernYours.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 234,250 **** else fail(Arrays.toString(x) + " not equal to " + Arrays.toString(y));} public static void main(String[] args) throws Throwable { try {realMain(args);} catch (Throwable t) {unexpected(t);} System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new AssertionError("Some tests failed");} - private static abstract class Fun {abstract void f() throws Throwable;} - static void THROWS(Class<? extends Throwable> k, Fun... fs) { - for (Fun f : fs) - try { f.f(); fail("Expected " + k.getName() + " not thrown"); } - catch (Throwable t) { - if (k.isAssignableFrom(t.getClass())) pass(); - else unexpected(t);}} private static abstract class CheckedThread extends Thread { abstract void realRun() throws Throwable; public void run() { try {realRun();} catch (Throwable t) {unexpected(t);}}} } --- 234,243 ----