Search in sources :

Example 11 with MethodNode

use of org.objectweb.asm.tree.MethodNode in project felix by apache.

the class NamesTestCase method testAddPatternRecognition.

public void testAddPatternRecognition() throws Exception {
    MethodNode node = new MethodNode();
    node.name = "addService";
    assertEquals("Service", getMethodIdentifier(node));
}
Also used : MethodNode(org.objectweb.asm.tree.MethodNode)

Example 12 with MethodNode

use of org.objectweb.asm.tree.MethodNode in project felix by apache.

the class NamesTestCase method testSpecificationRecognizedWithMap.

public void testSpecificationRecognizedWithMap() throws Exception {
    MethodNode node = new MethodNode();
    node.name = "handle";
    node.desc = "(Lmy/Service;Ljava/util/Map;)V";
    assertEquals("my.Service", getMethodIdentifier(node));
}
Also used : MethodNode(org.objectweb.asm.tree.MethodNode)

Example 13 with MethodNode

use of org.objectweb.asm.tree.MethodNode in project felix by apache.

the class NamesTestCase method testSpecificationRecognizedWithServiceReference.

public void testSpecificationRecognizedWithServiceReference() throws Exception {
    MethodNode node = new MethodNode();
    node.name = "handle";
    node.desc = "(Lmy/Service;Lorg/osgi/framework/ServiceReference;)V";
    assertEquals("my.Service", getMethodIdentifier(node));
}
Also used : MethodNode(org.objectweb.asm.tree.MethodNode)

Example 14 with MethodNode

use of org.objectweb.asm.tree.MethodNode in project felix by apache.

the class NamesTestCase method testRemovePatternRecognition.

public void testRemovePatternRecognition() throws Exception {
    MethodNode node = new MethodNode();
    node.name = "removeService";
    assertEquals("Service", getMethodIdentifier(node));
}
Also used : MethodNode(org.objectweb.asm.tree.MethodNode)

Example 15 with MethodNode

use of org.objectweb.asm.tree.MethodNode in project felix by apache.

the class NamesTestCase method testModifiedPatternRecognition.

public void testModifiedPatternRecognition() throws Exception {
    MethodNode node = new MethodNode();
    node.name = "modifiedService";
    assertEquals("Service", getMethodIdentifier(node));
}
Also used : MethodNode(org.objectweb.asm.tree.MethodNode)

Aggregations

MethodNode (org.objectweb.asm.tree.MethodNode)322 ClassNode (org.objectweb.asm.tree.ClassNode)123 Test (org.junit.Test)94 AbstractInsnNode (org.objectweb.asm.tree.AbstractInsnNode)59 ClassReader (org.objectweb.asm.ClassReader)57 InsnList (org.objectweb.asm.tree.InsnList)49 MethodInsnNode (org.objectweb.asm.tree.MethodInsnNode)47 Label (org.objectweb.asm.Label)44 VarInsnNode (org.objectweb.asm.tree.VarInsnNode)41 InsnNode (org.objectweb.asm.tree.InsnNode)34 ClassWriter (org.objectweb.asm.ClassWriter)26 FieldNode (org.objectweb.asm.tree.FieldNode)26 JumpInsnNode (org.objectweb.asm.tree.JumpInsnNode)26 ArrayList (java.util.ArrayList)24 FieldInsnNode (org.objectweb.asm.tree.FieldInsnNode)24 LdcInsnNode (org.objectweb.asm.tree.LdcInsnNode)21 LabelNode (org.objectweb.asm.tree.LabelNode)19 TypeInsnNode (org.objectweb.asm.tree.TypeInsnNode)19 List (java.util.List)17 Type (org.objectweb.asm.Type)17