// Path: core/src/main/java/org/apache/commons/jci2/problems/CompilationProblem.java
// public interface CompilationProblem {
// 
//     /**
//      * is the problem an error and compilation cannot continue
//      * or just a warning and compilation can proceed
//      *
//      * @return true if the problem is an error
//      */
//     boolean isError();
// 
//     /**
//      * name of the file where the problem occurred
//      *
//      * @return name of the file where the problem occurred
//      */
//     String getFileName();
// 
//     /**
//      * position of where the problem starts in the source code
//      *
//      * @return position of where the problem starts in the source code
//      */
//     int getStartLine();
//     int getStartColumn();
// 
//     /**
//      * position of where the problem stops in the source code
//      *
//      * @return position of where the problem stops in the source code
//      */
//     int getEndLine();
//     int getEndColumn();
// 
//     /**
//      * the description of the problem
//      *
//      * @return the description of the problem
//      */
//     String getMessage();
// 
// }
// 
// Path: core/src/main/java/org/apache/commons/jci2/readers/ResourceReader.java
// public interface ResourceReader {
// 
//     boolean isAvailable( final String pResourceName );
//     byte[] getBytes( final String pResourceName );
// 
// }
// 
// Path: core/src/main/java/org/apache/commons/jci2/stores/MemoryResourceStore.java
// public final class MemoryResourceStore implements ResourceStore {
// 
//     private final Log log = LogFactory.getLog(MemoryResourceStore.class);
// 
//     private final Map<String, byte[]> store = new HashMap<String, byte[]>();
// 
//     public byte[] read( final String pResourceName ) {
//         log.debug("reading resource " + pResourceName);
//         return store.get(pResourceName);
//     }
// 
//     public void write( final String pResourceName, final byte[] pData ) {
//         log.debug("writing resource " + pResourceName + "(" + pData.length + ")");
//         store.put(pResourceName, pData);
//     }
// 
//     public void remove( final String pResourceName ) {
//         log.debug("removing resource " + pResourceName);
//         store.remove(pResourceName);
//     }
// 
//     /**
//      * @deprecated
//      */
//     @Deprecated
//     public String[] list() {
//         if (store == null) {
//             return new String[0];
//         }
//         final List<String> names = new ArrayList<String>();
// 
//         for (final String name : store.keySet()) {
//             names.add(name);
//         }
// 
//         return names.toArray(new String[store.size()]);
//     }
// 
//     @Override
//     public String toString() {
//         return this.getClass().getName() + store.toString();
//     }
// }


