I wrote my Database Layer and my CRUD Methods for my Android Application.
Now i am wondering how to test my layer?
I wrote a main method:
public static void main(String[] args) {
CRUD crud = new CRUD();
Location location = new Location(1.0,null, "TestData1");
CRUD.insertLocation(location);
System.out.println("Location successfully added!" + location.locationToString());
crud.removeLocation(location);
System.out.println("Location successfully deleted!" + location.locationToString());
}
But when I am doing Debug as> Web Application the compiler says these Exceptions:
java.lang.ClassNotFoundException:
javax.servlet.UnavailableException:
java.lang.NullPointerException
So how to test if the DataLayer is right or not?
See Local Unit Testing for Java from the App Engine documentation (FYI it is the first result on Google for “app engine java unit test”).