eclipse / Xpect

This repository has been rewritten to move to the Eclipse Foundation. Find the old history here: https://github.com/TypeFox/Xpect
http://www.xpect-tests.org/
Eclipse Public License 2.0
32 stars 28 forks source link

GH-224: Avoid hack for populating go to menu entries for Xpect tests #229

Closed qtran-n4 closed 6 years ago

qtran-n4 commented 6 years ago

Task: https://github.com/eclipse/Xpect/issues/224

qtran-n4 commented 6 years ago

@meysholdt

However, the following does not work:

screen shot 2018-01-29 at 15 35 45
qtran-n4 commented 6 years ago

@meysholdt Good catch Moritz. I am stuck then :( How can we calculate the URI to an Xpect method while providing short labels for Xpect methods in the ResultView tree. Any idea?

meysholdt commented 6 years ago

To run an individual test maybe Xpect could filter out all sibling tests but keep the parent test suites. However, if we're unlucky Xpect does this already and it's JDT that removes the parent test suites.

qtran-n4 commented 6 years ago

It's JDT that does not create a TestSuiteElement node if a single Xpect test is executed (cf. TestRunSession#createTestElement)

    public TestElement createTestElement(TestSuiteElement parent, String id, String testName, boolean isSuite, int testCount) {
        TestElement testElement;
        if (isSuite) {
            TestSuiteElement testSuiteElement= new TestSuiteElement(parent, id, testName, testCount);
            testElement= testSuiteElement;
            if (testCount > 0)
                fIncompleteTestSuites.add(new IncompleteTestSuite(testSuiteElement, testCount));
        } else {
            testElement= new TestCaseElement(parent, id, testName);
        }
        fIdToTest.put(id, testElement);
        return testElement;
    }
qtran-n4 commented 6 years ago

@meysholdt I have included in resource URI in the labels for Xpect test methods. For readability, I show the Xpect test method name + optional comment on the right hand side and put the resource URI inside a special brackets.

screen shot 2018-02-06 at 16 40 18
qtran-n4 commented 6 years ago

@yoosiba @meysholdt Please have a second look