package patdroid.smali;

import org.junit.Assert;
import org.junit.Test;
import patdroid.core.Scope;

import java.io.File;

public class SmaliLoaderTest {
    private static final File FRAMEWORK_CLASSES_FOLDER = new File("apilevels");
    private static final int API_LEVEL = 19;
    private final Scope scope = new Scope();

    @Test
    public void testLoadFrameworkClasses() {
        SmaliClassDetailLoader ldr = SmaliClassDetailLoader.fromFramework(FRAMEWORK_CLASSES_FOLDER, API_LEVEL);
        if (ldr == null) {
            System.out.println("framework classes loader test skipped, API19 not available");
            return ;
        }
        ldr.loadAll(scope);
        Assert.assertNotNull(scope.findClass("android.app.Activity"));
        Assert.assertNotNull(scope.findClass("android.view.View"));
        Assert.assertNull(scope.findClass("android.bluetooth.le.ScanResult")); // api21
    }
}

@@ -801,24 +801,261 @@
 ew.View%22));%0A
+        Assert.assertTrue(scope.findClass(%22android.view.View%22).isConvertibleTo(scope.findClass(%22java.lang.Object%22)));%0A        Assert.assertFalse(scope.findClass(%22java.lang.Object%22).isConvertibleTo(scope.findClass(%22android.view.View%22)));%0A
         Asse

add convertibility tests