Package com.apress.prospring3.springblog.service.jpa

Source Code of com.apress.prospring3.springblog.service.jpa.EntryServiceImplTest

/**
* Created on Nov 1, 2011
*/
package com.apress.prospring3.springblog.service.jpa;

import org.joda.time.DateTime;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.apress.prospring3.springblog.domain.Entry;
import com.apress.prospring3.springblog.service.EntryService;

/**
* @author Clarence
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"/jpa-app-context-test.xml"})
public class EntryServiceImplTest {

  @Autowired
  private EntryService entryService;
 
  @Test
  public void testInsert() {
    Entry entry = new Entry();
    entry.setSubject("Testing entry clarence");
    entry.setBody("Testing entry clarence");
    entry.setPostDate(new DateTime());
    entry.setCategoryId("Spring");
    entry.setCreatedBy("prospring3");
    entry.setCreatedDate(new DateTime());
    entry.setLastModifiedBy("prospring3");
    entry.setLastModifiedDate(new DateTime());   
    entryService.save(entry);
System.out.println("Entry: " + entry);   
  }
 
}
TOP

Related Classes of com.apress.prospring3.springblog.service.jpa.EntryServiceImplTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.