I'm not seeing why java
cannot find App
as it's explicitly added to the classpath:
nicholas@mordor:~$
nicholas@mordor:~$ java -cp /usr/share/maven-repo/org/testng/testng/debian/testng-debian.jar:/home/nicholas/NetbeansProjects/testng_gradle/src/main/java/testng_gradle/App /home/nicholas/NetBeansProjects/testng_gradle/app/src/test/java/testng_gradle/AppTest.java /home/Nicholas/NetbeansProjects/testng_gradle/test.xml
/home/nicholas/NetBeansProjects/testng_gradle/app/src/test/java/testng_gradle/AppTest.java:11: error: cannot find symbol
App classUnderTest = new App();
^
symbol: class App
location: class AppTest
/home/nicholas/NetBeansProjects/testng_gradle/app/src/test/java/testng_gradle/AppTest.java:11: error: cannot find symbol
App classUnderTest = new App();
^
symbol: class App
location: class AppTest
2 errors
error: compilation failed
nicholas@mordor:~$
nicholas@mordor:~$ tree NetBeansProjects/testng_gradle/
NetBeansProjects/testng_gradle/
├── app
│ ├── build.0
│ ├── build.gradle
│ ├── src
│ │ ├── main
│ │ │ ├── java
│ │ │ │ └── testng_gradle
│ │ │ │ └── App.java
│ │ │ └── resources
│ │ └── test
│ │ ├── java
│ │ │ └── testng_gradle
│ │ │ └── AppTest.java
│ │ └── resources
│ └── test.xml
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── test.xml
12 directories, 11 files
nicholas@mordor:~$
nicholas@mordor:~$ uname -a
Linux mordor 5.11.0-25-generic #27-Ubuntu SMP Fri Jul 9 23:06:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
nicholas@mordor:~$
Ideally, would like to use bash
as:
java -Dtestng.test.classpath="c:/build;c:/java/classes;" org.testng.TestNG testng.xml
but in using linux perhaps have gotten the command mixed up.
This is about the simplest testng
example possible.