Tag: bamboo

在程序包上运行时Junit测试失败,但在文件上运行时成功

最新消息:有没有人遇到过这个问题? 我在Maven项目中使用JUnit 4.5和Mockito 1.7。 我在testCaseFolder包中有testCaseA.java。 如果我打开testCaseA.java,右键单击代码,选择“Run as” – “Junit test”即可。 但如果我右键单击包,选择“运行方式” – “Junit测试”,它将失败: org.mockito.exceptions.misusing.InvalidUseOfMatchersException: Misplaced argument matcher detected! Somewhere before this line you probably misused Mockito argument matchers. For example you might have used anyObject() argument matcher outside of verification or stubbing. Here are examples of correct usage of argument matchers: when(mock.get(anyInt())).thenReturn(null); doThrow(new RuntimeException()).when(mock).someVoidMethod(anyObject()); verify(mock).someMethod(contains(“foo”)); […]

Sonarqube:查看覆盖源的unit testing

我们在Bamboo中有一个CI设置,它运行Junit测试并使用Jacoco计算unit testing覆盖率。 然后我们运行Sonar插件进行源代码分析。 一切都很好,我们可以看到SonarCube服务器上的分析,包括覆盖范围,但我们希望确切地看到哪些测试涵盖了某些代码行。 现在它只是说: 由unit testing覆盖 。 有没有办法做到这一点?

要传递给Java应用程序以使用http代理进行身份validation的Java属性

我有一个Java应用程序试图通过http代理访问Web服务。 Java应用程序是我们无法访问源代码的第三方应用程序。 可以通过传递Java启动参数来配置它的启动。 我想知道一个人可以传递的java属性是什么,以便应用程序可以使用登录用户的NTLM凭据来validation代理连接? 当我通过https.proxyHost和https.proxyPort(即-Dhttps.proxyHost = abcd …到jvm命令行)时,我确实看到了日志的不同。 现在它失败了,下面有消息。 [WrapperSimpleAppMain] [AuthChallengeProcessor] ntlm authentication scheme selected INFO | jvm 5 | 2015/06/03 14:49:25 | 2015-06-03 14:49:25,380 INFO [WrapperSimpleAppMain] [HttpMethodDirector] No credentials available for NTLM @proxy.ins.dell.com:80 INFO | jvm 5 | 2015/06/03 14:49:25 | Exiting due to fatal exception. INFO | jvm 5 | 2015/06/03 14:49:25 | […]

运行junit任务时,Bamboo Ant任务失败

在我目前的项目中,我正在使用junit测试。 在我的本地PC上运行我的ant文件会按预期生成我的测试报告,但是当bamboo尝试运行我的测试时,它会产生以下输出。 我的错是什么? SimplerTest.java import static org.junit.Assert.*; import org.junit.Test; public class SimplerTest { @Test public void dummerTest() { assertTrue(true); } } 本地输出: Buildfile: C:\Users\jussi\git\kingdom-builder-repository\build.xml compile-test: [javac] Compiling 1 source file to C:\Users\jussi\git\kingdom-builder-repository\bin junit: [junit] Running me.jussi.kingdombuilder.SimplerTest [junit] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0,062 sec main: BUILD SUCCESSFUL Total time: […]