Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8186903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:22:55+00:00 2026-06-07T02:22:55+00:00

I have a Java project that I’ve been developing primarily in windows. I have

  • 0

I have a Java project that I’ve been developing primarily in windows. I have some unit tests that I’ve written in TestNG that I also run… I’m using TestNG version 5.14.1

My project compiles fine under OS X. The TestNG tests also compile fine.. However when I try to execute the unit tests the task fails with the following error:

Omair-Inams-MacBook-Pro:PNServices omairkhawaja$ ant clean testng
...

compile-and-jar:
    [mkdir] Created dir: /Users/omairkhawaja/source/my-project/common/server/PNServices/build/classes
    [javac] Compiling 131 source files to /Users/omairkhawaja/source/my-project/common/server/PNServices/build/classes
    [javac]                                                                                           
     [copy] Copying 7 files to /Users/omairkhawaja/source/my-project/common/server/PNServices/build/classes
      [jar] Building jar: /Users/omairkhawaja/source/my-project/common/server/PNServices/build/jars/PNServices.jar

compileTest:
    [mkdir] Created dir: /Users/omairkhawaja/source/my-project/common/server/PNServices/build/test/classes
    [javac] /Users/omairkhawaja/source/my-project/common/server/PNServices/buildtools/build-test.xml:28: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 14 source files to /Users/omairkhawaja/source/my-project/common/server/PNServices/build/test/classes
    [javac] /Users/omairkhawaja/source/my-project/common/server/PNServices/src/test/java/com/corp/monitoring/my-project/service/discovery/PnDiscoveryServiceTest.java:234: warning: non-varargs call of varargs method with inexact argument type for last parameter;
    [javac] cast to java.util.List<java.lang.Object> for a varargs call
    [javac] cast to java.util.List<java.lang.Object>[] for a non-varargs call and to suppress this warning
    [javac]         when(mdo.getList("ineligibleDevices")).thenReturn(ineligibleResultList, null);
    [javac]                                                                                 ^
    [javac] /Users/omairkhawaja/source/my-project/common/server/PNServices/src/test/java/com/corp/monitoring/my-project/service/discovery/PnDiscoveryServiceTest.java:252: warning: non-varargs call of varargs method with inexact argument type for last parameter;
    [javac] cast to java.util.List<java.lang.Object> for a varargs call
    [javac] cast to java.util.List<java.lang.Object>[] for a non-varargs call and to suppress this warning
    [javac]         when(mdo.getList("ineligibleDevices")).thenReturn(null, null);
    [javac]                                                                 ^
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 2 warnings
    [mkdir] Created dir: /Users/omairkhawaja/source/my-project/common/server/PNServices/build/test/jar
      [jar] Building jar: /Users/omairkhawaja/source/my-project/common/server/PNServices/build/test/jar/agent-test.jar

testng:
    [mkdir] Created dir: /Users/omairkhawaja/source/my-project/common/server/PNServices/build/testng
    [mkdir] Created dir: /Users/omairkhawaja/source/my-project/common/server/PNServices/build/coverage
   [testng] [TestNGAntTask] TESTNG PASSED @/var/folders/ft/p4_xg83109v465y_ktnrq29m0000gn/T/testng6488341970286082385 WHICH CONTAINS:
   [testng]   -usedefaultlisteners
   [testng]   false
   [testng]   -d
   [testng]   /Users/omairkhawaja/source/my-project/common/server/PNServices/build/testng
   [testng]   -groups
   [testng]   unit
   [testng]   -listener
   [testng]   org.uncommons.reportng.HTMLReporter;org.testng.reporters.JUnitXMLReporter;org.uncommons.reportng.JUnitXMLReporter
   [testng]   -suitename
   [testng]   Ant suite
   [testng]   -testname
   [testng]   Ant test
   [testng]   /Users/omairkhawaja/source/my-project/common/server/PNServices/buildtools/suite.xml
   [testng] Listening for transport dt_socket at address: 5005
   [testng] [ERROR]: No test suite found.  Nothing to run
   [testng] java.io.FileNotFoundException: test-output/testng.css (No such file or directory)
   [testng]     at java.io.FileOutputStream.open(Native Method)
   [testng]     at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
   [testng]     at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
   [testng]     at org.testng.internal.Utils.writeResourceToFile(Utils.java:618)
   [testng]     at org.testng.reporters.HtmlHelper.generateStylesheet(HtmlHelper.java:25)
   [testng]     at org.testng.reporters.SuiteHTMLReporter.generateReport(SuiteHTMLReporter.java:49)
   [testng]     at org.testng.TestNG.run(TestNG.java:613)
   [testng]     at org.testng.TestNG.privateMain(TestNG.java:999)
   [testng]     at org.testng.TestNG.main(TestNG.java:936)
   [testng] ERROR WHILE WRITING TO test-output/index.html
   [testng] java.io.IOException: No such file or directory
   [testng]     at java.io.UnixFileSystem.createFileExclusively(Native Method)
   [testng]     at java.io.File.createNewFile(File.java:883)
   [testng]     at org.testng.internal.Utils.writeFile(Utils.java:168)
   [testng]     at org.testng.reporters.SuiteHTMLReporter.generateIndex(SuiteHTMLReporter.java:138)
   [testng]     at org.testng.reporters.SuiteHTMLReporter.generateReport(SuiteHTMLReporter.java:75)
   [testng]     at org.testng.TestNG.run(TestNG.java:613)
   [testng]     at org.testng.TestNG.privateMain(TestNG.java:999)
   [testng]     at org.testng.TestNG.main(TestNG.java:936)

