Compare commits

...

78 commits

Author SHA1 Message Date
f43b3e18d2
Add OS matrix for Ubuntu, Windows and macOS 2025-03-25 21:48:14 -07:00
0f7a7cf090
Fix non-system specific path separator 2025-03-25 21:46:59 -07:00
9625db4b62
JDK 24 2025-03-18 23:42:02 -07:00
8d4e858035
Add generic installation instructions 2025-03-18 13:02:25 -07:00
f2b7863bb2
Bump JUnit to version 5.12.1 2025-03-18 13:00:56 -07:00
d95cb2990d
Bump PMD extension to version 1.2.1 2025-03-18 13:00:43 -07:00
b9b7b0fb44
Bump bld to version 2.2.1 2025-02-24 23:21:06 -08:00
98ea8a7812
Bump JUnit to version 5.12.0 2025-02-24 23:20:51 -08:00
4a0ad1aebe
Version 1.0.2 2025-02-12 23:00:19 -08:00
f12eb82f99
Bump TestNG to 7.11.0 2025-02-12 22:58:44 -08:00
8e2a2fa2fd
Fix copyright template 2025-02-12 22:57:38 -08:00
0133572c46
Bump AssertJ to version 3.27.3 2025-02-12 22:55:11 -08:00
c72607ff65
Bump PMD extension to 1.2.0 2025-02-12 22:49:34 -08:00
69cf0da32a
Update pages action to latest versions 2025-02-12 22:48:11 -08:00
d41df03d08
Version 1.0.1 2025-01-14 11:45:21 -08:00
e4c47afcfc
Updated copyright for 2025 2025-01-14 11:45:09 -08:00
8632c7525c
Bumped bld to version 2.2.0 2025-01-14 11:42:49 -08:00
69d20a0ed1
Bumped Exec extension to version 1.0.4 2025-01-14 11:36:12 -08:00
d59d109aa9
Bumped Jacoco extension to version 0.9.9 2025-01-14 11:36:12 -08:00
251c8abb6a
Bumped AssertJ to version 3.27.2 2025-01-14 11:31:44 -08:00
61d32ca117
Bumped PMD extension to version 1.1.9 2024-12-28 18:13:59 -08:00
807ccffe0e
Bumped JUnit to version 5.11.4 2024-12-28 18:13:38 -08:00
1ff935aa7e
Bumped AssertJ to version 3.27.0 2024-12-28 18:13:16 -08:00
0f5dae6cdc
Updated dependencies
Updated dependencies

Bumped JUnit version to 5.11.3
Bumped PMD extension version to 1.1.7
Bumped JDK to version 23 (GitHub CI Workflow)
2024-10-28 10:15:48 -07:00
a46ad60a66
Added GitHub repository 2024-10-28 10:14:38 -07:00
450c2df0f5
Added soft assertions 2024-10-28 10:13:14 -07:00
e2695625fd
Version 1.0.0 2024-08-30 13:38:04 -07:00
f2cf1b18bb
Minor cleanups 2024-08-30 13:37:43 -07:00
fd950f223d
Updated extensions dependencies 2024-08-30 13:07:22 -07:00
c35b3cefcd
Bumped bld to version 2.1.0 2024-08-29 22:42:11 -07:00
4e44484157
Cleaned up API to match bld operations aand options APIs 2024-08-28 14:10:22 -07:00
994bc399d6
Bumpled JUnit to version 5.11.0 2024-08-28 14:07:45 -07:00
d4931cc3af
Version 0.9.9 2024-07-28 23:02:18 -07:00
f462b1eca8
Bumpled bld to version 2.0.1 2024-07-28 22:56:38 -07:00
1ebc093bbc
Bumped bld to version 2.0.0-SNAPSHOT 2024-07-23 08:35:29 -07:00
0cb08be61a
Bumped PMD extension to version 1.1.2 2024-07-03 16:00:26 -07:00
7aedfc790e
Added array for the methods argument 2024-06-27 20:34:43 -07:00
8db60b473c
Log error messages and throw exit status exceptions to stop processing 2024-06-27 20:33:04 -07:00
4fa74c3efd
Bumped JUnit to version 5.10.3 2024-06-27 20:19:24 -07:00
177ad3d961
Added methods to access the map of options and sets 2024-06-22 21:13:28 -07:00
057bb39247
Bumped extensions depdencies
Exec extension to version 1.0.1
JaCoCo extension to version 0.9.5
PMD extension to version 1.1.0
2024-06-22 21:11:16 -07:00
0156100013
Execute cliargs script before running tests 2024-05-28 14:22:50 -07:00
cd34bb182c
Cleaned up cliargs script 2024-05-27 22:51:12 -07:00
0a869da1d5
Read parameters from resource file 2024-05-27 20:27:15 -07:00
b0cf0f5035
Added script to list parameters 2024-05-27 16:22:55 -07:00
6020dde8eb
Added test to check all parameters 2024-05-26 14:52:58 -07:00
273dbc014b
Bumped assertj-core to version 3.26.0 2024-05-26 14:48:31 -07:00
a5ce6ab0ec
Fixed report file location URL 2024-05-11 15:22:17 -07:00
cf879d30db
Bumped bld to version 1.9.1 2024-05-09 21:33:28 -07:00
b1db44062a
Added support for TestNG 7.10.2 2024-04-28 09:44:15 -07:00
155052a861
Bumped PMD extensions to version 0.9.9 2024-04-28 09:41:19 -07:00
f822d4489e
Bumped TestNG to version 7.10.1 2024-04-09 13:35:35 -07:00
d74ee9d819
Added supprot for TestNG 7.10.0 2024-04-07 14:23:35 -07:00
645e6d104a
Added visual diff parameter 2024-04-07 14:23:07 -07:00
f9cbd63bce
Only log java command and arguments on Level.FINE 2024-04-04 02:34:23 -07:00
4d4479bf23
Added support for JaCoCo extension. Closes #2 2024-04-03 20:35:21 -07:00
63635f408b
Bumped PMD extension to version 0.9.8 2024-04-03 20:33:44 -07:00
b80ae060e0
Bumped workflows actions to latest versions 2024-04-03 20:32:19 -07:00
b9e9714255
Added JDK 22 to CI 2024-03-21 13:43:05 -07:00
be3206f91b
Bumped to bld 1.9.0 2024-03-21 00:26:00 -07:00
1e7c9724c0
Bumped JUnit versions 2024-03-21 00:26:00 -07:00
f017dce3d9
Improved Visual Studio Code support 2024-03-21 00:26:00 -07:00
1e23f03f46
Version 0.9.3 2024-03-21 00:26:00 -07:00
cfa0a18581
Bumped bld to 1.8.0 2024-03-21 00:26:00 -07:00
d1e16bbee3
Added shell script to check for new TestNG arguments 2024-03-21 00:25:34 -07:00
75b33ba6d6 Reworked tests 2024-01-28 17:54:00 -08:00
c8fe28cda9 Added support for new TestNG thread pool arguments 2024-01-28 17:53:40 -08:00
e26934ef67 Updated copyright 2024-01-28 17:45:13 -08:00
47e23dc23c Added support for TestNG 7.9.0 2023-12-28 17:25:52 -08:00
ef4a259a33 Cleaned up Javadocs 2023-11-27 13:10:11 -08:00
e32abb231b Fixed examples link 2023-11-04 03:26:03 -07:00
428dfd1a2d Version 0.9.2 2023-10-22 14:45:05 -07:00
1074e12b9b Updated dependencies 2023-10-20 21:23:26 -07:00
402e9d9025 Minor cleanup 2023-08-28 14:26:22 -07:00
dd196cd761 Updated copyright 2023-08-28 14:23:12 -07:00
100ce6dc0d Added examples link 2023-08-28 14:21:58 -07:00
f92ab27463 Added support for collection arguments 2023-08-28 14:21:08 -07:00
b69faf34d6 Updated bld badge 2023-08-21 07:43:18 -07:00
45 changed files with 1564 additions and 409 deletions

