Ad

I still get nothing but Solution.main()<:LF:>
It doesn't really tell us enough to debug it.

Code
Diff
  • class Solution {
        public static void main(String[] args) {
            System.out.println("Hello World :D");
        }
    }
    • class Solution {
    • public static void main(String[] args) {
    • System.out.println("Hello darkness, my old friend...");
    • System.out.println("Hello World :D");
    • }
    • }

I guess we could make it even smaller/simplier if we make the method static. I guess that is as simple as the test class can be right?

Code
Diff
  • public class Java {
      public static int multiply(int x, int y) {
        return x * y;
      }
    }
    • public class Java {
    • public int multiply(int x, int y) {
    • public static int multiply(int x, int y) {
    • return x * y;
    • }
    • }

I decided to test the java framework.

My opinions:

-I just started learning python, and in comparison, it takes a lot more to set up the tests in java, mostly beacause you have to set up the class and methods. Not much can be done about that anyway though.

-It takes a while to start up, and I even got some timeouts on something this simple. I assume the JVM that takes this much time to start up.

-I do miss eclipse's hability to automatiaclly indent and add the missing "}" when you press enter while the cursor is right after a "{". That would speed up setting up stuff.

-After so much programming in python and not much java, I found myself consistently forgetting to add ";" :P

Note:

I copied most stuff from https://github.com/Codewars/kata-test-framework-java , under CodewarsJava/src.
I found the int's in the beggining of the tester class to be completly useless in a test this simple though.

Also, just wanted to point out that in that kata in the git repository the assertEquals, in case of fail will print the error message, and after that the failed method will be called, which prints it again, causing it to print the exact same thing twice.

Notes to self and others that want to try making a java kumite:

To start a kumite, must set up:
-Class with the name of the test
-A class with the same name plus "Test"
-Create a member instante of the first class within the test.
-Create public void setUp() and tearDown() with @Before and @After anotations.
-Make the method that will test the kata or kumite, with a @Test anotation
-Create an instance of TestWatcher, with @Rule anotation, overriding both protected final void succeeded(Description description) and failed(Throwable e, Description description)

Hope this is useful to others.
Thanks for reading :)

PS: Sorry if my english is not the best, I'm not a native speaker.

public class Java {
  public int multiply(int x, int y) {
    return x * y;
  }
}