简体   繁体   中英

How to test Database implementation for Google App Engine?

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?

请参阅App Engine文档中的Java本地单元测试 (仅供参考,这是Google在“ App Engine Java单元测试”中的第一个结果)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM