コンソールからの入力ができません。
@Test public static void abcde1() throws Exception { Run1 run123=new run1(); ApplicationContext context = new ClassPathXmlApplicationContext( "test-beans.xml"); ServiceClient serviceClient = (ServiceClien)context.getBean("customer"); System.out.println(serviceClient); run123.setup(serviceClient);//setup belongs to another class }
2.この関数は別の Run1 に属します (BufferRead はそこでのみ定義され、System.in を入力として受け取ります。
public void setup(ServiceClient serviceClient) throws Exception { System.out.println("enter some "); System.out.println("Enter the UserName the user wants to login With"); String userName = bufferRead.readLine(); System.out.println(userName); }
プログラムでは、testng.xmlを参照してこのテストを呼び出します
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>