test_class.declarator: ejbOp = new EJBOperations()
test_class.original_string: EJBOperations ejbOp = new EJBOperations();
test_class.type: EJBOperations
test_class.var_name: ejbOp
test_class.file: javaee/impl/src/test/java/org/jboss/forge/addon/javaee/ejb/EJBOperationsTest.java
test_class.identifier: EJBOperationsTest
test_case.body: @Test
     public void testSetupMessageDrivenBean()
     {
        JavaClassSource mdb = Roaster.create(JavaClassSource.class).setName("FooMDB");
        ejbOp.setupMessageDrivenBean(mdb, JMSDestinationType.QUEUE, "queue/foo");
        Assert.assertThat(mdb.hasAnnotation(MessageDriven.class), is(true));
        Assert.assertThat(mdb.getInterfaces(), hasItem("javax.jms.MessageListener"));
        AnnotationSource<JavaClassSource> annotation = mdb.getAnnotation(MessageDriven.class);
        AnnotationSource<JavaClassSource> configs[] = annotation.getAnnotationArrayValue("activationConfig");
        Assert.assertThat(configs.length, equalTo(2));
        Assert.assertThat(configs[0].getStringValue("propertyName"), equalTo("destinationType"));
        Assert.assertThat(configs[0].getStringValue("propertyValue"), equalTo("javax.jms.Queue"));
  
        Assert.assertThat(configs[1].getStringValue("propertyName"), equalTo("destination"));
        Assert.assertThat(configs[1].getStringValue("propertyValue"), equalTo("queue/foo"));
     }
test_case.class_method_signature: EJBOperationsTest.testSetupMessageDrivenBean()
test_case.full_signature: @Test public void testSetupMessageDrivenBean()
test_case.identifier: testSetupMessageDrivenBean
test_case.invocations: setName create setupMessageDrivenBean assertThat hasAnnotation is assertThat getInterfaces hasItem getAnnotation getAnnotationArrayValue assertThat equalTo assertThat getStringValue equalTo assertThat getStringValue equalTo assertThat getStringValue equalTo assertThat getStringValue equalTo
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSetupMessageDrivenBean()
focal_class.file: javaee/impl/src/main/java/org/jboss/forge/addon/javaee/ejb/EJBOperations.java
focal_class.identifier: EJBOperations
focal_class.class_method_signature: EJBOperations.newEJB(
              final Project project,
              final String ejbName,
              final String targetPackage,
              final EJBType ejbType,
              final boolean serializable)
focal_class.full_signature: public JavaResource newEJB(
              final Project project,
              final String ejbName,
              final String targetPackage,
              final EJBType ejbType,
              final boolean serializable)
focal_class.identifier: newEJB
focal_class.modifiers: public
focal_class.parameters: (
              final Project project,
              final String ejbName,
              final String targetPackage,
              final EJBType ejbType,
              final boolean serializable)
focal_class.return: JavaResource
focal_class.signature: JavaResource newEJB(
              final Project project,
              final String ejbName,
              final String targetPackage,
              final EJBType ejbType,
              final boolean serializable)
focal_class.class_method_signature: EJBOperations.newEJB(DirectoryResource target,
              final String ejbName,
              final String ejbPackage,
              final EJBType ejbType,
              final boolean serializable)
focal_class.full_signature: public JavaResource newEJB(DirectoryResource target,
              final String ejbName,
              final String ejbPackage,
              final EJBType ejbType,
              final boolean serializable)
focal_class.identifier: newEJB
focal_class.modifiers: public
focal_class.parameters: (DirectoryResource target,
              final String ejbName,
              final String ejbPackage,
              final EJBType ejbType,
              final boolean serializable)
focal_class.return: JavaResource
focal_class.signature: JavaResource newEJB(DirectoryResource target,
              final String ejbName,
              final String ejbPackage,
              final EJBType ejbType,
              final boolean serializable)
focal_class.class_method_signature: EJBOperations.createJavaClass(
              final String className,
              final String classPackage,
              final EJBType type,
              boolean serializable)
focal_class.full_signature: private JavaClassSource createJavaClass(
              final String className,
              final String classPackage,
              final EJBType type,
              boolean serializable)
focal_class.identifier: createJavaClass
focal_class.modifiers: private
focal_class.parameters: (
              final String className,
              final String classPackage,
              final EJBType type,
              boolean serializable)
focal_class.return: JavaClassSource
focal_class.signature: JavaClassSource createJavaClass(
              final String className,
              final String classPackage,
              final EJBType type,
              boolean serializable)
