Package org.eclipse.ltk.core.refactoring

Examples of org.eclipse.ltk.core.refactoring.Change


        multiChange.addAll(changes);
      }
    }

    //unless there are actually new changes return null
    Change result = null;
    if(multiChange.getChildren().length > 0) {
      result = multiChange;
    }
   
    return result;
View Full Code Here


        "javax.persistence.Query query = entityManager.createQuery(\"SELECT p from Product p where p.name = ?1\");\r\n" +
        "query.getResultList();";
   
    facade.changeInvocationsTo("org.superbiz.ProductHome", "findBy", new String[] { "java.lang.String"}, code); //$NON-NLS-1$
   
    Change change = facade.getChange();
    change.perform(new NullProgressMonitor());

    assertEquals(fixture.getStreamContent(getClass().getResourceAsStream(expectedFilename)), fixture.getClassContents(bean)); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

  public void testShouldAddAnAnnotationToAJavaSourceFile() throws Exception {
    addNewClassToProject("org.apache.openejb.test.TestBean1", fixture.getStreamContent(getClass().getResourceAsStream("Test1.txt"))); //$NON-NLS-1$ //$NON-NLS-2$
    JDTFacade facade = new JDTFacade(fixture.getProject());
    facade.addClassAnnotation("org.apache.openejb.test.TestBean1", Stateless.class, null); //$NON-NLS-1$
   
    Change change = facade.getChange();
    FakeProgressMonitor progressMonitor = new FakeProgressMonitor();
    change.perform(progressMonitor);

    assertEquals(fixture.getStreamContent(getClass().getResourceAsStream("ExpectedResult1.txt")), getClassContents("org.apache.openejb.test.TestBean1")); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

    addNewClassToProject("org.apache.openejb.test.TestBean2", fixture.getStreamContent(getClass().getResourceAsStream("Test2.txt"))); //$NON-NLS-1$ //$NON-NLS-2$
   
    JDTFacade facade = new JDTFacade(fixture.getProject());
    facade.addClassAnnotation("org.apache.openejb.test.TestBean2", Stateless.class, null); //$NON-NLS-1$
   
    Change change = facade.getChange();
    FakeProgressMonitor progressMonitor = new FakeProgressMonitor();
    change.perform(progressMonitor);
   
    assertEquals(fixture.getStreamContent(getClass().getResourceAsStream("ExpectedResult2.txt")), getClassContents("org.apache.openejb.test.TestBean2")); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

  public void testShouldAddAnAnnotationToAJavaSourceFileAndNotAddAnImportIfThePackageIsAlreadyImported() throws Exception {
    addNewClassToProject("org.apache.openejb.test.TestBean3", fixture.getStreamContent(getClass().getResourceAsStream("Test3.txt"))); //$NON-NLS-1$ //$NON-NLS-2$
    JDTFacade facade = new JDTFacade(fixture.getProject());
    facade.addClassAnnotation("org.apache.openejb.test.TestBean3", Stateless.class, null); //$NON-NLS-1$
   
    Change change = facade.getChange();
    FakeProgressMonitor progressMonitor = new FakeProgressMonitor();
    change.perform(progressMonitor);
   
    assertEquals(fixture.getStreamContent(getClass().getResourceAsStream("ExpectedResult3.txt")), getClassContents("org.apache.openejb.test.TestBean3")); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

    properties.put("name", "Test"); //$NON-NLS-1$ //$NON-NLS-2$

    JDTFacade facade = new JDTFacade(fixture.getProject());
    facade.addClassAnnotation("org.apache.openejb.test.TestBean4", Entity.class, properties); //$NON-NLS-1$
   
    Change change = facade.getChange();
    FakeProgressMonitor progressMonitor = new FakeProgressMonitor();
    change.perform(progressMonitor);
   
    assertEquals(fixture.getStreamContent(getClass().getResourceAsStream("ExpectedResult4.txt")), getClassContents("org.apache.openejb.test.TestBean4")); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

    properties.put("value", TransactionManagementType.BEAN); //$NON-NLS-1$

    JDTFacade facade = new JDTFacade(fixture.getProject());
    facade.addClassAnnotation("org.apache.openejb.test.TestBean5", TransactionManagement.class, properties); //$NON-NLS-1$
   
    Change change = facade.getChange();
    FakeProgressMonitor progressMonitor = new FakeProgressMonitor();
    change.perform(progressMonitor);
   
    assertEquals(fixture.getStreamContent(getClass().getResourceAsStream("ExpectedResult5.txt")), getClassContents("org.apache.openejb.test.TestBean5")); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

    addNewClassToProject("org.apache.openejb.test.TestBean6", fixture.getStreamContent(getClass().getResourceAsStream("Test6.txt"))); //$NON-NLS-1$ //$NON-NLS-2$

    JDTFacade facade = new JDTFacade(fixture.getProject());
    facade.addMethodAnnotation("org.apache.openejb.test.TestBean6", "echoHelloWorld", new String[] {"java.lang.String"}, ManyToMany.class, null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
   
    Change change = facade.getChange();
    FakeProgressMonitor progressMonitor = new FakeProgressMonitor();
    change.perform(progressMonitor);
   
    assertEquals(fixture.getStreamContent(getClass().getResourceAsStream("ExpectedResult6.txt")), getClassContents("org.apache.openejb.test.TestBean6")); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

    JDTFacade facade = new JDTFacade(fixture.getProject());
    Map<String, Object> properties = new HashMap<String,Object>();
    properties.put("value", new String[] { "org.apache.openejb.test.Test7" }); //$NON-NLS-1$ //$NON-NLS-2$
    facade.addClassAnnotation("org.apache.openejb.test.TestBean7", Remote.class, properties); //$NON-NLS-1$
   
    Change change = facade.getChange();
    FakeProgressMonitor progressMonitor = new FakeProgressMonitor();
    change.perform(progressMonitor);
   
    assertEquals(fixture.getStreamContent(getClass().getResourceAsStream("ExpectedResult7.txt")), getClassContents("org.apache.openejb.test.TestBean7")); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

   
    properties.put("activationConfig", new Map[] { activationConfigProperty }); //$NON-NLS-1$
   
    facade.addClassAnnotation("org.apache.openejb.test.TestBean8", MessageDriven.class, properties); //$NON-NLS-1$
   
    Change change = facade.getChange();
    FakeProgressMonitor progressMonitor = new FakeProgressMonitor();
    change.perform(progressMonitor);
   
    assertEquals(fixture.getStreamContent(getClass().getResourceAsStream("ExpectedResult8.txt")), getClassContents("org.apache.openejb.test.TestBean8")); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ltk.core.refactoring.Change

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.