Author Topic: junit support in gradle project?  (Read 3046 times)

Tree

  • Community Member
  • Posts: 79
  • Hero Points: 2
junit support in gradle project?
« on: March 20, 2017, 08:13:32 PM »

I have a java project that uses gradle as an external script to build. (It's a complex project with 50 or so sub-projects, with gradle as a build tool. Setting up the sub-projects manually in slickedit is a non-starter)

I see that there is junit support in slickedit, but it seems to want to compile java code rather than using my build tool. I also see that there is gradle project support. I was able to successfully import the gradle project and some/most of the build tasks were available, so it seems to have mostly worked, but I don't see any of the java/junit options.

So, is there a way to get junit to work from a gradle project?

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: junit support in gradle project?
« Reply #1 on: March 21, 2017, 03:23:46 PM »
Just to be clear, you're seeing the test tasks for your imported gradle file, but our JUnit support doesn't recognize it?  Or are the tasks not even showing up in the import.

The current JUnit support doesn't recognize gradle as a way to kick off the test harness, so we would need to add that support for you.

Tree

  • Community Member
  • Posts: 79
  • Hero Points: 2
Re: junit support in gradle project?
« Reply #2 on: March 21, 2017, 03:29:05 PM »
Running the gradle test task just runs a gradle task, capturing the output. It doesn't do any of the things that I would call "junit support" or that the slickedit help talks about for supporting junit.

Basically, if gradle is being used to build java, slickedit should treat it as a java project as well as a gradle project.

All my co-workers are using intellij or eclipse, which work directly with gradle and support running unit tests in the IDE.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: junit support in gradle project?
« Reply #3 on: March 23, 2017, 01:09:46 PM »
I'm going to try to fix this for v22.  If I remember the details of the gradle API, I might not be able to detect which task names kick off JUnit tests, so it's possible I'll need to add some pieces to the UI so you can mark a task as a JUnit. 

Tree

  • Community Member
  • Posts: 79
  • Hero Points: 2
Re: junit support in gradle project?
« Reply #4 on: March 23, 2017, 08:11:32 PM »
Best would be to look at intellij/eclipse and see how they do it.

The key is the ability (like the existing junit support in slickedit) to be able to select a test class from the Projects window.

From the slickedit help:
"...Projects tool window, select the project, package or file that you want, then on the right-click context menu, select Unit Test → Run (junit command) or Unit Test → Debug (junit_debug command)"

Marcel

  • Senior Community Member
  • Posts: 261
  • Hero Points: 26
Re: junit support in gradle project?
« Reply #5 on: March 24, 2017, 02:06:06 AM »
@patrick: I am adding my voice to this. And while you're at it, please add support for junit 5.

Tree

  • Community Member
  • Posts: 79
  • Hero Points: 2
Re: junit support in gradle project?
« Reply #6 on: May 11, 2018, 02:29:08 PM »
Was there any progress with this?