hamcrest는 matchers의 철자순서를 바꾼말로매치되는 조건들을 서술적으로 나열할 수 있도록 만들어주는 프레임웍이다.예를 들면 아래와 같이assertThat(theBiscuit, equalTo(myBiscuit));theBiscuit이 myBiscuit과 동일한지를 체크하는 조건을 영어로 말하듯이 기술할 수 있다.여러개의 기본정의된 matcher(제약사항이나 술어)들이 있고 이 matcher들을 JUnit과 같은 unit testing framework에서 사용할 수 있다.공식 홈페이지 내용을 보면 아래와 같다.Provides a library of matcher objects (also known as constraints or predicates) allowing 'match' rules to..
메이븐으로 dependency관리되는 프로젝트에서 java source attach하는 설정 Preference에서 Maven 선택Download Artifact Sources 체크Download Artifact JavaDoc 체크 이제 이클립스에서 클래스명을 ctrl + click을 하면(맥은 cmd + click )소스가 attach안되어 있는 경우 maven repository에서 소스를 다운받은후 Source attachment항목을 연결해준다. http://stackoverflow.com/questions/2059431/get-source-jars-from-maven-repository http://stackoverflow.com/questions/310720/get-source-jar-file..
Public Class Test {private String[] locations; public void setLocations(String... locations) { this.locations = locations}} java에서 가변인자 사용하는 내용은 http://omen666.tistory.com/229http://docs.oracle.com/javase/1.5.0/docs/guide/language/varargs.htmljava 1.5부터 추가되었고 메소드 호출시 전달된 인자의 갯수를 자신의 크기로 하는 배열을 만들어서 호출된 메소드에 전달한다.즉 받는 입장에서는 가변인자가 배열로 들어온다고 생각하면 된다.더 나아가서 가변인자대신에 배열을 직접 인자로 넘겨도 된다.여기까지 중요 지식 한가지 그..
