Pluggable selector

Jinhan Choi
1 min readJan 29, 2020

--

class JUnit{

Map<String, Class> map = new HashMap<String, Class>();

public void addTest(Class clazz){

Method[] methods = clazz.getDeclaredMethods();

for(Method method : methods){

method.setAccessible(true);

if(method.getName().startsWith(“test”)){

map.put(method.getName(), clazz);

}

}

}

출처: https://effectiveprogramming.tistory.com/entry/Pluggable-Selector-패턴 [Effective Programming]

--

--

No responses yet