2013-07-12 79 views
0

我在JMeter中一個Java請求我寫的擴展AbstractJavaSamplerClient代碼並執行重寫的方法 我打,可以看到日誌遠程機器 在響應,但我看不到在視圖結果響應樹並保存在迴應JMeter的 到文件下面是的runTest代碼片段,請讓我知道我如何能捕捉到的JMeter的JMeter的Java請求

public SampleResult runTest(JavaSamplerContext context) { 

    System.out.println("run Test method actual method is called here.."); 
    XCardService xcardService = null; 
    String urlString = context.getParameter("rubyURL"); 
    SampleResult result = new SampleResult(); 
    boolean success = true; 
    result.sampleStart(); 
    //try with Junit 
    String[] rubyURL = new String[1]; 
    rubyURL[0] = urlString; 
    try { 
     System.out.println("RubyUrl::"+rubyURL); 
     xcardService = XCardFactory.getService(rubyURL, 165, appPassword, 5000); 
    } catch (AuthenticationFailureException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } catch (IncompatibleVersionException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } catch (ServiceUnavailableException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } catch (ServiceInitFailedException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } catch (XCardTimeoutException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } catch (InvalidURLException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } 
    DiagnosticContext dc = new ServerDiagnosticContext("Junit TestCase"); 
    try { 
     System.out.println("xcardService::"+xcardService); 
     AccountInfo account = xcardService.getAccountInfo(dc, 1089765); 
     System.out.println("getAccount Info ::"+account.toString()); 
    } catch (InvalidArgumentException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } catch (ClientNotAuthenticatedException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } catch (SystemException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } catch (XCardTimeoutException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } catch (XCardException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } 
    result.sampleEnd(); 
    result.setSuccessful(success); 
    System.out.println("Response Message:::"+result.getResponseMessage()); 
    return result; 

} 

回答