2016-11-02 36 views
3

進口嘗試(初始化期間)從HAC 運行項目的更新工作正常,在一次導入的單元+集成測試數據。項目數據沒有得到JUnit的初始化過程中的hybris

但是當我使用命令init或更新項目數據爲我定製的,甚至對於開箱即用的擴展,它是沒有得到進口。

我已經使用設置下面的方法導入數據的嘗試:

@SystemSetup(type = Type.PROJECT, process = Process.ALL) 
public void createProjectData(final SystemSetupContext context) {//...} 

我試圖「型= Type.ESSENTIAL」太對我的IMPEX進口而不是從CLI在平臺目錄中的成功。

任何幫助將不勝感激。

+0

你想要什麼命令?你用螞蟻命令使用了-Dantant = junit嗎?請提供一些細節 – Vikrant

+0

您是否將您的設置類聲明爲Spring bean? –

+0

是的,我已經創建了我的安裝類的bean,我正在使用init進程的命令:「ant initialize -Dtenant = junit」。 –

回答

0

你可以做的是直接從您的測試代碼做到這一點。 我給你一個例子在groovy:

def init(){ 

    //Call below line only if you want to do an init between two tests for example 
    initTestTenant(); 

    //Call this to execute the code in createProjectData 
    final SystemSetupContext systemSetupContext = new SystemSetupContext(new HashMap<String, String[]>(), Type.ESSENTIAL, 
     Process.ALL, "projectname"); 
    yourExtensionSystemSetup.createProjectData(systemSetupContext); 

} 
相關問題