如何单元测试谷歌云端点的Java使用的Andr​​oid 0.8工作室 [英] How to Unit Test Google Cloud Endpoints Java Using Android Studio 0.8

查看:173
本文介绍了如何单元测试谷歌云端点的Java使用的Andr​​oid 0.8工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经发现了一些岗位,但他们要么是指前端测试,或Python。
有一个教程Java的GCE,但有关于如何设置它Android Studio中,只是一些随机引用到Eclipse无特异性。

I've found a few posts, but they either refer to front-end testing, or python. There is one tutorial for java GCE but there's no specificity on how to set it up in Android Studio, just a few random references to Eclipse.

例如

Android Studio中的单元测试0.8

<一个href=\"https://developers.google.com/appengine/docs/java/tools/localunittesting#Java_Writing_Datastore_and_memcache_tests\" rel=\"nofollow\">https://developers.google.com/appengine/docs/java/tools/localunittesting#Java_Writing_Datastore_and_memcache_tests

https://www.youtube.com/watch?v=z47B1nhC3K0

随时在我大喊如果我错过了一些相关的职位并指导我给它。谢谢你。

Feel free to yell at me if I've missed some relevant post and direct me to it. Thank you.

咆哮:请忽略
我可以说,我觉得疯狂,在2014年,他们的品牌新的Andr​​oid工作室(的IntelliJ)平台,与所有的经验教训,从previous迭代了解到,谷歌未能提供一种简单,无缝的方式来设置前端/后端测试?我不能决定什么词用在这里:可怜的,缺乏的窘况任何先见之明,还是慵懒?是的,我知道对骂是不是生产性的,但我觉得我必须要愤怒的权利。我知道,谷歌希望它的开发是成功的,那么,为什么不彻底,完全明显,任何形式的IDE解决方案必须至少包括烘烤做测试一个基本的工作流程。得到它谷歌!测试是不是想后。这是在生产中有任何不平凡的code在那里的核心。解决这个问题。我们不应该需要社会拿出了停止每隔几个月工作随机解补丁工作。谷歌是一家软件公司,他们知道这东西。我爱你,谷歌,但在这种情况下我很反感,你知道我们都是正确的是。 /夸夸其谈

Rant: please ignore. May I say I find it insane that in 2014, on their brand new Android Studio (IntelliJ) platform, with all the lessons learned from previous iterations, Google has failed to provide a simple, seamless way to set up front-/back-end testing? I cannot decide what epithet to use here: pathetic, horrendously lacking any foresight, or lazy? Yes, I know name calling is not productive, but I feel I have the right to be outraged. I know Google wants its developers to be successful, so why is it not utterly and completely obvious that any kind of IDE solution must include at least a basic workflow baked in to do testing. Get on it Google! Testing is not an after-thought. It's the CORE of having any kind of non-trivial code out there in production. Fix this. We shouldn't need the community to come up with a patch-work of random solutions that stop working every few months. Google is a software company, they know this stuff. I love you Google but in this instance I'm disgusted and you know we all are right to be. /rant

推荐答案

好一些gradle这个google搜索,我设法得到它在我的后端模块添加以下的中的build.gradle文件的工作。

Ok with some gradle googling, I managed to get it to work by adding the following the the build.gradle file in my backend module

testCompile 'com.google.appengine:appengine-api-labs:1.9.8'
testCompile 'com.google.appengine:appengine-api-stubs:1.9.8'
testCompile 'com.google.appengine:appengine-testing:1.9.8'
testCompile 'junit:junit:4.12+'

和也是继本(在原岗位)
<一href=\"https://developers.google.com/appengine/docs/java/tools/localunittesting#Java_Writing_Datastore_and_memcache_tests\" rel=\"nofollow\">https://developers.google.com/appengine/docs/java/tools/localunittesting#Java_Writing_Datastore_and_memcache_tests

And also following this (in the original post) https://developers.google.com/appengine/docs/java/tools/localunittesting#Java_Writing_Datastore_and_memcache_tests

希望这可以帮助其他人也是如此。

Hopefully it helps someone else as well.

这篇关于如何单元测试谷歌云端点的Java使用的Andr​​oid 0.8工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