focal_class.class_method_signature: EJBOperations.setupMessageDrivenBean(JavaClassSource ejb, JMSDestinationType destType, String destName)
focal_class.full_signature: public JavaClassSource setupMessageDrivenBean(JavaClassSource ejb, JMSDestinationType destType, String destName)
focal_class.identifier: setupMessageDrivenBean
focal_class.modifiers: public
focal_class.parameters: (JavaClassSource ejb, JMSDestinationType destType, String destName)
focal_class.return: JavaClassSource
focal_class.signature: JavaClassSource setupMessageDrivenBean(JavaClassSource ejb, JMSDestinationType destType, String destName)
focal_class.class_method_signature: EJBOperations.getJavaResource(final DirectoryResource sourceDir, final String relativePath)
focal_class.full_signature: private JavaResource getJavaResource(final DirectoryResource sourceDir, final String relativePath)
focal_class.identifier: getJavaResource
focal_class.modifiers: private
focal_class.parameters: (final DirectoryResource sourceDir, final String relativePath)
focal_class.return: JavaResource
focal_class.signature: JavaResource getJavaResource(final DirectoryResource sourceDir, final String relativePath)
focal_class.class_method_signature: EJBOperations.isEJB(JavaType<?> javaType)
focal_class.full_signature: public boolean isEJB(JavaType<?> javaType)
focal_class.identifier: isEJB
focal_class.modifiers: public
focal_class.parameters: (JavaType<?> javaType)
focal_class.return: boolean
focal_class.signature: boolean isEJB(JavaType<?> javaType)
focal_class.class_method_signature: EJBOperations.addActivationConfigProperty(JavaClassSource ejb, String name, String value)
focal_class.full_signature: public void addActivationConfigProperty(JavaClassSource ejb, String name, String value)
focal_class.identifier: addActivationConfigProperty
focal_class.modifiers: public
focal_class.parameters: (JavaClassSource ejb, String name, String value)
focal_class.return: void
focal_class.signature: void addActivationConfigProperty(JavaClassSource ejb, String name, String value)
focal_class.class_method_signature: EJBOperations.removeActivationConfigProperty(JavaClassSource target, String name)
focal_class.full_signature: public void removeActivationConfigProperty(JavaClassSource target, String name)
focal_class.identifier: removeActivationConfigProperty
focal_class.modifiers: public
focal_class.parameters: (JavaClassSource target, String name)
focal_class.return: void
focal_class.signature: void removeActivationConfigProperty(JavaClassSource target, String name)
focal_method.body: public JavaClassSource setupMessageDrivenBean(JavaClassSource ejb, JMSDestinationType destType, String destName)
     {
        Assert.notNull(destType, "JMS Destination type must not be null when bean is Message Driven");
        Assert.notNull(destName, "JMS Destination name must not be null when bean is Message Driven");
  
        AnnotationSource<JavaClassSource> annotation = ejb.getAnnotation(EJBType.MESSAGEDRIVEN.getAnnotation());
        if (annotation == null)
        {
           annotation = ejb.addAnnotation(EJBType.MESSAGEDRIVEN.getAnnotation());
        }
        if (destType != null && destName != null)
        {
           ejb.addImport(ActivationConfigProperty.class);
           ejb.addImport(Message.class);
           ejb.implementInterface(MessageListener.class);
           annotation.setLiteralValue("name", "\"" + ejb.getName() + "\"")
                    .setLiteralValue(
                             "activationConfig",
                             "{@ActivationConfigProperty(propertyName = \"destinationType\", propertyValue = \""
                                      + destType.getDestinationType()
                                      + "\"), "
                                      + "@ActivationConfigProperty(propertyName = \"destination\", propertyValue = \""
                                      + destName + "\")" + "}");
        }
  
        return ejb;
     }
focal_method.class_method_signature: EJBOperations.setupMessageDrivenBean(JavaClassSource ejb, JMSDestinationType destType, String destName)
focal_method.full_signature: public JavaClassSource setupMessageDrivenBean(JavaClassSource ejb, JMSDestinationType destType, String destName)
focal_method.identifier: setupMessageDrivenBean
focal_method.invocations: notNull notNull getAnnotation getAnnotation addAnnotation getAnnotation addImport addImport implementInterface setLiteralValue setLiteralValue getName getDestinationType
focal_method.modifiers: public
focal_method.parameters: (JavaClassSource ejb, JMSDestinationType destType, String destName)
focal_method.return: JavaClassSource
focal_method.signature: JavaClassSource setupMessageDrivenBean(JavaClassSource ejb, JMSDestinationType destType, String destName)