Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Junit test in IntelliJ IDE can't see class for testing

I created simple Java project in IntelliJ, one class (RandomizedQueue) and generated JUnit test class for it. So it's just two files and they both are in the same directory - src.

Everything compiled and all was well. For some time. Then suddenly - it stopped with this error:

java: cannot find symbol
  symbol:   class RandomizedQueue
  location: class RandomizedQueueTest

I tried everything I could think of. Recreating a project worked for a while but the same error reappeared (without any obvious reason). I can't find any logic in this! Compilation from cmd does work.

I tried deleting everything from class and test - and I still can't make an instance in test method.

here is the whole project

like image 743
Amomum Avatar asked Feb 15 '14 21:02

Amomum


1 Answers

See those white x-es next to the class name?

enter image description here

Somehow you have excluded RandomizedQueue class from the compilation.

enter image description here

Remove it from the excludes and everything will be back to where it was before.

PS: Coursera FTW :-)

like image 160
kukido Avatar answered Sep 20 '22 16:09

kukido