View file

@ -4,29 +4,36 @@ on: [ push, pull_request, workflow_dispatch ]
jobs:
build-bld-project:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 17, 20 ]
java-version: [ 17, 21, 24 ]
kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
distribution: "zulu"
java-version: ${{ matrix.java-version }}
- name: Grant execute permission for bld
run: chmod +x bld
- name: Download the dependencies
- name: Download dependencies [examples]
working-directory: examples
run: ./bld download
- name: Run tests with bld
- name: Run tests with JaCoCo [examples]
working-directory: examples
run: ./bld compile jacoco
- name: Download dependencies
run: ./bld download
- name: Run tests
run: ./bld compile test

View file

@ -30,14 +30,14 @@ jobs:
steps:
- name: Checkout source repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
distribution: "zulu"
java-version: 17
- name: Build Javadocs
@ -47,11 +47,11 @@ jobs:
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
# Upload generated Javadocs repository
path: 'build/javadoc/'
path: "build/javadoc/"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4

1
.gitignore vendored
View file

@ -55,3 +55,4 @@ atlassian-ide-plugin.xml
.idea/httpRequests
local.properties
test-output

6
.idea/bld.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BldConfiguration">
<events />
</component>
</project>

View file

@ -1,6 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value=" Copyright &amp;#36;today.year the original author or authors.&#10; &#10; Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);&#10; you may not use this file except in compliance with the License.&#10; You may obtain a copy of the License at&#10; &#10; https://www.apache.org/licenses/LICENSE-2.0&#10; &#10; Unless required by applicable law or agreed to in writing, software&#10; distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; See the License for the specific language governing permissions and&#10; limitations under the License." />
<option name="notice" value="Copyright 2023-&amp;#36;today.year the original author or authors.&#10; &#10;Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);&#10;you may not use this file except in compliance with the License.&#10;You may obtain a copy of the License at&#10;&#10; https://www.apache.org/licenses/LICENSE-2.0&#10;&#10;Unless required by applicable law or agreed to in writing, software&#10;distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10;See the License for the specific language governing permissions and&#10;limitations under the License." />
<option name="myName" value="Apache License" />
</copyright>
</component>

13
.idea/icon.svg generated Normal file
View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 179 108" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(1,0,0,1,-210.511,-96.3382)">
<g transform="matrix(1,0,0,1,-23.3386,-649.816)">
<g transform="matrix(0.221288,0,0,0.24,73.9536,390.254)">
<path d="M722.568,1482.92L722.568,1921.1L808.968,1921.1L808.968,1888.7C822.168,1907.9 846.168,1930.1 893.568,1930.1C933.168,1930.1 961.968,1917.5 985.368,1893.5C1012.97,1865.9 1027.37,1827.5 1027.37,1786.1C1027.37,1741.7 1011.17,1705.1 985.368,1680.5C961.968,1658.3 928.968,1644.5 892.368,1644.5C862.968,1644.5 830.568,1654.1 808.968,1683.5L808.968,1482.92L722.568,1482.92ZM871.368,1718.9C888.768,1718.9 903.768,1723.7 917.568,1736.9C930.168,1748.9 938.568,1766.3 938.568,1787.9C938.568,1807.7 930.168,1825.1 917.568,1837.1C904.368,1849.7 887.568,1855.7 872.568,1855.7C856.368,1855.7 837.168,1849.1 823.368,1835.9C813.168,1826.3 803.568,1810.1 803.568,1787.9C803.568,1765.1 812.568,1749.5 822.768,1738.7C836.568,1724.3 852.768,1718.9 871.368,1718.9Z" style="fill:rgb(35,146,255);fill-rule:nonzero;"/>
<rect x="1083.77" y="1482.92" width="86.4" height="438.182" style="fill:rgb(250,144,82);fill-rule:nonzero;"/>
<path d="M1531.37,1482.92L1444.97,1482.92L1444.97,1683.5C1423.37,1654.1 1390.97,1644.5 1361.57,1644.5C1324.97,1644.5 1291.97,1658.3 1268.57,1680.5C1242.77,1705.1 1226.57,1741.7 1226.57,1786.1C1226.57,1827.5 1240.97,1865.9 1268.57,1893.5C1291.97,1917.5 1320.77,1930.1 1360.37,1930.1C1407.77,1930.1 1431.77,1907.9 1444.97,1888.7L1444.97,1921.1L1531.37,1921.1L1531.37,1482.92ZM1382.57,1718.9C1401.17,1718.9 1417.37,1724.3 1431.17,1738.7C1441.37,1749.5 1450.37,1765.1 1450.37,1787.9C1450.37,1810.1 1440.77,1826.3 1430.57,1835.9C1416.77,1849.1 1397.57,1855.7 1381.37,1855.7C1366.37,1855.7 1349.57,1849.7 1336.37,1837.1C1323.77,1825.1 1315.37,1807.7 1315.37,1787.9C1315.37,1766.3 1323.77,1748.9 1336.37,1736.9C1350.17,1723.7 1365.17,1718.9 1382.57,1718.9Z" style="fill:rgb(35,146,255);fill-rule:nonzero;"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

204
.idea/intellij-javadocs-4.0.1.xml generated Normal file
View file

@ -0,0 +1,204 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaDocConfiguration">
<GENERAL>
<MODE>UPDATE</MODE>
<OVERRIDDEN_METHODS>false</OVERRIDDEN_METHODS>
<SPLITTED_CLASS_NAME>true</SPLITTED_CLASS_NAME>
<LEVELS>
<LEVEL>TYPE</LEVEL>
<LEVEL>METHOD</LEVEL>
<LEVEL>FIELD</LEVEL>
</LEVELS>
<VISIBILITIES>
<VISIBILITY>PROTECTED</VISIBILITY>
<VISIBILITY>DEFAULT</VISIBILITY>
<VISIBILITY>PUBLIC</VISIBILITY>
</VISIBILITIES>
</GENERAL>
<TEMPLATES>
<CLASSES>
<CLASS>
<KEY>^.*(public|protected|private)*.+interface\s+\w+.*</KEY>
<VALUE>/**\n
* The interface ${name}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
*/</VALUE>
</CLASS>
<CLASS>
<KEY>^.*(public|protected|private)*.+enum\s+\w+.*</KEY>
<VALUE>/**\n
* The enum ${name}.\n
*/</VALUE>
</CLASS>
<CLASS>
<KEY>^.*(public|protected|private)*.+class\s+\w+.*</KEY>
<VALUE>/**\n
* The type ${name}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
*/</VALUE>
</CLASS>
<CLASS>
<KEY>.+</KEY>
<VALUE>/**\n
* The type ${name}.\n
*/</VALUE>
</CLASS>
</CLASSES>
<CONSTRUCTORS>
<CONSTRUCTOR>
<KEY>.+</KEY>
<VALUE>/**\n
* Instantiates a new ${name}.\n
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</CONSTRUCTOR>
</CONSTRUCTORS>
<METHODS>
<METHOD>
<KEY>^.*(public|protected|private)*\s*.*(\w(\s*&lt;.+&gt;)*)+\s+get\w+\s*\(.*\).+</KEY>
<VALUE>/**\n
* Gets ${partName}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if isNotVoid&gt;
*\n
* @return the ${partName}\n
&lt;/#if&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
<METHOD>
<KEY>^.*(public|protected|private)*\s*.*(void|\w(\s*&lt;.+&gt;)*)+\s+set\w+\s*\(.*\).+</KEY>
<VALUE>/**\n
* Sets ${partName}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if isNotVoid&gt;
*\n
* @return the ${partName}\n
&lt;/#if&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
<METHOD>
<KEY>^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+</KEY>
<VALUE>/**\n
* The entry point of application.\n
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
* @param ${element.parameterList.parameters[0].name} the input arguments\n
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
<METHOD>
<KEY>.+</KEY>
<VALUE>/**\n
* ${name}&lt;#if isNotVoid&gt; ${return}&lt;/#if&gt;.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if isNotVoid&gt;
*\n
* @return the ${return}\n
&lt;/#if&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
</METHODS>
<FIELDS>
<FIELD>
<KEY>^.*(public|protected|private)*.+static.*(\w\s\w)+.+</KEY>
<VALUE>/**\n
* The constant ${element.getName()}.\n
*/</VALUE>
</FIELD>
<FIELD>
<KEY>^.*(public|protected|private)*.*(\w\s\w)+.+</KEY>
<VALUE>/**\n
&lt;#if element.parent.isInterface()&gt;
* The constant ${element.getName()}.\n
&lt;#else&gt;
* The ${name}.\n
&lt;/#if&gt; */</VALUE>
</FIELD>
<FIELD>
<KEY>.+</KEY>
<VALUE>/**\n
&lt;#if element.parent.isEnum()&gt;
*${name} ${typeName}.\n
&lt;#else&gt;
* The ${name}.\n
&lt;/#if&gt;*/</VALUE>
</FIELD>
</FIELDS>
</TEMPLATES>
</component>
</project>

