views:

411

answers:

4

I have a class that I made for some unit tests. Everything was going swimmingly until I changed the name of the class to match the class that I was testing suffixed with TestCase. All of a sudden every time I tried to run the test case in Eclipse I get a "There is no input configuration for this type".

Someone then suggested that there is a 30 character length limit on the name of the class. I had a look at the class name and it was 32 characters long. I then deleted two characters off the end and tried again and everything worked. I put them back and it stopped working.

Is there an explanation for this?

EDIT:

In response to some of the comments. It is Galileo, using Windows XP, JUnit 4.4.

EDIT 2:

Sorry guys. I guess I was wrong. The pattern seems to be that JUnit/Eclipse does not like my class name being TestCase. As soon as I take the TestCase part away it works. It works with a massively long string, short strings and everything in between. The name can be anything like ABCTestCase it just CANNOT be for some reason TestCase.

A: 
VonC
Can't be. It works if the class name is under 30 characters and not when over 30 characters. The above error is what I am seeing yes. But I also did a Google and the link is the first one I came across. It is most definitely on the build bath.
uriDium
@uriDium: ok (I did not find that link right away, since you did not copy *exactly* the error message). May be some length limit related to the Build Path, then?
VonC
Sorry about the exact message :( I was trying to type it in from memory. It seems that way. There seems to be people that are coping with quite a long name. The build path might be quite lengthy at that point. I will keep investigating.
uriDium
A: 

Check your run Configuration under Run -> Run... Your Test has a Configuration there. Check the "Test class" field.

keuleJ
+1  A: 

By default I believe the JUnit runners are set to look for *Test files, so it will filter out TestCase. People often use *TestCase as a base class without any tests of its own. Not sure if that's what you're running into. If so, it's configurable in the runner.

ndp
+1  A: 

Turns out that it was because I was extending TestCase which makes the JUnit runner think it is still version 3. Even if you tell it to use version 4.

uriDium