diff --git a/CHANGES.txt b/CHANGES.txt index 8725175f46..328d6c42ee 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ Current +New: XSD file for suite file validation (Julien Herr) Changed: GITHUB-2564: Source code is split into several modules for better modularity in the future (for now only a combined jar is released as it was before) Added: GITHUB-2564: Added license files as META-INF/LICENSE.txt within the released jar Test: GITHUB-2564: Added pax-exam-based OSGi test to verify the manifest @@ -582,9 +583,9 @@ Added: Allow injection of java.lang.reflect.Constructor and org.testng.ITestNGMe Fixed: Assertions in the Assertions class were not failing properly. Fixed: GITHUB-337: ConfigurationMethod#m_instance set to Boolean.FALSE due to incorrect constructor call in clone() + auto-boxing (davidely) Fixed: Fix NPE for dependency methods/groups (Krishnan Mahadevan) -Fixed: preserve-order bug (found by VladSarrokhin). +Fixed: preserve-order bug (found by VladSarrokhin). Fixed: GITHUB-300: OutOfMemoryException from reporters when there are a lot of tests -Fixed: GITHUB-137: Main parameters with a default value should be overridden if a main parameter is specified +Fixed: GITHUB-137: Main parameters with a default value should be overridden if a main parameter is specified Fixed: GITHUB-107: Allow enum values without converting them to uppercase. Fixed: @Guice with no modules specified is now supported Fixed: Reporter.log() invoked from listeners were being discarded @@ -601,7 +602,7 @@ Added: Big performance improvement when generating the reports (Frank Pavageau) Added: allows you to specify group dependencies in testng.xml Added: Blow up early if trying to include/exclude an unknown method Added: can now be specified under (Storm Qi) -Added: GITHUB-243: Add Reporter Output per Test in XMLReporter (dunse) +Added: GITHUB-243: Add Reporter Output per Test in XMLReporter (dunse) Fixed: Better HTML escaping of the stack traces Fixed: The failed assertions now use [] as delimiters instead of <> (better for the HTML reports) Fixed: GITHUB-237: Wrong time format in XML reporter @@ -786,7 +787,7 @@ Eclipse: Added: New quick fix "Add static import org.testng.AssertJUnit.assertXXX" Added: New workspace wide setting: excluded stack traces, to provide shorter stack traces in the view Added: New "Clear results" icon in the tool bar -Added: When the search filter is modified, don't update the tree live if it is too big +Added: When the search filter is modified, don't update the tree live if it is too big Added: Two new @Test refactorings (pull to class level, push to method level) Added: JUnit conversion: @Ignore Added: JUnit conversion: assertArrayEquals() @@ -930,10 +931,10 @@ Added: -testnames (command line) and testnames (ant) Added: New ant task tag: propertyset (Todd Wells) Added: ITestNGListenerFactory Added: Passing command line properties via the ant task and doc update (Todd Wells) -Added: Hierarchical XmlSuites (Nalin Makar) +Added: Hierarchical XmlSuites (Nalin Makar) Added: Reporter#clear() Fixed: NullPointerException when a suite produces no results (Cefn Hoile) -Fixed: Identical configuration methods were not always invoked in the correct order in superclasses (Nalin Makar) +Fixed: Identical configuration methods were not always invoked in the correct order in superclasses (Nalin Makar) Fixed: @DataProvider(parallel = true) was passing incorrect parameters with injection Fixed: Replaced @Test(sequential) with @Test(singleThreaded) Fixed: If inherited configuration methods had defined deps, they could be invoked in incorrect order (Nalin Makar) @@ -950,9 +951,9 @@ Fixed: Issue78 NPE with non-public class. Now throws TestNG exception Fixed: NPE with @Optional null parameters (Yves Dessertine) Fixed: TESTNG-387 TestNG not rerunning test method with the right data set from Data Provider (Francois Reynaud) Fixed: Show correct number of pass/failed numbers for tests using @DataProvider -Fixed: Return correct method status and exception (if any) in InvokedMethodListener.afterInvocation() -Fixed: Trivial fixes: TESTNG-241 (log message at Info), Issue2 (throw SAXException and not NPE for invalid testng xml) -Fixed: Configuration methods couldn't depend on an abstract method (Nalin Makar) +Fixed: Return correct method status and exception (if any) in InvokedMethodListener.afterInvocation() +Fixed: Trivial fixes: TESTNG-241 (log message at Info), Issue2 (throw SAXException and not NPE for invalid testng xml) +Fixed: Configuration methods couldn't depend on an abstract method (Nalin Makar) Fixed: TestNG#setTestClasses was not resetting m_suites Fixed: Exceptions thrown by IInvokedMethodListeners were not caught (Nalin Makar) Fixed: @Listeners now works on base classes as well @@ -1067,8 +1068,8 @@ Fixed: Quick fixes no longer introduce deprecated annotations (Greg Turnquist) 5.9 2009/04/09 -Added: New ant task boolean flag: delegateCommandSystemProperties (Justin) -Added: skipfailedinvocations under in testng-1.0.dtd (Gael Marziou / Stevo Slavic) +Added: New ant task boolean flag: delegateCommandSystemProperties (Justin) +Added: skipfailedinvocations under in testng-1.0.dtd (Gael Marziou / Stevo Slavic) Added: -testrunfactory on the command line and in the ant task (Vitalyi Pamajonkov) Added: TESTNG-298: parallel="classes", which allows entire classes to be run in the same thread Added: @BeforeMethod can now declare Object[] as a parameter, which will be filled by the parameters of the test method @@ -1161,7 +1162,7 @@ Added: ISuite now gives access to the current XmlSuite Fixed: TESTNG-139 dependsOnMethods gets confused when dependency is "protected" Fixed: TESTNG-141 junit attribute set to false in testng-failed.xml when it should be true Fixed: TESTNG-142 Exceptions in DataProvider are not reported as failed test -Added: Improved behavior for @Before/@AfterClass when using @Factory +Added: Improved behavior for @Before/@AfterClass when using @Factory (https://forums.opensymphony.com/thread.jspa?threadID=6594&messageID=122294#122294) Added: Support for concurrent execution for invocationCount=1 threadPoolSize>1 and @DataProvider (https://forums.opensymphony.com/thread.jspa?threadID=64738&tstart=0) @@ -1197,7 +1198,7 @@ Added: Method selectors receive a Context and can stop the chain with setStopped Fixed: XmlMethodSelector was always run first regardless of its priority Added: @BeforeGroups/@AfterGroups can live in classes without @Test methods Added: DataProvider can now take an ITestContext parameter -Fixed: Wasn't parsing correctly +Fixed: Wasn't parsing correctly Fixed: Annotation Transformers now work on class-level annotations Fixed: Some class-level @Test attributes were not always honored Added: Clean separation between @Test invocation events and @Configuration invocation events @@ -1234,7 +1235,7 @@ Eclipse plug-in Fixed: groups with multi-attribute javadoc annotations Fixed: consistent behavior for dependsOnMethods Fixed: consistent behavior for tests with dependsOnGroups (a warning is emitted) -Fixed: consistent merge of configuration arguments when an existing launch configuration exists +Fixed: consistent merge of configuration arguments when an existing launch configuration exists =========================================================================== 5.3 2006/10/30 @@ -1338,7 +1339,7 @@ Added: Can now specify listener classes 5.0.1 Fixed: reports generated by SuiteHTMLReporter do not work with JDK1.4 - + =========================================================================== 5.0 @@ -1424,7 +1425,7 @@ Fixed: TESTNG-18: Eclipse plugin ignores Factory annotation Fixed: TESTNG-21: Show differences when double clicking assertion exceptions Added: UI allows setting orientation (even more space) https://forums.opensymphony.com/thread.jspa?threadID=17225&messageID=33805#33805 - + =========================================================================== 4.5 @@ -1527,7 +1528,7 @@ Fixed: dependsOnGroups wasn't working on regular expressions Fixed: Bug in when directories contain spaces in their names Fixed: Introduced a JDK5 dependency in the JDK1.4 build (getEnclosingClass()) Fixed: Output directory in ant task was not honored if it didn't exist -Fixed: Problem with timeout according to +Fixed: Problem with timeout according to https://forums.opensymphony.com/thread.jspa?threadID=6707 Eclipse plug-in: @@ -1537,7 +1538,7 @@ Fixed: Bug in QuickFix implementation Added: Quick Fix for JUnit conversion (Annotations and JavaDoc) Fixed: Methods Run as TestNG test Added: Package level Run as TestNG test -Fixed: Resources from the linked directories are using a wrong path when +Fixed: Resources from the linked directories are using a wrong path when passed to command line TestNG IDEA plug-in: @@ -1602,7 +1603,7 @@ Fixed: TestNGException thrown when TestNG conditions are not fulfilled Documentation: - New assert classes -- New ways to launch +- New ways to launch - JUnitConverter documentation - new beforeSuite/afterSuite diff --git a/testng-core/src/test/resources/hosts.properties b/bin/hosts.properties similarity index 100% rename from testng-core/src/test/resources/hosts.properties rename to bin/hosts.properties diff --git a/bin/master.bat b/bin/master.bat index a4040d8284..bd9bdd0e02 100644 --- a/bin/master.bat +++ b/bin/master.bat @@ -1 +1 @@ -testng -hostfile test\hosts.properties -d test\test-output %1 %2 %3 %4 %5 test\testng.xml \ No newline at end of file +testng -hostfile hosts.properties -d test\test-output %1 %2 %3 %4 %5 test\testng.xml diff --git a/settings.gradle.kts b/settings.gradle.kts index 79d629710e..73c0c340a3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -6,7 +6,7 @@ rootProject.name = "testng-root" plugins { `gradle-enterprise` - id("de.fayard.refreshVersions") version "0.10.0" + id("de.fayard.refreshVersions") version "0.10.1" } gradleEnterprise { diff --git a/testng-core/build.gradle.kts b/testng-core/build.gradle.kts index 137bafeff2..cdab660307 100644 --- a/testng-core/build.gradle.kts +++ b/testng-core/build.gradle.kts @@ -1,8 +1,9 @@ plugins { id("testng.java-library") groovy - kotlin("jvm") version "1.5.10" + kotlin("jvm") id("testng.sonarqube") + id("com.github.bjornvester.xjc") } java { diff --git a/testng-core/src/main/resources/testng-1.1.xsd b/testng-core/src/main/resources/testng-1.1.xsd new file mode 100644 index 0000000000..3c1b7ad9b2 --- /dev/null +++ b/testng-core/src/main/resources/testng-1.1.xsd @@ -0,0 +1,511 @@ + + + + + + Here is a quick overview of the main parts of this DTD. For more information, + refer to the main web site. + + A suite is made of tests and parameters. + + A test is made of three parts: + +
    +
  • parameters, which override the suite parameters +
  • +
  • groups, made of two parts +
  • +
  • classes, defining which classes are going to be part of this test run +
  • +
+ + In turn, groups are made of two parts: +
    +
  • Definitions, which allow you to group groups into + bigger groups +
  • +
  • Runs, which defines the groups that the methods + must belong to in order to be run during this test +
  • +
