草庐IT

test_phoenix

全部标签

java - spring-boot testing - 多个测试可以共享一个上下文吗?

我创建了多个spring-boot测试类,(使用spring-boot1.4.0)。FirstActionTest.java:@RunWith(SpringRunner.class)@WebMvcTest(FirstAction.class)@TestPropertySource("classpath:test-application.properties")publicclassFirstActionTest{@AutowiredprivateMockMvcmvc;//...}SecondActionTest.java:@RunWith(SpringRunner.class)@Web

Windows BAT : test if a specific file is empty

我想检查windows.bat文件中的特定文件是否为空。这是我的非工作脚本:setdir="C:\test"setfile="%dir%\fff.txt"cd%dir%if%file%%~zi==0exitftp-s:"%dir%\ftp.action"exit你能帮我调试一下吗? 最佳答案 或者试试@echooffset"dir=C:\temp"set"file=%dir%\a.txt"call:CheckEmpty"%file%"goto:eof:CheckEmptyif%~z1==0exitftp-s:"%dir%\ftp.a

java - Logback-test.xml 配置生成两个日志文件而不是一个?

当我停止运行我的spring-boot应用程序时,会生成两个日志文件,而不是一个(应该有一个)。p>我的Logback-test.xml文件中有什么问题可能导致此问题?logback-test.xml:%d{HH:mm:ss.SSS}-%msg%nC:\path\to\my\file\myLog-${myTimestamp}.log%d{yyyy-MM-dd_HH:mm:ss.SSS}-%msg%nmyLog.%i{yyyy-MM-dd_HH:mm:ss.SSS}}.log1102MB正在创建的两个文件是例如:myLog-2016-04-22_15-47-30.126.logandmy

java - Logback-test.xml 配置生成两个日志文件而不是一个?

当我停止运行我的spring-boot应用程序时,会生成两个日志文件,而不是一个(应该有一个)。p>我的Logback-test.xml文件中有什么问题可能导致此问题?logback-test.xml:%d{HH:mm:ss.SSS}-%msg%nC:\path\to\my\file\myLog-${myTimestamp}.log%d{yyyy-MM-dd_HH:mm:ss.SSS}-%msg%nmyLog.%i{yyyy-MM-dd_HH:mm:ss.SSS}}.log1102MB正在创建的两个文件是例如:myLog-2016-04-22_15-47-30.126.logandmy

swift - 漏洞 : hit-testing with sibling nodes and the userInteractionEnabled property in Sprite Kit

错误—当sibling重叠时,HitTest无法按预期工作:Thereare2overlappingnodesinascenewhichhavethesameparent(ie.siblings)ThetopmostnodehasuserInteractionEnabled=NOwhilsttheothernodehasuserInteractionEnabled=YES.Iftheoverlapistouched,afterthetopmostnodeishit-testedandfails(becauseuserInteractionEnabled=NO),insteadofthe

线程 "main"java.net.UnknownHostException : Test: Test: unknown error OS ubuntu 中的 java 异常

此错误与我之前的问题有关,我在使用InetAddress.getLocalHost()时出错。我找到了一个suggestion在/etc/hosts中添加条目:myiplocalhost127.0.0.1localhost127.0.1.1test5但是我的错误还是没有解决。我的代码:importjava.net.*;publicclassInetAddressTest{publicstaticvoidmain(Stringargs[])throwsUnknownHostException{InetAddressAddress=InetAddress.getLocalHost();}}

java - 预期状态 :<200> but was:<404> in spring test

我有这门课:packagecontrollers;importstaticorg.junit.Assert.*;importstaticorg.mockito.Mockito.mock;importstaticorg.mockito.Mockito.times;importstaticorg.mockito.Mockito.verify;importstaticorg.mockito.Mockito.when;importjava.util.HashSet;importorg.junit.Before;importorg.junit.Test;importorg.junit.runne

java - 预期状态 :<200> but was:<404> in spring test

我有这门课:packagecontrollers;importstaticorg.junit.Assert.*;importstaticorg.mockito.Mockito.mock;importstaticorg.mockito.Mockito.times;importstaticorg.mockito.Mockito.verify;importstaticorg.mockito.Mockito.when;importjava.util.HashSet;importorg.junit.Before;importorg.junit.Test;importorg.junit.runne

ios - xcodebuild 相当于 Xcode 的 "Product > Build For > Testing"

我正在尝试编写一个脚本,将iOS应用程序提交到AppThwack(一种“真实设备”UI测试服务)。他们的指导是使用XcodeGUI并使用XcodeProduct菜单中的BuildFor>Testing选项构建应用程序。这行得通,但我无法将其转换为等效的xcodebuild。更一般地说,我们如何确定Xcode传递给xcodebuild的参数(假设它使用该工具)。 最佳答案 从Xcode8开始(在撰写本文时处于测试阶段),这现在是可能的。使用build-for-testing.例子:xcodebuild-workspace-scheme

c# - IIS 托管 WCF 服务 : Integration tests and code coverage

我为一个项目编写了一个wcf服务库。它可以托管在IIS和自托管服务中。对于所有连接的外部系统,我提供了提供一些通用数据的Mock实现,这样服务(库)就可以保持运行和工作。它是一个经典的自动机/有限状态机。引导时,所有数据源都已连接。在测试模式下,模拟实现是连接的。因此,当我运行测试时,服务库是从自托管服务“启动”的,而不是IIS,并且状态机保持运行和处理数据包。有没有办法从这样的运行中获得某种“测试覆盖率”。如果我能分辨出我从模拟对象提供的示例数据命中了哪些代码路径,我将不胜感激。然后提供更多的测试数据以获得更高的覆盖率。如果我无需提供“大量额外”测试代码就可以做到这一点,那就太好了。