JUnit

From BC$ MobileTV Wiki
Revision as of 17:03, 22 June 2022 by Bcmoney (Talk | contribs)

Jump to: navigation, search
Java (cup of java) Logo
jUnit project logo

jUnit is the most widely used testing tool for Java software development.


Specification


Unit Testing supporting frameworks

TestNG

[2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]

Mocking frameworks

[16] [17] [18] [19] [20] [21]

Mockito

[22] [23] [24] [25]

PowerMock

EasyMock

JMockIt

WireMock


Reporting Frameworks

Allure

Allure is an OSS dashboard and reporting tool for JUnit and similarly formatted Test frameworks' outputs. It aggregates Test results into trend graphs and visual charts/graphs that could be consumed and understood by less technical users.

ReportPortal


Tools

JAVA

[30] [31] [32] [33] [34] [35] [36] [37] [38] [39]


JavaScript

PHP

Perl

Python

C#

C++

Objective-C

XML

JSON


Resources


Tutorials


[69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79]

External Links


[84] [85] [86] [87] [88] [89] [90] [91] [92]


References

  1. TestNG Test Suite: https://www.toolsqa.com/selenium-webdriver/testng-testsuite/
  2. Reasons to use TestNG in the age of JUnit 5?: https://www.reddit.com/r/java/comments/78v0kr/reasons_to_use_testng_in_the_age_of_junit_5/
  3. JUnit vs TestNG: https://www.journaldev.com/21768/junit-vs-testng
  4. Difference Between JUnit and TestNG: https://www.differencebetween.net/technology/difference-between-junit-and-testng/
  5. TestNG vs JUnit 5 battle: https://seleniumcamp.com/talk/testng-vs-junit-5-battle/
  6. TestNG Vs JUnit -- What's the Difference?: https://www.guru99.com/junit-vs-testng.html
  7. A quick JUnit .vs. TestNG comparison: https://www.baeldung.com/junit-vs-testng
  8. From JUnit to TestNG - migration story: http://kaczanowscy.pl/tomek/2012-04/from-testng-to-junit-migration-story
  9. Provide AssertionsTestNG to aid migration from TestNG: https://github.com/junit-team/junit5/issues/1009
  10. TestNG docs -- Migrating from JUnit: https://testng.org/doc/migrating.html
  11. TestNG MixedMode: http://wiki.netbeans.org/TestNG_MixedMode
  12. Converting OpenGamma From JUnit to TestNG: https://web.archive.org/web/20130702055926/https://opengamma.com/blog/2011/04/04/converting-opengamma-junit-testng
  13. Migration from jUnit to TestNG: http://go-gaga-over-testing.blogspot.com/2016/03/migration-from-junit-to-testng.html
  14. Test Automation For Manual Testers: http://test-able.blogspot.com/2016/10/how-to-convert-test-classes-from-junit-to-testng.html
  15. Reassessing TestNG vs. Junit: https://blog.frankel.ch/reassessing-testng-junit/
  16. A Guide to Mocking With Mockito : https://dzone.com/articles/a-guide-to-mocking-with-mockito
  17. Unit tests with Mockito - Tutorial: http://www.vogella.com/tutorials/Mockito/article.html
  18. Stubbing and Mocking with Mockito 2 and JUnit: https://semaphoreci.com/community/tutorials/stubbing-and-mocking-with-mockito-2-and-junit
  19. Getting Started with Mocking in Java using Mockito : https://dzone.com/articles/getting-started-mocking-java
  20. Unit testing void methods in Java Junit/Mockito: https://stackoverflow.com/questions/41398426/unit-testing-void-methods-in-java-junit-mockito
  21. How to Mock HttpServletRequest: https://www.baeldung.com/java-httpservletrequest-mock
  22. Create a mocked list in Mockito: https://stackoverflow.com/questions/18514033/create-a-mocked-list-by-mockito
  23. Introduction to Mockito’s AdditionalAnswers: https://www.baeldung.com/mockito-additionalanswers
  24. The Difference Between mockito-core and mockito-all packages: https://www.baeldung.com/mockito-core-vs-mockito-all
  25. Clean Unit Tests with Mockito: https://reflectoring.io/clean-unit-tests-with-mockito/
  26. Create Selenium/WebDriver HTML Reports With The Allure Framework (using simple Maven POM config): https://seleniumjava.com/2015/10/15/create-selenium-webdriver-html-reports-with-the-allure-framework/
  27. Jenkins plugin -- xUnit: https://plugins.jenkins.io/xunit
  28. Jenkins & JUnit: https://stackoverflow.com/questions/8790366/jenkins-and-junit
  29. Jenkins - Unit Testing: https://www.tutorialspoint.com/jenkins/jenkins_unit_testing.htm
  30. Quick Guide to the Maven Surefire Plugin: https://www.baeldung.com/maven-surefire-plugin
  31. Maven Surefire: https://maven.apache.org/surefire/maven-surefire-plugin/
  32. How to configure maven surefire plugin work with JUnit 5: https://ahmadatwi.me/2018/08/16/tutorial-how-to-configure-maven-surefire-plugin-work-with-junit-5/
  33. Using JUnit 5 Platform from Maven surefire: https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit-platform.html
  34. Integration Of Maven With TestNg Using Maven Surefire Plugin: https://www.softwaretestinghelp.com/integration-of-maven-with-testng-using-surefire-plugin/
  35. What is the use of Maven-Surefire plugin: https://stackoverflow.com/questions/32942389/what-is-the-use-of-maven-surefire-plugin
  36. Maven surefire - No tests were executed: https://stackoverflow.com/questions/58996562/maven-no-tests-were-executed
  37. Using JaCoCo And Surefire Maven Plugins With Spring Boot: https://asbnotebook.com/2020/01/08/using-jacoco-and-surefire-maven-plugins-with-spring-boot/
  38. An API incompatibility was encountered while executing org.apache.maven.plugins:maven-shade-plugin:1.3.1:shade: java.lang.AbstractMethodError: null: https://stackoverflow.com/questions/32382445/an-api-incompatibility-was-encountered-while-executing-org-apache-maven-plugins
  39. JUnit 5 does not execute method annotated with BeforeEach: https://stackoverflow.com/questions/49441049/junit-5-does-not-execute-method-annotated-with-beforeeach
  40. Create JUnit Test Suite with Example: @RunWith @SuiteClasses: https://www.guru99.com/create-junit-test-suite.html
  41. JUnit in a Nutshell -- Test Runners: https://www.codeaffine.com/2014/09/03/junit-nutshell-test-runners/
  42. JUnit in a Nutshell -- Unit Test Assertion: https://www.codeaffine.com/2014/09/10/junit-nutshell-unit-test-assertions/
  43. How to run a java project in command line: https://stackoverflow.com/questions/6153057/how-to-run-a-java-project-in-command-line
  44. Random Programming Notes from a Web Developerby Sergiy KovalchukHow to Compile and Run Java Code from a Command Line: http://www.sergiy.ca/how-to-compile-and-launch-java-code-from-command-line/
  45. How to execute jar file with a external dependency using command line on Windows?: https://stackoverflow.com/questions/26551718/how-to-execute-jar-file-with-a-external-dependency-using-command-line-on-windows#26552470
  46. Running a junit class file from command line: https://stackoverflow.com/questions/31049286/running-a-junit-class-file-from-command-line
  47. Maven "surefire" plugin example: https://examples.javacodegeeks.com/enterprise-java/maven/maven-surefire-plugin-example/
  48. How to run unit test with Maven: https://www.mkyong.com/maven/how-to-run-unit-test-with-maven/
  49. How to skip Maven unit test: https://www.mkyong.com/maven/how-to-skip-maven-unit-test/
  50. Run Junit Suite using Maven Command: https://stackoverflow.com/questions/11762801/run-junit-suite-using-maven-command
  51. Running (a particular) JUnit test suite using Maven: https://stackoverflow.com/questions/13911716/running-junit-test-suite-using-maven
  52. Running a JUnit4 Test Suite in Maven using maven-failsafe-plugin: https://stackoverflow.com/questions/7792886/running-a-junit4-test-suite-in-maven-using-maven-failsafe-plugin
  53. How to run JUnit tests by category in Maven?: https://stackoverflow.com/questions/3100924/how-to-run-junit-tests-by-category-in-maven
  54. Using JUnit Categories with Maven Failsafe plugin: https://stackoverflow.com/questions/11542530/using-junit-categories-with-maven-failsafe-plugin
  55. Using JUnit @Category and Maven profiles to get stable test suite: https://technicaltesting.wordpress.com/2012/09/24/using-junit-category-and-maven-profiles-to-get-stable-test-suites/
  56. jUnit Frames XSLT: http://svn.apache.org/viewvc/ant/core/tags/ANT_171/src/etc/junit-frames.xsl?view=markup (original report formatter from XML to HTML)
  57. XML JUnit Results formatter: http://svn.apache.org/viewvc/ant/core/tags/ANT_171/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java?view=markup
  58. Custom JUnit Report?: https://stackoverflow.com/questions/1727616/custom-junit-report
  59. What XSLT converts JUnit Xml format to JUnit Plain format: https://stackoverflow.com/a/9471505/335867
  60. jUnit with Parameters -- Quickstart docs: https://github.com/Pragmatists/JUnitParams/wiki/Quickstart
  61. Detecting Windows or Linux (in JAVA)?: https://stackoverflow.com/questions/14288185/detecting-windows-or-linux
  62. Get Path of current file: https://stackoverflow.com/questions/19451480/get-path-of-current-file?lq=1
  63. How to get the path of running java program: https://stackoverflow.com/questions/17540942/how-to-get-the-path-of-running-java-program
  64. Migration from Junit 4 to Junit 5: https://dev.to/vga/migration-from-junit-4-to-junit-5-19d6
  65. Porting Your Existing Tests to JUnit5: https://dzone.com/articles/porting-your-existing-tests-to-junit5
  66. emonstrate migration path from JUnit 4 to JUnit 5: https://github.com/junit-team/junit5/issues/169
  67. Spring-Based Apps -- Migrating to JUnit 5: https://dzone.com/articles/spring-based-application-migrating-to-junit-5
  68. How to Replace Rules in JUnit 5 : https://www.codeaffine.com/2016/04/06/replace-rules-in-junit5/
  69. JUnit 5.3+ docs -- Parallel Execution: https://junit.org/junit5/docs/current/user-guide/#writing-tests-parallel-execution
  70. Running JUnit 4 Tests in Parallel with "Maven Surefire" settings: https://www.baeldung.com/maven-junit-parallel-tests
  71. Running tests in parallel with JUnit 5: https://igorski.co/running-tests-in-parallel-with-junit-5/
  72. Running Tests in Parallel with JUnit: https://stackoverflow.com/questions/33703618/running-tests-in-parallel-with-junit
  73. Migrate from TestNG to JUnit -- commit examle on orientdb: https://github.com/orientechnologies/orientdb/commit/5580620c79ebd9a432b2cffcfb028a2317be285b
  74. Migrating from JUnit 4 to JUnit 5 -- A Definitive Guide: https://www.codingrevolution.com/junit-5-migration/ | SRC
  75. Migrate tests from TestNG to JUnit: https://github.com/Graylog2/graylog2-server/commit/c148953cac96fcdf9681ddca9ad80aed8c6698f8
  76. Migrating to TestNG (using Java-based TestNG XML generator): https://www.theserverside.com/news/1365207/Migrating-to-TestNG
  77. JUnit .vs. TestNG -- Which Testing Framework Should You Choose?: https://blog.overops.com/junit-vs-testng-which-testing-framework-should-you-choose/
  78. JUnit4 vs TestNG – Comparison: https://www.mkyong.com/unittest/junit-4-vs-testng-comparison/
  79. Migrating from JUnit to TestNG: https://rvsubrahmanyam.wordpress.com/2015/09/10/migrating-from-junit-to-testng/
  80. JUnit - testing helper class with only static methods: https://stackoverflow.com/questions/9700179/junit-testing-helper-class-with-only-static-methods
  81. What Are JUnit 3.8 Naming Conventions?: http://sqa.fyicenter.com/FAQ/JUnit/What_Are_JUnit_3_8_Naming_Conventions_.html
  82. Are Naming Conventions For JUnit 4+ Still Needed?: http://www.adam-bien.com/roller/abien/entry/are_naming_conventions_for_junit
  83. Selenium Grid + JUnit + Jenkins — How to: https://stackoverflow.com/questions/21910296/selenium-grid-junit-jenkins-how-to
  84. Configure JUnit library container in test proj: https://github.com/eclipse/xtext-eclipse/pull/673
  85. Launch as Junit test not working for junit 5: https://github.com/eclipse/xtext-eclipse/issues/653
  86. Fix error "the import 'org.junit' cannot be resolved" in Eclipse: https://www.toddlahman.com/import-org-junit-cannot-resolved-eclipse/
  87. can't find run as junit test in eclipse: https://stackoverflow.com/questions/4794751/cant-find-run-as-junit-test-in-eclipse
  88. JUnit5 @Testable is ignored if org.junit.jupiter:junit-jupiter-engine is missing: https://github.com/eclipse/xtext-xtend/issues/519
  89. java.lang.NoClassDefFoundError org/junit/platform/launcher/TestExecutionListener: https://stackoverflow.com/questions/56387386/java-lang-noclassdeffounderror-org-junit-platform-launcher-testexecutionlistene
  90. java.lang.NoSuchMethodError org.junit.platform.commons.util.ReflectionUtils.tryToLoadClass Migrating to 5.4.0: https://github.com/junit-team/junit5/issues/1773
  91. Java Code Coverage in Eclipse: https://dzone.com/articles/java-code-coverage-in-eclipse
  92. java.lang.NoClassDefFoundError: org/junit/platform/commons/PreconditionViolationException when trying run junit5 test with maven: https://stackoverflow.com/questions/57040675/java-lang-noclassdeffounderror-org-junit-platform-commons-preconditionviolation

See Also

Testing | Java | Ant | Maven | Jenkins