Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions com.avaloq.tools.ddk.check.core.test/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,13 @@ Bundle-ActivationPolicy: lazy
Require-Bundle: com.avaloq.tools.ddk.check.core,
com.avaloq.tools.ddk.xtext,
com.avaloq.tools.ddk.xtext.test.core,
com.avaloq.tools.ddk.check.ui,
org.eclipse.xtext,
org.eclipse.xtext.xbase,
org.eclipse.xtext.ui,
org.eclipse.jdt.core,
org.eclipse.core.resources,
org.eclipse.ui,
org.eclipse.ui.ide,
org.eclipse.core.runtime,
org.eclipse.xtext.ui.testing,
org.eclipse.xtext.testing,
org.mockito.mockito-core,
com.avaloq.tools.ddk.check.runtime.core,
org.eclipse.ui.workbench;resolution:=optional,
org.apache.commons.lang3,
org.eclipse.xtext.xbase.testing,
junit-jupiter-api,
Expand Down
5 changes: 0 additions & 5 deletions com.avaloq.tools.ddk.check.core.test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,4 @@

<artifactId>com.avaloq.tools.ddk.check.core.test</artifactId>
<packaging>eclipse-test-plugin</packaging>

<properties>
<tycho.surefire.useUIHarness>true</tycho.surefire.useUIHarness>
<test.reactorConcurrencyLevel>1</test.reactorConcurrencyLevel>
</properties>
</project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import java.util.Set;

import org.apache.commons.lang3.Validate;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
Expand All @@ -44,10 +46,12 @@


