【问题标题】:Unit test cases for Java Controller based Webscripts in AlfrescoAlfresco 中基于 Java 控制器的 Web 脚本的单元测试用例
【发布时间】:2019-03-04 14:52:57
【问题描述】:

我计划对使用 Java 作为控制器的 webscript 进行单元测试。我找到了两种方法。

1) 遵循引导代码HelloWorldWebScriptControllerTest.java

2) 关注https://github.com/Alfresco/alfresco-remote-api。在这里,测试类扩展org.alfresco.repo.web.scripts.BaseWebScriptTest

对于第二种方法,我尝试添加以下依赖项,但找不到此 BaseWebScriptTest。

<!-- https://mvnrepository.com/artifact/org.alfresco/alfresco-remote-api -->
<dependency>
    <groupId>org.alfresco</groupId>
    <artifactId>alfresco-remote-api</artifactId>
    <version>5.2.b-EA</version>
</dependency>

我也尝试将&lt;classifier&gt;tests&lt;/classifier&gt; 添加到上述依赖项中。但是,找不到这个类。

如何解决这个问题?另外,建议使用哪种方法?

【问题讨论】:

    标签: unit-testing junit alfresco alfresco-webscripts


    【解决方案1】:

    使用引导代码示例。这很简单,而且很有效。我认为没有理由让它变得更复杂。

    但是,如果您查看 Alfresco 源代码,您会在下面看到该类 ./projects/repository/source/test-java/org/alfresco/repo/web/scripts/BaseWebScriptTest.java

    【讨论】:

      猜你喜欢
      • 2012-04-19
      • 1970-01-01
      • 1970-01-01
      • 2012-04-16
      • 2015-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-11
      相关资源
      最近更新 更多