public void testDiscouraedDefaultPackage() throws Exception {
   GroovyRuntime.removeGroovyNature(fJProject.getProject());
   NewClassWizardPage wizardPage = new NewClassWizardPage();
   wizardPage.setPackageFragmentRoot(fSourceFolder, true);
   assertStatus(
       IStatus.WARNING, "The use of the default package is discouraged.", wizardPage.getStatus());
 }
 public void testNotGroovyProject() throws Exception {
   GroovyRuntime.removeGroovyNature(fJProject.getProject());
   IPackageFragment frag = fProject.createPackage("test1");
   NewClassWizardPage wizardPage = new NewClassWizardPage();
   wizardPage.setPackageFragmentRoot(fSourceFolder, true);
   wizardPage.setPackageFragment(frag, true);
   assertStatus(
       IStatus.WARNING,
       "is not a groovy project.  Groovy Nature will be added to project upon completion.",
       wizardPage.getStatus());
 }
 @Override
 protected void setUp() throws Exception {
   super.setUp();
   createGenericProject();
   IProject project = getDefaultProject();
   AbstractDSLInferencingTest.refreshExternalFoldersProject();
   GroovyRuntime.addLibraryToClasspath(
       JavaCore.create(project), GroovyDSLCoreActivator.CLASSPATH_CONTAINER_ID, false);
   env.fullBuild();
   new RefreshDSLDJob(project).run(null);
   GroovyDSLCoreActivator.getDefault().getContainerListener().ignoreProject(project);
 }
  public List<IJavaCompletionProposal> getQuickFixProposals() {
    IJavaProject project = getQuickFixProblem().getCompilationUnit().getJavaProject();
    List<IJavaCompletionProposal> proposals = new ArrayList<IJavaCompletionProposal>(2);
    try {
      if (!GroovyRuntime.hasGroovyClasspathContainer(project)) {
        proposals.add(new AddGroovyRuntimeProposal(project, getQuickFixProblem(), 100));
        return proposals;
      }
    } catch (CoreException e) {
      GroovyCore.logWarning("Problem calculating quickfixes", e);
    }

    return null;
  }
 public void apply(IDocument document) {
   GroovyRuntime.addGroovyClasspathContainer(project);
 }