Skip to content

Commit

Permalink
Add support for trait, script, etc. in New Type Wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Dec 26, 2018
1 parent 9efa6c3 commit f30ccdb
Show file tree
Hide file tree
Showing 22 changed files with 2,435 additions and 2,733 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ import org.junit.runners.Suite
org.codehaus.groovy.eclipse.test.ui.HighlightingExtenderTests,
org.codehaus.groovy.eclipse.test.ui.OutlineExtenderTests,
org.codehaus.groovy.eclipse.test.ui.SemanticHighlightingTests,
org.codehaus.groovy.eclipse.test.wizards.NewGroovyTestCaseWizardTests,
org.codehaus.groovy.eclipse.test.wizards.NewGroovyTestWizardTests,
org.codehaus.groovy.eclipse.test.wizards.NewGroovyTypeWizardTests
])
final class AllGroovyTests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Export-Package: org.codehaus.groovy.eclipse.test,
org.codehaus.groovy.eclipse.test.wizards
Import-Package: org.codehaus.groovy.eclipse.codebrowsing.requestor,
org.codehaus.groovy.eclipse.refactoring.formatter,
org.codehaus.groovy.frameworkadapter.util,
org.eclipse.debug.core,
org.eclipse.debug.core.model,
org.eclipse.debug.internal.ui,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import static org.codehaus.jdt.groovy.model.GroovyNature.GROOVY_NATURE
import static org.junit.Assert.assertEquals

import org.codehaus.groovy.eclipse.test.GroovyEclipseTestSuite
import org.codehaus.groovy.eclipse.wizards.NewGroovyTestTypeWizardPage
import org.codehaus.groovy.eclipse.wizards.NewTestWizard
import org.eclipse.core.runtime.NullProgressMonitor
import org.eclipse.jdt.core.JavaCore
import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants
Expand All @@ -29,7 +29,7 @@ import org.eclipse.jdt.junit.wizards.NewTestCaseWizardPageTwo
import org.junit.Before
import org.junit.Test

final class NewGroovyTestCaseWizardTests extends GroovyEclipseTestSuite {
final class NewGroovyTestWizardTests extends GroovyEclipseTestSuite {

@Before
void setUp() {
Expand All @@ -41,7 +41,7 @@ final class NewGroovyTestCaseWizardTests extends GroovyEclipseTestSuite {
void testCreateGroovyTestCase_NotGroovyProject() {
removeNature(GROOVY_NATURE)
try {
def wizardPage = newGroovyTestTypeWizardPage()
def wizardPage = newTestWizardPage1()
wizardPage.setTypeName('NonGroovyProjectTestCase', true)
wizardPage.createType(new NullProgressMonitor())

Expand All @@ -53,7 +53,7 @@ final class NewGroovyTestCaseWizardTests extends GroovyEclipseTestSuite {

@Test
void testCreateGroovyTestCase_YesGroovyProject() {
def wizardPage = newGroovyTestTypeWizardPage()
def wizardPage = newTestWizardPage1()
wizardPage.setTypeName('GroovyProjectTestCase', true)
wizardPage.createType(new NullProgressMonitor())

Expand All @@ -71,7 +71,7 @@ final class NewGroovyTestCaseWizardTests extends GroovyEclipseTestSuite {

@Test
void testCreateGroovyTestCase_SetUpAndTearDown() {
def wizardPage = newGroovyTestTypeWizardPage()
def wizardPage = newTestWizardPage1()
wizardPage.setTypeName('GroovyProjectTestCase', true)
wizardPage.setStubSelection('setUp', true)
wizardPage.setStubSelection('tearDown', true)
Expand Down Expand Up @@ -101,8 +101,8 @@ final class NewGroovyTestCaseWizardTests extends GroovyEclipseTestSuite {

//--------------------------------------------------------------------------

private NewGroovyTestTypeWizardPage newGroovyTestTypeWizardPage() {
def wizardPage = new NewGroovyTestTypeWizardPage(new NewTestCaseWizardPageTwo())
private NewTestWizard.PageOne newTestWizardPage1() {
def wizardPage = new NewTestWizard.PageOne(new NewTestCaseWizardPageTwo())
wizardPage.setPackageFragmentRoot(getPackageFragmentRoot(), true)
wizardPage.setPackageFragment(getPackageFragment('test'), true)
wizardPage.setEnclosingTypeSelection(false, true)
Expand Down
Loading

0 comments on commit f30ccdb

Please sign in to comment.