View file

@ -2,11 +2,12 @@
<library name="bld">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.2.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.2-sources.jar!/" />
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1-sources.jar!/" />
</SOURCES>
<excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />

View file

@ -7,7 +7,7 @@
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/compile" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" type="SOURCES" />
</library>
</component>

View file

@ -8,7 +8,7 @@
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/runtime" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" type="SOURCES" />
</library>
</component>

View file

@ -8,7 +8,7 @@
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/test" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" type="SOURCES" />
</library>
</component>

3
.idea/misc.xml generated
View file

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<pattern value="rife.bld.extension.TestNgOperationBuild" method="pmd" />
@ -8,7 +9,7 @@
<component name="PDMPlugin">
<option name="customRuleSets">
<list>
<option value="K:\java\semver\config\pmd.xml" />
<option value="$PROJECT_DIR$/config/pmd.xml" />
</list>
</option>
<option name="skipTestSources" value="false" />

9
.vscode/launch.json vendored
View file

@ -5,7 +5,14 @@
"type": "java",
"name": "Run Tests",
"request": "launch",
"mainClass": "rife.bld.extension.TestNgOperationTest"
"mainClass": "org.junit.platform.console.ConsoleLauncher",
"args": [
"--details=verbose",
"--scan-classpath",
"--disable-banner",
"--disable-ansi-colors",
"--exclude-engine=junit-platform-suite",
"--exclude-engine=junit-vintage"]
}
]
}

10
.vscode/settings.json vendored
View file

@ -3,13 +3,13 @@
"src/main/java",
"src/main/resources",
"src/test/java",
"src/bld/java"
"src/test/resources",
"src/bld/java",
"src/bld/resources"
],
"java.configuration.updateBuildConfiguration": "automatic",
"java.project.referencedLibraries": [
"${HOME}bld-1.7.1.jar",
"lib/compile/*.jar",
"lib/runtime/*.jar",
"lib/test/*.jar"
"${HOME}/.bld/dist/bld-2.2.1.jar",
"lib/**/*.jar"
]
}

View file

