2

尝试一次为单元+集成测试导入数据(在初始化期间)从 HAC 运行项目更新工作正常。

但是,当我使用命令为我的自定义甚至 OOTB 扩展程序初始化或更新项目数据时,它并没有被导入。

我尝试使用以下方法进行设置以导入数据:

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

我也为 impex 导入尝试了“type = Type.ESSENTIAL”,但在平台目录的 CLI 中没有成功。

任何帮助将不胜感激。

4

1 回答 1

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);

}
于 2017-02-23T10:27:22.263 回答