Posts mit dem Label testing werden angezeigt. Alle Posts anzeigen
Posts mit dem Label testing werden angezeigt. Alle Posts anzeigen

2020-03-20

Using Cucumber with Gradle with tags

I want to run Cucumber from Gradle with the possibility to specify tags. Here is a build.gradle to do this:


  • gradle cucumber - will run all cucumber scenarios but not these tagged with @Ignore
  • gradle cucumber -P tags=@Smoketest - will run all smoketests but again will ignore these with the tag @Ignore.

2012-11-04

Infinitest with TestNG 6.8 support

Infinitest is an eclipse plugin which executes after editing files all corresponding unittests. After using infinitest for a while I realize that some features of TestNG 6.8 are not available by infinitest itself (in my case assertNotEquals). And therefor result in a reported problem.

Fortunately the project is availible on github and so I fork the project and change it to support TestNG 6.8. An pull request to the original project is waiting.

If you want to try it on your own risk - you can download it here. To install it in your Eclipse you have to unzip the file in the eclipse/dropins directory. I have test the version on Win7 and OSX with Eclipse 3.7 - and it seems to work ;-) 

2012-10-19

Unittest to verify that static method is called

.. using PowerMock, Mockito, TestNG

In example the class under test (cut) has a method showErrorMessage(msg). This method will call the static method JOptionPane.showMessageDialog(...) to show a error message.

I wrote a unittest to

  1. mock the showMessageDialog call - because otherwise the test will fail with an java.lang.VerifyError (UIManager is not initialized)
  2. verify that showMessageDialog is called + with the right parameter