Package org.apache.openejb.devtools.core

Examples of org.apache.openejb.devtools.core.JDTFacade


    super.tearDown();
  }

  public void testShouldConvertEjbCreateMethodToAConstructor() throws Exception {
    fixture.addClassToProject("org.superbiz.ProductBean", fixture.getStreamContent(getClass().getResourceAsStream("Ejb21ProductBean.txt"))); //$NON-NLS-1$ //$NON-NLS-2$
    JDTFacade facade = new JDTFacade(fixture.getProject());
    facade.convertMethodToConstructor("org.superbiz.ProductBean", "ejbCreate", new String[] { "java.lang.Integer", "java.lang.String", "java.lang.String", "java.lang.String"}); //$NON-NLS-1$
   
    Change change = facade.getChange();
    change.perform(new NullProgressMonitor());

    assertEquals(fixture.getStreamContent(getClass().getResourceAsStream("Expected30ProductBean.txt")), fixture.getClassContents("org.superbiz.ProductBean")); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here


    fixture.addClassToProject("org.superbiz.ProductBean", fixture.getStreamContent(getClass().getResourceAsStream("Ejb21ProductBean.txt"))); //$NON-NLS-1$ //$NON-NLS-2$
    fixture.addClassToProject("org.superbiz.ProductHome", fixture.getStreamContent(getClass().getResourceAsStream("Ejb21ProductHome.txt"))); //$NON-NLS-1$ //$NON-NLS-2$
    fixture.addClassToProject("org.superbiz.SessionBean", fixture.getStreamContent(getClass().getResourceAsStream("Ejb21SessionBean.txt"))); //$NON-NLS-1$ //$NON-NLS-2$
    fixture.addClassToProject("org.superbiz.Product", fixture.getStreamContent(getClass().getResourceAsStream("Ejb21Product.txt"))); //$NON-NLS-1$ //$NON-NLS-2$
   
    JDTFacade facade = new JDTFacade(fixture.getProject());
    String[] signature = new String[] { "java.lang.Integer", "java.lang.String", "java.lang.String", "java.lang.String" };
    facade.changeInvocationsToConstructor("org.superbiz.ProductHome", "create", signature, "org.superbiz.ProductBean");

    Change change = facade.getChange();
    change.perform(new NullProgressMonitor());

    assertEquals(fixture.getStreamContent(getClass().getResourceAsStream("ExpectedSessionBean.txt")), fixture.getClassContents("org.superbiz.SessionBean")); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

          String bean = (String) marker.getAttribute(ISingletonDependencyMarker.BEAN);
          String[] dependencies = (String[]) marker.getAttribute(ISingletonDependencyMarker.DEPENDENCIES);
         
          IProject project = marker.getResource().getProject();

          JDTFacade facade = new JDTFacade(project);
          Map<String, Object> properties = new HashMap<String, Object>();
          properties.put("value", dependencies);
         
          facade.removeClassAnnotation(bean, DependsOn.class);
         
          if (dependencies != null && dependencies.length > 0) {
            facade.addClassAnnotation(bean, DependsOn.class, properties);
          }
         
          facade.getChange().perform(new NullProgressMonitor());
         
        } catch (JavaModelException e) {
          e.printStackTrace();
        } catch (CoreException e) {
          e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.apache.openejb.devtools.core.JDTFacade

Copyright © 2018 www.massapicom. 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.