Spectrum support

46 views
Skip to first unread message

Manav Brar

unread,
Jul 24, 2017, 7:19:21 PM7/24/17
to Xtend Programming Language

import static com.greghaskins.spectrum.dsl.gherkin.Gherkin.example;


import static com.greghaskins.spectrum.dsl.gherkin.Gherkin.feature;


import static com.greghaskins.spectrum.dsl.gherkin.Gherkin.given;


import static com.greghaskins.spectrum.dsl.gherkin.Gherkin.then;


import static com.greghaskins.spectrum.dsl.gherkin.Gherkin.when;


import static com.greghaskins.spectrum.dsl.gherkin.Gherkin.withExamples;


import static java.util.Arrays.asList;




import org.junit.runner.RunWith;




import com.greghaskins.spectrum.Spectrum;




import static com.greghaskins.spectrum.dsl.gherkin.Gherkin.scenarioOutline;




@RunWith(Spectrum.class)


public class MaxPairWIzeTest {


  {


    feature("find the max pair wise product", () -> {


      scenarioOutline("intialise evaluation with", (inputSample, resultOutput) -> {




        given("some integers: " + asList(inputSample), () -> {




        });




        when("computing the max pairwise product", () -> {




        });




        then("the result should be " + resultOutput, () -> {




        });


      }, withExamples(example(new int[] { 3, 4, 81, 1 }, 324L), example(new int[] { 5, 7, 2, 8 }, 56L)));


    });


  }


}


I can't seem to cover this kind of code to a Xtend file is there a workaround https://github.com/greghaskins/spectrum 

Sven Efftinge (sven@efftinge.de)

unread,
Jul 25, 2017, 2:21:38 AM7/25/17
to xtend...@googlegroups.com
Did you try right click on the java file in the navigator and run "Convert to Xtend"?
Otherwise, please be specific about which part you don't know how to translate.

--
You received this message because you are subscribed to the Google Groups "Xtend Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xtend-lang+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Manav Brar

unread,
Jul 26, 2017, 8:53:18 PM7/26/17
to Xtend Programming Language
sorry, got an error when I convert to extend I figured providing code example would help in replicating the issue

class SomClass{
 
{
    feature
('some feature' [])
 
}
}

so you see all Spectrum tests require that outer level of curly braces and Xtend does not know what to do with it!
To unsubscribe from this group and stop receiving emails from it, send an email to xtend-lang+...@googlegroups.com.

Christian Dietrich

unread,
Jul 27, 2017, 2:08:22 AM7/27/17
to Xtend Programming Language
Xtend does not support initialization blocks (static initializers as well)
=> j2x has no strategy to deal with that.
can you please file an issue at https://github.com/eclipse/xtext-xtend/issues

Sven Efftinge (sven@efftinge.de)

unread,
Jul 28, 2017, 2:27:26 AM7/28/17
to xtend...@googlegroups.com
You can move that code into the constructor.

--
You received this message because you are subscribed to the Google Groups "Xtend Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xtend-lang+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages