Package org.auraframework.system

Examples of org.auraframework.system.Location


        Throwable child = new TestQuickFixException(getName());
        Throwable error = new IOError(child);
        Exception t = new Exception(error);

        try {
            AuraExceptionUtil.wrapExecutionException(t, new Location("here", 0));
            fail("Expected the Error to get rethrown");
        } catch (IOError e) {
            assertEquals("Topmost Error was not rethrown", error, e);
        }
        try {
            AuraExceptionUtil.wrapExecutionException(error, new Location("here", 0));
            fail("Expected the Error to get rethrown");
        } catch (IOError e) {
            assertEquals("Topmost Error was not rethrown", error, e);
        }
    }
View Full Code Here


        Throwable t3 = new RuntimeException("intermediate3", t4);
        Throwable t2 = new RuntimeException("intermediate2", t3);
        Throwable t1 = new AuraUnhandledException("intermediate1", t2);
        Exception t = new RuntimeException("top", t1);
        assertEquals("Did not get the original nested QuickFixException", t4,
                AuraExceptionUtil.wrapExecutionException(t, new Location("here", 0)));
    }
View Full Code Here

        Throwable t3 = new AuraUnhandledException("intermediate3", t4);
        Throwable t2 = new AuraUnhandledException("intermediate2", t3);
        Throwable t1 = new AuraUnhandledException("intermediate1", t2);
        Exception t = new RuntimeException("top", t1);
        try {
            AuraExceptionUtil.wrapExecutionException(t, new Location("here", 0));
            fail("Expected the topmost nested AuraRuntimeException to get rethrown");
        } catch (AuraExecutionException e) {
            assertEquals("Topmost exception was not wrapped", t, e.getCause());
        }
    }
View Full Code Here

        Throwable t3 = new IOError(t4);
        Throwable t2 = new RuntimeException("intermediate2", t3);
        Throwable t1 = new RuntimeException("intermediate3", t2);
        Exception t = new RuntimeException("top", t1);
        try {
            AuraExceptionUtil.wrapExecutionException(t, new Location("here", 0));
            fail("Expected the nested Error to get rethrown");
        } catch (IOError e) {
            assertEquals("Topmost nested Error was not rethrown", t3, e);
        }
    }
View Full Code Here

        Throwable t2 = new RuntimeException("intermediate2", t3);
        Throwable t1 = new RuntimeException("intermediate1", t2);
        Throwable t0 = new RuntimeException("intermediate1", t1);
        Exception t = new RuntimeException("top", t0);
        try {
            AuraExceptionUtil.wrapExecutionException(t, new Location("here", 0));
            fail("Expected the original Throwable to get wrapped in a new AuraRuntimeException");
        } catch (AuraRuntimeException e) {
            assertEquals("Original Throwable was not wrapped", t, e.getCause());
        }
    }
View Full Code Here

     * Any other Throwable is wrapped in a new AuraRuntimeException.
     */
    public void testWrapExecutionExceptionWithoutMatching() throws Exception {
        Exception t = new RuntimeException(getName());
        try {
            AuraExceptionUtil.wrapExecutionException(t, new Location("here", 0));
            fail("Expected the original Throwable to get wrapped in a new AuraRuntimeException");
        } catch (AuraRuntimeException e) {
            assertEquals("Original Throwable was not wrapped", t, e.getCause());
        }
    }
View Full Code Here

        Mockito.doReturn(SupportLevel.GA).when(parentDef).getSupport();
        Mockito.doReturn(parentDef).when(this.extendsDescriptor).getDef();
        Mockito.doReturn(GLOBAL_ACCESS).when(parentDef).getAccess();
        Mockito.doReturn(DefType.COMPONENT).when(this.extendsDescriptor).getDefType();

        Location exprLocation = new Location("expression", 0);
        this.expressionRefs = Sets.newHashSet();
        this.expressionRefs.add(new PropertyReferenceImpl("v.privateAttribute", exprLocation));
        this.attributeDefs = ImmutableMap.of();

        try {
View Full Code Here

    public void testEquals() {
        DefDescriptor<EventDef> desc = DefDescriptorImpl.getInstance("fake:event", EventDef.class);
        DefDescriptor<EventDef> ext = DefDescriptorImpl.getInstance("fake:extendevent", EventDef.class);
        EventDefImpl def = vendor
                .makeEventDef(desc, EventType.COMPONENT, null, new Location("filename1", 5, 5, 0), ext);
        EventDefImpl def2 = vendor.makeEventDef(desc, EventType.COMPONENT, null, new Location("filename1", 5, 5, 0),
                ext);
        assertEquals(def, def2);
    }
View Full Code Here

        assertFalse("Equals should have been false due to different extends descriptors", def.equals(def2));
    }

    public void testEqualsWithNullExtendsDescriptors() {
        DefDescriptor<EventDef> desc = DefDescriptorImpl.getInstance("fake:event", EventDef.class);
        EventDefImpl def = vendor.makeEventDef(desc, EventType.COMPONENT, null, new Location("filename1", 5, 5, 0),
                null);
        EventDefImpl def2 = vendor.makeEventDef(desc, EventType.COMPONENT, null, new Location("filename1", 5, 5, 0),
                null);
        assertEquals(def, def2);
    }
View Full Code Here

        assertEquals(def, def2);
    }

    public void testHashCode() {
        DefDescriptor<EventDef> desc = DefDescriptorImpl.getInstance("fake:event", EventDef.class);
        EventDefImpl def = vendor.makeEventDefWithNulls(desc, EventType.COMPONENT, null, new Location("filename1", 5,
                5, 0), null);
        EventDefImpl def2 = vendor.makeEventDefWithNulls(desc, EventType.COMPONENT, null, new Location("filename1", 5,
                5, 0), null);
        assertEquals(def.hashCode(), def2.hashCode());
    }
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.