I have following code:
package prototype; public interface Refill { public static final int TYPE_BALL=1; public static final int TYPE_GEL=2; public int getType(); public int getPrice(); } public abstract class Pen { public static final int TYPE_REFILLABLE=1; public abstract int getType(); public abstract Refill getRefill(); public int getPrice(); } public abstract class PushablePen extends Pen { public int state; public static final int STATE_NORMAL=1; public static final int STATE_PUSHED=2; public static final int TYPE_PUSHABLE=2; public static final int TYPE_ REFILLABLE _PUSHABLE=3; public abstract void push(); public abstract getState(); }
The classes are on different files with their names in 'Prototype'.
I have another package 'Luxar' having following:
package luxar; import prototype.Refill; public class BallRefill implements Refill { public int getType() { ------- } public int getPrice() { --------- } }
and there is a similar class GelRefill.In the same package sub class of Pen by the name P1 and a subclass of PushablePen, by the name P2.
Now i am trying to test the above with a class in another package 'Tester' which tests:
1)Price of Pen> Price of refill
2)For pushable pen the states alternate between Pushed & Normal.
3)Warning message if a Non-Pushable pen is pushed.
Can anyone help me with these?
Thanks,
J