Package org.eclipse.ltk.core.refactoring

Examples of org.eclipse.ltk.core.refactoring.Change.perform()


            HaxeRenameProcessor processor = getAppropriateProcessor(node, newName);
            Change change = processor.createChange(null);
            IProgressMonitor monitor = new NullProgressMonitor();
            if (processor.checkFinalConditions(monitor, null).isOK())
            {
                change.perform(monitor);               
            }
        }
        catch (ClassCastException  e)
        {
            System.out.println(e.getMessage());
View Full Code Here


        "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

    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$
  }
 
  public void testShouldAddAnAnnotationToAJavaSourceFileAndNotAddAnImportIfTheImportAlreadyExists() throws Exception {
View Full Code Here

    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$
  }

  public void testShouldAddAnAnnotationToAJavaSourceFileAndNotAddAnImportIfThePackageIsAlreadyImported() throws Exception {
View Full Code Here

    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$
  }

  public void testShouldAddAnnotationWithProperties() throws Exception {
View Full Code Here

    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$
  }

  public void testShouldAddAnnotationWithEnumProperty() throws Exception {
View Full Code Here

    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$
  }

  public void testShouldAddMethodAnnotationWithEnumProperty() throws Exception {
View Full Code Here

    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$
  }
 
  public void testShouldAddAnnotationWithClassAttributeWithStringPassedIn() throws Exception {
View Full Code Here

    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$
  }

  public void testShouldAddAnnotationWithNestedAttributes() throws Exception {
View Full Code Here

   
    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$
  }
 
  /* (non-Javadoc)
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.