Open kazurayam opened 4 months ago
I have developed
I made a test for it
The test wrote a file
which had the following content:
{
"implementation-class" : "org.testng.TestRunner",
"startDate" : "2024-05-20 09:42:07 +0900",
"name" : "Gradle test",
"suite" : "Gradle suite",
"outputDirectory" : "/Users/kazuakiurayama/github/TestngITestContextSerializer/lib/build/reports/tests/test/Gradle suite",
"allTestMethods" : [ {
"id" : "",
"methodName" : "test_ITestContext_toString",
"qualifiedName" : "com.kazurayam.testng.ITestContextSerializerTest.test_ITestContext_toString"
}, {
"id" : "",
"methodName" : "test_bare_exception",
"qualifiedName" : "com.kazurayam.testng.ITestContextSerializerTest.test_bare_exception"
}, {
"id" : "Test worker@1186339926",
"methodName" : "test_serialize",
"qualifiedName" : "com.kazurayam.testng.ITestContextSerializerTest.test_serialize"
} ],
"failedTests" : {
"allMethods" : [ ],
"allResults" : [ ]
},
"passedTests" : {
"allMethods" : [ {
"id" : "Test worker@1186339926",
"methodName" : "test_serialize",
"qualifiedName" : "com.kazurayam.testng.ITestContextSerializerTest.test_serialize"
} ],
"allResults" : [ {
"name" : "test_serialize",
"status" : "SUCCESS"
} ]
},
"skippedTests" : {
"allMethods" : [ ],
"allResults" : [ ]
},
"attributes" : {
"foo" : "bar",
"now" : "2024-05-20 09:42:08 +0900"
}
}
This JSON tells me exactly what information is held in a ITestContext object; very helpful.
I have learned enough about programming using the Jackson ObjectMapper. I can extend the ITestContext
more.
I want to serialize an instance of org.testng.ITestContext into JSON.