Skip to content

Commit

Permalink
changed names of JUnit test cases
Browse files Browse the repository at this point in the history
So that they match what surefire expects by default

Change-Id: I249e39e91c2d1f38fba56362ed2e9a0fad6dd4fe
  • Loading branch information
LorenzoBettini committed Nov 25, 2016
1 parent b4133b8 commit f35feb6
Show file tree
Hide file tree
Showing 19 changed files with 109 additions and 118 deletions.
8 changes: 0 additions & 8 deletions dsl/org.eclipse.emf.parsley.dsl.tests/pom.xml
Expand Up @@ -40,14 +40,6 @@
<!-- tycho.testArgLine repeated to re-use the configuration for argLine
for jacoco agent -->
<argLine>${tycho.testArgLine} ${memoryArgs}</argLine>
<includes>
<include>**/org/eclipse/emf/parsley/dsl/tests/*Tests.java</include>
<include>**/org/eclipse/emf/parsley/dsl/tests/*Test.java</include>
</includes>
<excludes>
<exclude>**/org/eclipse/emf/parsley/dsl/tests/*AllTests.java</exclude>
<exclude>**/org/eclipse/emf/parsley/dsl/tests/*AbstractTests.java</exclude>
</excludes>
</configuration>
<goals>
<goal>test</goal>
Expand Down
Expand Up @@ -24,53 +24,52 @@ import org.junit.runner.RunWith

import static extension org.junit.Assert.*

@RunWith(typeof(XtextRunner))
@InjectWith(typeof(EmfParsleyDslInjectorProvider))
class EmfParsleyDslAbstractTests {
@RunWith(XtextRunner)
@InjectWith(EmfParsleyDslInjectorProvider)
abstract class EmfParsleyDslAbstractTest {

@Inject
protected TestInputs inputs

@Inject
protected TestInputsWithErrors inputsWithErrors

@Inject extension ParseHelper<Model>
@Inject extension ValidationTestHelper
@BeforeClass

@Inject extension ValidationTestHelper

@BeforeClass
def static void setCRLF() {
System::setProperty("line.separator", "\n")
}
def parseAndAssertNoError(CharSequence s) {

def parseAndAssertNoError(CharSequence s) {
var ts = s.parse
ts.assertNoErrors
ts
}

def parseAndAssertError(CharSequence s, EClass objectType, String code,
String messagePart) {
s.parse.assertError(objectType, code, messagePart)

def parseAndAssertError(CharSequence s, EClass objectType, String code, String messagePart) {
s.parse.assertError(objectType, code, messagePart)
}

def parseModel(CharSequence s) {
s.parse
}

def parseAndAssertErrors(CharSequence s) {
(s.parse.validate.size > 0).assertTrue
}

def module(CharSequence s) {
s.parseAndAssertNoError.module
}

def assertEqualsStrings(Object expected, Object actual) {
assertEquals("" + expected, "" + actual)
}

def partSpecification(CharSequence s) {
s.module.partsSpecifications.parts.head
}
}
}
Expand Up @@ -19,21 +19,21 @@
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
EmfParsleyDslGeneratorUtilsTests.class,
EmfParsleyDslGeneratorUtilsTest.class,
EmfParsleyDslParsingTest.class,
EmfParsleyDslGuiceModuleHelperTests.class,
EmfParsleyDslSmokeTests.class,
EmfParsleyDslScopingTests.class,
EmfParsleyDslValidatorTests.class,
EmfParsleyDslPluginXmlGeneratorTests.class,
EmfParsleyDslGeneratorTests.class,
EmfParsleyDslOrganizeImportsTests.class,
EmfParsleyDslNewProjectFilesTests.class,
EmfParsleyProjectFilesGeneratorUtilTests.class,
EmfParsleyTemplateWizardConfigurationTests.class,
EmfParsleyTemplateWizardConfigurationFactoryTests.class,
EmfParsleyDslFormatterTests.class,
EmfParsleyDslPluginXmlLoaderTests.class
EmfParsleyDslGuiceModuleHelperTest.class,
EmfParsleyDslSmokeTest.class,
EmfParsleyDslScopingTest.class,
EmfParsleyDslValidatorTest.class,
EmfParsleyDslPluginXmlGeneratorTest.class,
EmfParsleyDslGeneratorTest.class,
EmfParsleyDslOrganizeImportsTest.class,
EmfParsleyDslNewProjectFilesTest.class,
EmfParsleyProjectFilesGeneratorUtilTest.class,
EmfParsleyTemplateWizardConfigurationTest.class,
EmfParsleyTemplateWizardConfigurationFactoryTest.class,
EmfParsleyDslFormatterTest.class,
EmfParsleyDslPluginXmlLoaderTest.class
})
public class EmfParsleyDslAllTests {

Expand Down
Expand Up @@ -17,9 +17,9 @@ import org.eclipse.xtext.junit4.formatter.FormatterTester
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(typeof(XtextRunner))
@InjectWith(typeof(EmfParsleyDslInjectorProvider))
class EmfParsleyDslFormatterTests extends EmfParsleyDslAbstractTests {
@RunWith(XtextRunner)
@InjectWith(EmfParsleyDslInjectorProvider)
class EmfParsleyDslFormatterTest extends EmfParsleyDslAbstractTest {

@Inject extension FormatterTester

Expand Down
Expand Up @@ -26,13 +26,13 @@ import org.junit.runner.RunWith

import static org.junit.Assert.*

@RunWith(typeof(XtextRunner))
@InjectWith(typeof(EmfParsleyDslInjectorProviderCustom))
class EmfParsleyDslGeneratorTests extends EmfParsleyDslAbstractTests {
@RunWith(XtextRunner)
@InjectWith(EmfParsleyDslInjectorProviderCustom)
class EmfParsleyDslGeneratorTest extends EmfParsleyDslAbstractTest {

@Rule
@Inject public TemporaryFolder temporaryFolder

@Inject extension CompilationTestHelper

@Test
Expand Down
Expand Up @@ -15,7 +15,7 @@ import org.junit.Test
import static extension org.junit.Assert.*
import org.eclipse.emf.parsley.dsl.jvmmodel.EmfParsleyDslGeneratorUtils

class EmfParsleyDslGeneratorUtilsTests {
class EmfParsleyDslGeneratorUtilsTest {

extension EmfParsleyDslGeneratorUtils utils = new EmfParsleyDslGeneratorUtils

Expand Down
Expand Up @@ -21,13 +21,13 @@ import org.junit.runner.RunWith

import static extension org.junit.Assert.*

@RunWith(typeof(XtextRunner))
@InjectWith(typeof(EmfParsleyDslInjectorProvider))
class EmfParsleyDslGuiceModuleHelperTests extends EmfParsleyDslAbstractTests {
@RunWith(XtextRunner)
@InjectWith(EmfParsleyDslInjectorProvider)
class EmfParsleyDslGuiceModuleHelperTest extends EmfParsleyDslAbstractTest {

@Inject extension ParseHelper<Model>
@Inject extension EmfParsleyDslGuiceModuleHelper
@Inject extension EmfParsleyDslGuiceModuleHelper

@Test
def void testModuleWithNoNameInferredType() {
'''
Expand Down
Expand Up @@ -8,7 +8,7 @@ import static extension org.junit.Assert.*
/**
* @author Lorenzo Bettini - Initial contribution and API
*/
class EmfParsleyDslNewProjectFilesTests {
class EmfParsleyDslNewProjectFilesTest {

val generator = new EmfParsleyDslNewProjectFiles

Expand Down
Expand Up @@ -26,10 +26,10 @@ import static org.junit.Assert.*
/**
* @author Lorenzo Bettini - inspired by the Xtext Domainmodel example
*/
@RunWith(typeof(XtextRunner))
@InjectWith(typeof(EmfParsleyDslInjectorProvider))
class EmfParsleyDslOrganizeImportsTests {
@RunWith(XtextRunner)
@InjectWith(EmfParsleyDslInjectorProvider)
class EmfParsleyDslOrganizeImportsTest {

@Inject extension ParseHelper<Model>
@Inject ImportOrganizer importOrganizer

Expand Down
Expand Up @@ -14,7 +14,7 @@ import org.junit.runner.RunWith

@RunWith(XtextRunner)
@InjectWith(EmfParsleyDslInjectorProvider)
class EmfParsleyDslParsingTest extends EmfParsleyDslAbstractTests {
class EmfParsleyDslParsingTest extends EmfParsleyDslAbstractTest {

@Inject extension ValidationTestHelper

Expand Down
Expand Up @@ -21,9 +21,9 @@ import org.eclipse.xtext.junit4.XtextRunner
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(typeof(XtextRunner))
@InjectWith(typeof(EmfParsleyDslInjectorProvider))
class EmfParsleyDslPluginXmlGeneratorTests extends EmfParsleyDslAbstractTests {
@RunWith(XtextRunner)
@InjectWith(EmfParsleyDslInjectorProvider)
class EmfParsleyDslPluginXmlGeneratorTest extends EmfParsleyDslAbstractTest {

@Inject EmfParsleyDslPluginXmlGenerator pluginXmlGenerator

Expand Down
Expand Up @@ -10,7 +10,7 @@ import static extension org.junit.Assert.*
import org.eclipse.xtend2.lib.StringConcatenation
import org.eclipse.emf.parsley.dsl.pluginxml.PluginXmlUtils

class EmfParsleyDslPluginXmlLoaderTests {
class EmfParsleyDslPluginXmlLoaderTest {

new() {
// to avoid missed code coverage for the protected constructor
Expand Down
Expand Up @@ -19,10 +19,10 @@
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
EmfParsleyDslNewProjectFilesTests.class,
EmfParsleyProjectFilesGeneratorUtilTests.class,
EmfParsleyTemplateWizardConfigurationTests.class,
EmfParsleyTemplateWizardConfigurationFactoryTests.class
EmfParsleyDslNewProjectFilesTest.class,
EmfParsleyProjectFilesGeneratorUtilTest.class,
EmfParsleyTemplateWizardConfigurationTest.class,
EmfParsleyTemplateWizardConfigurationFactoryTest.class
})
public class EmfParsleyDslProjectWizardAllTests {

Expand Down
Expand Up @@ -22,9 +22,9 @@ import org.junit.runner.RunWith

import static org.junit.Assert.*

@RunWith(typeof(XtextRunner))
@InjectWith(typeof(EmfParsleyDslInjectorProvider))
class EmfParsleyDslScopingTests extends EmfParsleyDslAbstractTests {
@RunWith(XtextRunner)
@InjectWith(EmfParsleyDslInjectorProvider)
class EmfParsleyDslScopingTest extends EmfParsleyDslAbstractTest {

@Inject extension IScopeProvider

Expand Down

0 comments on commit f35feb6

Please sign in to comment.