Is there an end of live for JUnit4? - eclipse-rcp

Is there some kind of end of live for JUnit4? Be it because it's discontinued, no longer gets security updates, does not work with new JDKs or something like this.
Or in other words. Are there any hard facts that would force us to move to Junit5?
Background: We have to maintain a big RCP project with weird dependencies and lots of SWTBot tests. There's a Junit5 Version of SWTBot, but we are struggling to get it to work.

Related

Eclipse RCP opinions

I am working on a standalone Eclipse RCP product. My team replaced another team that wrote the infrastructure of the product.
I and my team leader aren't very happy with the Eclipse RCP framework because we feel that it is just very hard to get it to work correctly.
This is because:
The GUI building tools are annoying. XWT is buggy (bindings don't
always work, can't add scrollbars, and this is only the half of it).
SWT also isn't very exciting. I don't like the API and it doesn't
have too many exciting widgets.
Eclipse IDE itself is buggy (we
have to restart it every few hours). We are using eclipse juno. When
we tried to upgrade to luna we ran into some unsolvable issues:
Eclipse Luna: Handlers' #CanExecute methods not called due to wrong context
We have lots of weird bugs (e.g. eclipse looks at wrong selection
service and much more).
Even though there is support and
documentation, we find that it is kind of poor compared to other
solutions out there.
Due to the above, developement of simple
things seem to take too long. We have another .NET product which is
much easier to write.
However, google didn't seem to badmouth eclipse rcp... So I wanted to ask, what do you guys think about it? Do you find it easy to use? Do you find it flexible?
Just want to hear some opinions.
Thanks!!!

How to test the UI of an Eclipse Juno RCP

We're developing an Eclipse-based RCP. Recently we've updated to Eclipse Juno and currently we focus on quality, which of course brought automated tests into focus, since the application is quite big and the testing effort delays releases.
We're already writing JUnit tests, but I'm more interested in UI tests. With older Eclipses this would not be a problem. There are plenty of good test frameworks around. Unfortunately with Juno everything changed due to the added ability to switch out the default SWT UI by Swing or JavaFX (at least this is what I've understood about the changes causing problems)
So most of the test tools don't work properly anymore. From past experiences it seems that:
SWTBot seems to get not much love lately and is very unstable (can't find elements in certain versions)
Window Tester seems quite good, but has a lot of problems identifying an element during the test run (especially with pop-ups such as content assist or tool tips)
Apparently Froglogics Squish supports Juno, but since a license costs about 2,5k Euro I have to pass
The same seems to be the case for QF-Test (too expensive).
This leaves Jubula (or GUIDancer, which is the commercial Jubula), which we've tried in the past, but which had similar problems as Window Tester and SWTBot (unstable in terms of changes to the Eclipse platform and difficulties to detect some elements)
I need to know, which tool to focus on / trust in. Does anybody have experience with one of the tools or is even currently testing a Juno RCP (or Juno itself for that matter)? Or does anybody know how Eclipse tests their own platform (if they even do it atm)?
Searching for information related to "test", "Juno" and "UI/GUI" only brings up the commercial products.
For me it is important, to find a tool, where I can use the developed test cased even in future releases, which means: A framework project, which has some support of the community to be able to adapt quickly. Also it is important to also find stuff like tool-tips, overlays or content assists/suggestions) - similar to a Selenium compared to basic HTMLUnit.
At this point I don't even care too much about integration, reporting or compliance to standards..
You can find a comprehensive table of GUI-Testing tools in the Eclipse Wiki:
http://wiki.eclipse.org/Automated_Testing#UI_tests
One important decision you have to make is, if you want to use your mouse to record/create tests (Jubula, QFTest, ...), if you want to be able to hand-write test-code (SWTBot, ...), or if you want to be able to do both (WindowTester Pro, ...).
Eclipse Juno is rather new, and I would expect problems with all of the listed tools, however the migration should not take that long since most of these tools mainly focus on testing SWT-widgets and Juno still uses SWT. So far I have not heard from any RCP Application seriously using JavaFX other than for technical demos, but I would be curious to see them!
The problem I think, is rather that testing Eclipse is hard and GUI-testing is especially hard.
You might want to have a look at this study which finds and explains the major problems:
http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2011-010.pdf
If you believe this study, JUnit-testing is usually preferable to GUI-testing. Well, with Juno you have the big advantage that Unit-testing Eclipse now is easier than it ever was because the framework switched from inheritance and singletons to dependency injection, which makes it far more testable.
I'd suggest you too look at Xored's Q7, which is used for GUI testing of some of Eclipse projects including Eclipse DLTK, Eclipse LDT, Eclipse Tigerstripe and the tool is just perfect : it let you develop dozens of UI tests per day per engineer, and do not have stability and incorrect-recording problems. It's designed specially and only to test Eclipse-based apps and obviously the best in the niche.
However it costs money, which can be a blocker for you (like squish), but they have a free Community version, which is enough for most of use-cases. As well as those Xored guys just introduced pay-per-testexecution pricing model -- the tools will be free and you have to pay as you go only per tests executed monthly (less than 5000 is free). More about new model is here eclipse-testing.com

What's the best Scala build system? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I've seen questions about IDE's here -- Which is the best IDE for Scala development? and What is the current state of tooling for Scala?, but I've had mixed experiences with IDEs. Right now, I'm using the Eclipse IDE with the automatic workspace refresh option, and KDE 4's Kate as my text editor. Here are some of the problems I'd like to solve:
use my own editor IDEs are really geared at everyone using their components. I like Kate better, but the refresh system is very annoying (it doesn't use inotify, rather, maybe a 10s polling interval). The reason I don't use the built-in text editor is because broken auto-complete functionalities cause the IDE to hang for maybe 10s.
rebuild only modified files The Eclipse build system is broken. It doesn't know when to rebuild classes. I find myself almost half of the time going to project->clean. Worse, it seems even after it has finished building my project, a few minutes later it will pop up with some bizarre error (edit - these errors appear to be things that were previously solved with a project > clean, but then come back up...). Finally, setting "Preferences / Continue launch if project contains errors" to "prompt" seems to have no effect for Scala projects (i.e. it always launches even if there are errors).
build customization I can use the "nightly" release, but I'll want to modify and use my own Scala builds, not the compiler that's built into the IDE's plugin. It would also be nice to pass [e.g.] -Xprint:jvm to the compiler (to print out lowered code).
fast compiling Though Eclipse doesn't always build right, it does seem snappy -- even more so than fsc.
I looked at Ant and Maven, though haven't employed either yet (I'll also need to spend time solving #3 and #4). I wanted to see if anyone has other suggestions before I spend time getting a suboptimal build system working. Thanks in advance!
UPDATE - I'm now using Maven, passing a project as a compiler plugin to it. It seems fast enough; I'm not sure what kind of jar caching Maven does. A current repository for Scala 2.8.0 is available [link]. The archetypes are very cool, and cross-platform support seems very good. However, about compile issues, I'm not sure if fsc is actually fixed, or my project is stable enough (e.g. class names aren't changing) -- running it manually doesn't bother me as much. If you'd like to see an example, feel free to browse the pom.xml files I'm using [github].
UPDATE 2 - from benchmarks I've seen, Daniel Spiewak is right that buildr's faster than Maven (and, if one is doing incremental changes, Maven's 10 second latency gets annoying), so if one can craft a compatible build file, then it's probably worth it...
Points 2 and 4 are extremely difficult to manage with the current scalac. The problem is that Scala's compiler is a little dumb about building files. Basically, it will build whatever you feed it, regardless of whether or not that file really needs to be built. Scala 2.8.0 will have some tremendous improvements in this respect, but until then... Eclipse SDT actually has some very elaborate (and very hackish) code for doing change detection and dependency tracking. On the whole, it does a decent job, but as you have seen, there are wrinkles. Eclipse SDT 2.8.0 will rely on the aforementioned improvements to scalac itself.
So, building only modified files is pretty much out of the question. Aside from SDT, the only tool I know of which even tries this is SBT (Simple Build Tool). It uses a compiler plugin to track files as they are compiled and query the dependency graph computed by the compiler itself. In practice, this yields about a 50% improvement over the recompile-the-world approach. Once again, this is a hack to get around deficiencies in pre-2.8.0 scalac.
The good news is that reasonably fast compilation is still achievable even without worrying about change detection. FSC uses the same technology (ooh, that sounded so "Charlie Eppes") that Eclipse SDT uses to implement fast incremental compilation. In short, it's pretty snappy.
Personally, I use Apache Buildr. Its configuration is significantly cleaner than either Maven's or SBT's and its startup time is orders of magnitude less (when running under MRI). It integrates with FSC and attempts to do some basic change detection on its own (fairly primitive). It also has auto-magical support for the major Scala test frameworks (ScalaTest, ScalaCheck and Specs) as well as support for joint compilation with Java sources and IDE meta generation for IntelliJ and Eclipse. Oh, and it supports all of Maven's features (dependency resolution, etc) and then some. I'm even working on an extension which would allow interactive shell support integrated with JavaRebel and supporting several shell providers (Scala, JIRB, Clojure REPL, etc). It's not ready for the SVN yet, but I'll commit once it's ready (possibly in time for 1.3.5).
As you can see, I'm very firmly of the opinion that Buildr is the best Scala build tool out there. Its documentation is a little spotty where Scala is concerned, but that's because everything is so straightforward that it's hard to document without feeling verbose. You can always check out one of my GitHub repositories for examples. Good luck!
Have you looked at Intellij IDEA and its Scala integration ? Intellij has a loyal (fanatical?) following amongst Java developers, so you may find this is appropriate for your needs.
Am also quite frustrated with the scala plugin on Eclipse and I can add a few more problems to the list:
auto-complete only works some of the time
the debugger doesn't work properly (especially when trying to debug scala xml)
the debugger forgets breakpoints
'go to definition' doesn't work more often than not.
I'm glad to hear that Buildr sounds like a better alternative (on the build front anyhow), I'll give that a try - thanks!
If you use Emacs, I think Ensime is a pretty good IDE. I think at the time writing, Ensime is the only IDE that will give you fast and accurate autocompletion on both Scala and Java objects, including implicit conversions.
There's code browsing support using Speedbar, code templates using the excellent Yasnippet, and code completion menu using Autocomplete. These are all very modern, actively maintained Emacs packages. There's also out of the box incremental building support for Maven and SBT.
There's a lot more in there such as interactive debugging, refactoring, and the Scala interpreter in an inferior process. All the things you want in a modern IDE for Scala is already there in Ensime. Highly recommended for Emacsens.
For the reasons of completeness, I have to say that there is also Pants -- the build tool that in use in Twitter (one of the early scala adopters)
The main difference it that it is intended not only for scala (and written in python, by the way) and is modeled after google build system.
It's not so bloated as sbt, so for the freshmans it's much simplier, but I've never heard about Pants usage outside of twitter and foursquare.
If you scared of SBT, maybe another no-so-popular build tool, ABT, could be an alternative for you?
I went down the same road, and here is where I am at:
- After some initial investigation, I dropped Kate. I love to use it for most things, but when it came to things like defining tab completions, I found it sorely lacking. I would recommend that you look into gedit instead, which is much more robust for Scala development
- With gedit as my editor, I use SBT and have found it to be a great build tool. I can put it into a 'test' mode where when any code changes it recompiles the relevant files and runs my test suite. This has been an extremely effective way to work.
I have not taken a look at Buildr yet. I would like to say that I will, but honestly with SBT at my disposal I don't really have a compelling need to look at another build tool.
If you want to use Eclipse, but build the project using sbt, and still be able to debug, take a look at this post here:
zikaprog.wordpress.com/2010/04/19/scala-eclipse-sbt-and-debugging/
It also can be applied to builders other than sbt.
The latest version of the Maven Scala plugin supports Zinc/Nailgun for faster start times and faster incremental builds. See Zinc and Incremental Compilation.

How can one use the Web Page Editor in custom RCP application?

I want to use the "Web Tools Editor" that is part of the Web Tools Plattform in my own RCP-Application. I think i have got some understanding on the RCP plattform by now, but I still have no clue how to access the functionality of the pagedesigner (org.eclipse.jst.pagedesigner) after adding it as a dependency to my project. Has anyone some experience in adding components of the web tools plattform into an RCP-Application and can give me a hint or something?
There's a difficulty with these sorts of requests (I am, myself, trying to include this or that feature that I saw in the Eclipse IDE, every so often).
The trick is to try and identify the component you want to bring in, and then try and pull it into your project, without bringing in too many dependencies.
The first step used to be quite hard, but since 3.4 it is a matter of using the Plug-In Spy - hold down Alt-Shift-F1 on whilst your desired component is in focus should give you a tooltip showing you the class, the bundle, etc etc.
The second step is altogether more tricky and is where I usuaully fail to get any results:
if you are lucky then you can just include the bundle in the launch configuration/.product of your app. Once you hit Add Required Bundles, you are not left with 3000 bundles (i.e. your RCP is now Eclipse).
usually, this is not the case, because the Eclipse team haven't refactored the bit of code you're interested in out into an RCP safe bundle. If so, then you're going to have to do that yourself.
Again, if you are lucky then that will mean moving some classes out of the eclipse bundle into your own, including internal classes, and that will be the end of it - i.e. the dependencies of your desired functionality are all within the bundle.
If you're unlucky, then you need to isolate/reimplement the bit of functionality that is required, and change your version of the copied code.
It is hard laborious, and pretty difficult to upgrade. I realise that none of this is what you want to hear.

Are there any good Continuous Testing plugins for Eclipse out right now?

I've used the MIT Continuous testing plugin in the past, but it has long since passed out of date and is no longer compatible with anything approaching a modern release of Eclipse.
Does anyone have a good replacement? Free, naturally, is preferred.
I found that Infinitest now has an Eclipse plugin that seems to work pretty well.
There is a list in this Ben Rady article at Object Mentor: Continuous Testing Explained. Unfortunately the only Eclipse tool appears to be CT-Eclipse which is not currently maintained either.
There is also Fireworks for IntelliJ and Infinitest which is not IDE specific but also has some IntelliJ integration.
My experience is that continuous testing within the IDE can become unwieldy and distracting, so I prefer to use something like CruiseControl to do this kind of testing. One tool I have found very useful is EclEmma, which gives you a very fast coverage turnaround for your units, helping you to decide when you have finished testing a particular area of the code.
Infinitest decides what tests it wants to run. Often it runs the wrong ones. Green bar sometimes good, sometimes meaningless.
I've had good experience with infinitest on a small and simple project. I've not run into any issues with it and find it fast and helpful.
I also use Infinitest (and voted for one of its answers), but I wanted to add another approach, which relies on the build server. Whenever you want to implement something, create a branch in your VCS, do your changes, commit to your branch. If you have a build server configured, which runs unit tests on every checkin, your unit tests are then run on the build server without actually having polluted the trunk (or HEAD, whatever you call it) and without you waiting for the test run to finish.
I admit that this is not really continuous unit testing in the sense you asked the question, but for large projects or large test suites even a "normal" continuous test runner may slow you down way to much.
For small projects I also recommend Infinitest or CT Eclipse.