Package org.auraframework.system

Examples of org.auraframework.system.Location


            return DefDescriptorImpl.getInstance("test:fakeParentInterface",
                            InterfaceDef.class);
    }

    public Location getLocation() {
        return new Location("filename1", 5, 5, defaultLastModified);
    }
View Full Code Here


            return makeLocation(defaultFileName, 5, 5, defaultLastModified);
    }

    public Location makeLocation(String fileName, int line, int column,
                    long lastModified) {
            return new Location(fileName == null ? defaultFileName : fileName,
                            line, column, lastModified);
    }
View Full Code Here

    /**
     * Verify Throwable is from the expected Location.
     */
    private void assertLocation(Throwable e, String expectedLoc) {
        Location l = null;
        if (e instanceof QuickFixException) {
            l = ((QuickFixException) e).getLocation();
        } else if (e instanceof AuraRuntimeException) {
            l = ((AuraRuntimeException) e).getLocation();
        }
        assertNotNull("Unable to find location, expected " + expectedLoc, l);
        assertEquals("Unexpected location.", expectedLoc, l.getFileName());
    }
View Full Code Here

     * New StackTraceElement with filename and line number is inserted at top of
     * stack if location contains both properties.
     */
    public void testAddLocationWithFileAndLine() throws Exception {
        Throwable t = new Throwable();
        AuraExceptionUtil.addLocation(new Location(getName(), 22, 0, 0), t);
        assertEquals("Expected StackTraceElement not inserted at top", new StackTraceElement("", "", getName(), 22),
                t.getStackTrace()[0]);
    }
View Full Code Here

     * New StackTraceElement with filename only is inserted at top of stack if
     * location has negative line number set.
     */
    public void testAddLocationWithoutLine() throws Exception {
        Throwable t = new Throwable();
        AuraExceptionUtil.addLocation(new Location(getName(), 33), t);
        assertEquals("Expected StackTraceElement not inserted at top", new StackTraceElement("", "", getName(), -1),
                t.getStackTrace()[0]);
    }
View Full Code Here

     * New StackTraceElement with null filename is inserted at top of stack if
     * location contains null filename.
     */
    public void testAddLocationWithoutFile() throws Exception {
        Throwable t = new Throwable();
        AuraExceptionUtil.addLocation(new Location(null, 33, 0, 0), t);
        assertEquals("Expected StackTraceElement not inserted at top", new StackTraceElement("", "", null, 33),
                t.getStackTrace()[0]);
    }
View Full Code Here

     * QuickFixException is returned as is.
     */
    public void testWrapExecutionExceptionInstanceOfQuickFixException() throws Exception {
        Exception t = new TestQuickFixException(getName());
        assertEquals("Did not get the original QuickFixException", t,
                AuraExceptionUtil.wrapExecutionException(t, new Location("here", 0)));
    }
View Full Code Here

    public void testWrapExecutionExceptionInstanceOfAuraUnhandledException() throws Exception {
        Throwable start = new Exception("start");
        Throwable child = new AuraUnhandledException("child", start);
        Exception t = new AuraUnhandledException(getName(), child);
        try {
            AuraExceptionUtil.wrapExecutionException(t, new Location("here", 0));
            fail("Expected the AuraRuntimeException to get rethrown");
        } catch (AuraExecutionException e) {
            assertEquals("Topmost AuraRuntimeException was not wrapped", t, e.getCause());
        }
    }
View Full Code Here

     * Topmost AuraExecutionException is wrapped.
     */
    public void testWrapExecutionExceptionInstanceOfAuraExecutionException() throws Exception {
        Throwable start = new Exception("start");
        Throwable child = new AuraUnhandledException("child", start);
        Exception t = new AuraExecutionException(child, new Location("there", 0));
        try {
            AuraExceptionUtil.wrapExecutionException(t, new Location("here", 0));
            fail("Expected the AuraRuntimeException to get rethrown");
        } catch (AuraExecutionException e) {
            assertEquals("Topmost AuraRuntimeException was not wrapped", t, e.getCause());
        }
    }
View Full Code Here

    public void testWrapExecutionExceptionInstanceOfAuraHandledException() throws Exception {
        Throwable start = new Exception("start");
        Throwable child = new AuraHandledException(start);
        Exception t = new AuraUnhandledException(getName(), child);
        try {
            AuraExceptionUtil.wrapExecutionException(t, new Location("here", 0));
            fail("Expected the AuraRuntimeException to get rethrown");
        } catch (AuraHandledException e) {
            assertEquals("Topmost AuraHandledException was not unwrapped", child, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.auraframework.system.Location

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.