Search in sources :

Example 1 with BugTest

use of com.avaloq.tools.ddk.test.core.BugTest in project dsl-devkit by dsldevkit.

the class FixedIssueFilter method shouldRun.

/**
 * {@inheritDoc}
 */
@Override
public boolean shouldRun(final Description description) {
    if (FilterRegistry.isSuite(description)) {
        return true;
    }
    // else: test class or test method
    final Issues issuesAnnotation = description.getAnnotation(Issues.class);
    if (issuesAnnotation != null) {
        for (final Issue issueAnnotation : issuesAnnotation.value()) {
            if (issueAnnotation != null && !issueAnnotation.fixed()) {
                return false;
            }
        }
    }
    final Issue issueAnnotation = description.getAnnotation(Issue.class);
    if (issueAnnotation != null && !issueAnnotation.fixed()) {
        return false;
    }
    final BugTest bugTestAnnotation = description.getAnnotation(BugTest.class);
    if (bugTestAnnotation != null && bugTestAnnotation.unresolved()) {
        return false;
    }
    // if it is a test class we still want to check (and maybe run) its children
    return FilterRegistry.isTestMethod(description);
}
Also used : Issue(com.avaloq.tools.ddk.test.core.Issue) BugTest(com.avaloq.tools.ddk.test.core.BugTest) Issues(com.avaloq.tools.ddk.test.core.Issues)

Example 2 with BugTest

use of com.avaloq.tools.ddk.test.core.BugTest in project dsl-devkit by dsldevkit.

the class UnresolvedIssueFilter method shouldRun.

/**
 * {@inheritDoc}
 */
@Override
public boolean shouldRun(final Description description) {
    if (FilterRegistry.isSuite(description)) {
        return true;
    }
    // else: test class or test method
    final Issues issuesAnnotation = description.getAnnotation(Issues.class);
    if (issuesAnnotation != null) {
        for (final Issue issueAnnotation : issuesAnnotation.value()) {
            if (issueAnnotation != null && !issueAnnotation.fixed()) {
                return true;
            }
        }
    }
    final Issue issueAnnotation = description.getAnnotation(Issue.class);
    if (issueAnnotation != null && !issueAnnotation.fixed()) {
        return true;
    }
    final BugTest bugTestAnnotation = description.getAnnotation(BugTest.class);
    if (bugTestAnnotation != null && bugTestAnnotation.unresolved()) {
        return true;
    }
    // if it is a test class we still want to check (and maybe run) its children
    return FilterRegistry.isTestClass(description);
}
Also used : Issue(com.avaloq.tools.ddk.test.core.Issue) BugTest(com.avaloq.tools.ddk.test.core.BugTest) Issues(com.avaloq.tools.ddk.test.core.Issues)

Example 3 with BugTest

use of com.avaloq.tools.ddk.test.core.BugTest in project dsl-devkit by dsldevkit.

the class ShortFragmentProviderTest method testLongFragment.

@Test
@BugTest(value = "DSL-601")
public void testLongFragment() {
    int reps = 100;
    EObject root = EcoreUtil.create(testClass);
    EObject parent = root;
    for (int i = 0; i < reps; i++) {
        EObject child = EcoreUtil.create(testClass);
        parent.eSet(testReference, child);
        parent = child;
    }
    ResourceImpl resource = new ResourceImpl();
    resource.getContents().add(root);
    String fragment = fragmentProvider.getFragment(parent, fragmentFallback);
    Assert.assertEquals("/0*" + (reps + 1), fragment);
    Assert.assertEquals(parent, fragmentProvider.getEObject(resource, fragment, fragmentFallback));
}
Also used : ResourceImpl(org.eclipse.emf.ecore.resource.impl.ResourceImpl) EObject(org.eclipse.emf.ecore.EObject) BugTest(com.avaloq.tools.ddk.test.core.BugTest) BugTest(com.avaloq.tools.ddk.test.core.BugTest) Test(org.junit.Test) AbstractTest(com.avaloq.tools.ddk.xtext.test.AbstractTest)

Example 4 with BugTest

use of com.avaloq.tools.ddk.test.core.BugTest in project dsl-devkit by dsldevkit.

the class CheckProjectWizardTest method testNextButtonChangesPage.

/**
 * Tests that applying the next button changes the wizard page.
 */
@Test
@BugTest("AIG-479")
public void testNextButtonChangesPage() {
    wizard.writeToTextField(Messages.PROJECT_NAME_LABEL, "a.b");
    SWTBotShell projectPage = wizard.shell(Messages.PROJECT_WIZARD_WINDOW_TITLE);
    wizard.changeToNextPage();
    SWTBotShell catalogPage = wizard.shell(Messages.PROJECT_WIZARD_WINDOW_TITLE);
    assertNotSame("Next button changed page", projectPage, catalogPage);
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) BugTest(com.avaloq.tools.ddk.test.core.BugTest) BugTest(com.avaloq.tools.ddk.test.core.BugTest) Test(org.junit.Test)

Aggregations

BugTest (com.avaloq.tools.ddk.test.core.BugTest)4 Issue (com.avaloq.tools.ddk.test.core.Issue)2 Issues (com.avaloq.tools.ddk.test.core.Issues)2 Test (org.junit.Test)2 AbstractTest (com.avaloq.tools.ddk.xtext.test.AbstractTest)1 EObject (org.eclipse.emf.ecore.EObject)1 ResourceImpl (org.eclipse.emf.ecore.resource.impl.ResourceImpl)1 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)1