title: Why is TestNG seeing my package but not my class?
body: <p>When I run (Windows 7 command line):</p>
  
  <p>C:\rest-app\src\main\java\com\mycompany\app\Test>java org.testng.TestNG testng.xml</p>
  
  <p>I get:</p>
  
  <p>===============================================</p>
  
  <p>Suite1
  Total tests run: 0, Failures: 0, Skips: 0</p>
  
  <p>===============================================</p>
  
  <p>This is when my testng.xml file looks like:</p>
  
  <pre><code>&lt;!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" &gt;
  
  &lt;suite name="Suite1" verbose="1" &gt;
  &lt;test name="SandBoxTests"   &gt;
      &lt;packages&gt;
          &lt;package name="com.mycompany.app.Test" /&gt;
      &lt;/packages&gt;
  &lt;/test&gt;
  &lt;/suite&gt;
  </code></pre>
  
  <p>I have three tests in my class in that package.</p>
  
  <p>When I change my testng.xml file to be:</p>
  
  <pre><code>&lt;suite name="Suite1" verbose="1" &gt;
  &lt;test name="SandBoxTests"   &gt;
      &lt;classes&gt;
          &lt;class name="com.mycompany.app.Test.SandBoxTests"&gt;
              &lt;methods&gt;
                  &lt;include name="com.mycompany.app.Test.SandBoxTests.TestA"/&gt;
              &lt;/methods&gt;
          &lt;/class&gt;
      &lt;/classes&gt;
   &lt;/test&gt;
  &lt;/suite&gt;
  </code></pre>
  
  <p>I get the response:</p>
  
  <p>[TestNG] [ERROR]
  Cannot find class in classpath: com.mycompany.app.Test.SandBoxTests</p>
  
  <p>My classpath looks like:</p>
  
  <p>C:\rest-app\lib\ *;C:\rest-app\src\main\java\com\mycompany\app\Test\ *</p>
  
  <p>The first directory points to all of my included .jar files, including testng and the last directory includes the location of the class file from which I'm trying to run my tests. my testng.xml file is there as well.</p>
  
  <p>So how is it that TestNG appears to find my package just fine, but fails to see my class?</p>
  
  <p>My code is:</p>
  
  <pre><code>package com.mycompany.app.Test;
  
  import com.mycompany.app.RestMethods;
  import com.mycompany.app.Test.TestObjects.AutoCompleteList;
  import com.mycompany.app.Test.TestObjects.AutocompleteItem;
  import com.mycompany.app.Test.TestObjects.Title;
  import com.thoughtworks.xstream.XStream;
  import org.apache.http.HttpResponse;
  import org.testng.Reporter;
  import org.testng.annotations.AfterClass;
  import org.testng.annotations.BeforeClass;
  import org.testng.annotations.Test;
  
  import java.util.HashMap;
  import java.util.Map;
  import java.util.Properties;
  
  import static org.junit.Assert.assertTrue;
  
  
  public class SandBoxTests
  </code></pre>
  
  <p>{
      ...</p>
  
  <pre><code>@BeforeClass
  public void SetupSandBoxTests() throws Exception
  {
  
  }
  
  @Test
  public void TestA() throws Exception
  {
      ...
  }
  
  ...
  }
  </code></pre>
  
  <p>EDIT:  I updated my classpath to include the location of the compiled source file that has my TestNG tests and also included the root of the path which contains my testng.xml file, but nothing has changed.  I added:</p>
  
  <p>C:\rest-app\out\production\Main\ *;C:\rest-app\out\production\Main\com\homeaway\app\Test\ *</p>
  
  <p>EDIT 10/25: Maven now builds and executes the tests correctly, but I still am unable to get testng to execute from the command line.  In order to get Maven to run my tests I had to use</p>
  
  <pre><code>&lt;includes&gt;
      &lt;include&gt;**/*.java&lt;/include&gt;
  &lt;/includes&gt;
  </code></pre>
  
  <p>instead of:</p>
  
  <pre><code>&lt;suiteXmlFiles&gt;
      &lt;suiteXmlFile&gt;testng.xml&lt;/suiteXmlFile&gt;
  &lt;/suiteXmlFiles&gt;
  </code></pre>