ContextConfiguration卡住运行测试

时间:2014-06-25 14:42:10

标签: spring maven testing junit applicationcontext

输出

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running xxxxxxxxxxxxxx.aus.alerts.CriticalAlertMngTest
[06/25/14 10:21:33:395](main) WARN  - pertyPlaceholderConfigurer - Could not load properties from class path resource [env/psplatform-${psplatform.bonus}.properties]: class path resource [env/psplatform-${psplatform.bonus}.properties] cannot be opened because it does not exist
HttpAdaptor version 3.0.2 started on port 9080
[06/25/14 10:21:44:799](main) INFO  - SyncConfiguration          - Current name instance queue: [localmachine-VirtualBox]
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 14.843 sec
Running xxxxxxxxxxxxx.aus.dispatcher.utils.collections.CalRangeBeanTest

因此,此输出测试卡住了数据处理

自己测试

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:/com/xxx/yyy/spring/v1/testApplicationContext.xml"})
public class CalRangeBeanTest {

    @Test
    public void calendarDateBeanCollectionToListingDateRangeTest() {
        if(System.getProperty("integrationTest") != null && !System.getProperty("integrationTest").isEmpty() && System.getProperty("integrationTest").contains("false")) return;

        assertNull("null CalendarDateBeanCollection should be null", CalRangeBean.toListingDateRange(null));
        ...
    }

}

之前我发现如果某些bean在上下文中没有正确创建,因为有些东西被错过了测试也无法运行

我怎样才能找到测试被卡住的原因?

0 个答案:

没有答案