JUnit library for Kotlin - kotlin

I am new to Kotlin.
Can anyone explain what I'm doing wrong?
Why IDE cannot see #Test?

Understood. There are couple solutions how to add JUnit to your project here JUnit
But when I added it automatically it had "scope" Test and somehow it doesn't work. I changed to Compile and now it is fine

Related

Intellij Kotlin - Missing proceed on errors

While coding Java one can set the configuration "Proceed on errors" for example on the eclipse compiler in Intellij.
Is there an equivalent for Kotlin?
My specific case right now: all code (written in Java) is build OK, junit tests (written in Kotlin) are broken. I'm trying to fix and build the tests one by one.
Kind regards,
GJS

Why IntelliJ does not show errors in java code?

How to configure intelliJ to disply errors in java code like eclipse?
see the screenshot
It does show the errors you expect, if you don't have the JUnit jar files in the classpath.
I created the exact same file as you showed in my IntelliJ and it really shows the errors:
What you might have done is that you have probably accidentally added the jar to the classpath.
Check the External Libraries as you can see in the picture. If there is no JUnit there, then it really is missing.
Now I can easily add the JUnit jar from IntelliJ and you'll notice the difference in the External Libraries:
Here it has been added under External Libraries and the error goes away.
You almost certainly already included the junit library into your IntelliJ project configuration.
This is easy to do, since IntelliJ has a quick action (alt-enter) to Add junit to classpath.
Look in Settings -> Libraries / Global Libraries and you will see it there. :)
Or you can look directly in Settings on the relevant Module -> Dependencies
Either that, or the project you are working in is configured already (perhaps via maven?) to have a junit dependency.

Playframework 2.2.0-M1 and idea ide

I em installed scala plugin and play2 plugin in my "idea12". I entered in play console "idea" command.
project launched, but method "ok()" dont work, ide offers me a method to do it again.
img here
Please help me. I like idea and other ide not to my liking. Eclipse disgusting works with scala templates.
You use a wrong name. The status methods are CamelCased: Ok instead of ok.

Is there an eclipse plugin for Play2?

I know there is one for play1, but I don't find any for play2.
I hope the plugin can compile the templates to scala code automatically. It's not convenient now.
I just came across Scala IDE Play2 plugin for Eclipse Indigo/Juno and Scala IDE. The current features are
Syntax Highlighting (routes and templates)
Code completion (templates)
Formatter (routes)
Hyperlinking (routes and templates)
Note that hyperlinking to Java files is not supported for now. Also there are some limitations for the code completion feature, just take some time to read the doc. I didn't try it myself as I'm not working with Play2 right now, but thought it might be helpful for someone.
Edit: This answer is outdated. A Play Eclipse plugin has been written, as #Baztoune says.
There is no Play 2 plugin for Eclipse at the time I’m writing these lines. However, there is an eclipsify sbt command, provided by the Play 2 sbt plugin, which is able to generate an Eclipse project from a Play 2 application.
You won’t get syntax highlighting, contextual completion or code navigation inside Play 2 templates, but you can have them to be automatically compiled when saved by using the ~run sbt command (instead of just run). Check the Eclipse “General −> Workspace −> Refresh using native hooks or polling” option is enabled so it will take compiled templates changes into account.
Yes, here's how to get started:
Find the correct update site for your version of Eclipse from http://scala-ide.org/download/current.html.
In Eclipse go to Help->Install New Software. Use the update site from above to locate Scala related plugins.
Install both the Scala IDE for Eclipse plugin and the Play2 support in Scala IDE plugin. Note that the Play2 support in Scala IDE plugin is listed under the Scala IDE plugins checkbox.
I was unable to get this working at all starting from bare Eclipse, as many sources have suggested doing. The problem seems to be incompatible dependencies that only show up after much wasted time. The Scala IDE route eliminated this problem.
Yes. That's Scala IDE.
Update Site for Eclipse Juno and Kepler: http://download.scala-ide.org/sdk/e38/scala210/stable/site
Install with the following features:
Scala IDE for Eclipse
Scala IDE Plugins (incubation)
I use Scala IDE from http://scala-ide.org/ , then eclipsify my play2 project and import.
It works like a charm: it compiles my scala/java code.
You can get more details at this URL http://scala-ide.org/docs/tutorials/play20scalaide20/index.html

Eclipse PDE: How to add java project's classpath to a plug-in's classpath?

People,
I already searched a lot but I'm not finding my answer..
I did a eclipse plugin that writes junit test cases from source code.
By now, I'm starting to use reflection in my code, but the plugin can't find the classes in the java project being tested!
Is there a way to use the selected project classpath in my plug-in? How??
I've seen many questions like mine out there, but with no answers. Please someone help!
you could perhaps try to write programmatically a launch configuration that includes in the classpath both your plugin source code and the project source code.
By doing this way you should provide a valid entry point to your application.
this article explains how
Otherwise you could try to base your plugin on eclipse jdt using the Abstract Syntax Tree that jdt provides to generate the unit tests.
ref eclipsepedia