package com.arondor.common.reflection.parser.java;

import java.util.Arrays;
import java.util.List;

import org.junit.Assert;
import org.junit.Test;

import com.arondor.common.reflection.api.catalog.AccessibleClassCatalog;
import com.arondor.common.reflection.catalog.SimpleAccessibleClassCatalog;

public class TestDirectoryAccessibleClassParser
{
    @Test
    public void testParseLibsFolder() throws ClassNotFoundException
    {
        AccessibleClassCatalog catalog = new SimpleAccessibleClassCatalog();
        DirectoryAccessibleClassProvider provider = new DirectoryAccessibleClassProvider();
        JavaAccessibleClassParser parser = new JavaAccessibleClassParser();
        parser.setTryInstantiateClassForDefaultValue(true);
        provider.setAccessibleClassParser(parser);

        List<String> packagePrefixes = Arrays.asList("org.junit");
        provider.setPackagePrefixes(packagePrefixes);
        List<String> directories = Arrays.asList("src/test/resources/libs");
        provider.setDirectories(directories);
        provider.provideClasses(catalog);

        Assert.assertNotNull(catalog.getAccessibleClass("org.junit.Test"));
        try
        {
            catalog.getAccessibleClass("org.apache.log4j.Logger");
            Assert.fail();
        }
        catch (ClassNotFoundException e)
        {

        }

    }
}

@@ -1187,36 +1187,26 @@
     
-try%0D%0A        %7B%0D%0A            
+Assert.assertNull(
 cata
@@ -1258,114 +1258,10 @@
 er%22)
+)
 ;
-%0D%0A            Assert.fail();%0D%0A        %7D%0D%0A        catch (ClassNotFoundException e)%0D%0A        %7B%0D%0A%0D%0A        %7D
 %0D%0A%0D%0A

Fix unit test after exception removal