/**
* An abstract test class for tests on Check models. Allows creating a project, adding files, and generating and compiling the project.
* An abstract test class for tests which generate and compile Check models in memory.
*/
@SuppressWarnings("nls")
public class AbstractCheckGenerationTestCase extends AbstractCheckTestCase {
public class AbstractCheckGenerationTestCase {

protected static final Logger LOGGER = LogManager.getLogger(AbstractCheckGenerationTestCase.class);

@Inject
private CheckGenerator generator;
Expand Down Expand Up @@ -94,7 +98,7 @@ public List<JavaSource> generateAndCompile(final InputStream sourceStream) {
// Run the generator using an in-memory file system access; member injection wires the
// IFilePostProcessor so the LF ILineSeparatorInformation binding is actually exercised
InMemoryFileSystemAccess fsa = new InMemoryFileSystemAccess();
getInjector().injectMembers(fsa);
injector.injectMembers(fsa);
for (OutputConfiguration output : outputConfigurationProvider.getOutputConfigurations()) {
fsa.getOutputConfigurations().put(output.getName(), output);
}
Expand Down Expand Up @@ -131,9 +135,4 @@ public List<JavaSource> generateAndCompile(final InputStream sourceStream) {
}
}

@Override
protected Injector getInjector() {
return injector;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

import com.avaloq.tools.ddk.check.CheckUiInjectorProvider;
import com.avaloq.tools.ddk.check.core.test.util.RegistryIsolatingCheckInjectorProvider;
import com.avaloq.tools.ddk.check.check.Check;
import com.avaloq.tools.ddk.check.check.CheckCatalog;
import com.avaloq.tools.ddk.check.check.XIssueExpression;
Expand All @@ -32,7 +32,7 @@
import com.google.inject.Inject;


@InjectWith(CheckUiInjectorProvider.class)
@InjectWith(RegistryIsolatingCheckInjectorProvider.class)
@ExtendWith(InjectionExtension.class)
@SuppressWarnings("nls")
public class BasicModelTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import com.avaloq.tools.ddk.check.CheckUiInjectorProvider;
import com.avaloq.tools.ddk.check.core.test.util.RegistryIsolatingCheckInjectorProvider;
import com.avaloq.tools.ddk.check.check.CheckCatalog;
import com.avaloq.tools.ddk.check.check.XIssueExpression;
import com.google.inject.Inject;


@InjectWith(CheckUiInjectorProvider.class)
@InjectWith(RegistryIsolatingCheckInjectorProvider.class)
@ExtendWith(InjectionExtension.class)
@SuppressWarnings("nls")
public class BugAig830Test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import com.avaloq.tools.ddk.check.CheckUiInjectorProvider;
import com.avaloq.tools.ddk.check.core.test.util.RegistryIsolatingCheckInjectorProvider;
import com.google.inject.Inject;

// CHECKSTYLE:CONSTANTS-OFF
@InjectWith(CheckUiInjectorProvider.class)
@InjectWith(RegistryIsolatingCheckInjectorProvider.class)
@ExtendWith(InjectionExtension.class)
@SuppressWarnings("nls")
public class CheckFormattingTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import com.avaloq.tools.ddk.check.CheckUiInjectorProvider;
import com.avaloq.tools.ddk.check.core.test.util.RegistryIsolatingCheckInjectorProvider;
import com.avaloq.tools.ddk.check.check.CheckCatalog;
import com.google.inject.Inject;

@InjectWith(CheckUiInjectorProvider.class)
@InjectWith(RegistryIsolatingCheckInjectorProvider.class)
@ExtendWith(InjectionExtension.class)
@SuppressWarnings("nls")
public class CheckApiAccessValidationsTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import com.avaloq.tools.ddk.check.CheckUiInjectorProvider;
import com.avaloq.tools.ddk.check.core.test.util.RegistryIsolatingCheckInjectorProvider;
import com.google.inject.Inject;


/**
* Tests for com.avaloq.tools.ddk.check.validation.CheckJavaValidatorUtil.
*/

@InjectWith(CheckUiInjectorProvider.class)
@InjectWith(RegistryIsolatingCheckInjectorProvider.class)
@ExtendWith(InjectionExtension.class)
@SuppressWarnings("nls")
public class CheckJavaValidatorUtilTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import com.avaloq.tools.ddk.check.CheckUiInjectorProvider;
import com.avaloq.tools.ddk.check.core.test.util.RegistryIsolatingCheckInjectorProvider;
import com.avaloq.tools.ddk.check.check.CheckCatalog;
import com.avaloq.tools.ddk.check.check.CheckPackage;
import com.avaloq.tools.ddk.check.core.test.util.CheckModelUtil;
Expand All @@ -36,7 +36,7 @@
* <li>com.avaloq.tools.ddk.check.validation.ClasspathBasedChecks
* </ul>
*/
@InjectWith(CheckUiInjectorProvider.class)
@InjectWith(RegistryIsolatingCheckInjectorProvider.class)
@ExtendWith(InjectionExtension.class)
@SuppressWarnings("nls")
public class CheckValidationTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Bundle-SymbolicName: com.avaloq.tools.ddk.check.test.runtime.tests; singleton:=t
Bundle-ActivationPolicy: lazy
Require-Bundle: com.avaloq.tools.ddk.check.runtime.core,
com.avaloq.tools.ddk.check.test.runtime,
com.avaloq.tools.ddk.check.core.test,
com.avaloq.tools.ddk.check.ui.test,
com.avaloq.tools.ddk.check.test.runtime.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.junit.jupiter.api.extension.ExtendWith;

import com.avaloq.tools.ddk.check.TestLanguageUiInjectorProvider;
import com.avaloq.tools.ddk.check.core.test.AbstractCheckTestCase;
import com.avaloq.tools.ddk.check.ui.test.AbstractCheckTestCase;
import com.avaloq.tools.ddk.check.testLanguage.Model;
import com.avaloq.tools.ddk.check.testLanguage.TestLanguagePackage;
import com.avaloq.tools.ddk.check.ui.internal.TestLanguageActivator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.junit.jupiter.api.extension.ExtendWith;

import com.avaloq.tools.ddk.check.TestLanguageUiInjectorProvider;
import com.avaloq.tools.ddk.check.core.test.AbstractCheckTestCase;
import com.avaloq.tools.ddk.check.ui.test.AbstractCheckTestCase;
import com.avaloq.tools.ddk.check.testLanguage.Model;
import com.avaloq.tools.ddk.check.testLanguage.TestLanguagePackage;
import com.avaloq.tools.ddk.check.ui.internal.TestLanguageActivator;
Expand Down
3 changes: 2 additions & 1 deletion com.avaloq.tools.ddk.check.ui.test/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Require-Bundle: com.avaloq.tools.ddk.check.ui,
com.avaloq.tools.ddk.xtext.ui,
com.avaloq.tools.ddk.check.runtime.core,
org.hamcrest
Export-Package: com.avaloq.tools.ddk.check.ui.test.util,
Export-Package: com.avaloq.tools.ddk.check.ui.test,
com.avaloq.tools.ddk.check.ui.test.util,
com.avaloq.tools.ddk.check
Import-Package: org.hamcrest.core,
org.apache.logging.log4j
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Contributors:
* Avaloq Group AG - initial API and implementation
*******************************************************************************/
package com.avaloq.tools.ddk.check.core.test;
package com.avaloq.tools.ddk.check.ui.test;

import static com.google.common.collect.Sets.newHashSet;
import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down Expand Up @@ -307,11 +307,11 @@ protected String getSourceFolderName() {
* created.
*
* @param clazz
* the clazz
* a class in the package which holds the source files
* @param sourceFileNames
* the source file names
*/
public void addSourcesToWorkspace(final Class<? extends AbstractCheckTestCase> clazz, final List<String> sourceFileNames) {
public void addSourcesToWorkspace(final Class<?> clazz, final List<String> sourceFileNames) {
try {
new WorkspaceModifyOperation() {
@Override
Expand Down Expand Up @@ -359,7 +359,7 @@ protected String getSourceFolderPath() {
* @throws IOException
* if model could not be read
*/
private String getNormalizedContents(final Class<? extends AbstractCheckTestCase> clazz, final String modelName) throws IOException {
private String getNormalizedContents(final Class<?> clazz, final String modelName) throws IOException {
try (InputStreamReader s = new InputStreamReader(clazz.getResourceAsStream(modelName), StandardCharsets.UTF_8)) {
return CharStreams.toString(s);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Contributors:
* Avaloq Group AG - initial API and implementation
*******************************************************************************/
package com.avaloq.tools.ddk.check.core.test;
package com.avaloq.tools.ddk.check.ui.test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
Expand All @@ -27,6 +27,7 @@
import com.avaloq.tools.ddk.check.check.CheckCatalog;
import com.avaloq.tools.ddk.check.check.Implementation;
import com.avaloq.tools.ddk.check.check.XIssueExpression;
import com.avaloq.tools.ddk.check.core.test.BugAig1314Test;
import com.avaloq.tools.ddk.check.core.test.util.CheckTestUtil;
import com.google.common.collect.Lists;
import com.google.inject.Inject;
Expand Down Expand Up @@ -54,7 +55,7 @@ public List<String> getRequiredSourceFileNames() {

public void initializeTestProject() {
// sources are copied into the project and then built by the Xtext builder
addSourcesToWorkspace(CheckScopingTest.class, getRequiredSourceFileNames());
addSourcesToWorkspace(BugAig1314Test.class, getRequiredSourceFileNames());
// wait for build to finish, otherwise included catalog may not be resolvable
IResourcesSetupUtil.waitForBuild();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Avaloq Group AG - initial API and implementation
*******************************************************************************/

package com.avaloq.tools.ddk.check.core.test;
package com.avaloq.tools.ddk.check.ui.test;

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand All @@ -30,6 +30,7 @@
import org.junit.jupiter.api.extension.ExtendWith;

import com.avaloq.tools.ddk.check.CheckUiInjectorProvider;
import com.avaloq.tools.ddk.check.core.test.BugDsl27Test;
import com.google.common.collect.Lists;

@SuppressWarnings("nls")
Expand All @@ -55,7 +56,7 @@ public void initializeTestProject() {
if (!initialized) {
initialized = true;
// sources are copied into the project and then built by the Xtext builder
addSourcesToWorkspace(ProjectBasedTests.class, getRequiredSourceFileNames());
addSourcesToWorkspace(BugDsl27Test.class, getRequiredSourceFileNames());

// wait for build to finish, otherwise included catalog may not be resolvable
IResourcesSetupUtil.waitForBuild();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder;
import org.eclipse.xtext.ui.testing.util.ResourceLoadHelper;

import com.avaloq.tools.ddk.check.core.test.AbstractCheckTestCase;
import com.avaloq.tools.ddk.check.ui.test.AbstractCheckTestCase;
import com.avaloq.tools.ddk.xtext.test.PluginTestProjectManager;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.avaloq.tools.ddk.checkcfg.core.test</name>
<name>com.avaloq.tools.ddk.checkcfg.ui.test</name>
<comment></comment>
<projects>
</projects>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: com.avaloq.tools.ddk.checkcfg.core.test
Bundle-Name: com.avaloq.tools.ddk.checkcfg.ui.test
Bundle-Vendor: Avaloq Group AG
Bundle-Version: 17.3.1.qualifier
Bundle-SymbolicName: com.avaloq.tools.ddk.checkcfg.core.test; singleton:=true
Bundle-SymbolicName: com.avaloq.tools.ddk.checkcfg.ui.test; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: com.avaloq.tools.ddk.test.core,
com.avaloq.tools.ddk.check.test.runtime.ui,
Expand All @@ -27,4 +27,4 @@ Require-Bundle: com.avaloq.tools.ddk.test.core,
Import-Package: org.hamcrest.core
Export-Package: com.avaloq.tools.ddk.checkcfg.util
Bundle-RequiredExecutionEnvironment: JavaSE-21
Automatic-Module-Name: com.avaloq.tools.ddk.checkcfg.core.test
Automatic-Module-Name: com.avaloq.tools.ddk.checkcfg.ui.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</parent>
<version>17.3.1-SNAPSHOT</version>

<artifactId>com.avaloq.tools.ddk.checkcfg.core.test</artifactId>
<artifactId>com.avaloq.tools.ddk.checkcfg.ui.test</artifactId>
<packaging>eclipse-test-plugin</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Require-Bundle: com.avaloq.tools.ddk.sample.helloworld,
org.eclipse.ui.workbench;resolution:=optional,
com.avaloq.tools.ddk.check.runtime.core,
com.avaloq.tools.ddk.check.runtime.ui,
com.avaloq.tools.ddk.check.core.test,
com.avaloq.tools.ddk.check.ui.test,
org.eclipse.xtext.xbase.ui.testing,
junit-jupiter-api,
junit-jupiter-engine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import com.avaloq.tools.ddk.check.core.test.AbstractCheckTestCase;
import com.avaloq.tools.ddk.check.ui.test.AbstractCheckTestCase;
import com.avaloq.tools.ddk.sample.helloworld.helloWorld.HelloWorldPackage;
import com.avaloq.tools.ddk.sample.helloworld.helloWorld.Model;
import com.avaloq.tools.ddk.sample.helloworld.ui.HelloWorldUiInjectorProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import com.avaloq.tools.ddk.check.core.test.AbstractCheckTestCase;
import com.avaloq.tools.ddk.check.ui.test.AbstractCheckTestCase;
import com.avaloq.tools.ddk.sample.helloworld.helloWorld.HelloWorldPackage;
import com.avaloq.tools.ddk.sample.helloworld.helloWorld.Model;
import com.avaloq.tools.ddk.sample.helloworld.ui.HelloWorldUiInjectorProvider;
Expand Down
2 changes: 1 addition & 1 deletion ddk-configuration/working-set/ddk.wst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/com.avaloq.tools.ddk.check.runtime.ui" type="4"/>
<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/com.avaloq.tools.ddk.checkcfg.core" type="4"/>
<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/com.avaloq.tools.ddk.checkcfg.ide" type="4"/>
<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/com.avaloq.tools.ddk.checkcfg.core.test" type="4"/>
<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/com.avaloq.tools.ddk.checkcfg.ui.test" type="4"/>
<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/com.avaloq.tools.ddk.checkcfg.ui" type="4"/>
<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/com.avaloq.tools.ddk.check.core" type="4"/>
<item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/com.avaloq.tools.ddk.check.test.runtime.ui" type="4"/>
Expand Down
Loading