FileDocCategorySizeDatePackage
MergeConflictTest.javaAPI DocAndroid 5.1 API1612Thu Mar 12 22:18:30 GMT 2015com.android.dx.merge

MergeConflictTest

public final class MergeConflictTest extends TestCase

Fields Summary
Constructors Summary
Methods Summary
private com.android.dex.DexresourceToDexBuffer(java.lang.String resource)

        return new Dex(getClass().getResourceAsStream(resource));
    
public voidtestMergeConflict()

        Dex a = resourceToDexBuffer("/testdata/A.dex");
        Dex b = resourceToDexBuffer("/testdata/B.dex");

        // a and b don't overlap; this should succeed
        Dex ab = new DexMerger(a, b, CollisionPolicy.FAIL).merge();

        // a and ab overlap; this should fail
        DexMerger dexMerger = new DexMerger(a, ab, CollisionPolicy.FAIL);
        try {
            dexMerger.merge();
            fail();
        } catch (DexException expected) {
            assertEquals("Multiple dex files define Ltestdata/A;", expected.getMessage());
        }