Examples of FakeException


Examples of com.sun.jini.test.spec.activation.util.FakeException

    /**
     * This method performs all actions mentioned in class description.
     */
    public void run() throws Exception {
        Throwable serverSideException = new FakeException();
        for (int i = 0; i < cases.length; i++) {
            Throwable testedException = cases[i];
            logger.log(Level.FINEST, "test case: " + testedException);
            FakeActivationID aid = new FakeActivationID(logger);
            // 1
            ExceptionThrowingProxy afup =
                    new ExceptionThrowingProxy(logger);
            // 2
            InvocationHandler handler2 = new
                    ActivatableInvocationHandler(aid, afup);
            // 3
            ExceptionThrowingInterface fakeProxy =
                    (ExceptionThrowingInterface) Proxy.newProxyInstance(
                        ExceptionThrowingInterface.class.getClassLoader(),
                        new Class[] {ExceptionThrowingInterface.class},
                        handler2);
            // 4
            FakeActivationID aid2 = new FakeActivationID(logger, fakeProxy,
                    true);
            // 5
            ExceptionThrowingProxy fup = new ExceptionThrowingProxy(logger);
            // 6
            InvocationHandler handler = new
                    ActivatableInvocationHandler(aid2, fup);
            // 7
            ExceptionThrowingInterface fi =
                    (ExceptionThrowingInterface) Proxy.newProxyInstance(
                        ExceptionThrowingInterface.class.getClassLoader(),
                        new Class[] {ExceptionThrowingInterface.class},
                        handler);
            try {
                // 8
                afup.exceptionForThrow(serverSideException);
                // 9
                fup.exceptionForThrow(testedException);
                // 10
                fi.throwsException();
                throw new TestException(
                        serverSideException.toString()
                        + " should be thrown");
            } catch (Throwable t) {
                // 11
                assertion(serverSideException.equals(t),
                        serverSideException.toString()
                        + " should be thrown");
            }
        }
    }
View Full Code Here

Examples of com.sun.jini.test.spec.security.proxytrust.util.FakeException

     *
     * @throws FakeException (always)
     */
    public void exTest() throws FakeException {
        ++exTestNum;
        throw new FakeException("TestException");
    }
View Full Code Here

Examples of net.mindengine.galen.components.report.FakeException

        GalenTestInfo testInfo = new GalenTestInfo("Home page test", null);

        testInfo.setReport(new TestReport());
        testInfo.setStartedAt(new Date(1399741000000L));
        testInfo.setEndedAt(new Date(1399746930000L));
        testInfo.setException(new FakeException("Some exception here"));
        testInfos.add(testInfo);
       
        testInfo = new GalenTestInfo("Login page test", null);
        testInfo.setReport(new TestReport());
        testInfo.setStartedAt(new Date(1399741000000L));
View Full Code Here

Examples of net.mindengine.galen.components.report.FakeException

        testInfo.setEndedAt(new Date(1399746930000L));

        File attachmentFile = new File(Files.createTempDir().getAbsolutePath() + File.separator + "custom.txt");
        attachmentFile.createNewFile();
       
        testInfo.getReport().error(new FakeException("Some exception here")).withAttachment("custom.txt", attachmentFile);
        testInfo.getReport().info("Some detailed report").withDetails("Some details");
        testInfo.getReport().getNodes().get(0).setTime(new Date(1399741000000L));
        testInfo.getReport().getNodes().get(1).setTime(new Date(1399741000000L));
        testInfos.add(testInfo);
        new HtmlReportBuilder().build(testInfos, reportDirPath);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.