Nested testRunners: Can I runClasses separating tests?Unit Testing C CodeHow do you assert that a certain exception is thrown in JUnit 4 tests?What is Unit test, Integration Test, Smoke test, Regression Test?What's the difference between unit, functional, acceptance, and integration tests?Getting no result when run through cucumber. Trying to implement BDDCan't find how to run Cucumber step testsHow to mark Cucumber JUnit step as failed but continueCucumber cannot be resolved to a typeRunListener equivalent in TestNG

Is the Microsoft recommendation to use C# properties applicable to game development?

Is a suspension needed to do wheelies?

Why do aircraft leave cruising altitude long before landing just to circle?

Parse a simple key=value config file in C

What should we do with manuals from the 80s?

What's the point of writing that I know will never be used or read?

What is the purpose/function of this power inductor in parallel?

A+ rating still unsecure by Google Chrome's opinion

How should you gracefully leave a company you helped start?

Vegetarian dishes on Russian trains (European part)

If it isn't [someone's name]!

Units of measurement, especially length, when body parts vary in size among races

Why is the battery jumpered to a resistor in this schematic?

Does Medium Armor's Max dex also put a cap on the negative side?

What was the intention with the Commodore 128?

Reducing contention in thread-safe LruCache

If I am sleeping clutching on to something, how easy is it to steal that item?

global variant of csname…endcsname

programming a recursive formula into Mathematica and find the nth position in the sequence

May the tower use the runway while an emergency aircraft is inbound?

Unconventional examples of mathematical modelling

Meaning and structure of headline "Hair it is: A List of ..."

How to train a replacement without them knowing?

When does The Truman Show take place?



Nested testRunners: Can I runClasses separating tests?


Unit Testing C CodeHow do you assert that a certain exception is thrown in JUnit 4 tests?What is Unit test, Integration Test, Smoke test, Regression Test?What's the difference between unit, functional, acceptance, and integration tests?Getting no result when run through cucumber. Trying to implement BDDCan't find how to run Cucumber step testsHow to mark Cucumber JUnit step as failed but continueCucumber cannot be resolved to a typeRunListener equivalent in TestNG






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















background



I am building a small frame using Cucumber and Junit-quickcheck.
Guidelines require writing the scenarios in cucumber and I want to add the possibility of running property based tests. With quicktheories this works fine, but there are some bugs there and it's maintained by a single person so I'd like to switch to junit-quickcheck.



the question



The code works fine but the two tests are now run as one, and in the cucumber report it's not possible to identify them. So what I'd like is to find a way to write the pbt-tests in the PBT class (not as a class for each test!) and then execute them with cucumber as separate tests.



I suppose there should be a way using the TestClass maybe, but I haven't been able to get that working.



Here is my code that runs, but only as described:



public class Steps implements En 
public Scenario scenario;



public Steps()

Given("^I exeute a pbt$", () ->
System.out.println("Lets run the pbt");
Result res = JUnitCore.runClasses(PBT.class);
assertThat(res.getFailures().toString(), res.wasSuccessful(), equalTo(true));
);


}


and:



@RunWith(JUnitQuickcheck.class)
public class PBT
@Property public void concatenationLength(String s1, String s2)
assertEquals("nahh", s1.length() + s2.length(), (s1 + s2).length());


@Property public void reverseTwice(String str)
assertThat(new StringBuilder(str).reverse().reverse().toString(), equalTo(str));




Gives this result:



Running steps.TestRunner
Feature: PBT
Lets run the pbt

@PBT
Scenario: First example # PBT.feature:3
Given I exeute a pbt # Steps.java:40

1 Scenarios (1 passed)
1 Steps (1 passed)
0m0.597s









