Package jadx.tests.integration.invoke

Source Code of jadx.tests.integration.invoke.TestSuperInvoke$B

package jadx.tests.integration.invoke;

import jadx.core.dex.nodes.ClassNode;
import jadx.tests.api.IntegrationTest;

import org.junit.Test;

import static jadx.tests.api.utils.JadxMatchers.countString;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;

public class TestSuperInvoke extends IntegrationTest {

  public class A {
    public int a() {
      return 1;
    }
  }

  public class B extends A {
    @Override
    public int a() {
      return super.a() + 2;
    }

    public int test() {
      return a();
    }
  }

  public void check() {
    assertEquals(3, new B().test());
  }

  @Test
  public void test() {
    noDebugInfo();
    ClassNode cls = getClassNode(TestSuperInvoke.class);
    String code = cls.getCode().toString();

    assertThat(code, countString(2, "return super.a() + 2;"));
  }
}
TOP

Related Classes of jadx.tests.integration.invoke.TestSuperInvoke$B

TOP
Copyright © 2018 www.massapi.com. 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.