2016-03-07 90 views

回答

1

例如使用元數據註解

@Retention(RetentionPolicy.RUNTIME) 
@Target(ElementType.METHOD) //triggering used in method. 
@TestPropertySource(locations="classpath:test.properties") 
@Test 
public @interface testbase{} 

,並使用

@testbase 
public void aMethod(){} 
+0

10X我會把它和復出檢查你 – kidwon

+0

沒有不工作,test.properties不能在aMethod()中讀取 – tfeiner