Package org.auraframework.throwable

Examples of org.auraframework.throwable.AuraRuntimeException


    @Override
    public Reader getReader() {
        try {
            return new InputStreamReader(new FileInputStream(file), "UTF8");
        } catch (FileNotFoundException e) {
            throw new AuraRuntimeException(e);
        } catch (UnsupportedEncodingException uee) {
            throw new AuraError(uee);
        }
    }
View Full Code Here


            } else if (!file.canWrite()) {
                Aura.getSourceControlAdapter().checkout(file);
            }
            return new FileWriter(file);
        } catch (Exception e) {
            throw new AuraRuntimeException(e);
        }
    }
View Full Code Here

    }

    public static String getFilePath(File file) {
        try {
            if (!file.exists()) {
                throw new AuraRuntimeException("File does not exist: " + file.getPath());
            }
            return file.getCanonicalPath();
        } catch (Exception e) {
            throw new AuraRuntimeException(e);
        }
    }
View Full Code Here

        try {
            StringWriter sw = new StringWriter();
            IOUtil.copyStream(getHashingReader(), sw);
            return sw.toString();
        } catch (IOException e) {
            throw new AuraRuntimeException(e);
        }
    }
View Full Code Here

    @Override
    public boolean addOrUpdate(CharSequence newContents) {
        try {
            return Aura.getSourceControlAdapter().writeIfDifferent(new StringBuilder(newContents), file);
        } catch (IOException e) {
            throw new AuraRuntimeException(e);
        }
    }
View Full Code Here

    public Object initialize(Object config, BaseComponent<?, ?> valueProvider) throws QuickFixException {
        ComponentDefRef defRef = (ComponentDefRef) config;
        try {
            return defRef.newInstance(valueProvider);
        } catch (DefinitionNotFoundException e) {
            throw new AuraRuntimeException(e);
        }
    }
View Full Code Here

        mockingUtil.mockDef(modelDef);

        // chain 2 different string values followed by an exception
        MockModel model1 = new MockModel(modelDefDescriptor, ImmutableMap.of("string", (Object) "age"));
        MockModel model2 = new MockModel(modelDefDescriptor, ImmutableMap.of("string", (Object) "beauty"));
        Mockito.doReturn(model1).doReturn(model2).doThrow(new AuraRuntimeException("the afterlife")).when(modelDef)
                .newInstance();
        // rather than build another component, we'll just instantiate the same
        // component consecutively
        open(appDescriptor);
        assertEquals("age", getText(By.cssSelector("body")));
View Full Code Here

        Method meth;
        try {
            String name = AuraTextUtil.initLowerCase(getName().substring("test".length()));
            meth = defClass.getMethod(name);
        } catch (Exception e) {
            throw new AuraRuntimeException(e);
        }

        assertFalse(define(template, "false"), meth);
        assertFalse(define(template, "0"), meth);
        assertFalse(define(template, "-1"), meth);
View Full Code Here

    private void assertFalse(Object def, Method method) {
        try {
            assertFalse(String.format("%s should be false", method.getName()), (Boolean) method.invoke(def));
        } catch (Exception e) {
            throw new AuraRuntimeException(e);
        }
    }
View Full Code Here

    private void assertTrue(Object def, Method method) {
        try {
            assertTrue(String.format("%s should be true", method.getName()), (Boolean) method.invoke(def));
        } catch (Exception e) {
            throw new AuraRuntimeException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.auraframework.throwable.AuraRuntimeException

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.