@ -1,55 +1,46 @@
# [Bld](https://rife2.com/bld) Extension to Run Tests with [TestNG](https://testng.org/)
# [bld](https://rife2.com/bld) Extension to Run Tests with [TestNG](https://testng.org/)
[![License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
[![bld](https://img.shields.io/badge/1.7.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
[![bld](https://img.shields.io/badge/2.2.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
[![Release](https://flat.badgen.net/maven/v/metadata-url/repo.rife2.com/releases/com/uwyn/rife2/bld-testng/maven-metadata.xml?color=blue)](https://repo.rife2.com/#/releases/com/uwyn/rife2/bld-testng)
[![Snapshot](https://flat.badgen.net/maven/v/metadata-url/repo.rife2.com/snapshots/com/uwyn/rife2/bld-testng/maven-metadata.xml?label=snapshot)](https://repo.rife2.com/#/snapshots/com/uwyn/rife2/bld-testng)
[![GitHub CI](https://github.com/rife2/bld-testng/actions/workflows/bld.yml/badge.svg)](https://github.com/rife2/bld-testng/actions/workflows/bld.yml)
To install, please refer to the [extensions documentation](https://github.com/rife2/bld/wiki/Extensions).
To install the latest version, add the following to the `lib/bld/bld-wrapper.properties` file:
```properties
bld.extension-testng=com.uwyn.rife2:bld-testng
```
For more information, please refer to the [extensions](https://github.com/rife2/bld/wiki/Extensions) documentation.
## Test with TestNG
To run the tests with TestNG, add the following to your build file:
```java
@BuildCommand(summary = "Tests the project with TestNG")
public void testng() throws Exception {
new TestNgOperation()
.fromProject(this)
.packages("com.example")
.execute();
@Override
public TestOperation<?, ?> testOperation() {
return new TestNgOperation()
.fromProject(this)
.packages("com.example");
}
```
```text
./bld compile testng
```
You could also override the default `test` command:
```java
@BuildCommand(summary = "Tests the project with TestNG")
public void test throws Exception {
new TestNgOperation()
.fromProject(this)
.suites("src/test/resources/testng.xml")
.verbose(2)
.execute();
}
```
```
```console
./bld compile test
```
- [View Examples Project](https://github.com/rife2/bld-testng/tree/master/examples)
Please check the [TestNgOperation documentation](https://rife2.github.io/bld-testng/rife/bld/extension/TestNgOperation.html#method-summary) for all available configuration options.
### TestNG Dependency
Don't forget to add a TestNG test dependency to your build file, as it is not provided by the extension. For example:
Don't forget to add a TestNG `test` dependency to your build file, as it is not provided by the extension. For example:
```java
repositories = List.of(MAVEN_CENTRAL);
scope(test).include(dependency("org.testng", "testng", version(7, 8, 0)));
```
scope(test).include(dependency("org.testng", "testng", version(7, 11, 0)));
```

View file

@ -7,9 +7,9 @@
<!-- BEST PRACTICES -->
<rule ref="category/java/bestpractices.xml">
<exclude name="AvoidPrintStackTrace"/>
<exclude name="JUnit4TestShouldUseTestAnnotation"/>
<exclude name="JUnitTestContainsTooManyAsserts"/>
<exclude name="GuardLogStatement"/>
<exclude name="UnitTestContainsTooManyAsserts"/>
<exclude name="UnitTestShouldUseTestAnnotation"/>
</rule>
<rule ref="category/java/bestpractices.xml/MissingOverride">
@ -24,8 +24,8 @@
<rule ref="category/java/codestyle.xml">
<exclude name="AtLeastOneConstructor"/>
<exclude name="ClassNamingConventions"/>
<exclude name="ConfusingTernary"/>
<exclude name="CommentDefaultAccessModifier"/>
<exclude name="ConfusingTernary"/>
<exclude name="FieldNamingConventions"/>
<exclude name="LocalVariableCouldBeFinal"/>
<exclude name="LongVariable"/>
@ -35,8 +35,9 @@
<exclude name="ShortClassName"/>
<exclude name="ShortMethodName"/>
<exclude name="ShortVariable"/>
<exclude name="UselessParentheses"/>
<exclude name="UseExplicitTypes"/>
<exclude name="UseUnderscoresInNumericLiterals"/>
<exclude name="UselessParentheses"/>
</rule>
<rule ref="category/java/codestyle.xml/UnnecessaryImport">
@ -52,8 +53,6 @@
<exclude name="AvoidUncheckedExceptionsInSignatures"/>
<exclude name="CognitiveComplexity"/>
<exclude name="CyclomaticComplexity"/>
<exclude name="ExcessiveClassLength"/>
<exclude name="ExcessiveMethodLength"/>
<exclude name="ExcessiveParameterList"/>
<exclude name="ExcessivePublicCount"/>
<exclude name="GodClass"/>
@ -107,4 +106,4 @@
<!-- SECURITY -->
<rule ref="category/java/security.xml">
</rule>
</ruleset>
</ruleset>

1
examples/.idea/.name generated Normal file
View file

@ -0,0 +1 @@
bld-testng-examples

6
examples/.idea/bld.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BldConfiguration">
<events />
</component>
</project>

View file

@ -2,11 +2,12 @@
<library name="bld">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.2.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.2-sources.jar!/" />
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1-sources.jar!/" />
</SOURCES>
<excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />

View file

@ -7,7 +7,7 @@
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/compile" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" type="SOURCES" />
</library>
</component>

View file

@ -8,7 +8,7 @@
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/runtime" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" type="SOURCES" />
</library>
</component>

View file

@ -8,7 +8,7 @@
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/test" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" type="SOURCES" />
</library>
</component>

View file

@ -3,6 +3,10 @@
<component name="EntryPointsManager">
<pattern value="com.example.ExamplesBuild" method="testng" />
<pattern value="com.example.ExampleTest" method="testFail" />
<pattern value="com.example.ExamplesBuild" method="jacoco" />
<pattern value="com.example.ExamplesTest" />
<pattern value="com.example.ExamplesTest" method="foo" />
<pattern value="com.example.ExamplesTest" method="verifyHello" />
</component>
<component name="PDMPlugin">
<option name="customRuleSets">

View file

@ -5,7 +5,10 @@
"type": "java",
"name": "Run Tests",
"request": "launch",
"mainClass": "com.example.ExamplesTest"
"mainClass": "com.example.ExamplesBuild",
"args": [
"compile", "test"
]
}
]
}

View file

@ -3,13 +3,14 @@
"src/main/java",
"src/main/resources",
"src/test/java",
"src/bld/java"
"src/test/resources",
"src/bld/java",
"src/bld/resources",
"src/bld/resources"
],
"java.configuration.updateBuildConfiguration": "automatic",
"java.project.referencedLibraries": [
"${HOME}bld-1.7.2.jar",
"lib/compile/*.jar",
"lib/runtime/*.jar",
"lib/test/*.jar"
"${HOME}/.bld/dist/bld-2.2.1.jar",
"lib/**/*.jar"
]
}

11
examples/README.md Normal file
View file

@ -0,0 +1,11 @@
Compile and Run Tests with TestNG
```console
./bld compile test
```
Compile and Generate JaCoCo Reports
```console
./bld compile jacoco
```

Binary file not shown.

View file

@ -1,7 +1,8 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.extensions=com.uwyn.rife2:bld-testng:0.9.1
bld.repositories=MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.downloadLocation=
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.10-SNAPSHOT
bld.extension-testng=com.uwyn.rife2:bld-testng:1.0.3-SNAPSHOT
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories=
bld.version=1.7.2
bld.version=2.2.1

View file

@ -2,9 +2,14 @@ package com.example;
import rife.bld.BaseProject;
import rife.bld.BuildCommand;
import rife.bld.extension.JacocoReportOperation;
import rife.bld.extension.TestNgOperation;
import rife.bld.operations.TestOperation;
import java.util.List;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import static rife.bld.dependencies.Repository.MAVEN_CENTRAL;
import static rife.bld.dependencies.Scope.test;
@ -12,9 +17,10 @@ import static rife.bld.dependencies.Scope.test;
/**
* Example build.
*
* <ul style="list-style-type:none">
* <li>./bld compile test</li>
* </ul>
* <pre>{@code
* ./bld compile test
* ./bld compile jacoco
* }</pre>
*/
public class ExamplesBuild extends BaseProject {
public ExamplesBuild() {
@ -22,19 +28,41 @@ public class ExamplesBuild extends BaseProject {
name = "Examples";
version = version(0, 1, 0);
javaRelease = 17;
downloadSources = true;
autoDownloadPurge = true;
repositories = List.of(MAVEN_CENTRAL);
scope(test).include(dependency("org.testng", "testng", version(7, 8, 0)));
scope(test).include(dependency("org.testng", "testng", version(7, 11, 0)));
}
public static void main(String[] args) {
// Enable detailed logging for the JaCoCo extension
var level = Level.ALL;
var logger = Logger.getLogger("rife.bld.extension");
var consoleHandler = new ConsoleHandler();
consoleHandler.setLevel(level);
logger.addHandler(consoleHandler);
logger.setLevel(level);
logger.setUseParentHandlers(false);
new ExamplesBuild().start(args);
}
@BuildCommand(summary = "Tests the project with TestNG")
public void test() throws Exception {
new TestNgOperation()
@BuildCommand(summary = "Generates Jacoco Reports")
public void jacoco() throws Exception {
new JacocoReportOperation()
.fromProject(this)
.packages("com.example")
.execute();
}
}
@Override
public TestOperation<?, ?> testOperation() {
return new TestNgOperation()
.fromProject(this)
.packages("com.example");
}
}

View file

@ -3,18 +3,16 @@ package com.example;
import org.testng.Assert;
import org.testng.annotations.Test;
class ExampleTest {
public static void main(String[] args) {
new ExampleTest().verifyHello();
}
class ExamplesTest {
private final ExamplesLib example = new ExamplesLib();
@Test
void testFail() {
Assert.fail("failed");
void foo() {
Assert.assertNotEquals(example.getMessage(), "foo");
}
@Test
void verifyHello() {
Assert.assertTrue(true);
Assert.assertEquals(example.getMessage(), "Hello World!");
}
}

Binary file not shown.

View file

@ -1,8 +1,8 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.2
bld.extension-generated-version=com.uwyn.rife2:bld-generated-version:0.9.1
bld.repositories=MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.downloadLocation=
bld.extension-exec=com.uwyn.rife2:bld-exec:1.0.4
bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.2.1
bld.repositories=MAVEN_CENTRAL,MAVEN_LOCAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories=
bld.version=1.7.2
bld.version=2.2.1

16
scripts/checkcliargs.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
main="org.testng.TestNG"
new=/tmp/checkcliargs-new
old=/tmp/checkcliargs-old
java -cp "lib/test/*" $main 2>/dev/null >$new
java -cp "examples/lib/test/*" $main 2>/dev/null >$old
if [ "$1" = "-v" ]; then
code --wait --diff $old $new
else
diff $old $new
fi
rm -rf $new $old

9
scripts/cliargs.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
java -cp "lib/test/*" org.testng.TestNG 2>/dev/null |\
grep "^ -.*" |\
sed -e "s/ -/-/" -e "s/, -/\n-/" |\
sed "/testRunFactory/d" |\
sort |\
sed '$s/,//' > "src/test/resources/testng-args.txt"

View file

@ -1,17 +1,17 @@
/*
* Copyright 2023 the original author or authors.
* Copyright 2023-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package rife.bld.extension;
@ -24,8 +24,7 @@ import rife.bld.publish.PublishScm;
import java.util.List;
import static rife.bld.dependencies.Repository.MAVEN_CENTRAL;
import static rife.bld.dependencies.Repository.RIFE2_RELEASES;
import static rife.bld.dependencies.Repository.*;
import static rife.bld.dependencies.Scope.compile;
import static rife.bld.dependencies.Scope.test;
import static rife.bld.operations.JavadocOptions.DocLinkOption.NO_MISSING;
@ -34,44 +33,54 @@ public class TestNgOperationBuild extends Project {
public TestNgOperationBuild() {
pkg = "rife.bld.extension";
name = "bld-testng";
version = version(0, 9, 1);
version = version(1, 0, 3, "SNAPSHOT");
javaRelease = 17;
downloadSources = true;
autoDownloadPurge = true;
repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES, RIFE2_SNAPSHOTS);
var rife2 = version(1, 7, 0);
scope(compile)
.include(dependency("com.uwyn.rife2", "rife2", rife2))
.include(dependency("com.uwyn.rife2", "bld", version(1, 7, 2)));
.include(dependency("com.uwyn.rife2", "bld", version(2, 2, 1)));
scope(test)
.include(dependency("org.testng", "testng", version(7, 8, 0)))
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 0)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 0)))
.include(dependency("org.assertj:assertj-joda-time:2.2.0"));
.include(dependency("org.testng", "testng", version(7, 11, 0)))
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 12, 1)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 1)))
.include(dependency("org.assertj", "assertj-core", version(3, 27, 3)));
javadocOperation()
.javadocOptions()
.author()
.docLint(NO_MISSING)
.link("https://rife2.github.io/bld/")
.link("https://rife2.github.io/rife2/");
publishOperation()
.repository(version.isSnapshot() ? repository("rife2-snapshot") : repository("rife2"))
.repository(repository("github"))
.info()
.groupId("com.uwyn.rife2")
.artifactId("bld-testng")
.description("bld Extension to execute tests with TestNG")
.url("https://github.com/rife2/bld-testng")
.developer(new PublishDeveloper().id("ethauvin").name("Erik C. Thauvin").email("erik@thauvin.net")
.url("https://erik.thauvin.net/"))
.license(new PublishLicense().name("The Apache License, Version 2.0")
.url("http://www.apache.org/licenses/LICENSE-2.0.txt"))
.scm(new PublishScm().connection("scm:git:https://github.com/rife2/bld-testng.git")
.developer(new PublishDeveloper()
.id("ethauvin")
.name("Erik C. Thauvin")
.email("erik@thauvin.net")
.url("https://erik.thauvin.net/")
)
.license(new PublishLicense()
.name("The Apache License, Version 2.0")
.url("https://www.apache.org/licenses/LICENSE-2.0.txt")
)
.scm(new PublishScm()
.connection("scm:git:https://github.com/rife2/bld-testng.git")
.developerConnection("scm:git:git@github.com:rife2/bld-testng.git")
.url("https://github.com/rife2/bld-testng"))
.url("https://github.com/rife2/bld-testng")
)
.signKey(property("sign.key"))
.signPassphrase(property("sign.passphrase"));
}
@ -88,4 +97,16 @@ public class TestNgOperationBuild extends Project {
.ruleSets("config/pmd.xml")
.execute();
}
}
@Override
public void test() throws Exception {
var os = System.getProperty("os.name");
if (os != null && os.toLowerCase().contains("linux")) {
new ExecOperation()
.fromProject(this)
.command("scripts/cliargs.sh")
.execute();
}
super.test();
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,31 @@
/*
* Copyright 2023-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package rife.bld.extension;
/**
* Implements the TestNgExample class.
*
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
* @since 1.0
*/
@SuppressWarnings({"PMD.TestClassWithoutTestCases", "unused"})
class TestNgExample {
@SuppressWarnings("SameReturnValue")
public String getMessage() {
return "Hello World!";
}
}

View file

@ -0,0 +1,41 @@
/*
* Copyright 2023-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package rife.bld.extension;
import org.testng.Assert;
import org.testng.annotations.Test;
/**
* Implements the TestNgExampleTest class.
*
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
* @since 1.0
*/
@SuppressWarnings("unused")
class TestNgExampleTest {
private final TestNgExample example = new TestNgExample();
@Test
void foo() {
Assert.assertEquals(example.getMessage(), "foo");
}
@Test
void verifyHello() {
Assert.assertEquals(example.getMessage(), "Hello World!");
}
}

View file

@ -1,25 +1,35 @@
/*
* Copyright 2023 the original author or authors.
* Copyright 2023-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package rife.bld.extension;
import org.assertj.core.api.AutoCloseableSoftAssertions;
import org.junit.jupiter.api.Test;
import rife.bld.Project; // NOPMD
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;
import rife.bld.Project;
import rife.bld.blueprints.BaseProjectBlueprint;
import rife.bld.operations.exceptions.ExitStatusException;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import static org.assertj.core.api.Assertions.*;
/**
@ -36,47 +46,132 @@ class TestNgOperationTest {
@Test
void testAlwaysRunListeners() {
var op = new TestNgOperation().alwaysRunListeners(false);
assertThat(op.options.get("-alwaysrunlisteners")).isEqualTo("false");
assertThat(op.options().get("-alwaysrunlisteners")).isEqualTo("false");
op = new TestNgOperation().alwaysRunListeners(true);
assertThat(op.options.get("-alwaysrunlisteners")).isEqualTo("true");
assertThat(op.options().get("-alwaysrunlisteners")).isEqualTo("true");
}
@Test
@EnabledOnOs(OS.LINUX)
void testCheckAllParameters() throws IOException {
var args = Files.readAllLines(Paths.get("src", "test", "resources", "testng-args.txt"));
assertThat(args).isNotEmpty();
var params = new TestNgOperation()
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example", "examples", "Examples"))
.alwaysRunListeners(true)
.dataProviderThreadCount(1)
.dependencyInjectorFactory("injectorfactory")
.directory("dir")
.excludeGroups("group")
.failWhenEverythingSkipped(true)
.failurePolicy(TestNgOperation.FailurePolicy.SKIP)
.generateResultsPerSuite(true)
.groups("group1", "group2")
.ignoreMissedTestName(true)
.includeAllDataDrivenTestsWhenSkipping(true)
.listener("listener")
.listenerComparator("comparator")
.listenerFactory("factory")
.log(1)
.methodSelectors("selector")
.methods("methods")
.mixed(true)
.objectFactory("objectFactory")
.overrideIncludedMethods("method")
.parallel(TestNgOperation.Parallel.TESTS)
.propagateDataProviderFailureAsTestFailure(true)
.reporter("reporter")
.shareThreadPoolForDataProviders(true)
.spiListenersToSkip("listenter")
.suiteName("name")
.suiteThreadPoolSize(1)
.testClass("class")
.testJar("jar")
.testName("name")
.testNames("names")
.testRunFactory("runFactory")
.threadCount(1)
.threadPoolFactoryClass("poolClass")
.useDefaultListeners(true)
.useGlobalThreadPool(true)
.verbose(1)
.xmlPathInJar("jarPath")
.executeConstructProcessCommandList();
try (var softly = new AutoCloseableSoftAssertions()) {
for (var p : args) {
var found = false;
for (var a : params) {
if (a.startsWith(p)) {
found = true;
break;
}
}
softly.assertThat(found).as(p + " not found.").isTrue();
}
}
}
@Test
void testClass() {
var op = new TestNgOperation().testClass(FOO, BAR);
assertThat(op.options.get(TestNgOperation.TEST_CLASS_ARG)).isEqualTo(String.format("%s,%s", FOO, BAR));
assertThat(op.options().get("-testclass")).isEqualTo(String.format("%s,%s", FOO, BAR));
new TestNgOperation().testClass(List.of(FOO, BAR));
assertThat(op.options().get("-testclass")).as("as list")
.isEqualTo(String.format("%s,%s", FOO, BAR));
}
@Test
void testClasspath() {
var op = new TestNgOperation().testClasspath(FOO, BAR);
assertThat(op.testClasspath()).containsExactly(BAR, FOO);
}
@Test
void testDataProviderThreadCount() {
var op = new TestNgOperation().dataProviderThreadCount(1);
assertThat(op.options.get("-dataproviderthreadcount")).isEqualTo("1");
assertThat(op.options().get("-dataproviderthreadcount")).isEqualTo("1");
}
@Test
void testDependencyInjectorFactory() {
var op = new TestNgOperation().dependencyInjectorFactory(FOO);
assertThat(op.options.get("-dependencyinjectorfactory")).isEqualTo(FOO);
assertThat(op.options().get("-dependencyinjectorfactory")).isEqualTo(FOO);
}
@Test
void testDirectory() {
var foo = new File("FOO");
var op = new TestNgOperation().directory(FOO);
assertThat(op.options.get("-d")).isEqualTo(FOO);
assertThat(op.options().get("-d")).as("as string").isEqualTo(FOO);
op = new TestNgOperation().directory(foo);
assertThat(op.options().get("-d")).as("as file").isEqualTo(foo.getAbsolutePath());
op = new TestNgOperation().directory(foo.toPath());
assertThat(op.options().get("-d")).as("as path").isEqualTo(foo.getAbsolutePath());
}
@Test
void testExcludeGroups() {
var op = new TestNgOperation().excludeGroups(FOO, BAR);
assertThat(op.options.get("-excludegroups")).isEqualTo(String.format("%s,%s", FOO, BAR));
assertThat(op.options().get("-excludegroups")).isEqualTo(String.format("%s,%s", FOO, BAR));
op = new TestNgOperation().excludeGroups(List.of(FOO, BAR));
assertThat(op.options().get("-excludegroups")).as("as list").isEqualTo(String.format("%s,%s", FOO, BAR));
}
@Test
void testExecute() {
assertThatThrownBy(() ->
new TestNgOperation().fromProject(new Project())
.testClass("rife.bld.extension.TestNgSimpleTest")
.testClass("rife.bld.extension.TestNgExampleTest")
.execute())
.as("with testClass").isInstanceOf(ExitStatusException.class);
@ -88,10 +183,9 @@ class TestNgOperationTest {
assertThatCode(() ->
new TestNgOperation().fromProject(new Project())
.testClass("rife.bld.extension.TestNgSimpleTest")
.methods("rife.bld.extension.TestNgSimpleTest.verifyHello")
.methods("rife.bld.extension.TestNgExampleTest.foo")
.execute())
.as("with methods").doesNotThrowAnyException();
.as("with methods").isInstanceOf(ExitStatusException.class);
assertThatCode(() ->
new TestNgOperation().fromProject(new Project())
@ -101,245 +195,329 @@ class TestNgOperationTest {
assertThatCode(() ->
new TestNgOperation().fromProject(new Project())
.suites("src/test/resources/testng3.xml")
.suites("src/test/resources/testng2.xml")
.log(2)
.execute())
.as("suite 3").doesNotThrowAnyException();
.as("suite 2 - log ").doesNotThrowAnyException();
assertThatCode(() ->
new TestNgOperation().fromProject(new Project())
.suites("src/test/resources/testng3.xml")
.suites("src/test/resources/testng2.xml")
.testClasspath("lib/test/*", "build/main", "build/test")
.log(2)
.execute())
.as("with run classpath").doesNotThrowAnyException();
assertThatCode(() ->
new TestNgOperation().fromProject(new Project())
.suites("src/test/resources/testng2.xml")
.testClasspath(List.of("lib/test/*", "build/main", "build/test"))
.log(2)
.execute())
.as("with run classpath as list").doesNotThrowAnyException();
}
@Test
void testFailWheneverEverythingSkipped() {
var op = new TestNgOperation().failWhenEverythingSkipped(false);
assertThat(op.options.get("-failwheneverythingskipped")).isEqualTo("false");
assertThat(op.options().get("-failwheneverythingskipped")).isEqualTo("false");
op = new TestNgOperation().failWhenEverythingSkipped(true);
assertThat(op.options.get("-failwheneverythingskipped")).isEqualTo("true");
assertThat(op.options().get("-failwheneverythingskipped")).isEqualTo("true");
}
@Test
void testFailurePolicy() {
var op = new TestNgOperation().failurePolicy(TestNgOperation.FailurePolicy.CONTINUE);
assertThat(op.options.get("-configfailurepolicy")).isEqualTo("continue");
assertThat(op.options().get("-configfailurepolicy")).isEqualTo("continue");
op = new TestNgOperation().failurePolicy(TestNgOperation.FailurePolicy.SKIP);
assertThat(op.options.get("-configfailurepolicy")).isEqualTo("skip");
assertThat(op.options().get("-configfailurepolicy")).isEqualTo("skip");
}
@Test
void testGenerateResultsPerSuite() {
var op = new TestNgOperation().generateResultsPerSuite(false);
assertThat(op.options.get("-generateResultsPerSuite")).isEqualTo("false");
assertThat(op.options().get("-generateResultsPerSuite")).isEqualTo("false");
op = new TestNgOperation().generateResultsPerSuite(true);
assertThat(op.options.get("-generateResultsPerSuite")).isEqualTo("true");
assertThat(op.options().get("-generateResultsPerSuite")).isEqualTo("true");
}
@Test
void testGroups() {
var op = new TestNgOperation().groups(FOO, BAR);
assertThat(op.options.get("-groups")).isEqualTo(String.format("%s,%s", FOO, BAR));
assertThat(op.options().get("-groups")).isEqualTo(String.format("%s,%s", FOO, BAR));
op.groups(List.of("group3", "group4"));
assertThat(op.options().get("-groups")).isEqualTo("group3,group4");
}
@Test
void testIgnoreMissedTestName() {
var op = new TestNgOperation().ignoreMissedTestName(false);
assertThat(op.options.get("-ignoreMissedTestNames")).isEqualTo("false");
assertThat(op.options().get("-ignoreMissedTestNames")).isEqualTo("false");
op = new TestNgOperation().ignoreMissedTestName(true);
assertThat(op.options.get("-ignoreMissedTestNames")).isEqualTo("true");
assertThat(op.options().get("-ignoreMissedTestNames")).isEqualTo("true");
}
@Test
void testIncludeAllDataDrivenTestsWhenSkipping() {
var op = new TestNgOperation().includeAllDataDrivenTestsWhenSkipping(false);
assertThat(op.options.get("-includeAllDataDrivenTestsWhenSkipping")).isEqualTo("false");
assertThat(op.options().get("-includeAllDataDrivenTestsWhenSkipping")).isEqualTo("false");
op = new TestNgOperation().includeAllDataDrivenTestsWhenSkipping(true);
assertThat(op.options.get("-includeAllDataDrivenTestsWhenSkipping")).isEqualTo("true");
assertThat(op.options().get("-includeAllDataDrivenTestsWhenSkipping")).isEqualTo("true");
}
@Test
void testJar() {
var op = new TestNgOperation().testJar(FOO);
assertThat(op.options.get("-testjar")).isEqualTo(FOO);
assertThat(op.options().get("-testjar")).isEqualTo(FOO);
}
@Test
void testJunit() {
var op = new TestNgOperation().jUnit(false);
assertThat(op.options.get("-junit")).isEqualTo("false");
assertThat(op.options().get("-junit")).isEqualTo("false");
op = new TestNgOperation().jUnit(true);
assertThat(op.options.get("-junit")).isEqualTo("true");
assertThat(op.options().get("-junit")).isEqualTo("true");
}
@Test
void testListener() {
var ops = new TestNgOperation().listener(FOO, BAR);
assertThat(ops.options.get("-listener")).isEqualTo(String.format("%s,%s", FOO, BAR));
assertThat(ops.options().get("-listener")).isEqualTo(String.format("%s,%s", FOO, BAR));
ops = new TestNgOperation().listener(List.of(FOO, BAR));
assertThat(ops.options().get("-listener")).as("as list").isEqualTo(String.format("%s,%s", FOO, BAR));
}
@Test
void testMethodDetectors() {
var op = new TestNgOperation().methodSelectors(FOO, BAR);
assertThat(op.options.get("-methodselectors")).isEqualTo(String.format("%s,%s", FOO, BAR));
assertThat(op.options().get("-methodselectors")).isEqualTo(String.format("%s,%s", FOO, BAR));
op = new TestNgOperation().methodSelectors(List.of(FOO, BAR));
assertThat(op.options().get("-methodselectors")).as("as list").isEqualTo(String.format("%s,%s", FOO, BAR));
}
@Test
void testMethods() {
var op = new TestNgOperation().methods(FOO, BAR);
assertThat(op.options.get("-methods")).isEqualTo(String.format("%s,%s", FOO, BAR));
assertThat(op.methods()).containsExactly(BAR, FOO);
new TestNgOperation().methods(List.of(FOO, BAR));
assertThat(op.methods()).containsExactly(BAR, FOO);
}
@Test
void testMixed() {
var op = new TestNgOperation().mixed(false);
assertThat(op.options.get("-mixed")).isEqualTo("false");
assertThat(op.options().get("-mixed")).isEqualTo("false");
op = new TestNgOperation().mixed(true);
assertThat(op.options.get("-mixed")).isEqualTo("true");
assertThat(op.options().get("-mixed")).isEqualTo("true");
}
@Test
void testName() {
var op = new TestNgOperation().testName(FOO);
assertThat(op.options.get("-testname")).isEqualTo("\"" + FOO + '\"');
assertThat(op.options().get("-testname")).isEqualTo("\"" + FOO + '\"');
}
@Test
void testNames() {
var ops = new TestNgOperation().testNames(FOO, BAR);
assertThat(ops.options.get("-testnames")).isEqualTo(String.format("\"%s\",\"%s\"", FOO, BAR));
assertThat(ops.options().get("-testnames")).isEqualTo(String.format("\"%s\",\"%s\"", FOO, BAR));
new TestNgOperation().testNames(List.of(FOO, BAR));
assertThat(ops.options().get("-testnames")).as("as list").isEqualTo(String.format("\"%s\",\"%s\"", FOO, BAR));
}
@Test
void testObjectFactory() {
var ops = new TestNgOperation().objectFactory(FOO, BAR);
assertThat(ops.options.get("-objectfactory")).isEqualTo(String.format("%s,%s", FOO, BAR));
assertThat(ops.options().get("-objectfactory")).isEqualTo(String.format("%s,%s", FOO, BAR));
ops = new TestNgOperation().objectFactory(List.of(FOO, BAR));
assertThat(ops.options().get("-objectfactory")).as("as list").isEqualTo(String.format("%s,%s", FOO, BAR));
}
@Test
void testOverrideIncludedMethods() {
var ops = new TestNgOperation().overrideIncludedMethods(FOO, BAR);
assertThat(ops.options.get("-overrideincludedmethods")).isEqualTo(String.format("%s,%s", FOO, BAR));
assertThat(ops.options().get("-overrideincludedmethods")).isEqualTo(String.format("%s,%s", FOO, BAR));
ops = new TestNgOperation().overrideIncludedMethods(List.of(FOO, BAR));
assertThat(ops.options().get("-overrideincludedmethods")).as("as list").isEqualTo(String.format("%s,%s", FOO, BAR));
}
@Test
void testPackages() {
var op = new TestNgOperation().packages(FOO, BAR);
assertThat(op.packages).contains(FOO).contains(BAR);
assertThat(op.packages()).contains(FOO).contains(BAR);
op = new TestNgOperation().packages(List.of(FOO, BAR));
assertThat(op.packages()).as("as list").contains(FOO).contains(BAR);
}
@Test
void testParallel() {
var op = new TestNgOperation().parallel(TestNgOperation.Parallel.TESTS);
assertThat(op.options.get("-parallel")).isEqualTo("tests");
assertThat(op.options().get("-parallel")).isEqualTo("tests");
op = new TestNgOperation().parallel(TestNgOperation.Parallel.METHODS);
assertThat(op.options.get("-parallel")).isEqualTo("methods");
assertThat(op.options().get("-parallel")).isEqualTo("methods");
op = new TestNgOperation().parallel(TestNgOperation.Parallel.CLASSES);
assertThat(op.options.get("-parallel")).isEqualTo("classes");
assertThat(op.options().get("-parallel")).isEqualTo("classes");
}
@Test
void testPort() {
var op = new TestNgOperation().port(1);
assertThat(op.options.get("-port")).isEqualTo("1");
assertThat(op.options().get("-port")).isEqualTo("1");
}
@Test
void testPropagateDataProviderFailureAsTestFailure() {
var op = new TestNgOperation().propagateDataProviderFailureAsTestFailure(false);
assertThat(op.options.get("-propagateDataProviderFailureAsTestFailure")).isEqualTo("false");
assertThat(op.options().get("-propagateDataProviderFailureAsTestFailure")).isEqualTo("false");
op = new TestNgOperation().propagateDataProviderFailureAsTestFailure(true);
assertThat(op.options.get("-propagateDataProviderFailureAsTestFailure")).isEqualTo("true");
assertThat(op.options().get("-propagateDataProviderFailureAsTestFailure")).isEqualTo("true");
}
@Test
void testReported() {
var op = new TestNgOperation().reporter(FOO);
assertThat(op.options.get("-reporter")).isEqualTo(FOO);
assertThat(op.options().get("-reporter")).isEqualTo(FOO);
}
@Test
void testRunFactory() {
var op = new TestNgOperation().testRunFactory(FOO);
assertThat(op.options.get("-testrunfactory")).isEqualTo(FOO);
assertThat(op.options().get("-testrunfactory")).isEqualTo(FOO);
}
@Test
void testShareThreadPoolForDataProviders() {
var op = new TestNgOperation().shareThreadPoolForDataProviders(true);
assertThat(op.options().get("-shareThreadPoolForDataProviders")).isEqualTo("true");
op = new TestNgOperation().shareThreadPoolForDataProviders(false);
assertThat(op.options().get("-shareThreadPoolForDataProviders")).isNull();
}
@Test
void testSourceDir() {
var foo = new File(FOO);
var bar = new File(BAR);
var foobar = String.format("%s;%s", FOO, BAR);
var op = new TestNgOperation().sourceDir(FOO, BAR);
assertThat(op.options.get("-sourcedir")).isEqualTo(String.format("%s;%s", FOO, BAR));
assertThat(op.options().get("-sourcedir")).as("String...").isEqualTo(foobar);
op = new TestNgOperation().sourceDir(List.of(FOO, BAR));
assertThat(op.options().get("-sourcedir")).as("List(String...)").isEqualTo(foobar);
foobar = String.format("%s;%s", foo.getAbsolutePath(), bar.getAbsolutePath());
op = new TestNgOperation().sourceDir(foo, bar);
assertThat(op.options().get("-sourcedir")).as("File...").isEqualTo(foobar);
op = new TestNgOperation().sourceDirFiles(List.of(foo, bar));
assertThat(op.options().get("-sourcedir")).as("List(String...)").isEqualTo(foobar);
op = new TestNgOperation().sourceDir(foo.toPath(), bar.toPath());
assertThat(op.options().get("-sourcedir")).as("Path...").isEqualTo(foobar);
op = new TestNgOperation().sourceDirPaths(List.of(foo.toPath(), bar.toPath()));
assertThat(op.options().get("-sourcedir")).as("List(Path...)").isEqualTo(foobar);
}
@Test
void testSpiListenersToSkip() {
var ops = new TestNgOperation().spiListenersToSkip(FOO, BAR);
assertThat(ops.options.get("-spilistenerstoskip")).isEqualTo(String.format("%s,%s", FOO, BAR));
assertThat(ops.options().get("-spilistenerstoskip")).isEqualTo(String.format("%s,%s", FOO, BAR));
ops = new TestNgOperation().spiListenersToSkip(List.of(FOO, BAR));
assertThat(ops.options().get("-spilistenerstoskip")).as("as list").isEqualTo(String.format("%s,%s", FOO, BAR));
}
@Test
void testSuiteName() {
var op = new TestNgOperation().suiteName(FOO);
assertThat(op.options.get("-suitename")).isEqualTo("\"" + FOO + '\"');
assertThat(op.options().get("-suitename")).isEqualTo("\"" + FOO + '\"');
}
@Test
void testSuiteThreadPoolSize() {
var op = new TestNgOperation().suiteThreadPoolSize(1);
assertThat(op.options.get("-suitethreadpoolsize")).isEqualTo("1");
assertThat(op.options().get("-suitethreadpoolsize")).isEqualTo("1");
}
@Test
void testSuites() {
var op = new TestNgOperation().suites(FOO, BAR);
assertThat(op.suites).contains(FOO).contains(BAR);
assertThat(op.suites()).contains(FOO).contains(BAR);
op = new TestNgOperation().suites(List.of(FOO, BAR));
assertThat(op.suites()).as("as list").contains(FOO).contains(BAR);
}
@Test
void testThreadCount() {
var op = new TestNgOperation().threadCount(1);
assertThat(op.options.get("-threadcount")).isEqualTo("1");
assertThat(op.options().get("-threadcount")).isEqualTo("1");
}
@Test
void testThreadPoolFactoryClass() {
var op = new TestNgOperation().threadPoolFactoryClass(FOO);
assertThat(op.options.get("-threadpoolfactoryclass")).isEqualTo(FOO);
assertThat(op.options().get("-threadpoolfactoryclass")).isEqualTo(FOO);
}
@Test
void testUseDefaultListeners() {
var op = new TestNgOperation().useDefaultListeners(false);
assertThat(op.options.get("-usedefaultlisteners")).isEqualTo("false");
assertThat(op.options().get("-usedefaultlisteners")).isEqualTo("false");
op = new TestNgOperation().useDefaultListeners(true);
assertThat(op.options.get("-usedefaultlisteners")).isEqualTo("true");
assertThat(op.options().get("-usedefaultlisteners")).isEqualTo("true");
}
@Test
void testUseGlobalThreadPool() {
var op = new TestNgOperation().useGlobalThreadPool(true);
assertThat(op.options().get("-useGlobalThreadPool")).isEqualTo("true");
op = new TestNgOperation().useGlobalThreadPool(false);
assertThat(op.options().get("-useGlobalThreadPool")).isNull();
}
@Test
void testVerbose() {
var op = new TestNgOperation().log(1);
assertThat(op.options.get("-log")).isEqualTo("1");
assertThat(op.options().get("-log")).isEqualTo("1");
op = new TestNgOperation().verbose(1);
assertThat(op.options.get("-verbose")).isEqualTo("1");
assertThat(op.options().get("-verbose")).isEqualTo("1");
}
@Test
void testXmlPathInJar() {
var foo = new File(FOO);
var op = new TestNgOperation().xmlPathInJar(FOO);
assertThat(op.options.get("-xmlpathinjar")).isEqualTo(FOO);
assertThat(op.options().get("-xmlpathinjar")).as("as string").isEqualTo(FOO);
op = new TestNgOperation().xmlPathInJar(foo);
assertThat(op.options().get("-xmlpathinjar")).as("as file").isEqualTo(foo.getAbsolutePath());
op = new TestNgOperation().xmlPathInJar(foo.toPath());
assertThat(op.options().get("-xmlpathinjar")).as("as path").isEqualTo(foo.getAbsolutePath());
}
}

View file

@ -1,37 +0,0 @@
/*
* Copyright 2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package rife.bld.extension;
import org.testng.Assert;
import org.testng.annotations.Test;
/**
* Implements the TestNgSimpleTest class.
*
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
* @since 1.0
*/
class TestNgSimple2Test {
public static void main(String[] args) {
new TestNgSimple2Test().verifyHello();
}
@Test
void verifyHello() {
Assert.assertTrue(true);
}
}

View file

@ -1,42 +0,0 @@
/*
* Copyright 2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package rife.bld.extension;
import org.testng.Assert;
import org.testng.annotations.Test;
/**
* Implements the TestNgSimpleTest class.
*
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
* @since 1.0
*/
class TestNgSimpleTest {
public static void main(String[] args) {
new TestNgSimpleTest().verifyHello();
}
@Test
void testFail() {
Assert.fail("failed");
}
@Test
void verifyHello() {
Assert.assertTrue(true);
}
}

View file

@ -0,0 +1,38 @@
-alwaysrunlisteners
-configfailurepolicy
-d
-dataproviderthreadcount
-dependencyinjectorfactory
-excludegroups
-failwheneverythingskipped
-generateResultsPerSuite
-groups
-ignoreMissedTestNames
-includeAllDataDrivenTestsWhenSkipping
-listener
-listenercomparator
-listenerfactory
-log
-methods
-methodselectors
-mixed
-objectfactory
-overrideincludedmethods
-parallel
-propagateDataProviderFailureAsTestFailure
-reporter
-shareThreadPoolForDataProviders
-spilistenerstoskip
-suitename
-suitethreadpoolsize
-testclass
-testjar
-testname
-testnames
-testrunfactory
-threadcount
-threadpoolfactoryclass
-usedefaultlisteners
-useGlobalThreadPool
-verbose
-xmlpathinjar

View file

@ -2,7 +2,11 @@
<suite name="test suite 1" verbose="2">
<test name="simple test">
<classes>
<class name="rife.bld.extension.TestNgSimpleTest"/>
<class name="rife.bld.extension.TestNgExample"/>
<methods>
<exclude name="foo"/>
</methods>
</class>
</classes>
</test>
</suite>

View file

@ -2,9 +2,9 @@
<suite name="test suite 2" verbose="1">
<test name="exclude fail">
<classes>
<class name="rife.bld.extension.TestNgSimpleTest">
<class name="rife.bld.extension.TestNgExampleTest">
<methods>
<exclude name="testFail"/>
<exclude name="foo"/>
</methods>
</class>
</classes>

View file

@ -1,13 +0,0 @@
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="test suite 3">
<test name="test 2 classes">
<classes>
<class name="rife.bld.extension.TestNgSimpleTest">
<methods>
<exclude name="testFail"/>
</methods>
</class>
<class name="rife.bld.extension.TestNgSimple2Test"/>
</classes>
</test>
</suite>