为什么Doppl无法找到单元测试类?

时间:2017-10-28 19:09:50

标签: doppl

当试图为Doppl转换的项目运行JUnit测试时,我崩溃了:

Terminating app due to uncaught exception 'JavaLangRuntimeException', reason: 'java.lang.RuntimeException: java.lang.ClassNotFoundException: co.doppl.so.RepositoryTest'

因此,JUnit代码无法找到我的测试类(co.doppl.so.RepositoryTest)。

该课程已包含在我的dopplConfig

dopplConfig {
  translatePattern {
    include 'co/doppl/so/api/**'
    include 'co/doppl/so/arch/**'
    include 'co/doppl/so/RepositoryTest.java'
  }

  translatedPathPrefix 'co.doppl.so', 'SO'
  translatedPathPrefix 'co.doppl.so.api', 'SOAPI'
  translatedPathPrefix 'co.doppl.so.arch', 'SOA'

  testIdentifier {
    include 'co/doppl/so/RepositoryTest.java'
  }
}

我在SORepositoryTest.h中看到了SORepositoryTest.mapp/build/j2objcSrcGenTest/prefixes.properties文件似乎正确无误:

#Sat Oct 28 14:44:00 EDT 2017
co.doppl.so=SO
co.doppl.so.arch=SOA
co.doppl.so.api=SOAPI

dopplTests.txt列出了无法找到的类:

co.doppl.so.RepositoryTest

我的ViewController.swift文件正在提取dopplTests.txt文件:

import UIKit
import testdoppllib

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        CoTouchlabDopplTestingDopplJunitTestHelper.runResource(with: "dopplTests.txt")
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

为什么Doppl的JUnit会找不到这个课程?

1 个答案:

答案 0 :(得分:0)

这似乎是a bug/limitation/something当前的Doppl,其中测试无法使用translatePathPrefix重命名。