File tree 3 files changed +5
-4
lines changed
main/java/org/testng/internal
3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
Current
2
- New : Yaml parser: implement loadClasses flag (Dzmitry Sankouski)
2
+ Fixed: GITHUB-2689 : Yaml parser: implement loadClasses flag (Dzmitry Sankouski)
3
3
Fixed: GITHUB-2676: NPE is triggered when working with ITestObjectFactory (Krishnan Mahadevan)
4
4
Fixed: GITHUB-2674: Run onTestSkipped for each value from data provider (Krishnan Mahadevan)
5
5
Fixed: GITHUB-2672: Log real stacktrace when test times out. (cdalexndr)
Original file line number Diff line number Diff line change 8
8
import java .util .Map ;
9
9
import java .util .function .Consumer ;
10
10
import org .testng .TestNGException ;
11
+ import org .testng .internal .objects .InstanceCreator ;
11
12
import org .testng .util .Strings ;
12
13
import org .testng .xml .XmlClass ;
13
14
import org .testng .xml .XmlInclude ;
@@ -378,13 +379,13 @@ public Object newInstance(Node node) {
378
379
nodeTuple ->
379
380
((ScalarNode ) nodeTuple .getKeyNode ()).getValue ().equals ("name" ))
380
381
.findFirst ()
381
- .orElseThrow (RuntimeException :: new )
382
+ .orElseThrow (() -> new TestNGException ( "Node 'name' not found" ) )
382
383
.getValueNode ();
383
384
className = ((ScalarNode ) valueNode ).getValue ();
384
385
} else {
385
386
className = ((ScalarNode ) node ).getValue ();
386
387
}
387
- return c .newInstance (className , loadClasses );
388
+ return InstanceCreator .newInstance (c , className , loadClasses );
388
389
} catch (Exception e ) {
389
390
throw new TestNGException ("Failed to instantiate class" , e );
390
391
}
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ public void testXmlDependencyGroups() throws IOException {
72
72
assertThat (Yaml .toYaml (actualXmlSuite ).toString ()).isEqualToNormalizingNewlines (expectedYaml );
73
73
}
74
74
75
- @ Test
75
+ @ Test ( description = "GITHUB-2689" )
76
76
public void testLoadClassesFlag () throws IOException {
77
77
YamlParser yamlParser = new YamlParser ();
78
78
String yamlSuiteFile = "src/test/resources/yaml/suiteWithNonExistentTest.yaml" ;
You can’t perform that action at this time.
0 commit comments