BUILD SUCCESSFUL
Total time: 13 seconds
Omair-Inams-MacBook-Pro:PNServices omairkhawaja$ 

Omair-Inams-MacBook-Pro:PNServices omairkhawaja$ pwd
/Users/omairkhawaja/source/my-project/common/server/PNServices

Omair-Inams-MacBook-Pro:PNServices omairkhawaja$ ls -l buildtools/ | grep suite
-rw-r--r--   1 omairkhawaja  staff   858  5 Apr 15:43 suite.xml

This is the testng target I’m using

<testng outputDir="${testng.report.dir}"
                workingDir="${test.resources.dir}"
                haltOnfailure="false"
                useDefaultListeners="false"
                listeners="org.uncommons.reportng.HTMLReporter,org.testng.reporters.JUnitXMLReporter,org.uncommons.reportng.JUnitXMLReporter" dumpCommand="true"
                groups="unit" >
            <jvmarg value="-Dlog4j.configuration=file:log4j.properties" />
            <jvmarg value="-Dquest.debug=1" />
            <jvmarg value="-Xdebug"/>
            <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7007"/>
            <sysproperty key="org.uncommons.reportng.title" value="PNServices Unit Tests"/>
            <classpath>
                <fileset refid="test-dependencies.fileset"/>
                <fileset dir="${fglam.devkit.home}">
                    <include name="**/*.jar"/>
                </fileset>
                <fileset dir="${fglcore.home}">
                    <include name="**/*.jar"/>
                </fileset>
                <fileset dir="${build.jars.dir}">
                    <include name="*.jar"/>
                </fileset>
                <fileset dir="${test.resources.dir}">
                    <include name="log4j.properties"/>
                </fileset>
                <fileset dir="${build.test.dir}/jar" includes="agent-test.jar" />
            </classpath>

            <xmlfileset dir="${basedir}/buildtools" includes="suite.xml"/>
        </testng>

This is my suite.xml file

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!--Test suite name must not be changed as it is referenced in sonar-project.properties -->
<suite name="TestSuite" verbose="1" >
  <!-- Test MUST be named TEST-xxxx as Sonar requires this file naming format to be able to parse test results-->
  <test name="TEST-Unit">
      <packages>
          <package name="com.corp.monitoring.*" />
      </packages>

      <groups>
          <run>
            <exclude name="brokenTests"  />
            <include name="unit"  />
          </run>
        </groups>
  </test>
</suite>

As the command-line output in the beginning shows, my suite.xml file is located in the appropriate directory.. I’m not sure why TestNG runs successfully on windows but fails to run on OS X .. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T02:22:57+00:00Added an answer on June 7, 2026 at 2:22 am

    The issue happened due to a ReportNG dependency being downloading using the maven ant task which also declares a dependency on an ancient TestNG version which was being picked up first in the classpath and causing the testng ant target to fail.

    I ran into a similar issue on Windows recently .. and after floundering for a while discovered what the issue was.. I was attempting importing the ReportNG dependency using the maven dependency ant task… and it was downloading an old version of TestNG… As noted by Marcin Zajączkowski to use reportNG in maven you need to exclude the transitive TestNG dependency.. I don’t know if there’s a synonymous fix possible when using the ant maven task.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've inherited a java project that appears to have been developed using the NetBeans
I have a Java project that I've been working on for a while. The
I have a java project that has just been imported into TFS and I've
I have a have a java project that serializes some objects and ints to
I have an Android (Java) project that includes some native C/C++ code and I
I have a legacy java project that we have been moving to buildr/artifactory from
I have a java project that uses JPA 2/Hibernate 3.5.6 for data access and
I have a Java project that needs a addon interface. I was thinking about
I have a Java project that I'm trying to implement with a model-view-controller design.
I have a Java project that I build using an Ant script. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.