spock

TravisCI Android build fails only on CI not locally

蹲街弑〆低调 提交于 2020-01-05 01:45:19
问题 I have got a strange error and cannot find a solution: * What went wrong: Execution failed for task ':app:compileDebugAndroidTestGroovy'. > Unable to load class de.rheinfabrik.mvvm_example.activities.DetailsActivity due to missing dependency android/support/v4/view/LayoutInflaterFactory But it´s impossible. This project works locally. Also the dependency is there. Here my .travis.yml language: android jdk: oraclejdk8 env: matrix: - ANDROID_TARGET=android-22 ANDROID_ABI=armeabi-v7a global: -

TravisCI Android build fails only on CI not locally

こ雲淡風輕ζ 提交于 2020-01-05 01:44:50
问题 I have got a strange error and cannot find a solution: * What went wrong: Execution failed for task ':app:compileDebugAndroidTestGroovy'. > Unable to load class de.rheinfabrik.mvvm_example.activities.DetailsActivity due to missing dependency android/support/v4/view/LayoutInflaterFactory But it´s impossible. This project works locally. Also the dependency is there. Here my .travis.yml language: android jdk: oraclejdk8 env: matrix: - ANDROID_TARGET=android-22 ANDROID_ABI=armeabi-v7a global: -

How to test Grails service using Spock?

Deadly 提交于 2020-01-01 04:38:26
问题 I have a EncouragementService.groovy with following method class EncouragementService { def stripePaymentService def encourageUsers(List<User> users){ if(null != users && users.size()>0){ for(User user : users){ //logic stripePaymentService.encourage(user) // } } } } To test above code in JAVA universe, using JUnit I would first create two or three users in setup. Pass the list of users to encourageUsers(...) method and check whatever I want with the result. How can I achieve the same thing

How to set objects while functional testing grails with Spock

房东的猫 提交于 2019-12-31 01:56:12
问题 I've got a sample Domain such as this class User { String username String password def userHelper static contraints = { username(nullable: false, blank: false) password nullable: false, blank: false, validator: {pwd, userInstance -> return userInstance.userHelper.validatePassword(pwd) } } } the userHelper is being injected by the following in my resources.groovy beans = { userHelper(UserHelper) } When I test my application from the browser, everything runs fine. However, I get an exception

Gradle sonarqube not recognizing groovy tests

倾然丶 夕夏残阳落幕 提交于 2019-12-31 01:43:13
问题 I have a multi-language project with tests implemented using Java (JUnit) and Groovy (Spock). plugins { id "org.sonarqube" version "2.2.1" } apply plugin: 'idea' apply plugin: 'java' apply plugin: 'groovy' apply plugin: 'jacoco' ext { spockVersion = '1.1-groovy-2.4-rc-3' groovyVersion = '2.4.7' } group = "at.softwarecraftsmen.poc" version = "1.0.0-SNAPSHOT" repositories { mavenCentral() } dependencies { testCompile "junit:junit-dep:4.11" testCompile "org.codehaus.groovy:groovy-all:

Groovy 2.5.0 gives noclassdeffounderror for methodcalltransformation

偶尔善良 提交于 2019-12-30 18:06:46
问题 When I upgrade my project from Groovy 2.4.* to Groovy 2.5.0, it gives noclassdeffounderror for org/codehaus/groovy/ast/methodcalltransformation when compiling using Gradle. It works fine in Groovy 2.4. Posting the whole exception here: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileGroovy'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) at org.gradle.api.internal.tasks.execution

Java程序员必须掌握的10款开源工具

…衆ロ難τιáo~ 提交于 2019-12-27 05:22:44
本文主要介绍Java程序员应该在2019年学习的一些基本和高级工具。如果你是一位经验丰富的Java开发人员,你可能对这些工具很熟悉,但如果不是,现在就是是开始学习这些工具的好时机。 Java世界中存在许多工具,从Eclipse,NetBeans和IntelliJ IDEA等著名的IDE开始到Java开发人员应该知道的JVM分析和监视工具,如JConsole,VisualVM,Eclipse Memory Analyzer等。 尽管如此,在本文中,我将重点介绍适用于各种Java开发人员的通用工具,例如核心Java 开发人员和Web开发人员。 1. JIRA Atlassian的JIRA是当前敏捷开发领域最重要的工具之一。它用于错误跟踪,问题跟踪和项目管理。如果你遵循敏捷开发方法,例如Sprint和Scrum,那么你必须了解JIRA。它允许您创建Spring循环并跟踪软件开发的进度。 JIRA 是目前比较流行的基于Java架构的管理系统,由于Atlassian公 司对很多开源项目实行免费提供缺陷跟踪服务,因此在开源领域,其认知度比其他的产品要高得多,而且易用性也好一些。 2. Git Git是Java程序员的另一个必备工具,它是一个免费的开源分布式版本控制系统,旨在快速高效地处理从很小到非常大的项目版本管理。Git易于学习,占用空间小,具有超强的性能。 最初 Git 的开发是为了辅助

How to grab the value of the span element using jQuery

╄→гoц情女王★ 提交于 2019-12-26 11:39:32
问题 I have the following code: <tr> <td Width="50%" align="left"> <span id="ctl00_lblTotalDesc">Ext. Subtotal</span></td> <td Width="50%" align="right"> <span id="ctl00_lblTotalValue">100,087,000.00</span></td> </tr> I used the following to grab the value of the 2nd span element: spanValue = $('#ctl00_lblTotalValue').text(); But this doesn't seem to work in Spock/Geb. I get the following error: TypeError: $(...).text is not a function What am I doing wrong I get the following error if I use, $('

How to grab the value of the span element using jQuery

时光总嘲笑我的痴心妄想 提交于 2019-12-26 11:39:10
问题 I have the following code: <tr> <td Width="50%" align="left"> <span id="ctl00_lblTotalDesc">Ext. Subtotal</span></td> <td Width="50%" align="right"> <span id="ctl00_lblTotalValue">100,087,000.00</span></td> </tr> I used the following to grab the value of the 2nd span element: spanValue = $('#ctl00_lblTotalValue').text(); But this doesn't seem to work in Spock/Geb. I get the following error: TypeError: $(...).text is not a function What am I doing wrong I get the following error if I use, $('

How to print out spock metadata(the conent of given|when|then) when specs running?

女生的网名这么多〃 提交于 2019-12-25 07:47:49
问题 Is it possible or not?If yes,it will be a big help for debugging. Update: For metadata,I mean the content of after given|when|then statement,such as: def "test case"... given:"some preconditions" when:"do something" then:"some result" ... I want that blow content got printed: "test case" begins "some preconditions" "do something" "some result" 回答1: Currently this is not possible because even if you write a Spock extension, the deepest you can hook into at the moment is feature method