title: Calling a method from another class using TestNG and Java
body: <p>Getting an error below after running test2.java running as TestNG if I run it as Java Application everything is working.  What does the error mean and can anyone help me with this using TestNG and Java.  I am using Webdriver and Eclipse and just want to do this simple trick to apply for my test scripts.</p>
  
  <blockquote>
    <p>SKIPPED: main org.testng.TestNGException:  Method main requires 1
    parameters but 0 were supplied in the @Test annotation.</p>
  </blockquote>
  
  <p>Here is my code for Test1.java</p>
  
  <pre><code>package firsttestngpackage;
  
  import org.testng.annotations.Test;
  
  @Test
  public class Test1{
      public void message(){
          System.out.println("Test");
      }
  }
  </code></pre>
  
  <p>Here is my code for Test2.java</p>
  
  <pre><code>package firsttestngpackage;
  
  import org.testng.annotations.Parameters;
  import org.testng.annotations.Test;
  
  @Test
  public class Test2{
      public static void main(String[] args){
          Test1 class1 = new Test1();
          class1.message();
      }
  }
  </code></pre>