Выполняет тест junit для одного из моих методов в классе в android. и согласно информации на http://code.google.com/appengine/docs/java/tools/localunittesting.html, я должен добавить библиотеки ниже в мой путь к классам.Добавление JAR-файлов в ваш путь к классу тестирования:
${SDK_ROOT}/lib/impl/appengine-api.jar
${SDK_ROOT}/lib/impl/appengine-api-labs.jar
${SDK_ROOT}/lib/impl/appengine-api-stubs.jar
Мой вопрос в том, где в u.s я должен получить эти библиотеки и как их добавить? Я использую Android-студию, работающую на ubuntu 15 64bit.
Является довольно новым в Android-и GAE вещах!
, что я попробовал это то, что я добавил к build.gradle моей modlue в
dependencies {
testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:1.9.5"
testCompile 'com.google.appengine:appengine-testing:1.8.2'
testCompile 'com.google.appengine:appengine-api-labs:1.8.2'
testCompile 'com.google.appengine:appengine-api-stubs:1.8.2'
testCompile 'com.google.appengine:appengine-tools-sdk:1.8.2'
testCompile 'org.json:json:20141113'
}
Когда я пытаюсь запустить мой тест JUnit класс. это то, что я получаю
com.googlecode.objectify.SaveException: Error saving
[email protected]: No API environment is registered for this thread.
com.googlecode.objectify.impl.EntityMetadata.save(EntityMetadata.java:95)
at com.googlecode.objectify.impl.WriteEngine.save(WriteEngine.java:75)
at com.googlecode.objectify.impl.SaverImpl.entities(SaverImpl.java:60)
at com.googlecode.objectify.impl.SaverImpl.entity(SaverImpl.java:35)
org.mockito.internal.runners.JUnit45AndHigherRunnerImpl.run(JUnit45AndHigherRunnerImpl.java:37)
at org.mockito.runners.MockitoJUnitRunner.run(MockitoJUnitRunner.java:62)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: java.lang.NullPointerException: No API environment is registered for this thread.
Как я могу получить эти файлы .jar после того, как они были загружены при синхронизации моего проекта? в какой папке они хранятся? –
http://stackoverflow.com/questions/5405211/initialize-local-datastore-exception-no-api-environment-is-registered-for-this –
Как добавить эти .jar-файлы. Я делаю правильный путь, включив их в файл градиента моего модуля? так как он из этого модуля создает тестовый класс. –