Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1096

ClassCastException: Fork test for TestNG with xmlsuite

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.14, 2.15, 2.16, 2.17
    • Fix Version/s: 2.18
    • Component/s: TestNG support
    • Labels:
      None

      Description

      When i setup surefire for forking tests via:

      <forkCount>3</forkCount>
      <reuseForks>true</reuseForks>
      <parallel>false</parallel>
      

      And i'm using TestNG provider with xml suite definition:

      <suiteXmlFiles>
      <suiteXmlFile>suite.xml</suiteXmlFile>
      </suiteXmlFiles>
      

      I'm getting exception:

      Caused by: java.lang.ClassCastException: java.io.File cannot be cast to java.lang.Class
      	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.runSuitesForkOnceMultiple(ForkStarter.java:201)
      	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:160)
      	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:806)
      	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:701)
      	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:629)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                agudian Andreas Gudian
                Reporter:
                michal.bocek Michal Bocek
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: