Could you please suggest any tools or plugins which will help in debugging the error to JAXB Marshelling and unmarshelling. Any preferred way to run the junit etc.
Related
Warning: I'm a huge noob to TDD and Kotlin.
I've found good code snippets on the web for writing JUnit tests in Kotlin, but when I copy and paste, IntelliJ does not automagically import kotlin.test.* or org.junit.Test. Typically in Eclipse, when I copy and paste code snippets like this, the IDE can figure out where these libraries are in my underlying java install. Figured Kotlin/IntelliJ would be the same.
In the below screenshot, any idea why I cannot import test libraries? Do they need to be added explicitly to my path? Do I need to put these under a test, rather than the src folder?
Thanks
JUnit isn't in your project classpath, so IntelliJ can't find it's packages.
Follow the steps outlined in this answer: Correct way to add external jars (lib/*.jar) to an IntelliJ IDEA project, choosing libraries and then junit.
My thought is that "JUnit is a framework for testing java applications and is typically implemented as plugins (to popular IDEs)", but can't it also be considered a standalone testing tool if implemented as a standalone (although it might be a stupid idea)?
No, JUnit is a testing framework.
You would still require a "runner" to run your JUnit tests, be it Maven or a similar.
There are stand alone runners available so you can execute tests without build tools or an IDE.
In my rails application I need to write some custom Java classes, so just wondering if there's any guidelines/best practice on how to structure the project repository? I mean like rails have a default directory structure in place, like app, models etc..., what should be the best place for my custom Java code?
I don't think there's a standard recommended practice, but there are a few options:
ruby-maven provides a DSL and a set of Rake plugins to build Java code the Maven way.
jruby-gradle-plugin provides similar support for the Gradle build tool.
For managing dependency libraries, there's also jar-dependencies.
If you're going to start writing Java/JVM code to go with your app, you'll probably need to integrate with the rest of the Java ecosystem at some point, and these tools are designed to support that.
Is it possible to execute TestNg tests in a JUnit TestSuite. I see a lot of web pages describing how to use TestNg to run JUnit but none the other way around.
No, only JUnit tests can be run in TestNG.
TestNG was initially developed as a replacement for JUnit with additional functionality and an emphasis on smooth migration. An ability to run JUnit tests was one of the tools for that smooth migration.
TestNG fully covers the functionality of JUnit and adds something new. And JUnit can not (currently?) emulate that difference in functionality.
You may check the comparison of these two libraries here.
Is there any Eclipse plugin for Static analysis of Junits. I am looking for some best tool like PMD which checks for Junit practises and gives me a report on errors.
FindBugs has been described as a strong compliment to PMD and should cover JUnit tests since JUnit is still just Java. It's available from the University of Maryland.