当试图为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.m
和app/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会找不到这个课程?