I had to make a jar file from my test classes and add it to my class path. Previously I added my test class file to class path and then I got above error. So I created a jar and added to classpath.
e.g
java -cp "my_jars/*" org.testng.TestNG testing.xml