Suppose you have a file named MyClass.java:
===== MyClass.java =====
package myPackage;
/**
* @mock
*/
public class MyClass {
public NestedClass createNestedClass() {
return new NestedClass();
}
public InnerClass createInnerClass() {
return new InnerClass();
}
public static class NestedClass {
}
public class InnerClass {
}
}
===== EOF =====
MockMaker generates this:
===== MockMyClass =====
package myPackage;
...
import myPackage.MyClass;
import NestedClass;
import InnerClass;
...
public class MockMyClass extends MyClass{
...
}
===== EOF =====
It tries to import NestedClass, when it should import
myPackage.MyClass.NestedClass instead.
The same for the InnerClass.
This applies for the Doclet version of MockMaker (that
is, using the .java files, not the .class files).
Logged In: YES
user_id=630231
I've just worked around that, changing the references to
NestedClass with the (not so-) fully qualified class name:
===== MyClass.java =====
package myPackage;
public class MyClass {
public MyClass.NestedClass createNestedClass() ...
public MyClass.InnerClass createInnerClass() ...
...
}
===== EOF =====