KikainekoMocker

Java

Mock

Dealing with KikainekoMocker Problems

Here are ways to handle problems that occur when using KikainekoMocker.

TOC

What are the Symptoms?

The [KikainekoMocker] menu does not appear event though you right click the Test Class!

This is often caused when the class you right-clicked was not a TestCase Class.

  • Check that the class name of test ends with "***Test"
  • Check that the test class extends the TestCase class

When the [KikainekoMocker] menu does not appear, even though you are correctly identifying the test class, it is possible that you failed to properly install KikainekoMocker.
Please check and try the following.

* Is the runtime correctly placed under the plugins folder?
- Is it placed as the zip format (it is downloaded in that format)
  ->Unzip it and place it in the plugins folder
- Is it placed in the relavant plugins folder?
  ->When having several Eclipse runtimes, you might have placed it in the wrong plugins folder

* Is the JDK and Eclipse version old?
->KikainekoMocker is tested under the following environment.
JDK 1.4 and over, Eclipse 3.2
It is confirmed that KikainekoMocker can be used with Eclipse 3.1, but it does not work using Eclipse 2 and before.
In this case, please upgrade to the corresponding versions of JDK and Eclipse.

If it still doesn't work, refer and try Dealing with Installation Problems.

An error occurs during the execution of KikainekoMocker!

When this kind of problem occurs, the cause can be thought as either of the following:
a problem with the plugin, or a problem in writing the test case

* A problem in writing the test case
With writing test cases, please refer to the KikainekoMocker's Constraints and correct the code. When writing the test case in a inproper format, an exception occurs, and the process is aborted.
Also, please check if KikainekoMocker is executed without saving the test case file.

* A problem with the plugin
When there is a problem with the plugin, the cause is often failure of installation.
Please refer and try Dealing with Installation Problems.

The result of executing the test case is still red,
using the pseudo-class generated by KikainekoMocker!

This is often caused by the JUnit's assertEquals() implementation.
Also, it can be caused when KikainekoMocker could not correctly generate the pseudo-class.
In addition, it can be caused when the generated code is not properly reflected to Eclipse.

* JUnit's assertEquals()
When JUnit's assertEquals() implementation is the cause, this means that the pseudo-class generated by KikainekoMocker, correctly operates, but the fails to pass the test case.
This occurs when Object type of data is given to the assertEquals() method. With the default assertEquals() implementation, when Object types are set as arguments, it simply calls the Object's equals() method. The default equals() implementation just compares the hashCode, so if this method is not overrided, it often fails to pass the test case.
This can not be avoided. Either the test case must be rewritten, or the equals() method must be overwritten.
But KikainekoMocker generates the pseudo-class without any problems, so you can use the pseudo-class even though the test result is red.

* KikainekoMocker
In rare cases, KikainekoMocker generated incorrect code without infroming any errors.
This occurs when the test case is written in an inproper format. In most cases KikainekoMocker informs you that you have written the test case in a forbidden format, but in rare cases, it passes the parsing process without any errors. This is because KikainekoMocker does not perfrom strict validation ensuring code generation speed.

* Is not correctly reflected to Eclipse
Please rebuild the project. (F5 Shortcut is useful)

Dealing with Installation Problems

When failing to install, it is mostly because the reference to the old version of KikainekoMocker is left.
Begin by checking if there isn't a reference to the old version.

Please start Eclipse with the following steps.

  1. Right-click on eclipse.exe, and create a shortcut
  2. Open the properties of the created shortcut
  3. Add "-clean" to the target (eg. "C:\eclipse\eclipse.exe -clean")
  4. Double-click the shortcut and start Eclipse

Just add "-clean" and start Eclipse...

KikainekoMocker Still Doesn't Work

When nothing works even though you tried everything on this page, it is probabaly a bug in the plugin.
In this csae, please contact us through the Mailing List, or through the KikainekoMocker Developer's Blog.

And in this case, until the problem is resolved, please avoid using KikainekoMocker throught the Eclipse plugin, and use it throught the Text User Interface.