+
+
+ + + + A suite is the top-level element of a testng.xml file + + + + + + + + + + + + + + + + + + The name of this suite (as it will appear in the reports) + + + + + + + Whether to run in JUnit mode. + + + + + + + How verbose the output on the console will be. + This setting has no impact on the HTML reports. + + + + + + + Whether TestNG should use different threads + to run your tests (might speed up the process) + + + + + + + A module used to create the parent injector of all guice injectors used in tests of the suite + + + + + + + The stage with which the parent injector is created + + + + + + + Whether to continue attempting Before/After Class/Methods after they've failed once + or just skip remaining. + + + + + + + An integer giving the size of the thread pool to use if you set parallel. + + + + + + + If "javadoc", TestNG will look for JavaDoc annotations in your sources, + otherwise it will use JDK5 annotations. + + + + + + + The time to wait in milliseconds before aborting the method (if parallel="methods"), + or the test (parallel="tests") + + + + + + + Whether to skip failed invocations. + + + + + + + An integer giving the size of the thread pool to use for parallel data providers. + + + + + + + A class that implements IObjectFactory that will be used to instantiate the test objects. + + + + + + + + + If true, tests that return a value will be run as well + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A list of XML files that contain more suite descriptions + + + + + + + + + + + + + + + + + Parameters can be defined at the <suite> or at the <test> level. + Parameters defined at the <test> level override parameters of the same name in <suite> + Parameters are used to link Java method parameters to their actual value, defined here. + + + + + + + + + + + Method selectors define user classes used to select which methods to run. + They need to implement + org.testng.IMethodSelector + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A test contains parameters and classes. + Additionally, you can define additional groups ("groups of groups") + + + + + + + + + + + + + + The name of this test (as it will appear in the reports) + + + + + + + Whether to run in JUnit mode. + + + + + + + How verbose the output on the console will be. + This setting has no impact on the HTML reports. + Default value: suite level verbose. + + + + + + + Whether TestNG should use different threads to run your tests (might speed up the process) + + + + + + + An integer giving the size of the thread pool to be used if parallel mode is used. + Overrides the suite level value. + + + + + + + If "javadoc", TestNG will look for JavaDoc annotations in your sources, + otherwise it will use JDK5 annotations. + + + + + + + the time to wait in milliseconds before aborting + the method (if parallel="methods"), or the test (if parallel="tests") + + + + + + + flag to enable/disable current test. Default value: true + + + + + + + Whether to skip failed invocations. + + + + + + + If true, the classes in this tag will be run in the same order as found in the XML file. + + + + + + + + + + + + + If true, tests that return a value will be run as well + + + + + + + + + Defines additional groups ("groups of groups") and also which groups to include in this test run + + + + + + + + + + + + + + + + + + + + + + Defines which groups to include in the current group of groups + + + + + + + + + + + + + + + Defines which groups to exclude from the current group of groups + + + + + + + + + + The subtag of groups used to define which groups should be run + + + + + + + + + + + + + + + + + + + + + + + + + + The list of classes to include in this test + + + + + + + + + + + + + + + + + + + + + + The list of packages to include in this test + + + + + + + + + + + + The package description. + If the package name ends with .* then subpackages are included too. + + + + + + + + + + + + + + The list of methods to include/exclude from this test + + + + + + + + + + + + + + The list of listeners that will be passed to TestNG + + + + + + + + + + + + + +
diff --git a/testng-core/src/test/java/org/testng/JarFileUtilsTest.java b/testng-core/src/test/java/org/testng/JarFileUtilsTest.java index a2fcb562aa..4a7aa8d0ce 100644 --- a/testng-core/src/test/java/org/testng/JarFileUtilsTest.java +++ b/testng-core/src/test/java/org/testng/JarFileUtilsTest.java @@ -156,7 +156,7 @@ public Collection process(Collection suites) { } private static JarFileUtils newJarFileUtils(List testNames) throws MalformedURLException { - return newJarFileUtils("jarfileutils/testng-tests.xml", testNames); + return newJarFileUtils("samples/jarfileutils/testng-tests.xml", testNames); } private static JarFileUtils newJarFileUtils(String suiteXmlName, List testNames) diff --git a/testng-core/src/test/java/org/testng/jarfileutils/JarCreator.java b/testng-core/src/test/java/org/testng/jarfileutils/JarCreator.java index 5a1c78f2e7..5145d643bd 100644 --- a/testng-core/src/test/java/org/testng/jarfileutils/JarCreator.java +++ b/testng-core/src/test/java/org/testng/jarfileutils/JarCreator.java @@ -44,11 +44,11 @@ private static Class[] getTestClasses() { private static String[] getResources() { return new String[] { - "jarfileutils/testng-tests.xml", - "jarfileutils/child.xml", - "jarfileutils/child/child.xml", - "jarfileutils/child/childofchild/childofchild.xml", - "jarfileutils/childofchild/childofchild.xml" + "samples/jarfileutils/testng-tests.xml", + "samples/jarfileutils/child.xml", + "samples/jarfileutils/child/child.xml", + "samples/jarfileutils/child/childofchild/childofchild.xml", + "samples/jarfileutils/childofchild/childofchild.xml" }; } } diff --git a/testng-core/src/test/java/org/testng/xml/ParserTest.java b/testng-core/src/test/java/org/testng/xml/ParserTest.java index 938af7bc66..0577b5aa42 100644 --- a/testng-core/src/test/java/org/testng/xml/ParserTest.java +++ b/testng-core/src/test/java/org/testng/xml/ParserTest.java @@ -9,7 +9,7 @@ public class ParserTest { - private static final String XML_FILE_NAME = "src/test/resources/a.xml"; + private static final String XML_FILE_NAME = "src/test/resources/samples/a.xml"; @Test(dataProvider = "dp") public void testParsing(String file) throws Exception { diff --git a/testng-core/src/test/java/org/testng/xml/SuiteXmlParserTest.java b/testng-core/src/test/java/org/testng/xml/SuiteXmlParserTest.java index ac81a5eafa..d55ac522fd 100644 --- a/testng-core/src/test/java/org/testng/xml/SuiteXmlParserTest.java +++ b/testng-core/src/test/java/org/testng/xml/SuiteXmlParserTest.java @@ -10,7 +10,7 @@ public class SuiteXmlParserTest { - private static final File PARENT = new File(getPathToResource("xml")); + private static final File PARENT = new File(getPathToResource("samples/xml")); @DataProvider private static Object[][] dp() { diff --git a/testng-core/src/test/java/org/testng/xml/XmlSuiteTest.java b/testng-core/src/test/java/org/testng/xml/XmlSuiteTest.java index 05f412e82c..b51436ca5e 100644 --- a/testng-core/src/test/java/org/testng/xml/XmlSuiteTest.java +++ b/testng-core/src/test/java/org/testng/xml/XmlSuiteTest.java @@ -63,7 +63,7 @@ public Object[][] getData() { @Test(description = "GITHUB-1668") public void ensureNoExceptionsAreRaisedWhenMethodSelectorsDefinedAtSuiteLevel() throws IOException { - Parser parser = new Parser("src/test/resources/xml/issue1668.xml"); + Parser parser = new Parser("src/test/resources/samples/xml/issue1668.xml"); List suites = parser.parseToList(); XmlSuite xmlsuite = suites.get(0); TestNG testNG = create(); @@ -76,7 +76,7 @@ public void ensureNoExceptionsAreRaisedWhenMethodSelectorsDefinedAtSuiteLevel() @Test(description = "GITHUB-435") public void ensureSuiteLevelPackageIsAppliedToAllTests() throws IOException { - Parser parser = new Parser("src/test/resources/xml/issue435.xml"); + Parser parser = new Parser("src/test/resources/samples/xml/issue435.xml"); List suites = parser.parseToList(); XmlSuite xmlsuite = suites.get(0); assertThat(xmlsuite.getTests().get(0).getClasses().size()).isEqualTo(0); @@ -93,7 +93,7 @@ public void ensureSuiteLevelBeanshellIsAppliedToAllTests() throws IOException { StringOutputStream stream = new StringOutputStream(); try { System.setOut(new PrintStream(stream)); - Parser parser = new Parser("src/test/resources/xml/issue1674.xml"); + Parser parser = new Parser("src/test/resources/samples/xml/issue1674.xml"); List suites = parser.parseToList(); XmlSuite xmlsuite = suites.get(0); assertThat(xmlsuite.getTests().get(0).getMethodSelectors().size()).isEqualTo(0); diff --git a/testng-core/src/test/java/test/CheckSuitesInitializationTest.java b/testng-core/src/test/java/test/CheckSuitesInitializationTest.java index 9b01becd15..997802421f 100644 --- a/testng-core/src/test/java/test/CheckSuitesInitializationTest.java +++ b/testng-core/src/test/java/test/CheckSuitesInitializationTest.java @@ -29,7 +29,7 @@ public class CheckSuitesInitializationTest extends SimpleBaseTest { public void check() { TestListenerAdapter tla = new TestListenerAdapter(); TestNG tng = create(); - String testngXmlPath = getPathToResource("checksuitesinitialization/parent-suite.xml"); + String testngXmlPath = getPathToResource("samples/checksuitesinitialization/parent-suite.xml"); tng.setTestSuites(Collections.singletonList(testngXmlPath)); tng.addListener(tla); tng.run(); diff --git a/testng-core/src/test/java/test/SimpleBaseTest.java b/testng-core/src/test/java/test/SimpleBaseTest.java index 88ba4cde06..3315bfb71c 100644 --- a/testng-core/src/test/java/test/SimpleBaseTest.java +++ b/testng-core/src/test/java/test/SimpleBaseTest.java @@ -10,11 +10,7 @@ import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; import java.util.regex.Pattern; import org.testng.Assert; import org.testng.ITestNGMethod; @@ -55,6 +51,19 @@ public static InvokedMethodNameListener run(XmlSuite... suites) { return run(false, suites); } + public static InvokedMethodNameListener runFromSuite(String... suites) { + TestNG tng = create(); + List testSuites = new ArrayList<>(); + for (String suite : suites) { + testSuites.add(getPathToResource(suite)); + } + tng.setTestSuites(testSuites); + InvokedMethodNameListener listener = new InvokedMethodNameListener(); + tng.addListener(listener); + tng.run(); + return listener; + } + public static InvokedMethodNameListener run(boolean skipConfiguration, XmlSuite... suites) { TestNG tng = create(suites); diff --git a/testng-core/src/test/java/test/commandline/CommandLineOverridesXml.java b/testng-core/src/test/java/test/commandline/CommandLineOverridesXml.java index c81cd57b97..3d7160bf7e 100644 --- a/testng-core/src/test/java/test/commandline/CommandLineOverridesXml.java +++ b/testng-core/src/test/java/test/commandline/CommandLineOverridesXml.java @@ -55,7 +55,7 @@ private void runTest(String group, String excludedGroups, List methods) @Test public void ensureThatParallelismAndThreadCountAreRallied() { TestNG testng = create(); - testng.setTestSuites(Collections.singletonList("src/test/resources/987.xml")); + testng.setTestSuites(Collections.singletonList("src/test/resources/samples/987.xml")); testng.setThreadCount(2); testng.setParallel(XmlSuite.ParallelMode.METHODS); testng.run(); diff --git a/testng-core/src/test/java/test/configurationfailurepolicy/FailurePolicyTest.java b/testng-core/src/test/java/test/configurationfailurepolicy/FailurePolicyTest.java index 329fe4248a..e97fe17322 100644 --- a/testng-core/src/test/java/test/configurationfailurepolicy/FailurePolicyTest.java +++ b/testng-core/src/test/java/test/configurationfailurepolicy/FailurePolicyTest.java @@ -137,7 +137,7 @@ public void commandLineTestWithXMLFile_policyAsSkip() { OutputDirectoryPatch.getOutputDirectory(), "-configfailurepolicy", "skip", - getPathToResource("testng-configfailure.xml") + getPathToResource("samples/testng-configfailure.xml") }; TestListenerAdapter tla = new TestListenerAdapter(); TestNG.privateMain(argv, tla); @@ -155,7 +155,7 @@ public void commandLineTestWithXMLFile_policyAsContinue() { OutputDirectoryPatch.getOutputDirectory(), "-configfailurepolicy", "continue", - getPathToResource("testng-configfailure.xml") + getPathToResource("samples/testng-configfailure.xml") }; TestListenerAdapter tla = new TestListenerAdapter(); TestNG.privateMain(argv, tla); diff --git a/testng-core/src/test/java/test/github1417/TestParamsInjectionInBeforeClass.java b/testng-core/src/test/java/test/github1417/TestParamsInjectionInBeforeClass.java index ef52f429ea..883748b192 100644 --- a/testng-core/src/test/java/test/github1417/TestParamsInjectionInBeforeClass.java +++ b/testng-core/src/test/java/test/github1417/TestParamsInjectionInBeforeClass.java @@ -10,7 +10,7 @@ public class TestParamsInjectionInBeforeClass { @Test public void testMethod() { - String suite = "src/test/resources/parametertest/1417.xml"; + String suite = "src/test/resources/samples/parametertest/1417.xml"; TestNG testNG = new TestNG(); testNG.setTestSuites(Collections.singletonList(suite)); testNG.run(); diff --git a/testng-core/src/test/java/test/groupinvocation/GroupSuiteTest.java b/testng-core/src/test/java/test/groupinvocation/GroupSuiteTest.java index 3c7da7d448..661f6d3cf2 100644 --- a/testng-core/src/test/java/test/groupinvocation/GroupSuiteTest.java +++ b/testng-core/src/test/java/test/groupinvocation/GroupSuiteTest.java @@ -19,7 +19,7 @@ /** Test that tags can have g. */ public class GroupSuiteTest extends SimpleBaseTest { - private static final File PARENT = new File(getPathToResource("groupinvocation")); + private static final File PARENT = new File(getPathToResource("samples/groupinvocation")); @DataProvider private static Object[][] dp() { diff --git a/testng-core/src/test/java/test/guice/GuiceParentModuleTest.java b/testng-core/src/test/java/test/guice/GuiceParentModuleSample.java similarity index 94% rename from testng-core/src/test/java/test/guice/GuiceParentModuleTest.java rename to testng-core/src/test/java/test/guice/GuiceParentModuleSample.java index 3f4ddc67b3..0bb1a41bcb 100644 --- a/testng-core/src/test/java/test/guice/GuiceParentModuleTest.java +++ b/testng-core/src/test/java/test/guice/GuiceParentModuleSample.java @@ -8,7 +8,7 @@ @Test @Guice(modules = GuiceTestModule.class) -public class GuiceParentModuleTest { +public class GuiceParentModuleSample { @Inject MySession mySession; @Inject MyService myService; @Inject ITestContext context; diff --git a/testng-core/src/test/java/test/guice/GuiceTest.java b/testng-core/src/test/java/test/guice/GuiceTest.java index a212378d01..83565a0c5c 100644 --- a/testng-core/src/test/java/test/guice/GuiceTest.java +++ b/testng-core/src/test/java/test/guice/GuiceTest.java @@ -6,6 +6,7 @@ import org.testng.TestNG; import org.testng.annotations.Test; import org.testng.xml.XmlSuite; +import test.InvokedMethodNameListener; import test.SimpleBaseTest; import test.guice.issue2343.Person; import test.guice.issue2343.SampleA; @@ -77,4 +78,10 @@ public void ensureConfigureMethodCalledOnceForModule() { assertEquals(TestModuleOne.counter.get(), 1, "TestModuleOne configuration called times"); assertEquals(TestModuleTwo.counter.get(), 1, "TestModuleTwo configuration called times"); } + + @Test + public void guiceParentModuleTest() { + InvokedMethodNameListener listener = runFromSuite("samples/parent-module-suite.xml"); + assertThat(listener.getSucceedMethodNames()).containsExactly("testService"); + } } diff --git a/testng-core/src/test/java/test/jarpackages/JarPackagesTest.java b/testng-core/src/test/java/test/jarpackages/JarPackagesTest.java index 997d37110f..a954513685 100644 --- a/testng-core/src/test/java/test/jarpackages/JarPackagesTest.java +++ b/testng-core/src/test/java/test/jarpackages/JarPackagesTest.java @@ -26,7 +26,7 @@ private TestListenerAdapter init(String jarFile) { @Test public void jarWithTestngXml() { - TestListenerAdapter tla = init("withtestngxml.jar"); + TestListenerAdapter tla = init("samples/withtestngxml.jar"); Assert.assertEquals(tla.getPassedTests().size(), 2); String first = tla.getPassedTests().get(0).getName(); String second = tla.getPassedTests().get(1).getName(); @@ -37,7 +37,7 @@ public void jarWithTestngXml() { @Test public void jarWithoutTestngXml() { - TestListenerAdapter tla = init("withouttestngxml.jar"); + TestListenerAdapter tla = init("samples/withouttestngxml.jar"); Assert.assertEquals(tla.getPassedTests().size(), 2); String first = tla.getPassedTests().get(0).getName(); String second = tla.getPassedTests().get(1).getName(); diff --git a/testng-core/src/test/java/test/listeners/ExecutionListenerAndSuiteListenerTest.java b/testng-core/src/test/java/test/listeners/ExecutionListenerAndSuiteListenerTest.java index ae78446ff8..adafb4b2ca 100644 --- a/testng-core/src/test/java/test/listeners/ExecutionListenerAndSuiteListenerTest.java +++ b/testng-core/src/test/java/test/listeners/ExecutionListenerAndSuiteListenerTest.java @@ -12,7 +12,7 @@ public class ExecutionListenerAndSuiteListenerTest extends SimpleBaseTest { @Test public void executionListenerAndSuiteListenerTest() { - String suiteFile = getPathToResource("executionlistenersingletoncheck/parent.xml"); + String suiteFile = getPathToResource("samples/executionlistenersingletoncheck/parent.xml"); List suites = getSuites(suiteFile); TestNG testng = new TestNG(); testng.setXmlSuites(suites); diff --git a/testng-core/src/test/java/test/listeners/ListenerInXmlTest.java b/testng-core/src/test/java/test/listeners/ListenerInXmlTest.java index 871c7ed375..9351f220ff 100644 --- a/testng-core/src/test/java/test/listeners/ListenerInXmlTest.java +++ b/testng-core/src/test/java/test/listeners/ListenerInXmlTest.java @@ -11,7 +11,7 @@ public class ListenerInXmlTest extends SimpleBaseTest { @Test(description = "Make sure that listeners defined in testng.xml are invoked") public void listenerInXmlShouldBeInvoked() { TestNG tng = create(); - tng.setTestSuites(Arrays.asList(getPathToResource("listener-in-xml.xml"))); + tng.setTestSuites(Arrays.asList(getPathToResource("samples/listener-in-xml.xml"))); LListener.invoked = false; tng.run(); Assert.assertTrue(LListener.invoked); diff --git a/testng-core/src/test/java/test/listeners/github1284/TestListeners.java b/testng-core/src/test/java/test/listeners/github1284/TestListeners.java index ae4c420b7b..b347264575 100644 --- a/testng-core/src/test/java/test/listeners/github1284/TestListeners.java +++ b/testng-core/src/test/java/test/listeners/github1284/TestListeners.java @@ -13,7 +13,7 @@ public void verifyWithoutListener() { TestNG testNG = create(); testNG.setTestSuites( Collections.singletonList( - getPathToResource("test/listeners/github1284/github1284_nolistener.xml"))); + getPathToResource("samples/test/listeners/github1284/github1284_nolistener.xml"))); testNG.run(); Assert.assertEquals(testNG.getStatus(), 0); } @@ -23,7 +23,7 @@ public void verifyWithListener() { TestNG testNG = create(); testNG.setTestSuites( Collections.singletonList( - getPathToResource("test/listeners/github1284/github1284_withlistener.xml"))); + getPathToResource("samples/test/listeners/github1284/github1284_withlistener.xml"))); testNG.run(); Assert.assertEquals(testNG.getStatus(), 0); } @@ -32,7 +32,8 @@ public void verifyWithListener() { public void verifyWithChildSuite() { TestNG testNG = create(); testNG.setTestSuites( - Collections.singletonList(getPathToResource("test/listeners/github1284/github1284.xml"))); + Collections.singletonList( + getPathToResource("samples/test/listeners/github1284/github1284.xml"))); testNG.run(); Assert.assertEquals(testNG.getStatus(), 0); } diff --git a/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/MultipleInterceptorsTest.java b/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/MultipleInterceptorsTest.java index 9a25ba738f..65c63a3609 100644 --- a/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/MultipleInterceptorsTest.java +++ b/testng-core/src/test/java/test/methodinterceptors/multipleinterceptors/MultipleInterceptorsTest.java @@ -29,7 +29,7 @@ public void testMultipleInterceptorsWithPreserveOrder() { tng.setTestSuites( Collections.singletonList( getPathToResource( - "/methodinterceptors/multipleinterceptors/multiple-interceptors.xml"))); + "/samples/methodinterceptors/multipleinterceptors/multiple-interceptors.xml"))); TestListenerAdapter tla = new TestListenerAdapter(); tng.addListener((ITestNGListener) tla); tng.run(); diff --git a/testng-core/src/test/java/test/methodselectors/CommandLineTest.java b/testng-core/src/test/java/test/methodselectors/CommandLineTest.java index 448b4d71c6..16bed9da13 100644 --- a/testng-core/src/test/java/test/methodselectors/CommandLineTest.java +++ b/testng-core/src/test/java/test/methodselectors/CommandLineTest.java @@ -129,7 +129,7 @@ public void commandLineNoTest1Selector() { public void commandLineTestWithXmlFile() { ppp("commandLineTestWithXmlFile()"); ARG_WITHOUT_CLASSES[5] = "test.methodselectors.NoTest1MethodSelector:5"; - ARG_WITHOUT_CLASSES[6] = getPathToResource("testng-methodselectors.xml"); + ARG_WITHOUT_CLASSES[6] = getPathToResource("samples/testng-methodselectors.xml"); TestNG.privateMain(ARG_WITHOUT_CLASSES, tla); String[] passed = {"test2", "test3"}; String[] failed = {}; @@ -142,7 +142,7 @@ public void testOverrideExcludedMethodsCommandLineExclusions() { ppp("testOverrideExcludedMethodsCommandLineExclusions"); String[] args = new String[] { - "src/test/resources/test/methodselectors/sampleTest.xml", + "src/test/resources/samples/test/methodselectors/sampleTest.xml", "-log", "0", "-d", @@ -166,7 +166,7 @@ public void testOverrideExcludedMethodsSuiteExclusions() { ppp("testOverrideExcludedMethodsSuiteExclusions"); String[] args = new String[] { - "src/test/resources/test/methodselectors/sampleTestExclusions.xml", + "src/test/resources/samples/test/methodselectors/sampleTestExclusions.xml", "-log", "0", "-d", diff --git a/testng-core/src/test/java/test/methodselectors/MethodSelectorInSuiteTest.java b/testng-core/src/test/java/test/methodselectors/MethodSelectorInSuiteTest.java index c68e43689c..2765785d8f 100644 --- a/testng-core/src/test/java/test/methodselectors/MethodSelectorInSuiteTest.java +++ b/testng-core/src/test/java/test/methodselectors/MethodSelectorInSuiteTest.java @@ -49,7 +49,8 @@ public void programmaticXmlSuite() { @Test public void xmlXmlSuite() { TestNG tng = create(); - tng.setTestSuites(Collections.singletonList(getPathToResource("methodselector-in-xml.xml"))); + tng.setTestSuites( + Collections.singletonList(getPathToResource("samples/methodselector-in-xml.xml"))); tng.addListener((ITestNGListener) m_tla); tng.run(); @@ -62,7 +63,7 @@ public void fileOnCommandLine() { new String[] { "-d", OutputDirectoryPatch.getOutputDirectory(), - getPathToResource("methodselector-in-xml.xml") + getPathToResource("samples/methodselector-in-xml.xml") }; TestNG.privateMain(args, m_tla); diff --git a/testng-core/src/test/java/test/parameters/ParamInheritanceTest.java b/testng-core/src/test/java/test/parameters/ParamInheritanceTest.java index 0830d67344..e430217d78 100644 --- a/testng-core/src/test/java/test/parameters/ParamInheritanceTest.java +++ b/testng-core/src/test/java/test/parameters/ParamInheritanceTest.java @@ -23,7 +23,8 @@ public class ParamInheritanceTest extends SimpleBaseTest { + " during execution. This test makes sure we dont run into any NPEs") public void noNPEInCountingResults() { TestNG tng = create(); - tng.setTestSuites(Arrays.asList(getPathToResource("param-inheritance/parent-suite.xml"))); + tng.setTestSuites( + Arrays.asList(getPathToResource("samples/param-inheritance/parent-suite.xml"))); TestListenerAdapter tla = new TestListenerAdapter(); tng.addListener((ITestNGListener) tla); @@ -56,7 +57,7 @@ public void noNPEInCountingResults() { @Test(description = "Checks to make sure parameters are inherited and overridden properly") public void parameterInheritanceAndOverriding() { TestNG tng = create(); - tng.setTestSuites(Arrays.asList(getPathToResource("parametertest/parent-suite.xml"))); + tng.setTestSuites(Arrays.asList(getPathToResource("samples/parametertest/parent-suite.xml"))); TestListenerAdapter tla = new TestListenerAdapter(); tng.addListener((ITestNGListener) tla); diff --git a/testng-core/src/test/java/test/reports/EmailableReporterTest.java b/testng-core/src/test/java/test/reports/EmailableReporterTest.java index cc35f2b1a0..f6193369a9 100644 --- a/testng-core/src/test/java/test/reports/EmailableReporterTest.java +++ b/testng-core/src/test/java/test/reports/EmailableReporterTest.java @@ -85,7 +85,7 @@ private void runTestViaMainMethod(String clazzName, String jvm) { output.getAbsolutePath(), "-reporter", clazzName + ":fileName=" + filename, - "src/test/resources/1332.xml" + "src/test/resources/samples/1332.xml" }; try { if (jvm != null) { diff --git a/testng-core/src/test/java/test/reports/FailedReporterTest.java b/testng-core/src/test/java/test/reports/FailedReporterTest.java index 9864ab213f..7d7f175b16 100644 --- a/testng-core/src/test/java/test/reports/FailedReporterTest.java +++ b/testng-core/src/test/java/test/reports/FailedReporterTest.java @@ -60,8 +60,9 @@ public void failedFile() throws ParserConfigurationException, SAXException, IOEx @Test(description = "ISSUE-2445") public void testParameterPreservationWithFactory() throws IOException { final SuiteXmlParser parser = new SuiteXmlParser(); - final String testSuite = "src/test/resources/xml/github2445/test-suite.xml"; - final String expectedResult = "src/test/resources/xml/github2445/expected-failed-report.xml"; + final String testSuite = "src/test/resources/samples/xml/github2445/test-suite.xml"; + final String expectedResult = + "src/test/resources/samples/xml/github2445/expected-failed-report.xml"; final XmlSuite xmlSuite = parser.parse(testSuite, new FileInputStream(testSuite), true); final TestNG tng = create(xmlSuite); diff --git a/testng-core/src/test/java/test/sanitycheck/CheckSuiteNamesTest.java b/testng-core/src/test/java/test/sanitycheck/CheckSuiteNamesTest.java index f45c72d09e..67a8a75807 100644 --- a/testng-core/src/test/java/test/sanitycheck/CheckSuiteNamesTest.java +++ b/testng-core/src/test/java/test/sanitycheck/CheckSuiteNamesTest.java @@ -21,7 +21,7 @@ public class CheckSuiteNamesTest extends SimpleBaseTest { public void checkChildSuites() { TestListenerAdapter tla = new TestListenerAdapter(); TestNG tng = create(); - String testngXmlPath = getPathToResource("sanitycheck/test-s-b.xml"); + String testngXmlPath = getPathToResource("samples/sanitycheck/test-s-b.xml"); tng.setTestSuites(Collections.singletonList(testngXmlPath)); tng.addListener((ITestNGListener) tla); tng.run(); @@ -33,7 +33,7 @@ public void checkChildSuites() { public void checkChildSuitesFails() { TestListenerAdapter tla = new TestListenerAdapter(); TestNG tng = create(); - String testngXmlPath = getPathToResource("sanitycheck/test-s-a.xml"); + String testngXmlPath = getPathToResource("samples/sanitycheck/test-s-a.xml"); tng.setTestSuites(Collections.singletonList(testngXmlPath)); tng.addListener((ITestNGListener) tla); tng.run(); @@ -72,7 +72,7 @@ public void checkProgrammaticSuitesFails() { @Test public void checkXmlSuiteAddition() throws IOException { TestNG tng = create(); - String testngXmlPath = getPathToResource("sanitycheck/test-s-b.xml"); + String testngXmlPath = getPathToResource("samples/sanitycheck/test-s-b.xml"); Parser parser = new Parser(testngXmlPath); tng.setXmlSuites(parser.parseToList()); tng.initializeSuitesAndJarFile(); diff --git a/testng-core/src/test/java/test/sanitycheck/CheckTestNamesTest.java b/testng-core/src/test/java/test/sanitycheck/CheckTestNamesTest.java index c9d106decf..d8968eb0bd 100644 --- a/testng-core/src/test/java/test/sanitycheck/CheckTestNamesTest.java +++ b/testng-core/src/test/java/test/sanitycheck/CheckTestNamesTest.java @@ -17,13 +17,13 @@ public class CheckTestNamesTest extends SimpleBaseTest { /** Child suites and same suite has two tests with same name */ @Test public void checkWithChildSuites() { - runSuite("sanitycheck/test-a.xml"); + runSuite("samples/sanitycheck/test-a.xml"); } /** Simple suite with two tests with same name */ @Test public void checkWithoutChildSuites() { - runSuite("sanitycheck/test1.xml"); + runSuite("samples/sanitycheck/test1.xml"); } private void runSuite(String suitePath) { @@ -48,7 +48,7 @@ private void runSuite(String suitePath) { public void checkNoError() { TestListenerAdapter tla = new TestListenerAdapter(); TestNG tng = create(); - String testngXmlPath = getPathToResource("sanitycheck/test2.xml"); + String testngXmlPath = getPathToResource("samples/sanitycheck/test2.xml"); tng.setTestSuites(Collections.singletonList(testngXmlPath)); tng.addListener((ITestNGListener) tla); tng.run(); @@ -60,7 +60,7 @@ public void checkNoError() { public void checkNoErrorWtihChildSuites() { TestListenerAdapter tla = new TestListenerAdapter(); TestNG tng = create(); - String testngXmlPath = getPathToResource("sanitycheck/test-b.xml"); + String testngXmlPath = getPathToResource("samples/sanitycheck/test-b.xml"); tng.setTestSuites(Collections.singletonList(testngXmlPath)); tng.addListener((ITestNGListener) tla); tng.run(); diff --git a/testng-core/src/test/java/test/serviceloader/ServiceLoaderTest.java b/testng-core/src/test/java/test/serviceloader/ServiceLoaderTest.java index 34b21f9d26..af6b47a19e 100644 --- a/testng-core/src/test/java/test/serviceloader/ServiceLoaderTest.java +++ b/testng-core/src/test/java/test/serviceloader/ServiceLoaderTest.java @@ -20,7 +20,7 @@ public class ServiceLoaderTest extends SimpleBaseTest { @Test public void serviceLoaderShouldWork() { TestNG tng = create(ServiceLoaderSampleTest.class); - URL url = getClass().getClassLoader().getResource("serviceloader.jar"); + URL url = getClass().getClassLoader().getResource("samples/serviceloader.jar"); URLClassLoader ucl = URLClassLoader.newInstance(new URL[] {url}); tng.setServiceLoaderClassLoader(ucl); tng.run(); @@ -31,7 +31,7 @@ public void serviceLoaderShouldWork() { @Test(description = "GITHUB-2259") public void ensureSpiLoadedListenersCanBeSkipped() { TestNG tng = create(ServiceLoaderSampleTest.class); - URL url = getClass().getClassLoader().getResource("serviceloader.jar"); + URL url = getClass().getClassLoader().getResource("samples/serviceloader.jar"); URLClassLoader ucl = URLClassLoader.newInstance(new URL[] {url}); tng.setServiceLoaderClassLoader(ucl); String dontLoad = "test.serviceloader.TmpSuiteListener"; @@ -48,7 +48,7 @@ public void ensureSpiLoadedListenersCanBeSkipped() { @SuppressWarnings("deprecation") public void ensureSpiLoadedListenersCanBeSkipped2() { TestNG tng = create(ServiceLoaderSampleTest.class); - URL url = getClass().getClassLoader().getResource("serviceloader.jar"); + URL url = getClass().getClassLoader().getResource("samples/serviceloader.jar"); URLClassLoader ucl = URLClassLoader.newInstance(new URL[] {url}); tng.setServiceLoaderClassLoader(ucl); String dontLoad = "test.serviceloader.TmpSuiteListener"; @@ -70,7 +70,7 @@ public void serviceLoaderWithNoClassLoader() { // Since serviceloader.jar doesn't seem to be visible to the current thread's contextual class // loader // resorting to pushing in a class loader into the current thread that can load the resource - URL url = getClass().getClassLoader().getResource("serviceloader.jar"); + URL url = getClass().getClassLoader().getResource("samples/serviceloader.jar"); URLClassLoader ucl = URLClassLoader.newInstance(new URL[] {url}); Thread.currentThread().setContextClassLoader(ucl); TestNG tng = create(ServiceLoaderSampleTest.class); diff --git a/testng-core/src/test/java/test/suites/github1533/Github1533Test.java b/testng-core/src/test/java/test/suites/github1533/Github1533Test.java index 791f148445..91a3426c33 100644 --- a/testng-core/src/test/java/test/suites/github1533/Github1533Test.java +++ b/testng-core/src/test/java/test/suites/github1533/Github1533Test.java @@ -16,13 +16,13 @@ public class Github1533Test extends SimpleBaseTest { @Test public void testScenarioWithChildSuites() { - String suiteFile = "src/test/resources/xml/github1533/parent.xml"; + String suiteFile = "src/test/resources/samples/xml/github1533/parent.xml"; runTests(suiteFile, 1, 2, "GitHub1533_Suite", "GitHub1533_Parent_Suite"); } @Test public void testScenarioWithNoChildSuites() { - String suiteFile = "src/test/resources/xml/github1533/child.xml"; + String suiteFile = "src/test/resources/samples/xml/github1533/child.xml"; runTests(suiteFile, 0, 1, "GitHub1533_Suite"); } diff --git a/testng-core/src/test/java/test/suites/github1850/DuplicateChildSuitesInitializationTest.java b/testng-core/src/test/java/test/suites/github1850/DuplicateChildSuitesInitializationTest.java index 8ccac7bf0a..b9cb7be350 100644 --- a/testng-core/src/test/java/test/suites/github1850/DuplicateChildSuitesInitializationTest.java +++ b/testng-core/src/test/java/test/suites/github1850/DuplicateChildSuitesInitializationTest.java @@ -35,7 +35,8 @@ public class DuplicateChildSuitesInitializationTest extends SimpleBaseTest { @Test public void checkDuplicateChildSuites() throws IOException { String path = - getPathToResource("checksuitesinitialization/parent-suite-with-duplicate-child.xml"); + getPathToResource( + "samples/checksuitesinitialization/parent-suite-with-duplicate-child.xml"); Parser parser = new Parser(path); List suites = parser.parseToList(); XmlSuite rootSuite = suites.get(0); diff --git a/testng-core/src/test/java/test/testnames/TestNamesTest.java b/testng-core/src/test/java/test/testnames/TestNamesTest.java index 21392b2187..4f88490297 100644 --- a/testng-core/src/test/java/test/testnames/TestNamesTest.java +++ b/testng-core/src/test/java/test/testnames/TestNamesTest.java @@ -15,7 +15,8 @@ public void checkWithoutChildSuites() { TestListenerAdapter tla = new TestListenerAdapter(); TestNG tng = create(); tng.setTestNames(Collections.singletonList("testGroup2")); - tng.setTestSuites(Collections.singletonList(getPathToResource("testnames/upstream-suite.xml"))); + tng.setTestSuites( + Collections.singletonList(getPathToResource("samples/testnames/upstream-suite.xml"))); tng.addListener((ITestNGListener) tla); tng.run(); Assert.assertEquals(tla.getFailedTests().size(), 0); diff --git a/testng-core/src/test/java/test/thread/ParallelSuiteTest.java b/testng-core/src/test/java/test/thread/ParallelSuiteTest.java index 2a8f55671b..e037b98dd8 100644 --- a/testng-core/src/test/java/test/thread/ParallelSuiteTest.java +++ b/testng-core/src/test/java/test/thread/ParallelSuiteTest.java @@ -21,12 +21,18 @@ public void suitesShouldRunInParallel1() { 2, null, Arrays.asList( - getPathToResource("suite-parallel-1.xml"), getPathToResource("suite-parallel-2.xml"))); + getPathToResource("samples/suite-parallel-1.xml"), + getPathToResource("samples/suite-parallel-2.xml"))); } @Test public void suitesShouldRunInParallel2() { - runTest(5, 3, 3, null, Collections.singletonList(getPathToResource("suite-parallel-0.xml"))); + runTest( + 5, + 3, + 3, + null, + Collections.singletonList(getPathToResource("samples/suite-parallel-0.xml"))); } @Test(description = "Number of threads (2) is less than number of suites (3)") @@ -35,7 +41,7 @@ public void suitesShouldRunInParallel3() { TestListenerAdapter tla = new TestListenerAdapter(); TestNG tng = create(); tng.setSuiteThreadPoolSize(SUITE_THREAD_POOL_SIZE); - tng.setTestSuites(Collections.singletonList(getPathToResource("suite-parallel-0.xml"))); + tng.setTestSuites(Collections.singletonList(getPathToResource("samples/suite-parallel-0.xml"))); tng.addListener((ITestNGListener) tla); BaseThreadTest.initThreadLog(); @@ -79,10 +85,10 @@ public void suitesShouldRunInParallel4() { 5, null, Arrays.asList( - getPathToResource("parallel-suites/suite-parallel-1.xml"), - getPathToResource("parallel-suites/suite-parallel-2.xml"), - getPathToResource("parallel-suites/suite-parallel-2-1.xml"), - getPathToResource("parallel-suites/suite-parallel-2-2.xml"))); + getPathToResource("samples/parallel-suites/suite-parallel-1.xml"), + getPathToResource("samples/parallel-suites/suite-parallel-2.xml"), + getPathToResource("samples/parallel-suites/suite-parallel-2-1.xml"), + getPathToResource("samples/parallel-suites/suite-parallel-2-2.xml"))); } @Test @@ -92,7 +98,8 @@ public void suitesShouldRunInParallel5() { 5, 7, null, - Collections.singletonList(getPathToResource("parallel-suites/suite-parallel-0.xml"))); + Collections.singletonList( + getPathToResource("samples/parallel-suites/suite-parallel-0.xml"))); } @Test(description = "Number of threads (2) is less than level of suites (3)") @@ -102,7 +109,8 @@ public void suitesShouldRunInParallel6() { 2, 7, null, - Collections.singletonList(getPathToResource("parallel-suites/suite-parallel-0.xml"))); + Collections.singletonList( + getPathToResource("samples/parallel-suites/suite-parallel-0.xml"))); } @Test( @@ -112,7 +120,7 @@ public void suitesShouldRunInParallel6() { public void suitesShouldRunInOrder() { TestListenerAdapter tla = new TestListenerAdapter(); TestNG tng = create(); - tng.setTestSuites(Collections.singletonList(getPathToResource("suite-parallel-0.xml"))); + tng.setTestSuites(Collections.singletonList(getPathToResource("samples/suite-parallel-0.xml"))); tng.addListener((ITestNGListener) tla); BaseThreadTest.initThreadLog(); tng.run(); @@ -134,6 +142,11 @@ public void suitesShouldRunInOrder() { @Test(description = "Number of threads (1) is less than number of levels of suites (2)") public void suitesShouldRun1() { - runTest(1, 1, 3, true, Collections.singletonList(getPathToResource("suite-parallel-0.xml"))); + runTest( + 1, + 1, + 3, + true, + Collections.singletonList(getPathToResource("samples/suite-parallel-0.xml"))); } } diff --git a/testng-core/src/test/java/test/thread/ParallelTestTest.java b/testng-core/src/test/java/test/thread/ParallelTestTest.java index a12abd80a4..03dae0017f 100644 --- a/testng-core/src/test/java/test/thread/ParallelTestTest.java +++ b/testng-core/src/test/java/test/thread/ParallelTestTest.java @@ -65,7 +65,7 @@ public void verifyParallelWithFactory( @Test public void testParallelModeInheritanceInCommandlineMode() throws FileNotFoundException { SuiteXmlParser parser = new SuiteXmlParser(); - String file = "src/test/resources/1636.xml"; + String file = "src/test/resources/samples/1636.xml"; XmlSuite xmlSuite = parser.parse(file, new FileInputStream(file), true); TestNG tng = new TestNG(); tng.setXmlSuites(Collections.singletonList(xmlSuite)); diff --git a/testng-core/src/test/java/test/timeout/TimeOutFromXmlTest.java b/testng-core/src/test/java/test/timeout/TimeOutFromXmlTest.java index d7b976dbf0..c13ed99fbe 100644 --- a/testng-core/src/test/java/test/timeout/TimeOutFromXmlTest.java +++ b/testng-core/src/test/java/test/timeout/TimeOutFromXmlTest.java @@ -76,7 +76,7 @@ private XmlTest createXmlTest(XmlSuite suite, String name) { @Test public void timeOutInParallelTestsFromXml() throws IOException { - String file = "src/test/resources/test/timeout/issue575.xml"; + String file = "src/test/resources/samples/test/timeout/issue575.xml"; try (FileInputStream stream = new FileInputStream(file)) { SuiteXmlParser suiteParser = new SuiteXmlParser(); XmlSuite suite = suiteParser.parse(file, stream, true); diff --git a/testng-core/src/test/java/test/xml/TestNGContentHandlerTest.java b/testng-core/src/test/java/test/xml/TestNGContentHandlerTest.java index 1ed254898a..ea05743f11 100644 --- a/testng-core/src/test/java/test/xml/TestNGContentHandlerTest.java +++ b/testng-core/src/test/java/test/xml/TestNGContentHandlerTest.java @@ -12,7 +12,7 @@ public class TestNGContentHandlerTest extends SimpleBaseTest { @Test public void testDescriptionInclusion() throws Exception { - final String xml = getPathToResource("xml/simple-suite-with-method-desc.xml"); + final String xml = getPathToResource("samples/xml/simple-suite-with-method-desc.xml"); SuiteXmlParser parser = new SuiteXmlParser(); TestNGContentHandler handler = new TestNGContentHandler(xml, false); parser.parse(new FileInputStream(xml), handler); diff --git a/testng-core/src/test/java/test/xml/XmlVerifyTest.java b/testng-core/src/test/java/test/xml/XmlVerifyTest.java index b402f83d27..14004cd2fd 100644 --- a/testng-core/src/test/java/test/xml/XmlVerifyTest.java +++ b/testng-core/src/test/java/test/xml/XmlVerifyTest.java @@ -66,7 +66,7 @@ public void handleInvalidSuites() { TestListenerAdapter tla = new TestListenerAdapter(); try { TestNG tng = create(); - String testngXmlPath = getPathToResource("suite1.xml"); + String testngXmlPath = getPathToResource("samples/suite1.xml"); tng.setTestSuites(Collections.singletonList(testngXmlPath)); tng.addListener((ITestNGListener) tla); tng.run(); diff --git a/testng-core/src/test/java/test/yaml/YamlTest.java b/testng-core/src/test/java/test/yaml/YamlTest.java index b9339e6734..962df43936 100644 --- a/testng-core/src/test/java/test/yaml/YamlTest.java +++ b/testng-core/src/test/java/test/yaml/YamlTest.java @@ -32,9 +32,9 @@ public Object[][] dp() { @Test(dataProvider = "dp") public void compareFiles(String name) throws IOException { Collection s1 = - new Parser(getPathToResource("yaml" + File.separator + name + ".yaml")).parse(); + new Parser(getPathToResource("samples/yaml" + File.separator + name + ".yaml")).parse(); Collection s2 = - new Parser(getPathToResource("yaml" + File.separator + name + ".xml")).parse(); + new Parser(getPathToResource("samples/yaml" + File.separator + name + ".xml")).parse(); Assert.assertEquals(s1, s2); } @@ -42,7 +42,7 @@ public void compareFiles(String name) throws IOException { @Test(description = "GITHUB-1787") public void testParameterInclusion() throws IOException { SuiteXmlParser parser = new SuiteXmlParser(); - String file = "src/test/resources/yaml/1787.xml"; + String file = "src/test/resources/samples/yaml/1787.xml"; XmlSuite xmlSuite = parser.parse(file, new FileInputStream(file), false); StringBuilder yaml = org.testng.internal.Yaml.toYaml(xmlSuite); Matcher m = Pattern.compile("parameters:").matcher(yaml.toString()); @@ -60,10 +60,10 @@ public void testParameterInclusion() throws IOException { @Test(description = "GITHUB-2078") public void testXmlDependencyGroups() throws IOException { - String actualXmlFile = "src/test/resources/yaml/2078.xml"; + String actualXmlFile = "src/test/resources/samples/yaml/2078.xml"; XmlSuite actualXmlSuite = new SuiteXmlParser().parse(actualXmlFile, new FileInputStream(actualXmlFile), false); - String expectedYamlFile = "src/test/resources/yaml/2078.yaml"; + String expectedYamlFile = "src/test/resources/samples/yaml/2078.yaml"; String expectedYaml = new String( java.nio.file.Files.readAllBytes(Paths.get(expectedYamlFile)), StandardCharsets.UTF_8); diff --git a/testng-core/src/test/kotlin/org/testng/xml/XsdValidationTest.kt b/testng-core/src/test/kotlin/org/testng/xml/XsdValidationTest.kt new file mode 100644 index 0000000000..342ec9f2d1 --- /dev/null +++ b/testng-core/src/test/kotlin/org/testng/xml/XsdValidationTest.kt @@ -0,0 +1,50 @@ +package org.testng.xml + +import org.testng.annotations.BeforeClass +import org.testng.annotations.DataProvider +import org.testng.annotations.Test +import java.io.File +import javax.xml.XMLConstants +import javax.xml.transform.stream.StreamSource +import javax.xml.validation.SchemaFactory +import javax.xml.validation.Validator + +class XsdValidationTest { + + private lateinit var validator: Validator + + @DataProvider + fun dp(): Iterator> { + return loadResource("/samples") + .walk() + .filter { it.isFile && it.extension == "xml" } + .filter { !it.absolutePath.contains("xml/badWith") } + .map { arrayOf(it) } + .iterator() + } + + @BeforeClass + fun setUp() { + validator = newXsdValidator(loadResource("/testng-1.1.xsd")) + } + + + @Test(dataProvider = "dp") + fun `validate xml suite files`(xml: File) { + validator.validate(xml) + } + + private fun loadResource(resource: String) = {}::class.java.getResource(resource).let { + if (it == null) { + throw IllegalArgumentException("No resource found: $resource") + } + File(it.file) + } + + private fun newXsdValidator(xsd: File) = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI) + .newSchema(xsd).newValidator() + + private fun Validator.validate(source: File) { + this.validate(StreamSource(source)) + } +} diff --git a/testng-core/src/test/resources/188.xml b/testng-core/src/test/resources/188.xml deleted file mode 100644 index b31541f5e6..0000000000 --- a/testng-core/src/test/resources/188.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/testng-core/src/test/resources/b.xml b/testng-core/src/test/resources/b.xml deleted file mode 100644 index 0d27e3592d..0000000000 --- a/testng-core/src/test/resources/b.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/testng-core/src/test/resources/junit-suite.xml b/testng-core/src/test/resources/junit-suite.xml deleted file mode 100644 index b9324e67aa..0000000000 --- a/testng-core/src/test/resources/junit-suite.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/testng-core/src/test/resources/package.xml b/testng-core/src/test/resources/package.xml deleted file mode 100644 index 17fe02cc97..0000000000 --- a/testng-core/src/test/resources/package.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/testng-core/src/test/resources/1332.xml b/testng-core/src/test/resources/samples/1332.xml similarity index 100% rename from testng-core/src/test/resources/1332.xml rename to testng-core/src/test/resources/samples/1332.xml diff --git a/testng-core/src/test/resources/1636.xml b/testng-core/src/test/resources/samples/1636.xml similarity index 100% rename from testng-core/src/test/resources/1636.xml rename to testng-core/src/test/resources/samples/1636.xml diff --git a/testng-core/src/test/resources/987.xml b/testng-core/src/test/resources/samples/987.xml similarity index 100% rename from testng-core/src/test/resources/987.xml rename to testng-core/src/test/resources/samples/987.xml diff --git a/testng-core/src/test/resources/a.xml b/testng-core/src/test/resources/samples/a.xml similarity index 100% rename from testng-core/src/test/resources/a.xml rename to testng-core/src/test/resources/samples/a.xml diff --git a/testng-core/src/test/resources/checksuitesinitialization/child-suite1.xml b/testng-core/src/test/resources/samples/checksuitesinitialization/child-suite1.xml similarity index 100% rename from testng-core/src/test/resources/checksuitesinitialization/child-suite1.xml rename to testng-core/src/test/resources/samples/checksuitesinitialization/child-suite1.xml diff --git a/testng-core/src/test/resources/checksuitesinitialization/child-suite2.xml b/testng-core/src/test/resources/samples/checksuitesinitialization/child-suite2.xml similarity index 100% rename from testng-core/src/test/resources/checksuitesinitialization/child-suite2.xml rename to testng-core/src/test/resources/samples/checksuitesinitialization/child-suite2.xml diff --git a/testng-core/src/test/resources/checksuitesinitialization/children/child-suite-3.xml b/testng-core/src/test/resources/samples/checksuitesinitialization/children/child-suite-3.xml similarity index 100% rename from testng-core/src/test/resources/checksuitesinitialization/children/child-suite-3.xml rename to testng-core/src/test/resources/samples/checksuitesinitialization/children/child-suite-3.xml diff --git a/testng-core/src/test/resources/checksuitesinitialization/children/child-suite-4.xml b/testng-core/src/test/resources/samples/checksuitesinitialization/children/child-suite-4.xml similarity index 100% rename from testng-core/src/test/resources/checksuitesinitialization/children/child-suite-4.xml rename to testng-core/src/test/resources/samples/checksuitesinitialization/children/child-suite-4.xml diff --git a/testng-core/src/test/resources/checksuitesinitialization/children/morechildren/child-suite-5.xml b/testng-core/src/test/resources/samples/checksuitesinitialization/children/morechildren/child-suite-5.xml similarity index 100% rename from testng-core/src/test/resources/checksuitesinitialization/children/morechildren/child-suite-5.xml rename to testng-core/src/test/resources/samples/checksuitesinitialization/children/morechildren/child-suite-5.xml diff --git a/testng-core/src/test/resources/checksuitesinitialization/parent-suite-with-duplicate-child.xml b/testng-core/src/test/resources/samples/checksuitesinitialization/parent-suite-with-duplicate-child.xml similarity index 75% rename from testng-core/src/test/resources/checksuitesinitialization/parent-suite-with-duplicate-child.xml rename to testng-core/src/test/resources/samples/checksuitesinitialization/parent-suite-with-duplicate-child.xml index 85b26476c3..265fcbb117 100644 --- a/testng-core/src/test/resources/checksuitesinitialization/parent-suite-with-duplicate-child.xml +++ b/testng-core/src/test/resources/samples/checksuitesinitialization/parent-suite-with-duplicate-child.xml @@ -3,9 +3,9 @@ - + - + - \ No newline at end of file + diff --git a/testng-core/src/test/resources/checksuitesinitialization/parent-suite.xml b/testng-core/src/test/resources/samples/checksuitesinitialization/parent-suite.xml similarity index 82% rename from testng-core/src/test/resources/checksuitesinitialization/parent-suite.xml rename to testng-core/src/test/resources/samples/checksuitesinitialization/parent-suite.xml index 98f135e4ad..be52a48ba6 100644 --- a/testng-core/src/test/resources/checksuitesinitialization/parent-suite.xml +++ b/testng-core/src/test/resources/samples/checksuitesinitialization/parent-suite.xml @@ -3,7 +3,7 @@ - + - \ No newline at end of file +
diff --git a/testng-core/src/test/resources/create-serviceloader-jar.sh b/testng-core/src/test/resources/samples/create-serviceloader-jar.sh similarity index 100% rename from testng-core/src/test/resources/create-serviceloader-jar.sh rename to testng-core/src/test/resources/samples/create-serviceloader-jar.sh diff --git a/testng-core/src/test/resources/executionlistenersingletoncheck/child.xml b/testng-core/src/test/resources/samples/executionlistenersingletoncheck/child.xml similarity index 100% rename from testng-core/src/test/resources/executionlistenersingletoncheck/child.xml rename to testng-core/src/test/resources/samples/executionlistenersingletoncheck/child.xml diff --git a/testng-core/src/test/resources/executionlistenersingletoncheck/parent.xml b/testng-core/src/test/resources/samples/executionlistenersingletoncheck/parent.xml similarity index 100% rename from testng-core/src/test/resources/executionlistenersingletoncheck/parent.xml rename to testng-core/src/test/resources/samples/executionlistenersingletoncheck/parent.xml diff --git a/testng-core/src/test/resources/groupinvocation/parent-suiteA.xml b/testng-core/src/test/resources/samples/groupinvocation/parent-suiteA.xml similarity index 100% rename from testng-core/src/test/resources/groupinvocation/parent-suiteA.xml rename to testng-core/src/test/resources/samples/groupinvocation/parent-suiteA.xml diff --git a/testng-core/src/test/resources/groupinvocation/parent-suiteB.xml b/testng-core/src/test/resources/samples/groupinvocation/parent-suiteB.xml similarity index 100% rename from testng-core/src/test/resources/groupinvocation/parent-suiteB.xml rename to testng-core/src/test/resources/samples/groupinvocation/parent-suiteB.xml diff --git a/testng-core/src/test/resources/groupinvocation/suiteA.xml b/testng-core/src/test/resources/samples/groupinvocation/suiteA.xml similarity index 100% rename from testng-core/src/test/resources/groupinvocation/suiteA.xml rename to testng-core/src/test/resources/samples/groupinvocation/suiteA.xml diff --git a/testng-core/src/test/resources/groupinvocation/suiteB.xml b/testng-core/src/test/resources/samples/groupinvocation/suiteB.xml similarity index 100% rename from testng-core/src/test/resources/groupinvocation/suiteB.xml rename to testng-core/src/test/resources/samples/groupinvocation/suiteB.xml diff --git a/testng-core/src/test/resources/jarfileutils/child.xml b/testng-core/src/test/resources/samples/jarfileutils/child.xml similarity index 82% rename from testng-core/src/test/resources/jarfileutils/child.xml rename to testng-core/src/test/resources/samples/jarfileutils/child.xml index c53a6e0cb8..7d01b50b69 100755 --- a/testng-core/src/test/resources/jarfileutils/child.xml +++ b/testng-core/src/test/resources/samples/jarfileutils/child.xml @@ -2,11 +2,11 @@ - + - \ No newline at end of file +
diff --git a/testng-core/src/test/resources/jarfileutils/child/child.xml b/testng-core/src/test/resources/samples/jarfileutils/child/child.xml similarity index 82% rename from testng-core/src/test/resources/jarfileutils/child/child.xml rename to testng-core/src/test/resources/samples/jarfileutils/child/child.xml index c53a6e0cb8..7d01b50b69 100755 --- a/testng-core/src/test/resources/jarfileutils/child/child.xml +++ b/testng-core/src/test/resources/samples/jarfileutils/child/child.xml @@ -2,11 +2,11 @@ - + - \ No newline at end of file + diff --git a/testng-core/src/test/resources/jarfileutils/child/childofchild/childofchild.xml b/testng-core/src/test/resources/samples/jarfileutils/child/childofchild/childofchild.xml similarity index 100% rename from testng-core/src/test/resources/jarfileutils/child/childofchild/childofchild.xml rename to testng-core/src/test/resources/samples/jarfileutils/child/childofchild/childofchild.xml diff --git a/testng-core/src/test/resources/jarfileutils/childofchild/childofchild.xml b/testng-core/src/test/resources/samples/jarfileutils/childofchild/childofchild.xml similarity index 100% rename from testng-core/src/test/resources/jarfileutils/childofchild/childofchild.xml rename to testng-core/src/test/resources/samples/jarfileutils/childofchild/childofchild.xml diff --git a/testng-core/src/test/resources/jarfileutils/testng-tests.xml b/testng-core/src/test/resources/samples/jarfileutils/testng-tests.xml similarity index 92% rename from testng-core/src/test/resources/jarfileutils/testng-tests.xml rename to testng-core/src/test/resources/samples/jarfileutils/testng-tests.xml index 4d50afd20f..0e15f0698a 100644 --- a/testng-core/src/test/resources/jarfileutils/testng-tests.xml +++ b/testng-core/src/test/resources/samples/jarfileutils/testng-tests.xml @@ -2,7 +2,7 @@ - + @@ -20,4 +20,4 @@ - \ No newline at end of file + diff --git a/testng-core/src/test/resources/listener-in-xml.xml b/testng-core/src/test/resources/samples/listener-in-xml.xml similarity index 86% rename from testng-core/src/test/resources/listener-in-xml.xml rename to testng-core/src/test/resources/samples/listener-in-xml.xml index b5abf4511e..b99a3d0b37 100644 --- a/testng-core/src/test/resources/listener-in-xml.xml +++ b/testng-core/src/test/resources/samples/listener-in-xml.xml @@ -1,6 +1,6 @@ - diff --git a/testng-core/src/test/resources/methodinterceptors/multipleinterceptors/multiple-interceptors.xml b/testng-core/src/test/resources/samples/methodinterceptors/multipleinterceptors/multiple-interceptors.xml similarity index 100% rename from testng-core/src/test/resources/methodinterceptors/multipleinterceptors/multiple-interceptors.xml rename to testng-core/src/test/resources/samples/methodinterceptors/multipleinterceptors/multiple-interceptors.xml diff --git a/testng-core/src/test/resources/methodselector-in-xml.xml b/testng-core/src/test/resources/samples/methodselector-in-xml.xml similarity index 100% rename from testng-core/src/test/resources/methodselector-in-xml.xml rename to testng-core/src/test/resources/samples/methodselector-in-xml.xml diff --git a/testng-core/src/test/resources/parallel-suites/suite-parallel-0.xml b/testng-core/src/test/resources/samples/parallel-suites/suite-parallel-0.xml similarity index 63% rename from testng-core/src/test/resources/parallel-suites/suite-parallel-0.xml rename to testng-core/src/test/resources/samples/parallel-suites/suite-parallel-0.xml index a557d6e852..7ff5757782 100644 --- a/testng-core/src/test/resources/parallel-suites/suite-parallel-0.xml +++ b/testng-core/src/test/resources/samples/parallel-suites/suite-parallel-0.xml @@ -3,9 +3,9 @@ - - - + + + @@ -13,4 +13,4 @@ - \ No newline at end of file + diff --git a/testng-core/src/test/resources/parallel-suites/suite-parallel-1.xml b/testng-core/src/test/resources/samples/parallel-suites/suite-parallel-1.xml similarity index 100% rename from testng-core/src/test/resources/parallel-suites/suite-parallel-1.xml rename to testng-core/src/test/resources/samples/parallel-suites/suite-parallel-1.xml diff --git a/testng-core/src/test/resources/parallel-suites/suite-parallel-2-1.xml b/testng-core/src/test/resources/samples/parallel-suites/suite-parallel-2-1.xml similarity index 100% rename from testng-core/src/test/resources/parallel-suites/suite-parallel-2-1.xml rename to testng-core/src/test/resources/samples/parallel-suites/suite-parallel-2-1.xml diff --git a/testng-core/src/test/resources/parallel-suites/suite-parallel-2-2-1.xml b/testng-core/src/test/resources/samples/parallel-suites/suite-parallel-2-2-1.xml similarity index 100% rename from testng-core/src/test/resources/parallel-suites/suite-parallel-2-2-1.xml rename to testng-core/src/test/resources/samples/parallel-suites/suite-parallel-2-2-1.xml diff --git a/testng-core/src/test/resources/parallel-suites/suite-parallel-2-2.xml b/testng-core/src/test/resources/samples/parallel-suites/suite-parallel-2-2.xml similarity index 84% rename from testng-core/src/test/resources/parallel-suites/suite-parallel-2-2.xml rename to testng-core/src/test/resources/samples/parallel-suites/suite-parallel-2-2.xml index d5e6a17d7c..74e1a98a4e 100644 --- a/testng-core/src/test/resources/parallel-suites/suite-parallel-2-2.xml +++ b/testng-core/src/test/resources/samples/parallel-suites/suite-parallel-2-2.xml @@ -3,7 +3,7 @@ - + diff --git a/testng-core/src/test/resources/parallel-suites/suite-parallel-2.xml b/testng-core/src/test/resources/samples/parallel-suites/suite-parallel-2.xml similarity index 73% rename from testng-core/src/test/resources/parallel-suites/suite-parallel-2.xml rename to testng-core/src/test/resources/samples/parallel-suites/suite-parallel-2.xml index e9639b410b..2ecd6ca6b2 100644 --- a/testng-core/src/test/resources/parallel-suites/suite-parallel-2.xml +++ b/testng-core/src/test/resources/samples/parallel-suites/suite-parallel-2.xml @@ -9,7 +9,7 @@ - - + + diff --git a/testng-core/src/test/resources/parallel-suites/suite-parallel-3.xml b/testng-core/src/test/resources/samples/parallel-suites/suite-parallel-3.xml similarity index 100% rename from testng-core/src/test/resources/parallel-suites/suite-parallel-3.xml rename to testng-core/src/test/resources/samples/parallel-suites/suite-parallel-3.xml diff --git a/testng-core/src/test/resources/param-inheritance/child-suite.xml b/testng-core/src/test/resources/samples/param-inheritance/child-suite.xml similarity index 100% rename from testng-core/src/test/resources/param-inheritance/child-suite.xml rename to testng-core/src/test/resources/samples/param-inheritance/child-suite.xml diff --git a/testng-core/src/test/resources/param-inheritance/parent-suite.xml b/testng-core/src/test/resources/samples/param-inheritance/parent-suite.xml similarity index 79% rename from testng-core/src/test/resources/param-inheritance/parent-suite.xml rename to testng-core/src/test/resources/samples/param-inheritance/parent-suite.xml index 94993f7a5a..638e8b8c75 100644 --- a/testng-core/src/test/resources/param-inheritance/parent-suite.xml +++ b/testng-core/src/test/resources/samples/param-inheritance/parent-suite.xml @@ -3,6 +3,6 @@ - + - \ No newline at end of file + diff --git a/testng-core/src/test/resources/parametertest/1417.xml b/testng-core/src/test/resources/samples/parametertest/1417.xml similarity index 100% rename from testng-core/src/test/resources/parametertest/1417.xml rename to testng-core/src/test/resources/samples/parametertest/1417.xml diff --git a/testng-core/src/test/resources/parametertest/child1-suite.xml b/testng-core/src/test/resources/samples/parametertest/child1-suite.xml similarity index 100% rename from testng-core/src/test/resources/parametertest/child1-suite.xml rename to testng-core/src/test/resources/samples/parametertest/child1-suite.xml diff --git a/testng-core/src/test/resources/parametertest/child2-suite.xml b/testng-core/src/test/resources/samples/parametertest/child2-suite.xml similarity index 88% rename from testng-core/src/test/resources/parametertest/child2-suite.xml rename to testng-core/src/test/resources/samples/parametertest/child2-suite.xml index 9f0428f892..46cfa88fc2 100644 --- a/testng-core/src/test/resources/parametertest/child2-suite.xml +++ b/testng-core/src/test/resources/samples/parametertest/child2-suite.xml @@ -9,9 +9,9 @@ - + - + - \ No newline at end of file + diff --git a/testng-core/src/test/resources/parametertest/child3-suite.xml b/testng-core/src/test/resources/samples/parametertest/child3-suite.xml similarity index 100% rename from testng-core/src/test/resources/parametertest/child3-suite.xml rename to testng-core/src/test/resources/samples/parametertest/child3-suite.xml diff --git a/testng-core/src/test/resources/parametertest/parent-suite.xml b/testng-core/src/test/resources/samples/parametertest/parent-suite.xml similarity index 73% rename from testng-core/src/test/resources/parametertest/parent-suite.xml rename to testng-core/src/test/resources/samples/parametertest/parent-suite.xml index 77b1528384..be38e04a6b 100644 --- a/testng-core/src/test/resources/parametertest/parent-suite.xml +++ b/testng-core/src/test/resources/samples/parametertest/parent-suite.xml @@ -5,7 +5,7 @@ - - + + - \ No newline at end of file + diff --git a/testng-core/src/test/resources/parent-module-suite.xml b/testng-core/src/test/resources/samples/parent-module-suite.xml similarity index 78% rename from testng-core/src/test/resources/parent-module-suite.xml rename to testng-core/src/test/resources/samples/parent-module-suite.xml index 029241d823..57b7aea35d 100644 --- a/testng-core/src/test/resources/parent-module-suite.xml +++ b/testng-core/src/test/resources/samples/parent-module-suite.xml @@ -3,7 +3,7 @@ - + - \ No newline at end of file + diff --git a/testng-core/src/test/resources/sanitycheck/test-a.xml b/testng-core/src/test/resources/samples/sanitycheck/test-a.xml similarity index 69% rename from testng-core/src/test/resources/sanitycheck/test-a.xml rename to testng-core/src/test/resources/samples/sanitycheck/test-a.xml index 88c3ada11b..4310cf11eb 100644 --- a/testng-core/src/test/resources/sanitycheck/test-a.xml +++ b/testng-core/src/test/resources/samples/sanitycheck/test-a.xml @@ -2,7 +2,7 @@ - - + + diff --git a/testng-core/src/test/resources/sanitycheck/test-b.xml b/testng-core/src/test/resources/samples/sanitycheck/test-b.xml similarity index 69% rename from testng-core/src/test/resources/sanitycheck/test-b.xml rename to testng-core/src/test/resources/samples/sanitycheck/test-b.xml index 1eccba0c1f..f0b779aca7 100644 --- a/testng-core/src/test/resources/sanitycheck/test-b.xml +++ b/testng-core/src/test/resources/samples/sanitycheck/test-b.xml @@ -2,7 +2,7 @@ - - + + diff --git a/testng-core/src/test/resources/sanitycheck/test-s-1.xml b/testng-core/src/test/resources/samples/sanitycheck/test-s-1.xml similarity index 100% rename from testng-core/src/test/resources/sanitycheck/test-s-1.xml rename to testng-core/src/test/resources/samples/sanitycheck/test-s-1.xml diff --git a/testng-core/src/test/resources/sanitycheck/test-s-2.xml b/testng-core/src/test/resources/samples/sanitycheck/test-s-2.xml similarity index 100% rename from testng-core/src/test/resources/sanitycheck/test-s-2.xml rename to testng-core/src/test/resources/samples/sanitycheck/test-s-2.xml diff --git a/testng-core/src/test/resources/sanitycheck/test-s-3.xml b/testng-core/src/test/resources/samples/sanitycheck/test-s-3.xml similarity index 100% rename from testng-core/src/test/resources/sanitycheck/test-s-3.xml rename to testng-core/src/test/resources/samples/sanitycheck/test-s-3.xml diff --git a/testng-core/src/test/resources/sanitycheck/test-s-a.xml b/testng-core/src/test/resources/samples/sanitycheck/test-s-a.xml similarity index 69% rename from testng-core/src/test/resources/sanitycheck/test-s-a.xml rename to testng-core/src/test/resources/samples/sanitycheck/test-s-a.xml index 25ba33cdb9..afc5010121 100644 --- a/testng-core/src/test/resources/sanitycheck/test-s-a.xml +++ b/testng-core/src/test/resources/samples/sanitycheck/test-s-a.xml @@ -2,7 +2,7 @@ - - + + diff --git a/testng-core/src/test/resources/sanitycheck/test-s-b.xml b/testng-core/src/test/resources/samples/sanitycheck/test-s-b.xml similarity index 69% rename from testng-core/src/test/resources/sanitycheck/test-s-b.xml rename to testng-core/src/test/resources/samples/sanitycheck/test-s-b.xml index 9053d74c94..86be359e37 100644 --- a/testng-core/src/test/resources/sanitycheck/test-s-b.xml +++ b/testng-core/src/test/resources/samples/sanitycheck/test-s-b.xml @@ -2,7 +2,7 @@ - - + + diff --git a/testng-core/src/test/resources/sanitycheck/test1.xml b/testng-core/src/test/resources/samples/sanitycheck/test1.xml similarity index 100% rename from testng-core/src/test/resources/sanitycheck/test1.xml rename to testng-core/src/test/resources/samples/sanitycheck/test1.xml diff --git a/testng-core/src/test/resources/sanitycheck/test2.xml b/testng-core/src/test/resources/samples/sanitycheck/test2.xml similarity index 100% rename from testng-core/src/test/resources/sanitycheck/test2.xml rename to testng-core/src/test/resources/samples/sanitycheck/test2.xml diff --git a/testng-core/src/test/resources/sanitycheck/test3.xml b/testng-core/src/test/resources/samples/sanitycheck/test3.xml similarity index 100% rename from testng-core/src/test/resources/sanitycheck/test3.xml rename to testng-core/src/test/resources/samples/sanitycheck/test3.xml diff --git a/testng-core/src/test/resources/serviceloader.jar b/testng-core/src/test/resources/samples/serviceloader.jar similarity index 100% rename from testng-core/src/test/resources/serviceloader.jar rename to testng-core/src/test/resources/samples/serviceloader.jar diff --git a/testng-core/src/test/resources/suite-parallel-0.xml b/testng-core/src/test/resources/samples/suite-parallel-0.xml similarity index 100% rename from testng-core/src/test/resources/suite-parallel-0.xml rename to testng-core/src/test/resources/samples/suite-parallel-0.xml diff --git a/testng-core/src/test/resources/suite-parallel-1.xml b/testng-core/src/test/resources/samples/suite-parallel-1.xml similarity index 100% rename from testng-core/src/test/resources/suite-parallel-1.xml rename to testng-core/src/test/resources/samples/suite-parallel-1.xml diff --git a/testng-core/src/test/resources/suite-parallel-2.xml b/testng-core/src/test/resources/samples/suite-parallel-2.xml similarity index 100% rename from testng-core/src/test/resources/suite-parallel-2.xml rename to testng-core/src/test/resources/samples/suite-parallel-2.xml diff --git a/testng-core/src/test/resources/suite1-1.xml b/testng-core/src/test/resources/samples/suite1-1.xml similarity index 100% rename from testng-core/src/test/resources/suite1-1.xml rename to testng-core/src/test/resources/samples/suite1-1.xml diff --git a/testng-core/src/test/resources/suite1-2.xml b/testng-core/src/test/resources/samples/suite1-2.xml similarity index 100% rename from testng-core/src/test/resources/suite1-2.xml rename to testng-core/src/test/resources/samples/suite1-2.xml diff --git a/testng-core/src/test/resources/suite1.xml b/testng-core/src/test/resources/samples/suite1.xml similarity index 100% rename from testng-core/src/test/resources/suite1.xml rename to testng-core/src/test/resources/samples/suite1.xml diff --git a/testng-core/src/test/resources/test/listeners/github1284/github1284.xml b/testng-core/src/test/resources/samples/test/listeners/github1284/github1284.xml similarity index 100% rename from testng-core/src/test/resources/test/listeners/github1284/github1284.xml rename to testng-core/src/test/resources/samples/test/listeners/github1284/github1284.xml diff --git a/testng-core/src/test/resources/test/listeners/github1284/github1284_nolistener.xml b/testng-core/src/test/resources/samples/test/listeners/github1284/github1284_nolistener.xml similarity index 100% rename from testng-core/src/test/resources/test/listeners/github1284/github1284_nolistener.xml rename to testng-core/src/test/resources/samples/test/listeners/github1284/github1284_nolistener.xml diff --git a/testng-core/src/test/resources/test/listeners/github1284/github1284_withchildlistener.xml b/testng-core/src/test/resources/samples/test/listeners/github1284/github1284_withchildlistener.xml similarity index 100% rename from testng-core/src/test/resources/test/listeners/github1284/github1284_withchildlistener.xml rename to testng-core/src/test/resources/samples/test/listeners/github1284/github1284_withchildlistener.xml diff --git a/testng-core/src/test/resources/test/listeners/github1284/github1284_withlistener.xml b/testng-core/src/test/resources/samples/test/listeners/github1284/github1284_withlistener.xml similarity index 100% rename from testng-core/src/test/resources/test/listeners/github1284/github1284_withlistener.xml rename to testng-core/src/test/resources/samples/test/listeners/github1284/github1284_withlistener.xml diff --git a/testng-core/src/test/resources/test/methodselectors/sampleTest.xml b/testng-core/src/test/resources/samples/test/methodselectors/sampleTest.xml similarity index 100% rename from testng-core/src/test/resources/test/methodselectors/sampleTest.xml rename to testng-core/src/test/resources/samples/test/methodselectors/sampleTest.xml diff --git a/testng-core/src/test/resources/test/methodselectors/sampleTestExclusions.xml b/testng-core/src/test/resources/samples/test/methodselectors/sampleTestExclusions.xml similarity index 100% rename from testng-core/src/test/resources/test/methodselectors/sampleTestExclusions.xml rename to testng-core/src/test/resources/samples/test/methodselectors/sampleTestExclusions.xml diff --git a/testng-core/src/test/resources/test/timeout/issue575.xml b/testng-core/src/test/resources/samples/test/timeout/issue575.xml similarity index 100% rename from testng-core/src/test/resources/test/timeout/issue575.xml rename to testng-core/src/test/resources/samples/test/timeout/issue575.xml diff --git a/testng-core/src/test/resources/testnames/main-suite.xml b/testng-core/src/test/resources/samples/testnames/main-suite.xml similarity index 100% rename from testng-core/src/test/resources/testnames/main-suite.xml rename to testng-core/src/test/resources/samples/testnames/main-suite.xml diff --git a/testng-core/src/test/resources/testnames/upstream-suite.xml b/testng-core/src/test/resources/samples/testnames/upstream-suite.xml similarity index 100% rename from testng-core/src/test/resources/testnames/upstream-suite.xml rename to testng-core/src/test/resources/samples/testnames/upstream-suite.xml diff --git a/testng-core/src/test/resources/testng-configfailure.xml b/testng-core/src/test/resources/samples/testng-configfailure.xml similarity index 100% rename from testng-core/src/test/resources/testng-configfailure.xml rename to testng-core/src/test/resources/samples/testng-configfailure.xml diff --git a/testng-core/src/test/resources/testng-methodselectors.xml b/testng-core/src/test/resources/samples/testng-methodselectors.xml similarity index 100% rename from testng-core/src/test/resources/testng-methodselectors.xml rename to testng-core/src/test/resources/samples/testng-methodselectors.xml diff --git a/testng-core/src/test/resources/withouttestngxml.jar b/testng-core/src/test/resources/samples/withouttestngxml.jar similarity index 100% rename from testng-core/src/test/resources/withouttestngxml.jar rename to testng-core/src/test/resources/samples/withouttestngxml.jar diff --git a/testng-core/src/test/resources/withtestngxml.jar b/testng-core/src/test/resources/samples/withtestngxml.jar similarity index 100% rename from testng-core/src/test/resources/withtestngxml.jar rename to testng-core/src/test/resources/samples/withtestngxml.jar diff --git a/testng-core/src/test/resources/xml/badWithDoctype.xml b/testng-core/src/test/resources/samples/xml/badWithDoctype.xml similarity index 100% rename from testng-core/src/test/resources/xml/badWithDoctype.xml rename to testng-core/src/test/resources/samples/xml/badWithDoctype.xml diff --git a/testng-core/src/test/resources/xml/badWithoutDoctype.xml b/testng-core/src/test/resources/samples/xml/badWithoutDoctype.xml similarity index 100% rename from testng-core/src/test/resources/xml/badWithoutDoctype.xml rename to testng-core/src/test/resources/samples/xml/badWithoutDoctype.xml diff --git a/testng-core/src/test/resources/xml/github1533/child.xml b/testng-core/src/test/resources/samples/xml/github1533/child.xml similarity index 100% rename from testng-core/src/test/resources/xml/github1533/child.xml rename to testng-core/src/test/resources/samples/xml/github1533/child.xml diff --git a/testng-core/src/test/resources/xml/github1533/parent.xml b/testng-core/src/test/resources/samples/xml/github1533/parent.xml similarity index 100% rename from testng-core/src/test/resources/xml/github1533/parent.xml rename to testng-core/src/test/resources/samples/xml/github1533/parent.xml diff --git a/testng-core/src/test/resources/xml/github2445/expected-failed-report.xml b/testng-core/src/test/resources/samples/xml/github2445/expected-failed-report.xml similarity index 100% rename from testng-core/src/test/resources/xml/github2445/expected-failed-report.xml rename to testng-core/src/test/resources/samples/xml/github2445/expected-failed-report.xml diff --git a/testng-core/src/test/resources/xml/github2445/test-suite.xml b/testng-core/src/test/resources/samples/xml/github2445/test-suite.xml similarity index 100% rename from testng-core/src/test/resources/xml/github2445/test-suite.xml rename to testng-core/src/test/resources/samples/xml/github2445/test-suite.xml diff --git a/testng-core/src/test/resources/xml/goodWithDoctype.xml b/testng-core/src/test/resources/samples/xml/goodWithDoctype.xml similarity index 100% rename from testng-core/src/test/resources/xml/goodWithDoctype.xml rename to testng-core/src/test/resources/samples/xml/goodWithDoctype.xml diff --git a/testng-core/src/test/resources/xml/goodWithoutDoctype.xml b/testng-core/src/test/resources/samples/xml/goodWithoutDoctype.xml similarity index 100% rename from testng-core/src/test/resources/xml/goodWithoutDoctype.xml rename to testng-core/src/test/resources/samples/xml/goodWithoutDoctype.xml diff --git a/testng-core/src/test/resources/xml/issue1668.xml b/testng-core/src/test/resources/samples/xml/issue1668.xml similarity index 92% rename from testng-core/src/test/resources/xml/issue1668.xml rename to testng-core/src/test/resources/samples/xml/issue1668.xml index 1dce9f2cfb..3ab28c95fc 100644 --- a/testng-core/src/test/resources/xml/issue1668.xml +++ b/testng-core/src/test/resources/samples/xml/issue1668.xml @@ -1,6 +1,6 @@ - +