Package org.apache.commons.jci.readers

Examples of org.apache.commons.jci.readers.ResourceReader


    }

    public void testSimpleCompile() throws Exception {
        final JavaCompiler compiler = createJavaCompiler();

        final ResourceReader reader = new ResourceReader() {
            final private Map<String, byte[]> sources = new HashMap<String, byte[]>() {
                private static final long serialVersionUID = 1L;
                {
                    put("jci/Simple.java", (
                        "package jci;\n" +
View Full Code Here


    }

    public void testExtendedCompile() throws Exception {
        final JavaCompiler compiler = createJavaCompiler();

        final ResourceReader reader = new ResourceReader() {
            final private Map<String, byte[]> sources = new HashMap<String, byte[]>() {
                private static final long serialVersionUID = 1L;
                {
                    put("jci/Simple.java", (
                            "package jci;\n" +
View Full Code Here

    }

    public void testInternalClassCompile() throws Exception {
        final JavaCompiler compiler = createJavaCompiler();

        final ResourceReader reader = new ResourceReader() {
            final private Map<String, byte[]> sources = new HashMap<String, byte[]>() {
                private static final long serialVersionUID = 1L;
                {
                    put("jci/Simple.java", (
                            "package jci;\n" +
View Full Code Here

    }

    public void testUppercasePackageNameCompile() throws Exception {
        final JavaCompiler compiler = createJavaCompiler();

        final ResourceReader reader = new ResourceReader() {
            final private Map<String, byte[]> sources = new HashMap<String, byte[]>() {
                private static final long serialVersionUID = 1L;
                {
                    put("Jci/Simple.java", (
                            "package Jci;\n" +
View Full Code Here

    public void testCrossReferenceCompilation() throws Exception {
      final String javaVersion = System.getProperty("java.version");

      final JavaCompiler compiler = createJavaCompiler();

        final ResourceReader reader = new ResourceReader() {
            final private Map<String, byte[]> sources = new HashMap<String, byte[]>() {
                private static final long serialVersionUID = 1L;
                {
                    put("jci/Func1.java", (
                            "package jci;\n" +
View Full Code Here

     * https://issues.apache.org/jira/browse/JCI-59
     */
    public void testAdditionalTopLevelClassCompile() throws Exception {
        final JavaCompiler compiler = createJavaCompiler();
   
        final ResourceReader reader = new ResourceReader() {
           final private Map<String, byte[]> sources = new HashMap<String, byte[]>() {
               private static final long serialVersionUID = 1L;
               {
                   put("jci/Simple.java", (
                       "package jci;\n" +
View Full Code Here

    @Override
    public void testSimpleCompile() throws Exception {
        final JavaCompiler compiler = createJavaCompiler();

        final ResourceReader reader = new ResourceReader() {
            final private Map<String, byte[]> sources = new HashMap<String, byte[]>() {
                private static final long serialVersionUID = 1L;
                {
                    put("jci/Simple.js", (
                            " var i = 0;\n" +
View Full Code Here

    @Override
    public void testUppercasePackageNameCompile() throws Exception {
        final JavaCompiler compiler = createJavaCompiler();

        final ResourceReader reader = new ResourceReader() {
            final private Map<String, byte[]> sources = new HashMap<String, byte[]>() {
                private static final long serialVersionUID = 1L;
                {
                    put("Jci/Simple.js", (
                            " var i = 0;\n" +
View Full Code Here

            } else if ("Xmaxwarns".equals(option.getOpt())) {
                maxwarns = Integer.parseInt(option.getValue());
            }
        }

        final ResourceReader reader = new FileResourceReader(sourcepath);
        final ResourceStore store = new FileResourceStore(targetpath);
       
        final int maxErrors = maxerrs;
        final int maxWarnings = maxwarns;
        compiler.setCompilationProblemHandler(new CompilationProblemHandler() {
View Full Code Here

    }

    public FileInputStreamProxy(String pName) throws FileNotFoundException {
        name = ConversionUtils.getResourceNameFromFileName(pName);

        final ResourceReader reader = (ResourceReader) readerThreadLocal.get();

        if (reader == null) {
            throw new RuntimeException("forgot to set the ResourceReader for this thread?");
        }

        final byte[] bytes = reader.getBytes(name);

        if (bytes == null) {
            throw new FileNotFoundException(name);
        }
View Full Code Here

TOP

Related Classes of org.apache.commons.jci.readers.ResourceReader

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.