Configuration errors leading to a test skipping in TestNG without information in XML files

I am experimenting with TestNG and working on eclipse. I created a test suite and tried to run it from the command line.

Build failed with error saying

The final output during build says:

[testng] =============================================== [testng] Suite [testng] Total tests run: 1, Failures: 0, Skips: 1 [testng] Configuration Failures: 1, Skips: 2 [testng] =============================================== [testng] [testng] The tests failed. 

testng-results.xml and index.html do not report failures.

testng-failed.xml looks like this:

 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Failed suite [Default suite]"> <test name="Default test(failed)"> <classes> <class name="ABC.test.integration.PersistUrlTests"> <methods> <include name="springTestContextAfterTestClass"/> <include name="springTestContextBeforeTestClass"/> <include name="springTestContextPrepareTestInstance"/> <include name="springTestContextAfterTestMethod"/> <include name="checkTest"/> </methods> </class> <!-- ABC.test.integration.PersistUrlTests --> </classes> </test> <!-- Default test(failed) --> </suite> <!-- Failed suite [Default suite] --> 

The test is as follows:

 @Test @ContextConfiguration(locations = { "file:spring-configuration/mydb-integration-testing.xml" }) public class PersistUrlTests extends AbstractTestNGSpringContextTests { @Autowired protected MobiusDatabaseServiceClient mobiusDatabaseServiceClient; @Autowired UrlDAO urlDAO; @Autowired ScraperUrlDAO scraperUrlDAO; @BeforeClass public void init() throws Exception { } @Test public void checkTest() { GetActiveCategoriesResponse response = mobiusDatabaseServiceClient.newGetActiveCategoriesCall().call(); System.out.println(response.getCategoryList()); Assert.assertTrue(true); } } 

Suite is as follows:

 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Suite" parallel="none"> <test name="Test"> <classes> <class name="ABC.mydatabase.test.integration.PersistUrlTests"/> </classes> </test> <!-- Test --> </suite> <!-- Suite --> 

But, on the other hand, the last updated time for this file has passed. I am not sure if it is being updated or not.

I'm not sure how to debug these XML files generated by testNG, as they seem to be out of sync with each other.

Which file should I see exactly? And why don't they support the fact that the โ€œconfigurationโ€ failed?

+6
source share

Source: https://habr.com/ru/post/953413/


All Articles