Example usage for org.objectweb.asm.tree MethodNode MethodNode

List of usage examples for org.objectweb.asm.tree MethodNode MethodNode

Introduction

In this page you can find the example usage for org.objectweb.asm.tree MethodNode MethodNode.

Prototype

public MethodNode() 

Source Link

Document

Constructs an uninitialized MethodNode .

Usage

From source file:org.apache.felix.ipojo.manipulator.metadata.annotation.visitor.bind.MethodBindVisitorTestCase.java

License:Apache License

public void testIdentifierProvided() throws Exception {
    Reporter reporter = mock(Reporter.class);
    ComponentWorkbench workbench = new ComponentWorkbench(null, type());
    MethodNode node = new MethodNode();
    node.name = "myMethod";

    MethodBindVisitor visitor = new MethodBindVisitor(workbench, Action.BIND, node, reporter);
    visitor.visit("id", "my-identifier");
    visitor.visitEnd();/* w w w .j a v a 2  s .  c om*/

    assertNotNull(workbench.getIds().get("my-identifier"));
}

From source file:org.apache.felix.ipojo.manipulator.metadata.annotation.visitor.bind.MethodBindVisitorTestCase.java

License:Apache License

public void testNoIdentifierButSpecificationAsAttributeProvided() throws Exception {
    Reporter reporter = mock(Reporter.class);
    ComponentWorkbench workbench = new ComponentWorkbench(null, type());
    MethodNode node = new MethodNode();
    node.name = "notify";
    node.desc = "()V";

    MethodBindVisitor visitor = new MethodBindVisitor(workbench, Action.BIND, node, reporter);
    visitor.visit("specification", "my.Service");
    visitor.visitEnd();/*from w  w  w. ja v a 2s  . c  o m*/

    assertNotNull(workbench.getIds().get("my.Service"));
}

From source file:org.apache.felix.ipojo.manipulator.metadata.annotation.visitor.bind.MethodBindVisitorTestCase.java

License:Apache License

public void testNoIdentifierAndNoSpecificationProvided() throws Exception {
    Reporter reporter = mock(Reporter.class);
    ComponentWorkbench workbench = new ComponentWorkbench(null, type());
    MethodNode node = new MethodNode();
    node.name = "notify";
    node.desc = "()V";

    MethodBindVisitor visitor = new MethodBindVisitor(workbench, Action.BIND, node, reporter);
    visitor.visitEnd();/*  w ww. ja v a  2  s . c  o  m*/

    verify(reporter).error(anyString(), anyVararg());
}

From source file:org.apache.felix.ipojo.manipulator.metadata.annotation.visitor.util.NamesTestCase.java

License:Apache License

public void testBindPatternRecognition() throws Exception {
    MethodNode node = new MethodNode();
    node.name = "bindService";
    assertEquals("Service", getMethodIdentifier(node));
}

From source file:org.apache.felix.ipojo.manipulator.metadata.annotation.visitor.util.NamesTestCase.java

License:Apache License

public void testUnbindPatternRecognition() throws Exception {
    MethodNode node = new MethodNode();
    node.name = "unbindService";
    assertEquals("Service", getMethodIdentifier(node));
}

From source file:org.apache.felix.ipojo.manipulator.metadata.annotation.visitor.util.NamesTestCase.java

License:Apache License

public void testSetPatternRecognition() throws Exception {
    MethodNode node = new MethodNode();
    node.name = "setService";
    assertEquals("Service", getMethodIdentifier(node));
}

From source file:org.apache.felix.ipojo.manipulator.metadata.annotation.visitor.util.NamesTestCase.java

License:Apache License

public void testUnsetPatternRecognition() throws Exception {
    MethodNode node = new MethodNode();
    node.name = "unsetService";
    assertEquals("Service", getMethodIdentifier(node));
}

From source file:org.apache.felix.ipojo.manipulator.metadata.annotation.visitor.util.NamesTestCase.java

License:Apache License

public void testAddPatternRecognition() throws Exception {
    MethodNode node = new MethodNode();
    node.name = "addService";
    assertEquals("Service", getMethodIdentifier(node));
}

From source file:org.apache.felix.ipojo.manipulator.metadata.annotation.visitor.util.NamesTestCase.java

License:Apache License

public void testRemovePatternRecognition() throws Exception {
    MethodNode node = new MethodNode();
    node.name = "removeService";
    assertEquals("Service", getMethodIdentifier(node));
}

From source file:org.apache.felix.ipojo.manipulator.metadata.annotation.visitor.util.NamesTestCase.java

License:Apache License

public void testModifiedPatternRecognition() throws Exception {
    MethodNode node = new MethodNode();
    node.name = "modifiedService";
    assertEquals("Service", getMethodIdentifier(node));
}