Author Topic: Upgrade to 16.0.3 and junit no more work  (Read 3365 times)

RaffoPazzo

  • Community Member
  • Posts: 77
  • Hero Points: 2
Upgrade to 16.0.3 and junit no more work
« on: March 17, 2012, 04:29:01 PM »
Hi.
I have moved up to 16.0.3 but now when i select "Unit Test -> Run" from a java source file from the project dir SE doesn't run the tests and write "no tests found!" in the status bar.
In the build window it produces something like "<SE stuff> java -classpath <full:class:path> org.junit.runner.JUnitCore".
If i copy the "java ..." part to a shell it actually doesn't find no test but it works if i append the full test class name like "test.my.package.MyClassTest".

It used to work in 16.0.0 ....
What should I do to get it back to work ?

Thanks.

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Upgrade to 16.0.3 and junit no more work
« Reply #1 on: March 19, 2012, 08:26:10 PM »
Hi there,

What version of JUnit are you using with SlickEdit 16.0.3.  I ran a similar test case in my 16.0.3 and it worked.  It could be a JUnit version problem because they do change their APIs fairly often.  I was using JUnit 4.8.2.  From what you posted it seems like SlickEdit is generating the appropriate command line, though if you could copy/paste the whole thing from the build window that would be helpful.  Just right click in the Build window, select Clear Window, and then run your case again.  Copy the output here.

Is there anyway you could send the whole project, zipped up, into support?  Usually our customers can't do that but it is typically the fastest way we can resolve these problems so I have to make sure I ask :).  Hopefully we can get this figured out soon.

- Ryan

RaffoPazzo

  • Community Member
  • Posts: 77
  • Hero Points: 2
Re: Upgrade to 16.0.3 and junit no more work
« Reply #2 on: March 21, 2012, 10:54:12 AM »
Hi Ryan, thanks for your reply.
I'm using JUnit 4.8.2, too.

The following is the full output from the build window. In my project I'm using jMock so you can notice it's jars in the classpath.
Code: [Select]
setenv PATH "/opt/jdk1.7.0_03/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
[SE raffaele@rrx Slickedit]$ cd /home/raffaele/Progetti/Lighthouse/code
[SE raffaele@rrx code]$ /opt/slickedit/bin/vsbuild build  /home/raffaele/Progetti/Lighthouse/code/Lighthouse.vpw /home/raffaele/Progetti/Lighthouse/code/Lighthouse.vpj -signal 44673 -execmacro unittest_post_build java -classpath /opt/slickedit/vsjunit/vsjunit.jar:/opt/jmock/jmock-2.5.1.jar:/opt/hibernate-release-4.0.1.Final/lib/required/hibernate-core-4.0.1.Final.jar:/home/raffaele/Progetti/Lighthouse/code/src/:/opt/jmock/jmock-junit3-2.5.1.jar:/opt/JUnit4/junit-4.8.2.jar:classes/:/home/raffaele/Progetti/Lighthouse/code/ org.junit.runner.JUnitCore
---------- Build Project: 'Lighthouse.vpj' - 'Debug' ---------- VSLICKERRORPATH=/home/raffaele/Progetti/Lighthouse/code
/opt/jdk1.7.0_03/bin/javac -g -d "/home/raffaele/Progetti/Lighthouse/code/classes" -classpath /opt/slickedit/vsjunit/vsjunit.jar:/opt/jmock/jmock-2.5.1.jar:/opt/hibernate-release-4.0.1.Final/lib/required/hibernate-core-4.0.1.Final.jar:/home/raffaele/Progetti/Lighthouse/code/src/:/opt/jmock/jmock-junit3-2.5.1.jar:/opt/JUnit4/junit-4.8.2.jar:/home/raffaele/Progetti/Lighthouse/code/ /home/raffaele/Progetti/Lighthouse/code/src/uat/it/bandk/lighthouse/AcceptPcuConnectionTest.java
Build successful
[SE raffaele@rrx code]$

Regarding to zipping the project and send it to you, I could since it's still small but it is quite useless because any empty project I create with a dummy test-case has problems too.
I can just make some click "Project -> New ..." write an empty test case and it won't be run...

I've tried also to hardly remove any SE stuff from my computer and start again with a clean 16.0.3 installation. Still doesn't work...

RaffoPazzo

  • Community Member
  • Posts: 77
  • Hero Points: 2
Re: Upgrade to 16.0.3 and junit no more work
« Reply #3 on: March 21, 2012, 11:07:56 AM »
Some more news.
I'm used to write test-cases in junit-3 style so this way:
Code: [Select]
public class MyTestCase extends TestCase {
  public void testThis() {
  }
}

And I was successfully running it whithin SE but now it doesn't work any more.

So I tried to use the junit-4 writing style using annotations:
Code: [Select]
import org.junit.Test;
public class MyTest {
  @Test
  public void testThis() {
  }
}
That test have not be run but this time it thinks to have found some test since in the status bar it writes Command /tmp/<some_id> queued.

Hope this can help.

RaffoPazzo

  • Community Member
  • Posts: 77
  • Hero Points: 2
Re: Upgrade to 16.0.3 and junit no more work
« Reply #4 on: March 21, 2012, 11:35:37 AM »
Finally got it.
I have to write JUnit4 style test case, i.e. using annotations...

Do you guys want this to be a feature or a bug? :D

RaffoPazzo

  • Community Member
  • Posts: 77
  • Hero Points: 2
Re: Upgrade to 16.0.3 and junit no more work
« Reply #5 on: March 21, 2012, 12:23:42 PM »
One more issue....I'm just posting this morning instead of working...

SE does not run my tests, now written using annotations since their packaged in subfolders...
It can run tests in the default package or in a first level folder let's say package "test".
But the inner test cases let's say in the package "test.my.project" will not run. SE writes in the status bar "command /tmp/<id> queued" and nothing happens...