AppFuse-light 버전이 너무 간단한거 같아 AppFuse 2.x를 받아서
소스 좀 볼 요량으로 appfuse.org를 갔는데 웬걸 다운로드 링크가 없다... ㅠㅠ

설치 자체가 Maven을 이용하는 것으로 바뀌었다. 헐... 메이븐 설치도 안했는뎅!~

우선 Spring-MVC Basic 아키타입을 받고,

mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-spring -DremoteRepositories=http://static.appfuse.org/releases -DarchetypeVersion=2.0.1 -DgroupId=com.mycompany.app -DartifactId=myproject

myproject 디렉토리로 이동해서 mvn 날린후 아래 명령으로 전체 소스를 받는다.

mvn appfuse:full-source
혹시 받다가 URL 관련 에러날 경우에는 apache-maven-2.0.8\conf\settings.xml 를 열고,
로컬 메이븐 저장소 경로를 디폴트 경로(C:\Documents and Settings\Administrator\.m2\repository)에서
스페이스 없는 경로로 바꾸면 된다.

<settings>
  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ~/.m2/repository
  -->
  <localRepository>D:\MavenRepository</localRepository>

* 자바지기님의 메이븐 강좌도 참고하자.
Maven 강좌 7 - Maven을 이용하여 Appfuse 프로젝트 생성하기

Posted by 에코지오
,
Spring+Hibernate 조합 환경에서 단위테스트에 대한 토비님의 글.

AppFuse DAO Test 코드의 문제점

Rod Johnson의 Testing with Spring

Spring기반의 Hibernate DAO Unit Test 만들기

특히나 하이버네이트의 1차레벨 캐쉬 때문에

C/U/D 한 뒤 다시 객체를 읽어오는 경우 읽기전에 세션을 flush 해주어야 한다는 지적은

AppFuse 만든 Matt도 미처 몰랐던 사실!


spring-test 모듈의 AbstractTransactionalJUnit4SpringContextTests 사용환경에서는 아래처럼
만들어 놓고 중간중간 flushAndClearSession(); 해주면 될 듯. 
 @Autowired
 protected SessionFactory sessionFactory;

 protected Session getCurrentSession() {
  return SessionFactoryUtils.getSession(sessionFactory, true);
 }

 protected void flushSession() {
  getCurrentSession().flush();
 }

 protected void flushAndClearSession() {
  Session s = getCurrentSession();
  s.flush();
  s.clear();
 }



Posted by 에코지오
,
이클립스에서 static import 설정 팁.
http://whiteship.tistory.com/1416

스프링 2.5 레퍼런스의 테스트 부분.
http://static.springframework.org/spring/docs/2.5.x/reference/testing.html

스프링 샘플에 포함된 petclinic 테스트 소스 참고.
http://www.springframework.org/docs/petclinic.html

최범균님 스프링2.5 프로그래밍 책의 테스트 파트.


그 외.
http://mudchobo.tomeii.com/tt/233

http://otamot.tistory.com/61

http://cafe.naver.com/deve/2580
Posted by 에코지오
,