import java.util.HashMap;
import java.util.Map;
import junit.framework.TestCase;
import org.apache.commons.jci2.problems.CompilationProblem;
import org.apache.commons.jci2.readers.ResourceReader;
import org.apache.commons.jci2.stores.MemoryResourceStore;
               return sources.get(pResourceName);
           }

           public boolean isAvailable( final String pResourceName ) {
               return sources.containsKey(pResourceName);
           }
        };

        final MemoryResourceStore store = new MemoryResourceStore();
        final CompilationResult result = compiler.compile(
               new String[] {
                       "jci2/Simple.java"
               }, reader, store);

        assertEquals("Unexpected errors(s): " + toString(result.getErrors()), 0, result.getErrors().length);

        final byte[] clazzBytes = store.read("jci2/Simple.class");
        assertNotNull("Expected to find jci2/Simple.class", clazzBytes);
        assertTrue(clazzBytes.length > 0);

        final byte[] additionalTopLevelBytes = store.read("jci2/AdditionalTopLevel.class");
        assertNotNull("Expected to find jci2/AdditionalTopLevel.class", additionalTopLevelBytes);
        assertTrue(additionalTopLevelBytes.length > 0);

        assertEquals("Unexpected warning(s): " + toString(result.getWarnings()), 0, result.getWarnings().length);
    }

    public final String toString( final CompilationProblem[] pProblems ) {
        final StringBuilder sb = new StringBuilder();

// Path: core/src/main/java/org/apache/commons/jci2/problems/CompilationProblem.java
// public interface CompilationProblem {
// 
//     /**
//      * is the problem an error and compilation cannot continue
//      * or just a warning and compilation can proceed
//      *
//      * @return true if the problem is an error
//      */
//     boolean isError();
// 
//     /**
//      * name of the file where the problem occurred
//      *
//      * @return name of the file where the problem occurred
//      */
//     String getFileName();
// 
//     /**
//      * position of where the problem starts in the source code
//      *
//      * @return position of where the problem starts in the source code
//      */
//     int getStartLine();
//     int getStartColumn();
// 
//     /**
//      * position of where the problem stops in the source code
//      *
//      * @return position of where the problem stops in the source code
//      */
//     int getEndLine();
//     int getEndColumn();
// 
//     /**
//      * the description of the problem
//      *
//      * @return the description of the problem
//      */
//     String getMessage();
// 
// }
// 
// Path: core/src/main/java/org/apache/commons/jci2/readers/ResourceReader.java
// public interface ResourceReader {
// 
//     boolean isAvailable( final String pResourceName );
//     byte[] getBytes( final String pResourceName );
// 
// }
// 
// Path: core/src/main/java/org/apache/commons/jci2/stores/MemoryResourceStore.java
// public final class MemoryResourceStore implements ResourceStore {
// 
//     private final Log log = LogFactory.getLog(MemoryResourceStore.class);
// 
//     private final Map<String, byte[]> store = new HashMap<String, byte[]>();
// 
//     public byte[] read( final String pResourceName ) {
//         log.debug("reading resource " + pResourceName);
//         return store.get(pResourceName);
//     }
// 
//     public void write( final String pResourceName, final byte[] pData ) {
//         log.debug("writing resource " + pResourceName + "(" + pData.length + ")");
//         store.put(pResourceName, pData);
//     }
// 
//     public void remove( final String pResourceName ) {
//         log.debug("removing resource " + pResourceName);
//         store.remove(pResourceName);
//     }
// 
//     /**
//      * @deprecated
//      */
//     @Deprecated
//     public String[] list() {
//         if (store == null) {
//             return new String[0];
//         }
//         final List<String> names = new ArrayList<String>();
// 
//         for (final String name : store.keySet()) {
//             names.add(name);
//         }
// 
//         return names.toArray(new String[store.size()]);
//     }
// 
//     @Override
//     public String toString() {
//         return this.getClass().getName() + store.toString();
//     }
// }


// Path: core/src/test/java/org/apache/commons/jci2/compilers/AbstractCompilerTestCase.java
import java.util.HashMap;
import java.util.Map;
import junit.framework.TestCase;
import org.apache.commons.jci2.problems.CompilationProblem;
import org.apache.commons.jci2.readers.ResourceReader;
import org.apache.commons.jci2.stores.MemoryResourceStore;

               return sources.get(pResourceName);
           }

           public boolean isAvailable( final String pResourceName ) {
               return sources.containsKey(pResourceName);
           }
        };

        final MemoryResourceStore store = new MemoryResourceStore();
        final CompilationResult result = compiler.compile(
               new String[] {
                       "jci2/Simple.java"
               }, reader, store);

        assertEquals("Unexpected errors(s): " + toString(result.getErrors()), 0, result.getErrors().length);

        final byte[] clazzBytes = store.read("jci2/Simple.class");
        assertNotNull("Expected to find jci2/Simple.class", clazzBytes);
        assertTrue(clazzBytes.length > 0);

        final byte[] additionalTopLevelBytes = store.read("jci2/AdditionalTopLevel.class");
        assertNotNull("Expected to find jci2/AdditionalTopLevel.class", additionalTopLevelBytes);
        assertTrue(additionalTopLevelBytes.length > 0);

        assertEquals("Unexpected warning(s): " + toString(result.getWarnings()), 0, result.getWarnings().length);
    }

    public final String toString( final CompilationProblem[] pProblems ) {
        final StringBuilder sb = new StringBuilder();

        for (final CompilationProblem problem : pProblems) {