share|improve this question






























    0















    background



    I am building a small frame using Cucumber and Junit-quickcheck.
    Guidelines require writing the scenarios in cucumber and I want to add the possibility of running property based tests. With quicktheories this works fine, but there are some bugs there and it's maintained by a single person so I'd like to switch to junit-quickcheck.



    the question



    The code works fine but the two tests are now run as one, and in the cucumber report it's not possible to identify them. So what I'd like is to find a way to write the pbt-tests in the PBT class (not as a class for each test!) and then execute them with cucumber as separate tests.



    I suppose there should be a way using the TestClass maybe, but I haven't been able to get that working.



    Here is my code that runs, but only as described:



    public class Steps implements En 
    public Scenario scenario;



    public Steps()

    Given("^I exeute a pbt$", () ->
    System.out.println("Lets run the pbt");
    Result res = JUnitCore.runClasses(PBT.class);
    assertThat(res.getFailures().toString(), res.wasSuccessful(), equalTo(true));
    );


    }


    and:



    @RunWith(JUnitQuickcheck.class)
    public class PBT
    @Property public void concatenationLength(String s1, String s2)
    assertEquals("nahh", s1.length() + s2.length(), (s1 + s2).length());


    @Property public void reverseTwice(String str)
    assertThat(new StringBuilder(str).reverse().reverse().toString(), equalTo(str));




    Gives this result:



    Running steps.TestRunner
    Feature: PBT
    Lets run the pbt

    @PBT
    Scenario: First example # PBT.feature:3
    Given I exeute a pbt # Steps.java:40

    1 Scenarios (1 passed)
    1 Steps (1 passed)
    0m0.597s









    share|improve this question


























      0












      0








      0








      background



      I am building a small frame using Cucumber and Junit-quickcheck.
      Guidelines require writing the scenarios in cucumber and I want to add the possibility of running property based tests. With quicktheories this works fine, but there are some bugs there and it's maintained by a single person so I'd like to switch to junit-quickcheck.



      the question



      The code works fine but the two tests are now run as one, and in the cucumber report it's not possible to identify them. So what I'd like is to find a way to write the pbt-tests in the PBT class (not as a class for each test!) and then execute them with cucumber as separate tests.



      I suppose there should be a way using the TestClass maybe, but I haven't been able to get that working.



      Here is my code that runs, but only as described:



      public class Steps implements En 
      public Scenario scenario;



      public Steps()

      Given("^I exeute a pbt$", () ->
      System.out.println("Lets run the pbt");
      Result res = JUnitCore.runClasses(PBT.class);
      assertThat(res.getFailures().toString(), res.wasSuccessful(), equalTo(true));
      );


      }


      and:



      @RunWith(JUnitQuickcheck.class)
      public class PBT
      @Property public void concatenationLength(String s1, String s2)
      assertEquals("nahh", s1.length() + s2.length(), (s1 + s2).length());


      @Property public void reverseTwice(String str)
      assertThat(new StringBuilder(str).reverse().reverse().toString(), equalTo(str));




      Gives this result:



      Running steps.TestRunner
      Feature: PBT
      Lets run the pbt

      @PBT
      Scenario: First example # PBT.feature:3
      Given I exeute a pbt # Steps.java:40

      1 Scenarios (1 passed)
      1 Steps (1 passed)
      0m0.597s









      share|improve this question














      background



      I am building a small frame using Cucumber and Junit-quickcheck.
      Guidelines require writing the scenarios in cucumber and I want to add the possibility of running property based tests. With quicktheories this works fine, but there are some bugs there and it's maintained by a single person so I'd like to switch to junit-quickcheck.



      the question



      The code works fine but the two tests are now run as one, and in the cucumber report it's not possible to identify them. So what I'd like is to find a way to write the pbt-tests in the PBT class (not as a class for each test!) and then execute them with cucumber as separate tests.



      I suppose there should be a way using the TestClass maybe, but I haven't been able to get that working.



      Here is my code that runs, but only as described:



      public class Steps implements En 
      public Scenario scenario;



      public Steps()

      Given("^I exeute a pbt$", () ->
      System.out.println("Lets run the pbt");
      Result res = JUnitCore.runClasses(PBT.class);
      assertThat(res.getFailures().toString(), res.wasSuccessful(), equalTo(true));
      );


      }


      and:



      @RunWith(JUnitQuickcheck.class)
      public class PBT
      @Property public void concatenationLength(String s1, String s2)
      assertEquals("nahh", s1.length() + s2.length(), (s1 + s2).length());


      @Property public void reverseTwice(String str)
      assertThat(new StringBuilder(str).reverse().reverse().toString(), equalTo(str));




      Gives this result:



      Running steps.TestRunner
      Feature: PBT
      Lets run the pbt

      @PBT
      Scenario: First example # PBT.feature:3
      Given I exeute a pbt # Steps.java:40

      1 Scenarios (1 passed)
      1 Steps (1 passed)
      0m0.597s






      testing junit cucumber test-runner property-based-testing






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 27 at 12:55









      ChaiChai

      3783 silver badges13 bronze badges




      3783 silver badges13 bronze badges

























          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55377741%2fnested-testrunners-can-i-runclasses-separating-tests%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55377741%2fnested-testrunners-can-i-runclasses-separating-tests%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해