0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Class not found: "<class name>"Empty test suite. 解決メモ

0
Last updated at Posted at 2019-02-22

Androidのライブラリを書いていて、新しいmoduleを追加したのでkotlinのユニットテスト書いた。

class MessageTest {
    @Test
    fun testGet() {
        assertEquals(2, 1 + 1)
    }
}

実行すると以下のようなテストが見つからないというエラーが発生。

Process finished with exit code 1
Class not found: "com.github.bassaer.travismylib.MessageTest"Empty test suite.

試しにjavaのテストを追加してみる

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class FooTest {
    @Test
    public void fooTest() {
        assertEquals(2, 1+1);
    }
}

javaだと問題なし。

Process finished with exit code 0

結論

新しく追加したモジュールのgradleに以下を追加するのを忘れていた。

apply plugin: 'kotlin-android'
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?