2014-09-20 34 views
3

我試圖爲我們自己的框架創建適配器。我們的框架使用自己的斷言機制,所以我需要編寫適配器。爲自己的框架創建新的誘惑適配器

適配器類是非常簡單,它看起來像這樣:

public class AllureReportListener { 

    private static AllureReportListener object = new AllureReportListener(); 

    private Allure lifecycle = Allure.LIFECYCLE; 

    private String suiteUid = UUID.randomUUID().toString(); 

    private Set<String> startedTestNames = Collections.newSetFromMap(
      new ConcurrentHashMap<String, Boolean>()); 

    public static AllureReportListener getReportListener() 
    { 
     return object; 
    } 

    public void onTestSuiteStart(String testCaseName) 
    { 
     getLifecycle().fire(new TestSuiteStartedEvent(
       suiteUid,testCaseName 
     )); 
    } 

    public void onTestSuiteFinish() 
    { 
     getLifecycle().fire(new TestSuiteFinishedEvent(suiteUid)); 
    } 

    Allure getLifecycle() { 
     return lifecycle; 
    } 
} 

我們自己的測試套件類,呼籲正確的事件時間這些方法。

因爲我們有自己的測試框架,我們有自己的ant任務調用ownrunner這樣的:

<target name="test"> 
    <ownrunner classpathref="classpath" file="config/usecase/SEEDLoginCase.xml" parallel="Scenario" output="${build.report}"> 
    </ownrunner> 
</target> 

我跑Ant構建,但是我沒有看到在build文件夾中的任何誘惑力的結果。

現在我很震驚。我想要這個螞蟻任務產生魅力xml結果。我需要做什麼?

回答

6

您還需要啓動方面jar,這是ant build的一部分。將此行添加到您的版本中:

<jvmarg value="-javaagent:${currentDir}/aspectjweaver-1.8.0.jar"/> 

這將幫助您在您已配置的目錄下獲得誘人的結果。

相關問題