Examples of determineCauseChain()


Examples of org.springframework.security.web.util.ThrowableAnalyzer.determineCauseChain()

        };

        assertEquals("Unexpected number of registered types", 0, analyzer.getRegisteredTypes().length);

        Throwable t = this.testTrace[0];
        Throwable[] chain = analyzer.determineCauseChain(t);
        // Without extractors only the root throwable is available
        assertEquals("Unexpected chain size", 1, chain.length);
        assertEquals("Unexpected chain entry", t, chain[0]);
    }
View Full Code Here

Examples of org.springframework.security.web.util.ThrowableAnalyzer.determineCauseChain()

    public void testDetermineCauseChainWithDefaultExtractors() {
        ThrowableAnalyzer analyzer = this.standardAnalyzer;

        assertEquals("Unexpected number of registered types", 2, analyzer.getRegisteredTypes().length);

        Throwable[] chain = analyzer.determineCauseChain(this.testTrace[0]);

        // Element at index 2 is a NonStandardException which cannot be analyzed further by default
        assertEquals("Unexpected chain size", 3, chain.length);
        for (int i = 0; i < 3; ++i) {
            assertEquals("Unexpected chain entry: " + i, this.testTrace[i], chain[i]);
View Full Code Here

Examples of org.springframework.security.web.util.ThrowableAnalyzer.determineCauseChain()

    }

    public void testDetermineCauseChainWithCustomExtractors() {
        ThrowableAnalyzer analyzer = this.nonstandardAnalyzer;

        Throwable[] chain = analyzer.determineCauseChain(this.testTrace[0]);

        assertEquals("Unexpected chain size", this.testTrace.length, chain.length);
        for (int i = 0; i < chain.length; ++i) {
            assertEquals("Unexpected chain entry: " + i, this.testTrace[i], chain[i]);
        }
View Full Code Here

Examples of org.springframework.security.web.util.ThrowableAnalyzer.determineCauseChain()

    }

    public void testGetFirstThrowableOfTypeWithSuccess1() {
        ThrowableAnalyzer analyzer = this.nonstandardAnalyzer;

        Throwable[] chain = analyzer.determineCauseChain(this.testTrace[0]);

        Throwable result = analyzer.getFirstThrowableOfType(Exception.class, chain);

        assertNotNull("null not expected", result);
        assertEquals("Unexpected throwable found", this.testTrace[0], result);
View Full Code Here

Examples of org.springframework.security.web.util.ThrowableAnalyzer.determineCauseChain()

    }

    public void testGetFirstThrowableOfTypeWithSuccess2() {
        ThrowableAnalyzer analyzer = this.nonstandardAnalyzer;

        Throwable[] chain = analyzer.determineCauseChain(this.testTrace[0]);

        Throwable result = analyzer.getFirstThrowableOfType(NonStandardException.class, chain);

        assertNotNull("null not expected", result);
        assertEquals("Unexpected throwable found", this.testTrace[2], result);
View Full Code Here

Examples of org.springframework.security.web.util.ThrowableAnalyzer.determineCauseChain()

    }

    public void testGetFirstThrowableOfTypeWithFailure() {
        ThrowableAnalyzer analyzer = this.nonstandardAnalyzer;

        Throwable[] chain = analyzer.determineCauseChain(this.testTrace[0]);

        // IllegalStateException not in trace
        Throwable result = analyzer.getFirstThrowableOfType(IllegalStateException.class, chain);

        assertNull("null expected", result);
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.