# Junit test

# Junit test

by jihoon kim

HTML

<h1>Junit Test</h1>
<script>
function autolink(id) {
  var container = document.getElementById(id);
  var doc = container.innerHTML;
  var regURL = new RegExp("(http|https|ftp|telnet|news|irc)://([-/.a-zA-Z0-9_~#%$?&=:200-377()]+)","gi");
  var regEmail = new RegExp("([xA1-xFEa-z0-9_-]+@[xA1-xFEa-z0-9-]+\.[a-z0-9-]+)","gi");
  return doc.replace(regURL,"<a href='$1://$2' target='_blank'>$1://$2</a>").replace(regEmail,"<a href='mailto:$1'>$1</a>");
}

window.onload = function () {
  var container = document.getElementById("contents");
	container.innerHTML = autolink("contents");
}
</script>

<pre id="contents">
junit : https://junit.org/junit4/

junit cook book : http://junit.sourceforge.net/doc/cookbook/cookbook.htm
junit tutorial : https://www.tutorialspoint.com/junit/junit_ignore_test.htm

Junit 설정 : http://kamang-it.tistory.com/110
JUnit으로 유닛 테스팅하기(2) : http://kamang-it.tistory.com/305

assertThat : http://sejong-wiki.appspot.com/assertThat

JUnit 정리 & 기본 사용법 : http://jkonury.tistory.com/196 [마구마구 개발기]

hamcrest 로 가독성있는 jUnit Test Case 만들기 : https://www.lesstif.com/pages/viewpage.action?pageId=18219426

java main assert : https://www.google.co.kr/search?q=java+main+assert&safe=off&lr=lang_ko&sa=X&ved=0ahUKEwjNt4L9ma3cAhXRNpQKHR23ANYQuAEIIw&biw=1745&bih=861

■ assert란?
    가정 설정문(假定設定文) 또는 어서션(영어: assertion)은 프로그램 안에 추가하는 참·거짓을 미리 가정하는 문이다.
    개발자는 해당 문이 그 문의 장소에서 언제나 참이라고 간주한다. 런타임 중에 표명이 거짓으로 평가되면 표명 실패(assertion failure)를 초래하며 이 상황에서는 일반적으로 실행이 중단된다.
    참고 : https://ko.wikipedia.org/wiki/%ED%91%9C%EB%AA%85

■ assertThat 사용법
    assertThat은 assertThat(T actual, Matcher<? super T> matcher)

■ JUnit Assertions
    ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ====
    code                                        설명
    ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ====
    assertEquals([message], expected, actual)   두 값이 같은 지 비교
    assertSame([message], expceted, actual)     두 객체가 동일한 객체인지 비교
   ...