Remove all tests
This commit is contained in:
parent
ed4cc1efb5
commit
213419a4a3
@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
||||||
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
|
||||||
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
|
|
||||||
|
|
||||||
<bean id="tokenAuthenticationService"
|
|
||||||
class="com.jasamedika.medifirst2000.security.service.TokenAuthenticationService" />
|
|
||||||
|
|
||||||
<mvc:interceptors>
|
|
||||||
<bean class="com.jasamedika.medifirst2000.interceptor.AppInterceptor" />
|
|
||||||
</mvc:interceptors>
|
|
||||||
</beans>
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
/**Agama Class Test
|
|
||||||
*/
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class AsalAnggaranDaoTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void contextLoad() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
/**Agama Class Test
|
|
||||||
*/
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
|
|
||||||
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.jasamedika.medifirst2000.dao.DepartemenDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Departemen;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class DepartemenDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private DepartemenDao dao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindById() {
|
|
||||||
Departemen result = dao.findOne(1);
|
|
||||||
// System.out.println(result.getAlamats().size());
|
|
||||||
// assertNotNull(result.getAlamats());
|
|
||||||
//assertNull(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
/**Agama Class Test
|
|
||||||
*/
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
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.jasamedika.medifirst2000.dao.AntrianPasienDiPeriksaDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.FungsiProdukDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.FungsiProduk;
|
|
||||||
import com.jasamedika.medifirst2000.service.AntrianPasienDiPeriksaService;
|
|
||||||
import com.jasamedika.medifirst2000.service.MonitoringAbsenService;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class FungsiProdukDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private FungsiProdukDao dao;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MonitoringAbsenService monitoringAbsenService;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindById() {
|
|
||||||
FungsiProduk result = dao.findOne(1);
|
|
||||||
assertNull(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testLemburSDM(){
|
|
||||||
Integer lembur = monitoringAbsenService.getLemburVerifiedbySDM(141, "1-November-2017");
|
|
||||||
assertSame(360, lembur);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.dao.GenericViewDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapPernapasanDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class GenerateNoCmDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindNoCmDaoSelect() {
|
|
||||||
List<String> list=pasienDao.findAllNoCm();
|
|
||||||
assertNotNull(list);
|
|
||||||
System.out.println("LISSSSSSSSSST : "+list.size());
|
|
||||||
assertEquals("8", list.size());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
/**Agama Class Test
|
|
||||||
*/
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
|
|
||||||
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.jasamedika.medifirst2000.dao.JenisRekananDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.JenisRekanan;
|
|
||||||
|
|
||||||
//@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
//@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class JenisRekananDaoTest {
|
|
||||||
|
|
||||||
// @Autowired
|
|
||||||
private JenisRekananDao dao;
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
public void testFindById() {
|
|
||||||
JenisRekanan result = dao.findOne(1);
|
|
||||||
// System.out.println(result.getAlamats().size());
|
|
||||||
// assertNotNull(result.getAlamats());
|
|
||||||
assertNull(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
/**Agama Class Test
|
|
||||||
*/
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
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.jasamedika.medifirst2000.dao.custom.impl.KalkulatorDaoCustomImpl;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class KalkulatorDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private KalkulatorDaoCustomImpl dao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testKalkluator() {
|
|
||||||
String operationInput = "14 + 6/3 - 3*5 + 9-8 * (4-2)";
|
|
||||||
int result = dao.calculateFromString(operationInput);
|
|
||||||
assertEquals(-6, result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
/**Agama Class Test
|
|
||||||
*/
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
|
|
||||||
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.jasamedika.medifirst2000.dao.KelompokProdukDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.KelompokProduk;
|
|
||||||
|
|
||||||
//@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
//@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class KelompokProdukDaoTest {
|
|
||||||
|
|
||||||
// @Autowired
|
|
||||||
private KelompokProdukDao dao;
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
public void testFindById() {
|
|
||||||
KelompokProduk result = dao.findOne(1);
|
|
||||||
// System.out.println(result.getAlamats().size());
|
|
||||||
// assertNotNull(result.getAlamats());
|
|
||||||
assertNull(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
/**Agama Class Test
|
|
||||||
*/
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
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.jasamedika.medifirst2000.dao.LoginUserDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.LoginUser;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class LoginUserDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private LoginUserDao dao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindById() {
|
|
||||||
try {
|
|
||||||
LoginUser result = dao.findOne(new Integer(1));
|
|
||||||
assertNotNull(result);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
// System.out.println(result.getAlamats().size());
|
|
||||||
// assertNotNull(result.getAlamats());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testNorec(){
|
|
||||||
LoginUser loginUser = new LoginUser();
|
|
||||||
assertNotNull(loginUser.getNoRec());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,93 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
|
|
||||||
/**Agama Class Test
|
|
||||||
*/
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapAlergi;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.entities.RegistrasiPelayananPasien;
|
|
||||||
import com.jasamedika.medifirst2000.dao.GenericViewDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapAlergiDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapAlergiDaoTest {/*
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapAlergiDao papAlergiDao;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPapAlergiDaoSave(){
|
|
||||||
PapAlergi model = populateModel();
|
|
||||||
PapAlergi resultModel1 = papAlergiDao.save(model);
|
|
||||||
Cek Hasil save
|
|
||||||
assertNotNull(resultModel1);
|
|
||||||
assertEquals(resultModel1.getKeteranganData(),"Keterangan Data Alergi");
|
|
||||||
assertEquals(resultModel1.getPasien().getNamaPasien(),"adik");
|
|
||||||
assertEquals(resultModel1.getRegistrasiPelayananPasien().getKeteranganLainnyaRencana(),"Rencana");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPapAlergiDaoUpdate(){
|
|
||||||
PapAlergi model = populateModel();
|
|
||||||
PapAlergi result = papAlergiDao.save(model);
|
|
||||||
assertNotNull(result);
|
|
||||||
result.getPasien().setNamaPasien("Nama Update");
|
|
||||||
result.getRegistrasiPelayananPasien().setKeteranganLainnyaRencana("Keterangan Update");
|
|
||||||
result.setKeteranganData("Keterangan Data Update");
|
|
||||||
|
|
||||||
PapAlergi resultUpdate = papAlergiDao.save(result);
|
|
||||||
assertEquals("Keterangan Data Update",resultUpdate.getKeteranganData());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPapAlergiDaoDelete(){
|
|
||||||
PapAlergi model = populateModel();
|
|
||||||
papAlergiDao.save(model);
|
|
||||||
|
|
||||||
PapAlergi resultModel1 = papAlergiDao.findOne(model.getNoRec());
|
|
||||||
Cek Model di Database
|
|
||||||
assertNotNull(resultModel1);
|
|
||||||
assertNotNull(resultModel1.getKeteranganData());
|
|
||||||
|
|
||||||
papAlergiDao.delete(model);
|
|
||||||
PapAlergi resultModel2 = papAlergiDao.findOne(model.getNoRec());
|
|
||||||
Cek Hasil Delete Model
|
|
||||||
assertNull(resultModel2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public PapAlergi populateModel(){
|
|
||||||
PapAlergi model = new PapAlergi();
|
|
||||||
RegistrasiPelayananPasien registrasiPelayananPasien = new RegistrasiPelayananPasien();
|
|
||||||
registrasiPelayananPasien.setKeteranganLainnyaRencana("Rencana");
|
|
||||||
Pasien pasien = pasienDao.findOne(393);
|
|
||||||
|
|
||||||
model.setRegistrasiPelayananPasien(registrasiPelayananPasien);
|
|
||||||
model.setPasien(pasien);
|
|
||||||
model.setKeteranganData("Keterangan Data Alergi");
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
*/}
|
|
||||||
@ -1,103 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
|
|
||||||
/**Agama Class Test
|
|
||||||
*/
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapAlergi;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapAnamesis;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.entities.RegistrasiPelayananPasien;
|
|
||||||
import com.jasamedika.medifirst2000.dao.GenericViewDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapAnamesisDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapAnamesisDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapAnamesisDao papAnamesisDao;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPapAnamesisDaoSave(){
|
|
||||||
PapAnamesis model = populateModel();
|
|
||||||
PapAnamesis result = papAnamesisDao.save(model);
|
|
||||||
assertNotNull(result);
|
|
||||||
assertEquals(result.getKeluhan(),"Keterangan Keluhan");
|
|
||||||
assertEquals(result.getPasien().getNamaPasien(),"adik");
|
|
||||||
assertNotNull(result.getRegistrasiPelayananPasien());
|
|
||||||
assertNotNull(result.getTglInput());
|
|
||||||
|
|
||||||
PapAnamesis resultFind = papAnamesisDao.findOne(model.getNoRec());
|
|
||||||
assertNotNull(resultFind);
|
|
||||||
assertEquals(resultFind.getKeluhan(),"Keterangan Keluhan");
|
|
||||||
assertEquals(resultFind.getPasien().getNamaPasien(),"adik");
|
|
||||||
assertNotNull(resultFind.getRegistrasiPelayananPasien());
|
|
||||||
assertNotNull(resultFind.getTglInput());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPapAnamesisDaoUpdate(){
|
|
||||||
PapAnamesis model = populateModel();
|
|
||||||
PapAnamesis result = papAnamesisDao.save(model);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
result.setKeluhan("Update Keluhan");
|
|
||||||
result.getPasien().setNamaPasien("Update Nama Pasien");
|
|
||||||
result.getRegistrasiPelayananPasien().setKdDokter("Update Kode Dokter");
|
|
||||||
papAnamesisDao.save(result);
|
|
||||||
|
|
||||||
PapAnamesis resultUpdate = papAnamesisDao.findOne(result.getNoRec());
|
|
||||||
assertEquals("Update Keluhan",resultUpdate.getKeluhan());
|
|
||||||
assertEquals("Update Nama Pasien",resultUpdate.getPasien().getNamaPasien());
|
|
||||||
assertEquals("Update Kode Dokter",resultUpdate.getRegistrasiPelayananPasien().getKdDokter());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPapAnamesisDaoDelete(){
|
|
||||||
PapAnamesis model = populateModel();
|
|
||||||
papAnamesisDao.save(model);
|
|
||||||
|
|
||||||
PapAnamesis result1 = papAnamesisDao.findOne(model.getNoRec());
|
|
||||||
assertNotNull(result1);
|
|
||||||
assertNotNull(result1.getKeluhan());
|
|
||||||
|
|
||||||
papAnamesisDao.delete(model);
|
|
||||||
PapAnamesis result2 = papAnamesisDao.findOne(model.getNoRec());
|
|
||||||
assertNull(result2);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public PapAnamesis populateModel(){
|
|
||||||
PapAnamesis model = new PapAnamesis();
|
|
||||||
Pasien pasien = pasienDao.findOne(393);
|
|
||||||
model.setPasien(pasien);
|
|
||||||
model.setTglInput(new Date());
|
|
||||||
model.setRegistrasiPelayananPasien(new RegistrasiPelayananPasien());
|
|
||||||
model.setKeluhan("Keterangan Keluhan");
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,85 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.dao.GenericViewDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapCatatanDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapCatatan;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapCatatanDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private GenericViewDao genericViewDao;
|
|
||||||
@Autowired
|
|
||||||
private PapCatatanDao papCatatanDao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testGenericDaoSelect() {
|
|
||||||
GenericView rujukan = populateGenericView("Rujukan");
|
|
||||||
assertNotNull(rujukan);
|
|
||||||
assertEquals("1", String.valueOf(rujukan.getKdGenericView()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPCatatanDaoSave() {
|
|
||||||
PapCatatan model = populateModel();
|
|
||||||
PapCatatan resultModel=papCatatanDao.save(model);
|
|
||||||
assertNotNull(resultModel);
|
|
||||||
assertNotNull(resultModel.getRujukan());
|
|
||||||
//assertEquals("1", String.valueOf(resultModel.getRujukan().getKdGenericView()));
|
|
||||||
PapCatatan resultModel2=papCatatanDao.findOne(resultModel.getNoRec());
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
assertNotNull(resultModel2.getRujukan());
|
|
||||||
//assertEquals("1", String.valueOf(resultModel2.getRujukan().getKdGenericView()));
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapCatatan populateModel() {
|
|
||||||
PapCatatan model=new PapCatatan();
|
|
||||||
GenericView rujukan = populateGenericView("Rujukan");
|
|
||||||
//model.setRujukan(rujukan);
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GenericView populateGenericView(String previx) {
|
|
||||||
GenericView genericView=new GenericView();
|
|
||||||
List<GenericView> listRujukan=genericViewDao.findGenericViewByPrevix(previx);
|
|
||||||
for (GenericView gv:listRujukan) {
|
|
||||||
if(gv.getKdGenericView()==1){
|
|
||||||
genericView=gv;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return genericView;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPCatatanDaoFindAll() {
|
|
||||||
PapCatatan model1 = populateModel();
|
|
||||||
PapCatatan resultModel1=papCatatanDao.save(model1);
|
|
||||||
PapCatatan model2 = populateModel();
|
|
||||||
PapCatatan resultModel2=papCatatanDao.save(model2);
|
|
||||||
assertNotNull(resultModel1);
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
List<PapCatatan> results = (List<PapCatatan>) papCatatanDao.findAll();
|
|
||||||
assertTrue(results.size() > 0);
|
|
||||||
assertNotNull(results);
|
|
||||||
assertTrue(results.size() == 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,128 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.dao.GenericViewDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapEliminasiDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.RegistrasiPelayananPasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapEliminasi;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapEliminasiDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private GenericViewDao genericViewDao;
|
|
||||||
@Autowired
|
|
||||||
private PapEliminasiDao papEliminasiDao;
|
|
||||||
@Autowired
|
|
||||||
private RegistrasiPelayananPasienDao registrasiPelayananPasienDao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
//registrasiPelayananPasienDao.findOne("40288c99557b0f0f01557b155bcc0000");
|
|
||||||
Date tgl=DateUtil.toDate("2016-06-19");
|
|
||||||
System.out.println("DATEEEEEEEEEE : "+ tgl);
|
|
||||||
// PapEliminasi abc=papEliminasiDao.findPapEliminasiByNoCmAndTglInput("00001", DateUtil.toDate("2016-06-19"));
|
|
||||||
PapEliminasi abc=papEliminasiDao.findByNoRec("40288c99559075a1015590762cb40000");
|
|
||||||
assertNotNull(abc);
|
|
||||||
assertNotNull(abc.getPasien());
|
|
||||||
assertEquals("00001", abc.getPasien().getNoCm());
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testGenericDaoSelect() {
|
|
||||||
GenericView pengeluaranDefeaksi = populateGenericView("Pengeluaran Defeaksi");
|
|
||||||
GenericView pengeluaranUrin = populateGenericView("Pengeluaran Urin");
|
|
||||||
GenericView karakteristikFeses = populateGenericView("Karakteristik Feses");
|
|
||||||
assertNotNull(pengeluaranDefeaksi);
|
|
||||||
assertNotNull(pengeluaranUrin);
|
|
||||||
assertNotNull(karakteristikFeses);
|
|
||||||
assertEquals("1", String.valueOf(pengeluaranDefeaksi.getKdGenericView()));
|
|
||||||
assertEquals("1", String.valueOf(pengeluaranUrin.getKdGenericView()));
|
|
||||||
assertEquals("1", String.valueOf(karakteristikFeses.getKdGenericView()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPEliminasiDaoSave() {
|
|
||||||
PapEliminasi model = populateModel();
|
|
||||||
PapEliminasi resultModel=papEliminasiDao.save(model);
|
|
||||||
assertNotNull(resultModel);
|
|
||||||
assertEquals("1", resultModel.getFrekuensiDefeaksi());
|
|
||||||
assertEquals("2", resultModel.getKonsistensiDefeaksi());
|
|
||||||
assertEquals("3", resultModel.getDiuresisUrin());
|
|
||||||
assertNotNull(resultModel.getPengeluaranDefeaksi());
|
|
||||||
assertNotNull(resultModel.getPengeluaranUrin());
|
|
||||||
assertNotNull(resultModel.getKarakteristikFeses());
|
|
||||||
PapEliminasi resultModel2=papEliminasiDao.findOne(resultModel.getNoRec());
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
assertEquals("1", resultModel2.getFrekuensiDefeaksi());
|
|
||||||
assertEquals("2", resultModel2.getKonsistensiDefeaksi());
|
|
||||||
assertEquals("3", resultModel2.getDiuresisUrin());
|
|
||||||
assertNotNull(resultModel2.getPengeluaranDefeaksi());
|
|
||||||
assertNotNull(resultModel2.getPengeluaranUrin());
|
|
||||||
assertNotNull(resultModel2.getKarakteristikFeses());
|
|
||||||
assertEquals("1",String.valueOf(resultModel2.getPengeluaranDefeaksi().getKdGenericView()));
|
|
||||||
assertEquals("1",String.valueOf(resultModel2.getPengeluaranUrin().getKdGenericView()));
|
|
||||||
assertEquals("1",String.valueOf(resultModel2.getKarakteristikFeses().getKdGenericView()));
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapEliminasi populateModel() {
|
|
||||||
PapEliminasi model=new PapEliminasi();
|
|
||||||
GenericView pengeluaranDefeaksi = populateGenericView("Pengeluaran Defeaksi");
|
|
||||||
GenericView pengeluaranUrin = populateGenericView("Pengeluaran Urin");
|
|
||||||
GenericView karakteristikFeses = populateGenericView("Karakteristik Feses");
|
|
||||||
model.setPengeluaranDefeaksi(pengeluaranDefeaksi);
|
|
||||||
model.setFrekuensiDefeaksi("1");
|
|
||||||
model.setKonsistensiDefeaksi("2");
|
|
||||||
model.setKarakteristikFeses(karakteristikFeses);
|
|
||||||
model.setPengeluaranUrin(pengeluaranUrin);
|
|
||||||
model.setIsKelainanUrin(true);
|
|
||||||
model.setDiuresisUrin("3");
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GenericView populateGenericView(String previx) {
|
|
||||||
GenericView genericView=new GenericView();
|
|
||||||
List<GenericView> list=genericViewDao.findGenericViewByPrevix(previx);
|
|
||||||
for (GenericView gv:list) {
|
|
||||||
if(gv.getKdGenericView()==1){
|
|
||||||
genericView=gv;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return genericView;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPEliminasiDaoFindAll() {
|
|
||||||
PapEliminasi model1 = populateModel();
|
|
||||||
PapEliminasi resultModel1=papEliminasiDao.save(model1);
|
|
||||||
PapEliminasi model2 = populateModel();
|
|
||||||
PapEliminasi resultModel2=papEliminasiDao.save(model2);
|
|
||||||
assertNotNull(resultModel1);
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
List<PapEliminasi> results = (List<PapEliminasi>) papEliminasiDao.findAll();
|
|
||||||
assertTrue(results.size() > 0);
|
|
||||||
assertNotNull(results);
|
|
||||||
assertTrue(results.size() == 2);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
@ -1,103 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.dao.GenericViewDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapGastrointestinalDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapGastrointestinal;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapGastrointestinalDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private GenericViewDao genericViewDao;
|
|
||||||
@Autowired
|
|
||||||
private PapGastrointestinalDao papGastrointestinalDao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testGenericDaoSelect() {
|
|
||||||
GenericView mulut = populateGenericView("Mulut");
|
|
||||||
assertNotNull(mulut);
|
|
||||||
assertEquals("1", String.valueOf(mulut.getKdGenericView()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPGastrointestinalDaoSave() {
|
|
||||||
PapGastrointestinal model = populateModel();
|
|
||||||
PapGastrointestinal resultModel=papGastrointestinalDao.save(model);
|
|
||||||
assertNotNull(resultModel);
|
|
||||||
assertNotNull(resultModel.getMulut());
|
|
||||||
// assertEquals("1", String.valueOf(resultModel.getMulut().getKdGenericView()));
|
|
||||||
//assertEquals(true,resultModel.getIsAscites());
|
|
||||||
//assertEquals(true,resultModel.getIsMual());
|
|
||||||
//assertEquals(true,resultModel.getIsMuntah());
|
|
||||||
//assertEquals(true,resultModel.getIsNyeriUluHati());
|
|
||||||
assertEquals("1",resultModel.getPeristaltikUsus());
|
|
||||||
assertEquals("2",resultModel.getLingkarPerut());
|
|
||||||
PapGastrointestinal resultModel2=papGastrointestinalDao.findOne(resultModel.getNoRec());
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
assertNotNull(resultModel2.getMulut());
|
|
||||||
// assertEquals("1", String.valueOf(resultModel2.getMulut().getKdGenericView()));
|
|
||||||
// assertEquals(true,resultModel2.getIsAscites());
|
|
||||||
// assertEquals(true,resultModel2.getIsMual());
|
|
||||||
// assertEquals(true,resultModel2.getIsMuntah());
|
|
||||||
// assertEquals(true,resultModel2.getIsNyeriUluHati());
|
|
||||||
assertEquals("1",resultModel2.getPeristaltikUsus());
|
|
||||||
assertEquals("2",resultModel2.getLingkarPerut());
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapGastrointestinal populateModel() {
|
|
||||||
PapGastrointestinal model=new PapGastrointestinal();
|
|
||||||
GenericView mulut = populateGenericView("Mulut");
|
|
||||||
// model.setMulut(mulut);
|
|
||||||
// model.setIsAscites(true);
|
|
||||||
// model.setIsMual(true);
|
|
||||||
// model.setIsMuntah(true);
|
|
||||||
// model.setIsNyeriUluHati(true);
|
|
||||||
model.setPeristaltikUsus("1");
|
|
||||||
model.setLingkarPerut("2");
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GenericView populateGenericView(String previx) {
|
|
||||||
GenericView genericView=new GenericView();
|
|
||||||
List<GenericView> list=genericViewDao.findGenericViewByPrevix(previx);
|
|
||||||
for (GenericView gv:list) {
|
|
||||||
if(gv.getKdGenericView()==1){
|
|
||||||
genericView=gv;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return genericView;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPGastrointestinalDaoFindAll() {
|
|
||||||
PapGastrointestinal model1 = populateModel();
|
|
||||||
PapGastrointestinal resultModel1=papGastrointestinalDao.save(model1);
|
|
||||||
PapGastrointestinal model2 = populateModel();
|
|
||||||
PapGastrointestinal resultModel2=papGastrointestinalDao.save(model2);
|
|
||||||
assertNotNull(resultModel1);
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
List<PapGastrointestinal> results = (List<PapGastrointestinal>) papGastrointestinalDao.findAll();
|
|
||||||
assertTrue(results.size() > 0);
|
|
||||||
assertNotNull(results);
|
|
||||||
assertTrue(results.size() == 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,152 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
|
|
||||||
/**Agama Class Test
|
|
||||||
*/
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
import com.jasamedika.medifirst2000.entities.JenisKelamin;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapCatatan;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapGenatalia;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapRiwayatPsikososial;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pendidikan;
|
|
||||||
import com.jasamedika.medifirst2000.entities.RegistrasiPelayananPasien;
|
|
||||||
import com.jasamedika.medifirst2000.dao.GenericViewDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapGenataliaDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapGenataliaDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapGenataliaDao papGenataliaDao;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPapGenetaliaDaoSave(){
|
|
||||||
PapGenatalia model = populateModel();
|
|
||||||
PapGenatalia result = papGenataliaDao.save(model);
|
|
||||||
assertNotNull(result);
|
|
||||||
assertEquals(result.getKeterangan(),"Keterangan Genatalia");
|
|
||||||
assertEquals(result.getStatus(),"Status Genatalia");
|
|
||||||
assertNotNull(result.getRegistrasiPelayananPasien());
|
|
||||||
assertEquals(result.getRegistrasiPelayananPasien().getNamaTempatTujuan(),"Nama Tempat Tujuan");
|
|
||||||
assertNotNull(result.getPasien());
|
|
||||||
assertEquals(result.getPasien().getUmur(),"Umur Pasien");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPapGenataliaDaoUpdate(){
|
|
||||||
PapGenatalia model = populateModel();
|
|
||||||
PapGenatalia resultModel1 = papGenataliaDao.save(model);
|
|
||||||
assertNotNull(resultModel1);
|
|
||||||
|
|
||||||
/*Proses Update*/
|
|
||||||
PapGenatalia resultModel2 = papGenataliaDao.findOne(model.getNoRec());
|
|
||||||
resultModel2.setKeterangan("Keterangan Update");
|
|
||||||
resultModel2.setStatus("Status Update");
|
|
||||||
Pasien pasien = new Pasien();
|
|
||||||
pasien.setUmur("Umur Update");
|
|
||||||
resultModel2.setPasien(pasien);
|
|
||||||
RegistrasiPelayananPasien registrasiPelayananPasien = new RegistrasiPelayananPasien();
|
|
||||||
registrasiPelayananPasien.setNamaTempatTujuan("Tujuan Update");
|
|
||||||
resultModel2.setRegistrasiPelayananPasien(registrasiPelayananPasien);
|
|
||||||
papGenataliaDao.save(resultModel2);
|
|
||||||
|
|
||||||
/*Cek Nilai Update di DB*/
|
|
||||||
PapGenatalia resultModel3 = papGenataliaDao.findOne(model.getNoRec());
|
|
||||||
assertEquals("Keterangan Update",resultModel3.getKeterangan());
|
|
||||||
assertEquals("Status Update",resultModel3.getStatus());
|
|
||||||
assertEquals("Umur Update",resultModel3.getPasien().getUmur());
|
|
||||||
assertEquals("Tujuan Update",resultModel3.getRegistrasiPelayananPasien().getNamaTempatTujuan());
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
@Transactional
|
|
||||||
public void testPapGenetaliaDaoFindAll(){
|
|
||||||
/* Model 1 */
|
|
||||||
PapGenatalia model = populateModel();
|
|
||||||
PapGenatalia resultModel = papGenataliaDao.save(model);
|
|
||||||
assertNotNull(resultModel);
|
|
||||||
assertNotNull(resultModel.getKeterangan());
|
|
||||||
|
|
||||||
/* Model 2*/
|
|
||||||
PapGenatalia model2 = populateModel();
|
|
||||||
PapGenatalia resultModel2 = papGenataliaDao.save(model2);
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
assertNotNull(resultModel2.getKeterangan());
|
|
||||||
|
|
||||||
/* Cek Model di Database */
|
|
||||||
try {
|
|
||||||
List<PapGenatalia> hasil = toList(papGenataliaDao.findAll());
|
|
||||||
assertNotNull(hasil);
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPapGenetaliaDaoDelete(){
|
|
||||||
PapGenatalia model1 = populateModel();
|
|
||||||
PapGenatalia resultModel = papGenataliaDao.save(model1);
|
|
||||||
assertNotNull(resultModel);
|
|
||||||
assertNotNull(resultModel.getKeterangan());
|
|
||||||
PapGenatalia result1 = papGenataliaDao.findOne(model1.getNoRec());
|
|
||||||
assertNotNull(result1);
|
|
||||||
|
|
||||||
papGenataliaDao.delete(model1);
|
|
||||||
result1 = papGenataliaDao.findOne(model1.getNoRec());
|
|
||||||
assertNull(result1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Source : */
|
|
||||||
/* http://www.java2s.com/Code/Java/Collections-Data-Structure/ConvertIterabletoList.htm */
|
|
||||||
public static <E> List<E> toList(Iterable<E> iterable) {
|
|
||||||
if(iterable instanceof List) {
|
|
||||||
return (List<E>) iterable;
|
|
||||||
}
|
|
||||||
ArrayList<E> list = new ArrayList<E>();
|
|
||||||
if(iterable != null) {
|
|
||||||
for(E e: iterable) {
|
|
||||||
list.add(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PapGenatalia populateModel(){
|
|
||||||
PapGenatalia model = new PapGenatalia();
|
|
||||||
RegistrasiPelayananPasien registrasiPelayananPasien = new RegistrasiPelayananPasien();
|
|
||||||
registrasiPelayananPasien.setNamaTempatTujuan("Nama Tempat Tujuan");
|
|
||||||
Pasien pasien = pasienDao.findOne(541);
|
|
||||||
pasien.setUmur("Umur Pasien");
|
|
||||||
|
|
||||||
model.setRegistrasiPelayananPasien(registrasiPelayananPasien);
|
|
||||||
model.setPasien(pasien);
|
|
||||||
model.setStatus("Status Genatalia");
|
|
||||||
model.setKeterangan("Keterangan Genatalia");
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,79 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.dao.GenericViewDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapEliminasiDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapKeluhanTambahanDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapKeluhanUtamaDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.RegistrasiPelayananPasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapEliminasi;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapKeluhanTambahan;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapKeluhanUtama;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapMuskuloskeletal;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.entities.RegistrasiPelayananPasien;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapKeluhanUtamaDaoTest {/*
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapKeluhanUtamaDao papKeluhanUtamaDao;
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPMuskuloskeletalDaoSave() {
|
|
||||||
PapKeluhanUtama model = populateModel();
|
|
||||||
PapKeluhanUtama resultModel=papKeluhanUtamaDao.save(model);
|
|
||||||
assertNotNull(resultModel);
|
|
||||||
// assertEquals(false, resultModel.getIsKelainanTulangAda());
|
|
||||||
// assertEquals(true, resultModel.getIsGerakanAnakBebas());
|
|
||||||
PapKeluhanUtama resultModel2=papKeluhanUtamaDao.findOne("40288cd955ec500d0155ed88a93b0004");
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
// assertEquals(false, resultModel2.getIsKelainanTulangAda());
|
|
||||||
// assertEquals(true, resultModel2.getIsGerakanAnakBebas());
|
|
||||||
resultModel2=populateModelUpdate();
|
|
||||||
PapKeluhanUtama resultModelUpdate=papKeluhanUtamaDao.save(resultModel2);
|
|
||||||
assertNotNull(resultModelUpdate);
|
|
||||||
assertEquals("abcd", resultModelUpdate.getKeluhanUtama());
|
|
||||||
// assertEquals(false, resultModelUpdate.getIsGerakanAnakBebas());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapKeluhanUtama populateModel() {
|
|
||||||
Pasien pasien=new Pasien();
|
|
||||||
pasien.setId(535);
|
|
||||||
PapKeluhanUtama keluhanUtama=new PapKeluhanUtama();
|
|
||||||
keluhanUtama.setPasien(pasien);
|
|
||||||
keluhanUtama.setKeluhanUtama("abc");
|
|
||||||
return keluhanUtama;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapKeluhanUtama populateModelUpdate() {
|
|
||||||
Pasien pasien=new Pasien();
|
|
||||||
pasien.setId(535);
|
|
||||||
PapKeluhanUtama keluhanUtama=new PapKeluhanUtama();
|
|
||||||
keluhanUtama.setPasien(pasien);
|
|
||||||
keluhanUtama.setKeluhanUtama("abcd");
|
|
||||||
return keluhanUtama;
|
|
||||||
}
|
|
||||||
|
|
||||||
*/}
|
|
||||||
@ -1,93 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
|
|
||||||
/**Agama Class Test
|
|
||||||
*/
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapAlergi;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapMuskuloskeletal;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.entities.RegistrasiPelayananPasien;
|
|
||||||
import com.jasamedika.medifirst2000.dao.GenericViewDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapAlergiDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapMuskuloskeletalDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapMuskoskeletalDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapMuskuloskeletalDao papMuskuloskeletalDao;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPapAlergiDaoSave(){
|
|
||||||
PapMuskuloskeletal model = populateModel();
|
|
||||||
PapMuskuloskeletal result = papMuskuloskeletalDao.save(model);
|
|
||||||
assertNotNull(result);
|
|
||||||
assertNotNull(result.getRegistrasiPelayananPasien());
|
|
||||||
assertEquals(result.getRegistrasiPelayananPasien().getNamaTempatTujuan(),"Nama Tempat Tujuan");
|
|
||||||
assertNotNull(result.getPasien());
|
|
||||||
assertEquals(result.getPasien().getUmur(),"Umur Pasien");
|
|
||||||
assertNotNull(result.getTglInput());
|
|
||||||
assertTrue(result.getStatusEnabled());
|
|
||||||
|
|
||||||
PapMuskuloskeletal resultSelect = papMuskuloskeletalDao.findOne(model.getNoRec());
|
|
||||||
assertNotNull(resultSelect);
|
|
||||||
assertNotNull(resultSelect.getRegistrasiPelayananPasien());
|
|
||||||
assertEquals(resultSelect.getRegistrasiPelayananPasien().getNamaTempatTujuan(),"Nama Tempat Tujuan");
|
|
||||||
assertNotNull(resultSelect.getPasien());
|
|
||||||
assertEquals(resultSelect.getPasien().getUmur(),"Umur Pasien");
|
|
||||||
assertNotNull(resultSelect.getTglInput());
|
|
||||||
assertTrue(resultSelect.getStatusEnabled());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPapAlergiDaoUpdate(){
|
|
||||||
PapMuskuloskeletal model = populateModel();
|
|
||||||
PapMuskuloskeletal result = papMuskuloskeletalDao.save(model);
|
|
||||||
assertNotNull(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
@Transactional
|
|
||||||
public void testPapAlergiDaoDelete(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public PapMuskuloskeletal populateModel(){
|
|
||||||
PapMuskuloskeletal model = new PapMuskuloskeletal();
|
|
||||||
RegistrasiPelayananPasien registrasiPelayananPasien = new RegistrasiPelayananPasien();
|
|
||||||
registrasiPelayananPasien.setNamaTempatTujuan("Nama Tempat Tujuan");
|
|
||||||
Pasien pasien = pasienDao.findOne(393);
|
|
||||||
pasien.setUmur("Umur Pasien");
|
|
||||||
|
|
||||||
model.setRegistrasiPelayananPasien(registrasiPelayananPasien);
|
|
||||||
model.setPasien(pasien);
|
|
||||||
model.setTglInput(new Date());
|
|
||||||
model.setStatusEnabled(true);
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapMuskuloskeletalDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapMuskuloskeletal;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapMuskuloskeletalDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapMuskuloskeletalDao papMuskuloskeletalDao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPMuskuloskeletalDaoSave() {
|
|
||||||
PapMuskuloskeletal model = populateModel();
|
|
||||||
PapMuskuloskeletal resultModel=papMuskuloskeletalDao.save(model);
|
|
||||||
assertNotNull(resultModel);
|
|
||||||
// assertEquals(false, resultModel.getIsKelainanTulangAda());
|
|
||||||
// assertEquals(true, resultModel.getIsGerakanAnakBebas());
|
|
||||||
PapMuskuloskeletal resultModel2=papMuskuloskeletalDao.findOne(resultModel.getNoRec());
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
// assertEquals(false, resultModel2.getIsKelainanTulangAda());
|
|
||||||
// assertEquals(true, resultModel2.getIsGerakanAnakBebas());
|
|
||||||
resultModel2=populateModelUpdate();
|
|
||||||
PapMuskuloskeletal resultModelUpdate=papMuskuloskeletalDao.save(resultModel2);
|
|
||||||
assertNotNull(resultModelUpdate);
|
|
||||||
// assertEquals(true, resultModelUpdate.getIsKelainanTulangAda());
|
|
||||||
// assertEquals(false, resultModelUpdate.getIsGerakanAnakBebas());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapMuskuloskeletal populateModel() {
|
|
||||||
PapMuskuloskeletal model=new PapMuskuloskeletal();
|
|
||||||
// model.setIsKelainanTulangAda(false);
|
|
||||||
// model.setIsGerakanAnakBebas(true);
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapMuskuloskeletal populateModelUpdate() {
|
|
||||||
PapMuskuloskeletal model=new PapMuskuloskeletal();
|
|
||||||
// model.setIsKelainanTulangAda(true);
|
|
||||||
// model.setIsGerakanAnakBebas(false);
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPMuskuloskeletalDaoFindAll() {
|
|
||||||
PapMuskuloskeletal model = populateModel();
|
|
||||||
PapMuskuloskeletal resultModel1=papMuskuloskeletalDao.save(model);
|
|
||||||
PapMuskuloskeletal model2 = populateModel();
|
|
||||||
PapMuskuloskeletal resultModel2=papMuskuloskeletalDao.save(model2);
|
|
||||||
assertNotNull(resultModel1);
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
List<PapMuskuloskeletal> results = (List<PapMuskuloskeletal>) papMuskuloskeletalDao.findAll();
|
|
||||||
assertTrue(results.size() > 0);
|
|
||||||
assertNotNull(results);
|
|
||||||
assertTrue(results.size() == 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,88 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.dao.GenericViewDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapNeurologiDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapNeurologi;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapNeurologiDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private GenericViewDao genericViewDao;
|
|
||||||
@Autowired
|
|
||||||
private PapNeurologiDao papNeurologiDao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testGenericDaoSelect() {
|
|
||||||
GenericView kesadaran = populateGenericView("Kesadaran");
|
|
||||||
assertNotNull(kesadaran);
|
|
||||||
assertEquals("1", String.valueOf(kesadaran.getKdGenericView()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPNeurologiDaoSave() {
|
|
||||||
PapNeurologi model = populateModel();
|
|
||||||
PapNeurologi resultModel=papNeurologiDao.save(model);
|
|
||||||
assertNotNull(resultModel);
|
|
||||||
assertNotNull(resultModel.getKesadaran());
|
|
||||||
// assertEquals(true,resultModel.getIsGangguanNeorologis());
|
|
||||||
// assertEquals("1", String.valueOf(resultModel.getKesadaran().getKdGenericView()));
|
|
||||||
PapNeurologi resultModel2=papNeurologiDao.findOne(resultModel.getNoRec());
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
assertNotNull(resultModel2.getKesadaran());
|
|
||||||
// assertEquals("1", String.valueOf(resultModel2.getKesadaran().getKdGenericView()));
|
|
||||||
// assertEquals(true,resultModel.getIsGangguanNeorologis());
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapNeurologi populateModel() {
|
|
||||||
PapNeurologi model=new PapNeurologi();
|
|
||||||
GenericView kesadaran = populateGenericView("Kesadaran");
|
|
||||||
// model.setKesadaran(kesadaran);
|
|
||||||
// model.setIsGangguanNeorologis(true);
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GenericView populateGenericView(String previx) {
|
|
||||||
GenericView genericView=new GenericView();
|
|
||||||
List<GenericView> list=genericViewDao.findGenericViewByPrevix(previx);
|
|
||||||
for (GenericView gv:list) {
|
|
||||||
if(gv.getKdGenericView()==1){
|
|
||||||
genericView=gv;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return genericView;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPNeurologiDaoFindAll() {
|
|
||||||
PapNeurologi model1 = populateModel();
|
|
||||||
PapNeurologi resultModel1=papNeurologiDao.save(model1);
|
|
||||||
PapNeurologi model2 = populateModel();
|
|
||||||
PapNeurologi resultModel2=papNeurologiDao.save(model2);
|
|
||||||
assertNotNull(resultModel1);
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
List<PapNeurologi> results = (List<PapNeurologi>) papNeurologiDao.findAll();
|
|
||||||
assertTrue(results.size() > 0);
|
|
||||||
assertNotNull(results);
|
|
||||||
assertTrue(results.size() == 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,112 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.dao.GenericViewDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapPernapasanDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapPernapasan;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapPernapasanDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private GenericViewDao genericViewDao;
|
|
||||||
@Autowired
|
|
||||||
private PapPernapasanDao papPernapasanDao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testGenericDaoSelect() {
|
|
||||||
GenericView alatBantuNafas = populateGenericView("Alat bantu nafas");
|
|
||||||
assertNotNull(alatBantuNafas);
|
|
||||||
assertEquals("1", String.valueOf(alatBantuNafas.getKdGenericView()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPPernapasanDaoSave() {
|
|
||||||
PapPernapasan model = populateModel();
|
|
||||||
PapPernapasan resultModel=papPernapasanDao.save(model);
|
|
||||||
assertNotNull(resultModel);
|
|
||||||
assertNotNull(resultModel.getAlatBantuNafas());
|
|
||||||
// assertEquals("1", String.valueOf(resultModel.getAlatBantuNafas().getKdGenericView()));
|
|
||||||
/*
|
|
||||||
assertEquals(true,resultModel.getIsBentukDada());
|
|
||||||
assertEquals(true,resultModel.getIsIrama());
|
|
||||||
assertEquals(true,resultModel.getIsNafasKupingHidung());
|
|
||||||
assertEquals(true,resultModel.getIsPolaNapas());
|
|
||||||
assertEquals(true,resultModel.getIsRetraksiDada());
|
|
||||||
assertEquals(true,resultModel.getIsSianosis());
|
|
||||||
assertEquals(true,resultModel.getIsSuaraNapas());
|
|
||||||
*/
|
|
||||||
PapPernapasan resultModel2=papPernapasanDao.findOne(resultModel.getNoRec());
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
assertNotNull(resultModel2.getAlatBantuNafas());
|
|
||||||
// assertEquals("1", String.valueOf(resultModel2.getAlatBantuNafas().getKdGenericView()));
|
|
||||||
/*
|
|
||||||
assertEquals(true,resultModel2.getIsBentukDada());
|
|
||||||
assertEquals(true,resultModel2.getIsIrama());
|
|
||||||
assertEquals(true,resultModel2.getIsNafasKupingHidung());
|
|
||||||
assertEquals(true,resultModel2.getIsPolaNapas());
|
|
||||||
assertEquals(true,resultModel2.getIsRetraksiDada());
|
|
||||||
assertEquals(true,resultModel2.getIsSianosis());
|
|
||||||
assertEquals(true,resultModel2.getIsSuaraNapas());
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapPernapasan populateModel() {
|
|
||||||
PapPernapasan model=new PapPernapasan();
|
|
||||||
GenericView alatBantuNafas = populateGenericView("Alat bantu nafas");
|
|
||||||
// model.setAlatBantuNafas(alatBantuNafas);
|
|
||||||
/*
|
|
||||||
model.setIsBentukDada(true);
|
|
||||||
model.setIsIrama(true);
|
|
||||||
model.setIsNafasKupingHidung(true);
|
|
||||||
model.setIsPolaNapas(true);
|
|
||||||
model.setIsRetraksiDada(true);
|
|
||||||
model.setIsSianosis(true);
|
|
||||||
model.setIsSuaraNapas(true);
|
|
||||||
*/
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GenericView populateGenericView(String previx) {
|
|
||||||
GenericView genericView=new GenericView();
|
|
||||||
List<GenericView> list=genericViewDao.findGenericViewByPrevix(previx);
|
|
||||||
for (GenericView gv:list) {
|
|
||||||
if(gv.getKdGenericView()==1){
|
|
||||||
genericView=gv;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return genericView;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPPernapasanDaoFindAll() {
|
|
||||||
PapPernapasan model1 = populateModel();
|
|
||||||
PapPernapasan resultModel1=papPernapasanDao.save(model1);
|
|
||||||
PapPernapasan model2 = populateModel();
|
|
||||||
PapPernapasan resultModel2=papPernapasanDao.save(model2);
|
|
||||||
assertNotNull(resultModel1);
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
List<PapPernapasan> results = (List<PapPernapasan>) papPernapasanDao.findAll();
|
|
||||||
assertTrue(results.size() > 0);
|
|
||||||
assertNotNull(results);
|
|
||||||
assertTrue(results.size() == 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,131 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.dao.OrderPelayananDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapPernapasanDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapRencanaOrderRadiologiDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.RegistrasiPelayananPasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.StrukOrderDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
import com.jasamedika.medifirst2000.entities.OrderPelayanan;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapPernapasan;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapRencanaOrderRadiologi;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Produk;
|
|
||||||
import com.jasamedika.medifirst2000.entities.RegistrasiPelayananPasien;
|
|
||||||
import com.jasamedika.medifirst2000.entities.StrukOrder;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.ProdukVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapRadiologiDaoTest {
|
|
||||||
@Autowired
|
|
||||||
private OrderPelayananDao orderPelayananDao;
|
|
||||||
@Autowired
|
|
||||||
private StrukOrderDao strukOrderDao;
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
@Autowired
|
|
||||||
private PapRencanaOrderRadiologiDao papRencanaOrderRadiologiDao;
|
|
||||||
@Autowired
|
|
||||||
private RegistrasiPelayananPasienDao registrasiPelayananPasienDao;
|
|
||||||
private Pasien pasien;
|
|
||||||
private RegistrasiPelayananPasien registrasiPelayananPasien;
|
|
||||||
private Date date=new Date();
|
|
||||||
private String tgl="2016-06-23 ";
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindPasien() {
|
|
||||||
pasien=pasienDao.findOne(177);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("0000001",pasien.getNoCm());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindRegistrasiPelayananPasien() {
|
|
||||||
registrasiPelayananPasien=registrasiPelayananPasienDao.finByNoCm("0000001", (short)0, DateUtil.toDate(tgl));
|
|
||||||
assertNotNull(registrasiPelayananPasien);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testGenerateNoOrder() {
|
|
||||||
Integer abc=strukOrderDao.getCountByMonthAndYear(date);
|
|
||||||
System.out.println("OOOOOO : "+abc);
|
|
||||||
}
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testRadiologiSave() {
|
|
||||||
PapRencanaOrderRadiologi model=populateRencanaOrderRadiologi();
|
|
||||||
PapRencanaOrderRadiologi resultModel=papRencanaOrderRadiologiDao.save(model);
|
|
||||||
assertNotNull(resultModel);
|
|
||||||
assertNotNull(resultModel.getPasien());
|
|
||||||
assertEquals("0000001",resultModel.getPasien().getNoCm());
|
|
||||||
StrukOrder strukOrder=populateStrukOrder();
|
|
||||||
StrukOrder abc=strukOrderDao.save(strukOrder);
|
|
||||||
assertNotNull(abc);
|
|
||||||
assertEquals("11111",abc.getNoOrder());
|
|
||||||
Produk produk1=populateProduk("produk1");
|
|
||||||
OrderPelayanan orderPelayanan=populateOrderPelayanan();
|
|
||||||
orderPelayanan.setNoOrder(abc);
|
|
||||||
orderPelayanan.setProduk(produk1);
|
|
||||||
assertNotNull(produk1);
|
|
||||||
assertEquals("produk1",produk1.getNamaProduk());
|
|
||||||
OrderPelayanan abcd=orderPelayananDao.save(orderPelayanan);
|
|
||||||
assertNotNull(abcd);
|
|
||||||
assertNotNull(abcd.getProduk());
|
|
||||||
assertNotNull(abcd.getNoOrder());
|
|
||||||
assertEquals("produk1",abcd.getProduk().getNamaProduk());
|
|
||||||
resultModel.setStrukOrder(strukOrder);
|
|
||||||
assertNotNull(resultModel.getStrukOrder());
|
|
||||||
assertEquals("11111",resultModel.getStrukOrder().getNoOrder());
|
|
||||||
// model.setStrukOrder(strukOrder);
|
|
||||||
// for(ProdukVO produk:vo.getProdukSet()){
|
|
||||||
// Produk prod=produkConverter.transferVOToModel(produk, new Produk());
|
|
||||||
// produkDao.save(prod);
|
|
||||||
// orderPelayanan.setProduk(prod);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
private StrukOrder populateStrukOrder() {
|
|
||||||
StrukOrder model=new StrukOrder();
|
|
||||||
model.setNoOrder("11111");
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Produk populateProduk(String produk) {
|
|
||||||
Produk produk1=new Produk();
|
|
||||||
produk1.setId(1);
|
|
||||||
produk1.setNamaProduk(produk);
|
|
||||||
return produk1;
|
|
||||||
}
|
|
||||||
|
|
||||||
private OrderPelayanan populateOrderPelayanan() {
|
|
||||||
OrderPelayanan model=new OrderPelayanan();
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapRencanaOrderRadiologi populateRencanaOrderRadiologi() {
|
|
||||||
PapRencanaOrderRadiologi model=new PapRencanaOrderRadiologi();
|
|
||||||
model.setKeluhan("aaaaaaaaa");
|
|
||||||
model.setPasien(pasienDao.findOne(177));
|
|
||||||
model.setRegistrasiPelayananPasien(registrasiPelayananPasienDao.finByNoCm("0000001", (short)0, DateUtil.toDate(tgl)));
|
|
||||||
model.setTglInput(date);
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,103 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.dao.GenericViewDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapRiwayatKeluargaDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapRiwayatKeluarga;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapRiwayatKeluargaDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private GenericViewDao genericViewDao;
|
|
||||||
@Autowired
|
|
||||||
private PapRiwayatKeluargaDao papRiwayatKeluargaDao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testGenericDaoSelect() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPRiwayatKeluargaDaoSave() {
|
|
||||||
PapRiwayatKeluarga model = populateModel();
|
|
||||||
PapRiwayatKeluarga resultModel=papRiwayatKeluargaDao.save(model);
|
|
||||||
assertNotNull(resultModel);
|
|
||||||
assertEquals("1",resultModel.getNamaIbu());
|
|
||||||
assertEquals("1",resultModel.getUmurIbu());
|
|
||||||
assertEquals("1",resultModel.getBangsaIbu());
|
|
||||||
assertEquals("1",resultModel.getKesehatanIbu());
|
|
||||||
assertEquals("1",resultModel.getNamaAyah());
|
|
||||||
assertEquals("1",resultModel.getUmurAyah());
|
|
||||||
assertEquals("1",resultModel.getBangsaAyah());
|
|
||||||
assertEquals("1",resultModel.getKesehatanAyah());
|
|
||||||
assertEquals("1",resultModel.getAnakAnakLain());
|
|
||||||
PapRiwayatKeluarga resultModel2=papRiwayatKeluargaDao.findOne(resultModel.getNoRec());
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
assertEquals("1",resultModel.getNamaIbu());
|
|
||||||
assertEquals("1",resultModel.getUmurIbu());
|
|
||||||
assertEquals("1",resultModel.getBangsaIbu());
|
|
||||||
assertEquals("1",resultModel.getKesehatanIbu());
|
|
||||||
assertEquals("1",resultModel.getNamaAyah());
|
|
||||||
assertEquals("1",resultModel.getUmurAyah());
|
|
||||||
assertEquals("1",resultModel.getBangsaAyah());
|
|
||||||
assertEquals("1",resultModel.getKesehatanAyah());
|
|
||||||
assertEquals("1",resultModel.getAnakAnakLain());
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapRiwayatKeluarga populateModel() {
|
|
||||||
PapRiwayatKeluarga model=new PapRiwayatKeluarga();
|
|
||||||
model.setNamaIbu("1");
|
|
||||||
model.setUmurIbu("1");
|
|
||||||
model.setBangsaIbu("1");
|
|
||||||
model.setKesehatanIbu("1");
|
|
||||||
model.setNamaAyah("1");
|
|
||||||
model.setUmurAyah("1");
|
|
||||||
model.setBangsaAyah("1");
|
|
||||||
model.setKesehatanAyah("1");
|
|
||||||
model.setAnakAnakLain("1");
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GenericView populateGenericView(String previx) {
|
|
||||||
GenericView genericView=new GenericView();
|
|
||||||
List<GenericView> list=genericViewDao.findGenericViewByPrevix(previx);
|
|
||||||
for (GenericView gv:list) {
|
|
||||||
if(gv.getKdGenericView()==1){
|
|
||||||
genericView=gv;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return genericView;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPRiwayatKeluargaDaoFindAll() {
|
|
||||||
PapRiwayatKeluarga model1 = populateModel();
|
|
||||||
PapRiwayatKeluarga resultModel1=papRiwayatKeluargaDao.save(model1);
|
|
||||||
PapRiwayatKeluarga model2 = populateModel();
|
|
||||||
PapRiwayatKeluarga resultModel2=papRiwayatKeluargaDao.save(model2);
|
|
||||||
assertNotNull(resultModel1);
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
List<PapRiwayatKeluarga> results = (List<PapRiwayatKeluarga>) papRiwayatKeluargaDao.findAll();
|
|
||||||
assertTrue(results.size() > 0);
|
|
||||||
assertNotNull(results);
|
|
||||||
assertTrue(results.size() == 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,97 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.dao.GenericViewDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapRiwayatPsikososialDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapRiwayatPsikososialDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapRiwayatPsikososial;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapRiwayatPsikososialDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private GenericViewDao genericViewDao;
|
|
||||||
@Autowired
|
|
||||||
private PapRiwayatPsikososialDao papRiwayatPsikososialDao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testGenericDaoSelect() {
|
|
||||||
GenericView statusPsikologi = populateGenericView("Status Psikologi");
|
|
||||||
GenericView tempatTinggal = populateGenericView("Tempat Tinggal");
|
|
||||||
assertNotNull(statusPsikologi);
|
|
||||||
assertNotNull(tempatTinggal);
|
|
||||||
assertEquals("1", String.valueOf(statusPsikologi.getKdGenericView()));
|
|
||||||
assertEquals("1", String.valueOf(tempatTinggal.getKdGenericView()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPRiwayatPsikososialDaoSave() {
|
|
||||||
PapRiwayatPsikososial model = populateModel();
|
|
||||||
PapRiwayatPsikososial resultModel=papRiwayatPsikososialDao.save(model);
|
|
||||||
assertNotNull(resultModel);
|
|
||||||
// assertNotNull(resultModel.getStatusPsikologi());
|
|
||||||
// assertNotNull(resultModel.getTempatTinggal());
|
|
||||||
// assertEquals(true, resultModel.getIsHubunganPasien());
|
|
||||||
// assertEquals("1",resultModel.getKecenderunganLainnya());
|
|
||||||
PapRiwayatPsikososial resultModel2=papRiwayatPsikososialDao.findOne(resultModel.getNoRec());
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
// assertNotNull(resultModel2.getStatusPsikologi());
|
|
||||||
// assertNotNull(resultModel2.getTempatTinggal());
|
|
||||||
// assertEquals(true, resultModel2.getIsHubunganPasien());
|
|
||||||
// assertEquals("1",resultModel2.getKecenderunganLainnya());
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapRiwayatPsikososial populateModel() {
|
|
||||||
PapRiwayatPsikososial model=new PapRiwayatPsikososial();
|
|
||||||
GenericView statusPsikologi = populateGenericView("Status Psikologi");
|
|
||||||
GenericView tempatTinggal = populateGenericView("Tempat Tinggal");
|
|
||||||
// model.setStatusPsikologi(statusPsikologi);
|
|
||||||
// model.setTempatTinggal(tempatTinggal);
|
|
||||||
// model.setIsHubunganPasien(true);
|
|
||||||
// model.setKecenderunganLainnya("1");
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GenericView populateGenericView(String previx) {
|
|
||||||
GenericView genericView=new GenericView();
|
|
||||||
List<GenericView> list=genericViewDao.findGenericViewByPrevix(previx);
|
|
||||||
for (GenericView gv:list) {
|
|
||||||
if(gv.getKdGenericView()==1){
|
|
||||||
genericView=gv;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return genericView;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPRiwayatPsikososialDaoFindAll() {
|
|
||||||
PapRiwayatPsikososial model1 = populateModel();
|
|
||||||
PapRiwayatPsikososial resultModel1=papRiwayatPsikososialDao.save(model1);
|
|
||||||
PapRiwayatPsikososial model2 = populateModel();
|
|
||||||
PapRiwayatPsikososial resultModel2=papRiwayatPsikososialDao.save(model2);
|
|
||||||
assertNotNull(resultModel1);
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
List<PapRiwayatPsikososial> results = (List<PapRiwayatPsikososial>) papRiwayatPsikososialDao.findAll();
|
|
||||||
assertTrue(results.size() > 0);
|
|
||||||
assertNotNull(results);
|
|
||||||
assertTrue(results.size() == 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,118 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.dao.GenericViewDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PapSirkulasiDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapSirkulasi;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapSirkulasiDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private GenericViewDao genericViewDao;
|
|
||||||
@Autowired
|
|
||||||
private PapSirkulasiDao papSirkulasiDao;
|
|
||||||
/*
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testGenericDaoSelect() {
|
|
||||||
GenericView intensitasNadi = populateGenericView("Intensitas Nadi");
|
|
||||||
GenericView akral = populateGenericView("Akral");
|
|
||||||
GenericView crt = populateGenericView("CRT");
|
|
||||||
assertNotNull(intensitasNadi);
|
|
||||||
assertNotNull(akral);
|
|
||||||
assertNotNull(crt);
|
|
||||||
assertEquals("1", String.valueOf(intensitasNadi.getKdGenericView()));
|
|
||||||
assertEquals("1", String.valueOf(akral.getKdGenericView()));
|
|
||||||
assertEquals("1", String.valueOf(crt.getKdGenericView()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPSirkulasiDaoSave() {
|
|
||||||
PapSirkulasi model = populateModel();
|
|
||||||
PapSirkulasi resultModel=papSirkulasiDao.save(model);
|
|
||||||
assertNotNull(resultModel);
|
|
||||||
assertNotNull(resultModel.getIntensitasNadi());
|
|
||||||
assertNotNull(resultModel.getAkral());
|
|
||||||
assertNotNull(resultModel.getCrt());
|
|
||||||
assertEquals("1", String.valueOf(resultModel.getIntensitasNadi().getKdGenericView()));
|
|
||||||
assertEquals("1", String.valueOf(resultModel.getAkral().getKdGenericView()));
|
|
||||||
assertEquals("1", String.valueOf(resultModel.getCrt().getKdGenericView()));
|
|
||||||
assertEquals(true,resultModel.getIsSianosis());
|
|
||||||
assertEquals(true,resultModel.getIsPucat());
|
|
||||||
assertEquals(true,resultModel.getIsIramaNadi());
|
|
||||||
assertEquals(true,resultModel.getIsEdema());
|
|
||||||
assertEquals(true,resultModel.getIsClubbingFinger());
|
|
||||||
PapSirkulasi resultModel2=papSirkulasiDao.findOne(resultModel.getNoRec());
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
assertNotNull(resultModel2.getIntensitasNadi());
|
|
||||||
assertNotNull(resultModel2.getAkral());
|
|
||||||
assertNotNull(resultModel2.getCrt());
|
|
||||||
assertEquals("1", String.valueOf(resultModel2.getIntensitasNadi().getKdGenericView()));
|
|
||||||
assertEquals("1", String.valueOf(resultModel2.getAkral().getKdGenericView()));
|
|
||||||
assertEquals("1", String.valueOf(resultModel2.getCrt().getKdGenericView()));
|
|
||||||
assertEquals(true,resultModel.getIsSianosis());
|
|
||||||
assertEquals(true,resultModel.getIsPucat());
|
|
||||||
assertEquals(true,resultModel.getIsIramaNadi());
|
|
||||||
assertEquals(true,resultModel.getIsEdema());
|
|
||||||
assertEquals(true,resultModel.getIsClubbingFinger());
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapSirkulasi populateModel() {
|
|
||||||
PapSirkulasi model=new PapSirkulasi();
|
|
||||||
GenericView intensitasNadi = populateGenericView("Intensitas Nadi");
|
|
||||||
GenericView akral = populateGenericView("Akral");
|
|
||||||
GenericView crt = populateGenericView("CRT");
|
|
||||||
model.setIntensitasNadi(intensitasNadi);
|
|
||||||
model.setAkral(akral);
|
|
||||||
model.setCrt(crt);
|
|
||||||
model.setIsSianosis(true);
|
|
||||||
model.setIsPucat(true);
|
|
||||||
model.setIsIramaNadi(true);
|
|
||||||
model.setIsEdema(true);
|
|
||||||
model.setIsClubbingFinger(true);
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GenericView populateGenericView(String previx) {
|
|
||||||
GenericView genericView=new GenericView();
|
|
||||||
List<GenericView> list=genericViewDao.findGenericViewByPrevix(previx);
|
|
||||||
for (GenericView gv:list) {
|
|
||||||
if(gv.getKdGenericView()==1){
|
|
||||||
genericView=gv;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return genericView;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPAPSirkulasiDaoFindAll() {
|
|
||||||
PapSirkulasi model1 = populateModel();
|
|
||||||
PapSirkulasi resultModel1=papSirkulasiDao.save(model1);
|
|
||||||
PapSirkulasi model2 = populateModel();
|
|
||||||
PapSirkulasi resultModel2=papSirkulasiDao.save(model2);
|
|
||||||
assertNotNull(resultModel1);
|
|
||||||
assertNotNull(resultModel2);
|
|
||||||
List<PapSirkulasi> results = (List<PapSirkulasi>) papSirkulasiDao.findAll();
|
|
||||||
assertTrue(results.size() > 0);
|
|
||||||
assertNotNull(results);
|
|
||||||
assertTrue(results.size() == 2);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
@ -1,121 +0,0 @@
|
|||||||
//package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
//
|
|
||||||
//import static org.junit.Assert.assertEquals;
|
|
||||||
//import static org.junit.Assert.assertNotNull;
|
|
||||||
//
|
|
||||||
///**Agama Class Test
|
|
||||||
// */
|
|
||||||
//
|
|
||||||
//import static org.junit.Assert.assertNull;
|
|
||||||
//
|
|
||||||
//import java.util.ArrayList;
|
|
||||||
//import java.util.Date;
|
|
||||||
//import java.util.List;
|
|
||||||
//
|
|
||||||
//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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
//
|
|
||||||
//import com.jasamedika.medifirst2000.entities.GenericView;
|
|
||||||
//import com.jasamedika.medifirst2000.entities.PapAlergi;
|
|
||||||
//import com.jasamedika.medifirst2000.entities.PapSkriningGizi;
|
|
||||||
//import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
//import com.jasamedika.medifirst2000.entities.RegistrasiPelayananPasien;
|
|
||||||
//import com.jasamedika.medifirst2000.dao.GenericViewDao;
|
|
||||||
//import com.jasamedika.medifirst2000.dao.PapSkriningGiziDao;
|
|
||||||
//import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
//
|
|
||||||
//@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
//@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
//public class PapSkriningGiziDaoTest {
|
|
||||||
//
|
|
||||||
// @Autowired
|
|
||||||
// private PapSkriningGiziDao papSkriningGiziDao;
|
|
||||||
//
|
|
||||||
// @Autowired
|
|
||||||
// private PasienDao pasienDao;
|
|
||||||
//
|
|
||||||
// @Test
|
|
||||||
// @Transactional
|
|
||||||
// public void testPapSkriningGiziDaoSave(){
|
|
||||||
// PapSkriningGizi model = populateModel();
|
|
||||||
// PapSkriningGizi result = papSkriningGiziDao.save(model);
|
|
||||||
//
|
|
||||||
// /* Cek Hasil save */
|
|
||||||
// assertNotNull(result);
|
|
||||||
// assertEquals(String.valueOf(result.getBeratBadan()),String.valueOf((float)60));
|
|
||||||
// assertEquals(String.valueOf(result.getLingkarKepala()),String.valueOf((float)50));
|
|
||||||
// assertEquals(String.valueOf(result.getTinggiBadan()),String.valueOf((float)170));
|
|
||||||
// assertNotNull(result.getTglInput());
|
|
||||||
// assertEquals(result.getRegistrasiPelayananPasien().getNamaTempatTujuan(),"Tujuan");
|
|
||||||
// assertEquals(result.getPasien().getNamaPasien(),"adik");
|
|
||||||
//
|
|
||||||
// /*Cek Model di Database*/
|
|
||||||
// PapSkriningGizi resultSelect = papSkriningGiziDao.findOne(model.getNoRec());
|
|
||||||
// assertNotNull(resultSelect);
|
|
||||||
// assertEquals(String.valueOf(resultSelect.getBeratBadan()),String.valueOf((float)60));
|
|
||||||
// assertEquals(String.valueOf(resultSelect.getLingkarKepala()),String.valueOf((float)50));
|
|
||||||
// assertEquals(String.valueOf(resultSelect.getTinggiBadan()),String.valueOf((float)170));
|
|
||||||
// assertNotNull(resultSelect.getTglInput());
|
|
||||||
// assertEquals(resultSelect.getRegistrasiPelayananPasien().getNamaTempatTujuan(),"Tujuan");
|
|
||||||
// assertEquals(resultSelect.getPasien().getNamaPasien(),"adik");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Test
|
|
||||||
// @Transactional
|
|
||||||
// public void testPapSkriningGiziDaoUpdate(){
|
|
||||||
// PapSkriningGizi model = populateModel();
|
|
||||||
// PapSkriningGizi result = papSkriningGiziDao.save(model);
|
|
||||||
// assertNotNull(result);
|
|
||||||
//
|
|
||||||
// /*Proses Update*/
|
|
||||||
// result.setBeratBadan((float) 100);
|
|
||||||
// result.setLingkarKepala((float) 40);
|
|
||||||
// result.setTinggiBadan((float) 175);
|
|
||||||
// result.getPasien().setNamaPasien("Nama Update");
|
|
||||||
// result.getRegistrasiPelayananPasien().setNamaTempatTujuan("Tujuan Update");
|
|
||||||
// papSkriningGiziDao.save(result);
|
|
||||||
//
|
|
||||||
// /*Cek Hasil Update*/
|
|
||||||
// PapSkriningGizi resultSelect = papSkriningGiziDao.findOne(model.getNoRec());
|
|
||||||
// assertNotNull(resultSelect);
|
|
||||||
// assertEquals(String.valueOf(resultSelect.getBeratBadan()),String.valueOf((float)100));
|
|
||||||
// assertEquals(String.valueOf(resultSelect.getLingkarKepala()),String.valueOf((float)40));
|
|
||||||
// assertEquals(String.valueOf(resultSelect.getTinggiBadan()),String.valueOf((float)175));
|
|
||||||
// assertNotNull(resultSelect.getTglInput());
|
|
||||||
// assertEquals(resultSelect.getRegistrasiPelayananPasien().getNamaTempatTujuan(),"Tujuan Update");
|
|
||||||
// assertEquals(resultSelect.getPasien().getNamaPasien(),"Nama Update");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Test
|
|
||||||
// @Transactional
|
|
||||||
// public void testPapSkriningGiziDaoDelete(){
|
|
||||||
// PapSkriningGizi model = populateModel();
|
|
||||||
// papSkriningGiziDao.save(model);
|
|
||||||
//
|
|
||||||
// PapSkriningGizi resultModel1 = papSkriningGiziDao.findOne(model.getNoRec());
|
|
||||||
// /*Cek Model di Database*/
|
|
||||||
// assertNotNull(resultModel1);
|
|
||||||
//
|
|
||||||
// papSkriningGiziDao.delete(model);
|
|
||||||
// PapSkriningGizi resultModel2 = papSkriningGiziDao.findOne(model.getNoRec());
|
|
||||||
// /*Cek Hasil Delete Model*/
|
|
||||||
// assertNull(resultModel2);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public PapSkriningGizi populateModel(){
|
|
||||||
// PapSkriningGizi model = new PapSkriningGizi();
|
|
||||||
// Pasien pasien = pasienDao.findOne(393);
|
|
||||||
// model.setPasien(pasien);
|
|
||||||
// model.setRegistrasiPelayananPasien(new RegistrasiPelayananPasien());
|
|
||||||
// model.getRegistrasiPelayananPasien().setNamaTempatTujuan("Tujuan");
|
|
||||||
// model.setTglInput(new Date());
|
|
||||||
// model.setTinggiBadan((float)170);
|
|
||||||
// model.setBeratBadan((float)60);
|
|
||||||
// model.setLingkarKepala((float) 50);
|
|
||||||
// return model;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
/**Agama Class Test
|
|
||||||
*/
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
|
|
||||||
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.jasamedika.medifirst2000.dao.PasienMDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
|
|
||||||
//@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
//@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PasienDaoTest {
|
|
||||||
|
|
||||||
// @Autowired
|
|
||||||
private PasienMDao dao;
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
public void testFindById() {
|
|
||||||
Pasien result = dao.findOne(1);
|
|
||||||
// System.out.println(result.getAlamats().size());
|
|
||||||
// assertNotNull(result.getAlamats());
|
|
||||||
assertNotNull(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
/**RuanganMDao Class Test
|
|
||||||
*/
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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.jasamedika.medifirst2000.dao.RuanganMDao;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class RuanganMDaoTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RuanganMDao dao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testNativeQuery() {
|
|
||||||
List<Object[]> result = dao.getNativeNamaKelas();
|
|
||||||
assertNull(result);
|
|
||||||
|
|
||||||
List<Object[]> result2 = dao.getNativeNamaRuangan("25", "26");
|
|
||||||
assertNull(result2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,101 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.dao.test;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.TreeMap;
|
|
||||||
|
|
||||||
import org.apache.commons.lang.time.DateUtils;
|
|
||||||
import org.apache.poi.hssf.usermodel.HSSFRow;
|
|
||||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|
||||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
||||||
import org.apache.poi.ss.usermodel.Cell;
|
|
||||||
import org.apache.poi.ss.usermodel.CellStyle;
|
|
||||||
import org.apache.poi.ss.usermodel.Font;
|
|
||||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
|
||||||
import org.apache.poi.ss.util.CellRangeAddress;
|
|
||||||
|
|
||||||
public class Testing {
|
|
||||||
public static void main(String[] args) throws IOException {// Create
|
|
||||||
// blank
|
|
||||||
// workbook
|
|
||||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
|
||||||
// Create a blank sheet
|
|
||||||
HSSFSheet spreadsheet = workbook.createSheet(" Employee Info ");
|
|
||||||
// Create row object
|
|
||||||
HSSFRow row;
|
|
||||||
// This data needs to be written (Object[])
|
|
||||||
Map<String, Object[]> empinfo = new TreeMap<String, Object[]>();
|
|
||||||
|
|
||||||
CellStyle style = workbook.createCellStyle();
|
|
||||||
style.setFillForegroundColor(IndexedColors.AQUA.getIndex());
|
|
||||||
style.setFillPattern(CellStyle.SOLID_FOREGROUND);
|
|
||||||
Font font = workbook.createFont();
|
|
||||||
font.setColor(IndexedColors.BLACK.getIndex());
|
|
||||||
font.setBold(true);
|
|
||||||
style.setFont(font);
|
|
||||||
style.setWrapText(true);
|
|
||||||
|
|
||||||
CellStyle styleIsi = workbook.createCellStyle();
|
|
||||||
Font fontIsi = workbook.createFont();
|
|
||||||
fontIsi.setColor(IndexedColors.BLACK.getIndex());
|
|
||||||
fontIsi.setBold(false);
|
|
||||||
fontIsi.setFontName("Arial");
|
|
||||||
fontIsi.setFontHeightInPoints((short)8);
|
|
||||||
styleIsi.setFont(fontIsi);
|
|
||||||
styleIsi.setWrapText(true);
|
|
||||||
|
|
||||||
empinfo.put("01", new Object[] { "", "LAMPIRAN SURAT PENAWARAN HARGA OBAT TAHUN 2016 ", "", "" });
|
|
||||||
empinfo.put("02", new Object[] { "", "TAHUN 2016", "", "" });
|
|
||||||
empinfo.put("03", new Object[] { "", "EMP ID", "EMP NAME", "DESIGNATION" });
|
|
||||||
empinfo.put("04", new Object[] { "", "tp01", "Gopal", "Technical Manager" });
|
|
||||||
empinfo.put("05", new Object[] { "", "tp02", "Manisha", "Proof Reader" });
|
|
||||||
empinfo.put("06", new Object[] { "", "tp03", "Masthan", "Technical Writer" });
|
|
||||||
empinfo.put("07", new Object[] { "", "tp04", "Satish", "Technical Writer" });
|
|
||||||
empinfo.put("08", new Object[] { "", "tp05", "Krishna", "Technical Writer" });
|
|
||||||
empinfo.put("09", new Object[] { "", "tp06", "Krishna", "Technical Writer" });
|
|
||||||
empinfo.put("10", new Object[] { "", "tp07", "Krishna", "Technical Writer" });
|
|
||||||
empinfo.put("11", new Object[] { "", "tp08", "Krishna", "Technical Writer" });
|
|
||||||
empinfo.put("12", new Object[] { "", "tp09", "Krishna", "Technical Writer" });
|
|
||||||
empinfo.put("13", new Object[] { "", "tp10", "Krishna", "Technical Writer" });
|
|
||||||
empinfo.put("14", new Object[] { "", "tp11", "Krishna", "Technical Writer" });
|
|
||||||
empinfo.put("15", new Object[] { "", "tp12", "Krishna", "Technical Writer" });
|
|
||||||
empinfo.put("16", new Object[] { "", "tp13", "Krishna", "Technical Writer" });
|
|
||||||
|
|
||||||
// Iterate over data and write to sheet
|
|
||||||
Set<String> keyid = empinfo.keySet();
|
|
||||||
int rowid = 0;
|
|
||||||
for (String key : keyid) {
|
|
||||||
row = spreadsheet.createRow(rowid++);
|
|
||||||
Object[] objectArr = empinfo.get(key);
|
|
||||||
int cellid = 0;
|
|
||||||
for (Object obj : objectArr) {
|
|
||||||
|
|
||||||
Cell cell = row.createCell(cellid++);
|
|
||||||
if(key.equalsIgnoreCase("03") && cellid!=1){
|
|
||||||
System.out.println(cellid);
|
|
||||||
cell.setCellStyle(style);
|
|
||||||
|
|
||||||
}else{
|
|
||||||
cell.setCellStyle(styleIsi);
|
|
||||||
}
|
|
||||||
cell.setCellValue((String) obj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
spreadsheet.setColumnWidth(0, 1000);
|
|
||||||
spreadsheet.setColumnWidth(1, 7500);
|
|
||||||
spreadsheet.setColumnWidth(2, 7500);
|
|
||||||
spreadsheet.setColumnWidth(3, 7500);
|
|
||||||
spreadsheet.addMergedRegion(new CellRangeAddress(0, 0, 1, 4));
|
|
||||||
// Write the workbook in file system
|
|
||||||
FileOutputStream out = new FileOutputStream(new File("d:/Writesheet.xls"));
|
|
||||||
workbook.write(out);
|
|
||||||
out.close();
|
|
||||||
System.out.println("d:/Writesheet.xlsx written successfully");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.logging;
|
|
||||||
|
|
||||||
/**Simple Logging Class Test
|
|
||||||
*/
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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.jasamedika.medifirst2000.logging.dao.LoggingJdbcDaoImpl;
|
|
||||||
import com.jasamedika.medifirst2000.logging.entities.Logging;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class SimpleLoggingTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private LoggingJdbcDaoImpl loggingJdbcDaoImpl;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testCreate() {
|
|
||||||
loggingJdbcDaoImpl.create("nama", "deskripsi");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testUpdate() {
|
|
||||||
loggingJdbcDaoImpl.update(1, "nama xxx", "deskripsi xxx");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testDelete() {
|
|
||||||
loggingJdbcDaoImpl.delete(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testGetAll() {
|
|
||||||
List<Logging> results = loggingJdbcDaoImpl.listLoggings();
|
|
||||||
assertNotNull(results);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testGetById() {
|
|
||||||
Logging result = loggingJdbcDaoImpl.getLogging(2);
|
|
||||||
assertNotNull(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.entities.RIS_Order;
|
|
||||||
import com.jasamedika.medifirst2000.service.impl.RIS_OrderServiceImpl;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class AgamaServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RIS_OrderServiceImpl agamaService;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAdd() {
|
|
||||||
RIS_Order order = new RIS_Order();
|
|
||||||
order.setORDER_KEY(1);
|
|
||||||
order.setCREATE_DATE("");
|
|
||||||
order.setFLAG("");
|
|
||||||
order.setPATIENT_ID("");
|
|
||||||
order.setPATIENT_NAME("");
|
|
||||||
order.setPATIENT_UID("");
|
|
||||||
order.setLAST_NAME("");
|
|
||||||
order.setFIRST_NAME("");
|
|
||||||
order.setMIDDLE_NAME("");
|
|
||||||
order.setAETITLE("");
|
|
||||||
order.setSTUDY_RESERV_DATE("");
|
|
||||||
order.setORDER_MODALITY("");
|
|
||||||
order.setACCESSION_NUM("");
|
|
||||||
order.setORDER_STATUS("");
|
|
||||||
order.setORDER_CODE("");
|
|
||||||
order.setORDER_NAME("");
|
|
||||||
order.setORDER_REASON("");
|
|
||||||
order.setSTUDY_REMARK("");
|
|
||||||
order.setORDER_BODYPART("");
|
|
||||||
order.setCHARGE_DOC_ID("");
|
|
||||||
order.setCHARGE_DOC_NAME("");
|
|
||||||
order.setCONSULT_DOC_ID("");
|
|
||||||
order.setCONSULT_DOC_NAME("");
|
|
||||||
order.setORDER_DEPT("");
|
|
||||||
order.setORDER_DATE("");
|
|
||||||
order.setORDER_NO("");
|
|
||||||
order.setPATIENT_IO("");
|
|
||||||
order.setPATIENT_WARD("");
|
|
||||||
order.setIO_DATE("");
|
|
||||||
order.setPATIENT_BIRTH_DATE("");
|
|
||||||
order.setPATIENT_SEX("l");
|
|
||||||
order.setORDER_DIAG("");
|
|
||||||
order.setPATIENT_BLOOD("");
|
|
||||||
order.setORDER_CNT(0);
|
|
||||||
order.setGROUP1("");
|
|
||||||
order.setGROUP2("");
|
|
||||||
order.setGROUP3("");
|
|
||||||
order.setORDER_COMMENT("");
|
|
||||||
order.setEXTENSION1("");
|
|
||||||
order.setEXTENSION2("");
|
|
||||||
order.setEXTENSION3("");
|
|
||||||
order.setEXTENSION4("");
|
|
||||||
order.setEXTENSION5("");
|
|
||||||
order.setEXTENSION6("");
|
|
||||||
order.setEXTENSION7("");
|
|
||||||
order.setEXTENSION8("");
|
|
||||||
order.setEXTENSION9("");
|
|
||||||
order.setEXTENSION10("");
|
|
||||||
agamaService.save(order);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,69 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.dto.TPatient;
|
|
||||||
import com.jasamedika.medifirst2000.service.PacsService;
|
|
||||||
import com.jasamedika.medifirst2000.service.impl.PacsServiceImpl;
|
|
||||||
|
|
||||||
public class PacsServiceImplTest {
|
|
||||||
|
|
||||||
static PacsService test = new PacsServiceImpl();
|
|
||||||
|
|
||||||
public static void main(String[]args){
|
|
||||||
insert();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void insert(){
|
|
||||||
TPatient tPatient = new TPatient();
|
|
||||||
tPatient.setFLAG("Y");
|
|
||||||
tPatient.setINSTITUTION_KEY(new BigDecimal(1));
|
|
||||||
tPatient.setLAST_STUDYDATE("211198");
|
|
||||||
tPatient.setPATIENT_AGE("020Y");
|
|
||||||
tPatient.setPATIENT_BIRTH_DATE("20-11-88");
|
|
||||||
tPatient.setPATIENT_ID("NOCM.001");
|
|
||||||
tPatient.setPATIENT_IO("I");
|
|
||||||
tPatient.setPATIENT_KEY(new BigDecimal(2));
|
|
||||||
tPatient.setPATIENT_NAME("REZA FAUZAN");
|
|
||||||
tPatient.setPATIENT_SEX("M");
|
|
||||||
test.insert(tPatient);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void update(){
|
|
||||||
TPatient tPatient = new TPatient();
|
|
||||||
tPatient.setFLAG("Y");
|
|
||||||
tPatient.setINSTITUTION_KEY(new BigDecimal(1));
|
|
||||||
tPatient.setLAST_STUDYDATE("211198");
|
|
||||||
tPatient.setPATIENT_AGE("020Y");
|
|
||||||
tPatient.setPATIENT_BIRTH_DATE("20-11-88");
|
|
||||||
tPatient.setPATIENT_ID("NOCM.001");
|
|
||||||
tPatient.setPATIENT_IO("I");
|
|
||||||
tPatient.setPATIENT_KEY(new BigDecimal(2));
|
|
||||||
tPatient.setPATIENT_NAME("ELISA");
|
|
||||||
tPatient.setPATIENT_SEX("M");
|
|
||||||
test.update(tPatient);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void delete(){
|
|
||||||
test.delete("NOCM.001");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void getOne(){
|
|
||||||
TPatient tPatient = test.getOne("NOCM.001");
|
|
||||||
System.out.println(
|
|
||||||
tPatient.getPATIENT_KEY()+"\n"+
|
|
||||||
tPatient.getPATIENT_NAME()+"\n"+
|
|
||||||
tPatient.getPATIENT_ID());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void getAll(){
|
|
||||||
List<TPatient> tPatients = test.getAll();
|
|
||||||
for(TPatient tPatient : tPatients)
|
|
||||||
System.out.println(
|
|
||||||
tPatient.getPATIENT_KEY()+"\n"+
|
|
||||||
tPatient.getPATIENT_NAME()+"\n"+
|
|
||||||
tPatient.getPATIENT_ID()+"\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,143 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapAlergi;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapAlergiService;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapSkriningNyeriService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.AlergiVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapAlergiVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapAlergiServiceImplTest {/*
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapAlergiService papAlergiService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddAlergi() {
|
|
||||||
PapAlergiVO vo = populateModel();
|
|
||||||
Map<String,Object> result = papAlergiService.addAlergi(vo);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapAlergi papAlergi = (PapAlergi) result.get("papAlergi");
|
|
||||||
assertEquals("ALEGI SAMPO",papAlergi.getAlergi().getNamaAlergi());
|
|
||||||
assertEquals("Keterangan",papAlergi.getKeteranganData());
|
|
||||||
assertEquals("Reaksi",papAlergi.getReaksi());
|
|
||||||
assertEquals(generateDate(),papAlergi.getTglInput());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateAlergi() {
|
|
||||||
PapAlergiVO vo = populateModel();
|
|
||||||
Map<String,Object> result = papAlergiService.addAlergi(vo);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapAlergiVO voUpdate = populateModel();
|
|
||||||
voUpdate.setKeteranganData("Keterangan Update");
|
|
||||||
voUpdate.setReaksi("Reaksi Update");
|
|
||||||
Map<String,Object> resultUpdate = papAlergiService.addAlergi(voUpdate);
|
|
||||||
assertNotNull(resultUpdate);
|
|
||||||
PapAlergi papAlergi = (PapAlergi) resultUpdate.get("papAlergi");
|
|
||||||
assertEquals("Keterangan Update",papAlergi.getKeteranganData());
|
|
||||||
assertEquals("Reaksi Update",papAlergi.getReaksi());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
Map<String,Object> result = papAlergiService.findByNoCmAndTglInput("000001", DateUtil.toDate("2013-06-07 12:10:56"));
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindRegistrasiPelayananPasienByNoCmAndTglRegistrasi() {
|
|
||||||
Map<String,Object> result = papAlergiService.findRegistrasiPelayananPasienByNoCmAndTglRegistrasi("000001",(short) 0, DateUtil.toDate("2013-06-07 12:10:56"));
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindPasienByNoCm() {
|
|
||||||
Map<String,Object> result = papAlergiService.findPasienByNoCm("000001");
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPopulateModel(){
|
|
||||||
Cek Pasien Dao
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
|
|
||||||
Cek Pasien Converter
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
|
|
||||||
PapAlergiVO vo = populateModel();
|
|
||||||
assertEquals("ALEGI SAMPO",vo.getAlergi().getNamaAlergi());
|
|
||||||
assertEquals("Keterangan",vo.getKeteranganData());
|
|
||||||
assertEquals("Reaksi",vo.getReaksi());
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapAlergiVO populateModel(){
|
|
||||||
PapAlergiVO vo = new PapAlergiVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
AlergiVO alergiVO = new AlergiVO();
|
|
||||||
alergiVO.setId(1);
|
|
||||||
alergiVO.setNamaAlergi("ALEGI SAMPO");
|
|
||||||
vo.setPasien(pasienVO);
|
|
||||||
vo.setAlergi(alergiVO);
|
|
||||||
vo.setTglInput(generateDate());
|
|
||||||
vo.setKeteranganData("Keterangan");
|
|
||||||
vo.setReaksi("Reaksi");
|
|
||||||
return vo;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate(){
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 12:10:56 PM";
|
|
||||||
|
|
||||||
Date date = null;
|
|
||||||
try {
|
|
||||||
date = formatter.parse(dateInString);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
*/}
|
|
||||||
@ -1,144 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapAnamesis;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapAnamesisService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapAnamesisVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapAnamesisServiceImplTest {
|
|
||||||
@Autowired
|
|
||||||
private PapAnamesisService papAnamesisService;
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddAnamesis() throws ParseException {
|
|
||||||
PapAnamesisVO papAnamesisVO = populateModelVO();
|
|
||||||
assertNotNull(papAnamesisVO);
|
|
||||||
Map<String,Object> result = papAnamesisService.addAnamesis(papAnamesisVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
assertEquals("Setyo Wibudi",((PapAnamesis) result.get("papAnamesis")).getPasien().getNamaPasien());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateAnamesis() throws ParseException {
|
|
||||||
PapAnamesisVO papAnamesisVO = populateModelVO();
|
|
||||||
Map<String,Object> result = papAnamesisService.addAnamesis(papAnamesisVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapAnamesisVO papAnamesisVOUpdate = populateModelVOUpdate();
|
|
||||||
papAnamesisVOUpdate.setNoRec(((PapAnamesis) result.get("papAnamesis")).getNoRec());
|
|
||||||
assertNotNull(papAnamesisVOUpdate);
|
|
||||||
assertEquals(papAnamesisVOUpdate.getNoRec(),((PapAnamesis) result.get("papAnamesis")).getNoRec());
|
|
||||||
|
|
||||||
Map<String,Object> resultUpdate = papAnamesisService.addAnamesis(papAnamesisVOUpdate);
|
|
||||||
assertEquals(false,((PapAnamesis) resultUpdate.get("papAnamesis")).getStatusEnabled());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
String noCm = "000001";
|
|
||||||
String tglInput = "2016-07-17 02:12:03";
|
|
||||||
Map<String,Object> result = papAnamesisService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindByNoCmAndTglRegistrasi() {
|
|
||||||
String noCm = "000001";
|
|
||||||
String tglRegistrasi = "2016-07-17 02:12:03";
|
|
||||||
//Map<String,Object> result = papAnamesisService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
Map<String,Object> result = papAnamesisService.findRegistrasiPelayananPasienByNoCmAndTglRegistrasi(noCm,(short) 0, DateUtil.toDate(tglRegistrasi));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindPasienByNoCm() {
|
|
||||||
String noCm = "000000000000002";
|
|
||||||
Map<String,Object> result = papAnamesisService.findPasienByNoCm(noCm);
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private PapAnamesisVO populateModelVO() throws ParseException{
|
|
||||||
PapAnamesisVO papAnamesisVO = new PapAnamesisVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
papAnamesisVO.setPasien(pasienVO);
|
|
||||||
papAnamesisVO.setTglInput(generateDate());
|
|
||||||
papAnamesisVO.setStatusEnabled(true);
|
|
||||||
|
|
||||||
return papAnamesisVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapAnamesisVO populateModelVOUpdate() throws ParseException{
|
|
||||||
PapAnamesisVO papAnamesisVO = new PapAnamesisVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
papAnamesisVO.setTglInput(generateDate());
|
|
||||||
papAnamesisVO.setPasien(pasienVO);
|
|
||||||
papAnamesisVO.setStatusEnabled(false);
|
|
||||||
|
|
||||||
return papAnamesisVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testPopulate() throws ParseException{
|
|
||||||
/*Cek Method Populate*/
|
|
||||||
PapAnamesisVO papAnamesisVO = populateModelVO();
|
|
||||||
assertNotNull(papAnamesisVO);
|
|
||||||
|
|
||||||
|
|
||||||
/*Cek Dao*/
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Converter*/
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate() throws ParseException{
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 11:40:39 PM";
|
|
||||||
|
|
||||||
Date date = formatter.parse(dateInString);
|
|
||||||
return date;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,181 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.validation.constraints.AssertTrue;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.converter.RuanganConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.RuanganDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapBedah;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Ruangan;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapBedahService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapBedahVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.RuanganVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapBedahServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapBedahService papBedahService;
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
@Autowired
|
|
||||||
private RuanganDao ruanganDao;
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
@Autowired
|
|
||||||
private RuanganConverter ruanganConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddBedah() throws ParseException {
|
|
||||||
PapBedahVO papBedahVO = populateModelVO();
|
|
||||||
assertNotNull(papBedahVO);
|
|
||||||
Map<String,Object> result = papBedahService.addBedah(papBedahVO);
|
|
||||||
//assertEquals("10",((PapBedah) result.get("papBedah")).getStrukOrder().getRuangan().getId());
|
|
||||||
assertEquals("Setyo Wibudi",((PapBedah) result.get("papBedah")).getPasien().getNamaPasien());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testRuangan() throws ParseException {
|
|
||||||
PapBedahVO papBedahVO = populateModelVO();
|
|
||||||
assertNotNull(papBedahVO.getRuangan());
|
|
||||||
assertEquals("10", String.valueOf(papBedahVO.getRuangan().getId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateBedah() throws ParseException {
|
|
||||||
PapBedahVO papBedahVO = populateModelVO();
|
|
||||||
Map<String,Object> result = papBedahService.addBedah(papBedahVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapBedahVO papBedahVOUpdate = populateModelVOUpdate();
|
|
||||||
papBedahVOUpdate.setNoRec(((PapBedah) result.get("papBedah")).getNoRec());
|
|
||||||
assertNotNull(papBedahVOUpdate);
|
|
||||||
assertEquals(papBedahVOUpdate.getNoRec(),((PapBedah) result.get("papBedah")).getNoRec());
|
|
||||||
|
|
||||||
Map<String,Object> resultUpdate = papBedahService.addBedah(papBedahVO);
|
|
||||||
assertEquals(false,((PapBedah) resultUpdate.get("papBedah")).getStatusEnabled());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
String noCm = "000000000000002";
|
|
||||||
String tglInput = "2016-06-19 14:45:36";
|
|
||||||
Map<String,Object> result = papBedahService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindByNoCmAndTglRegistrasi() {
|
|
||||||
String noCm = "000000000000002";
|
|
||||||
String tglRegistrasi = "2016-07-17 02:12:03";
|
|
||||||
//Map<String,Object> result = papBedahService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
Map<String,Object> result = papBedahService.findRegistrasiPelayananPasienByNoCmAndTglRegistrasi(noCm,(short) 0, DateUtil.toDate(tglRegistrasi));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindPasienByNoCm() {
|
|
||||||
String noCm = "000000000000002";
|
|
||||||
Map<String,Object> result = papBedahService.findPasienByNoCm(noCm);
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private PapBedahVO populateModelVO() throws ParseException{
|
|
||||||
PapBedahVO papBedahVO = new PapBedahVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
papBedahVO.setPasien(pasienVO);
|
|
||||||
|
|
||||||
Ruangan ruangan = ruanganDao.findOne(10);
|
|
||||||
RuanganVO ruanganVO = ruanganConverter.transferModelToVO(ruangan,new RuanganVO());
|
|
||||||
papBedahVO.setRuangan(ruanganVO);
|
|
||||||
papBedahVO.setRuanganTujuan(ruanganVO);
|
|
||||||
papBedahVO.setTglInput(generateDate());
|
|
||||||
papBedahVO.setStatusEnabled(true);
|
|
||||||
|
|
||||||
return papBedahVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapBedahVO populateModelVOUpdate() throws ParseException{
|
|
||||||
PapBedahVO papBedahVO = new PapBedahVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
|
|
||||||
Ruangan ruangan = ruanganDao.findOne(10);
|
|
||||||
RuanganVO ruanganVO = ruanganConverter.transferModelToVO(ruangan,new RuanganVO());
|
|
||||||
|
|
||||||
papBedahVO.setRuangan(ruanganVO);
|
|
||||||
papBedahVO.setRuanganTujuan(ruanganVO);
|
|
||||||
papBedahVO.setTglInput(generateDate());
|
|
||||||
papBedahVO.setPasien(pasienVO);
|
|
||||||
papBedahVO.setStatusEnabled(false);
|
|
||||||
|
|
||||||
return papBedahVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testPopulate() throws ParseException{
|
|
||||||
/*Cek Method Populate*/
|
|
||||||
PapBedahVO papBedahVO = populateModelVO();
|
|
||||||
assertNotNull(papBedahVO);
|
|
||||||
|
|
||||||
|
|
||||||
/*Cek Dao*/
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
Ruangan ruangan = ruanganDao.findOne(10);
|
|
||||||
assertNotNull(ruangan);
|
|
||||||
assertEquals("Klinik Psikologi",ruangan.getNamaRuangan());
|
|
||||||
|
|
||||||
/*Cek Converter*/
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
|
|
||||||
RuanganVO ruanganVO = ruanganConverter.transferModelToVO(ruangan,new RuanganVO());
|
|
||||||
assertNotNull(ruanganVO);
|
|
||||||
//assertEquals("Klinik Psikologi",pasienVO.getNamaExternal());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate() throws ParseException{
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 11:40:39 PM";
|
|
||||||
|
|
||||||
Date date = formatter.parse(dateInString);
|
|
||||||
return date;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,138 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapEliminasi;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapGenatalia;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapEliminasiService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapEliminasiVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapEliminasiServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapEliminasiService papEliminasiService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddEliminasi() {
|
|
||||||
PapEliminasiVO papEliminasiVO = populateModel();
|
|
||||||
Map<String,Object> result = papEliminasiService.addEliminasi(papEliminasiVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
assertEquals("Diuresis Urin",((PapEliminasi)result.get("papEliminasi")).getDiuresisUrin());
|
|
||||||
assertEquals("Frekuensi Defraksi",((PapEliminasi)result.get("papEliminasi")).getFrekuensiDefeaksi());
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",((PapEliminasi)result.get("papEliminasi")).getPasien().getNamaPasien());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateEliminasi() {
|
|
||||||
PapEliminasiVO papEliminasiVO = populateModel();
|
|
||||||
Map<String,Object> result = papEliminasiService.addEliminasi(papEliminasiVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapEliminasiVO papEliminasiVOUpdate = populateModelUpdate();
|
|
||||||
papEliminasiVOUpdate.setNoRec(((PapEliminasi) result.get("papEliminasi")).getNoRec());
|
|
||||||
assertNotNull(papEliminasiVOUpdate);
|
|
||||||
assertEquals(papEliminasiVOUpdate.getNoRec(),((PapEliminasi) result.get("papEliminasi")).getNoRec());
|
|
||||||
|
|
||||||
Map<String,Object> resultUpdate = papEliminasiService.updateEliminasi(papEliminasiVOUpdate);
|
|
||||||
assertNotNull(resultUpdate);
|
|
||||||
assertEquals("Diuresis Urin Update",((PapEliminasi)resultUpdate.get("papEliminasi")).getDiuresisUrin());
|
|
||||||
assertEquals("Frekuensi Defraksi Update",((PapEliminasi)resultUpdate.get("papEliminasi")).getFrekuensiDefeaksi());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
String noCm = "000000000000005";
|
|
||||||
String tglInput = "2016-07-17 04:26:00";
|
|
||||||
Map<String,Object> result = papEliminasiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPopulateModel(){
|
|
||||||
/*Cek Pasien Dao*/
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Pasien Converter*/
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Populate*/
|
|
||||||
PapEliminasiVO papEliminasiVO = populateModel();
|
|
||||||
assertNotNull(papEliminasiVO);
|
|
||||||
assertEquals("Diuresis Urin",papEliminasiVO.getDiuresisUrin());
|
|
||||||
assertEquals("Frekuensi Defraksi",papEliminasiVO.getFrekuensiDefeaksi());
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",papEliminasiVO.getPasien().getNamaPasien());
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapEliminasiVO populateModel(){
|
|
||||||
PapEliminasiVO papEliminasiVO = new PapEliminasiVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
|
|
||||||
papEliminasiVO.setDiuresisUrin("Diuresis Urin");
|
|
||||||
papEliminasiVO.setFrekuensiDefeaksi("Frekuensi Defraksi");
|
|
||||||
papEliminasiVO.setTglInput(generateDate());
|
|
||||||
papEliminasiVO.setPasien(pasienVO);
|
|
||||||
return papEliminasiVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapEliminasiVO populateModelUpdate(){
|
|
||||||
PapEliminasiVO papEliminasiVO = new PapEliminasiVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
|
|
||||||
papEliminasiVO.setDiuresisUrin("Diuresis Urin Update");
|
|
||||||
papEliminasiVO.setFrekuensiDefeaksi("Frekuensi Defraksi Update");
|
|
||||||
papEliminasiVO.setTglInput(new Date());
|
|
||||||
papEliminasiVO.setPasien(pasienVO);
|
|
||||||
return papEliminasiVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate(){
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 12:10:56 PM";
|
|
||||||
|
|
||||||
Date date = null;
|
|
||||||
try {
|
|
||||||
date = formatter.parse(dateInString);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,132 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapGastrointestinal;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapGastrointestinalService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapGastrointestinalVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapGastrointestinalServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapGastrointestinalService papGastrointestinalService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter papGastrintestinal;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddGastrointestinal() throws ParseException {
|
|
||||||
PapGastrointestinalVO papGastrointestinalVO = populateModelVO();
|
|
||||||
assertNotNull(papGastrointestinalVO);
|
|
||||||
Map<String,Object> result = papGastrointestinalService.addGastrointestinal(papGastrointestinalVO);
|
|
||||||
assertEquals("15",((PapGastrointestinal) result.get("papGastrointestinal")).getLingkarPerut());
|
|
||||||
assertEquals(true,((PapGastrointestinal) result.get("papGastrointestinal")).getIsNormal());
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateGastrointestinal() throws ParseException {
|
|
||||||
PapGastrointestinalVO papGastrointestinalVO = populateModelVO();
|
|
||||||
Map<String,Object> result = papGastrointestinalService.addGastrointestinal(papGastrointestinalVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapGastrointestinalVO papGastrointestinalVOUpdate = populateModelVOUpdate();
|
|
||||||
papGastrointestinalVOUpdate.setNoRec(((PapGastrointestinal) result.get("papGastrointestinal")).getNoRec());
|
|
||||||
assertNotNull(papGastrointestinalVOUpdate);
|
|
||||||
assertEquals(papGastrointestinalVOUpdate.getNoRec(),((PapGastrointestinal) result.get("papGastrointestinal")).getNoRec());
|
|
||||||
|
|
||||||
Map<String,Object> resultUpdate = papGastrointestinalService.addGastrointestinal(papGastrointestinalVOUpdate);
|
|
||||||
assertEquals("15 update",((PapGastrointestinal) resultUpdate.get("papGastrointestinal")).getLingkarPerut());
|
|
||||||
assertEquals(false,((PapGastrointestinal) resultUpdate.get("papGastrointestinal")).getIsNormal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
String noCm = "000003";
|
|
||||||
String tglInput = "2013-06-07 11:40:39";
|
|
||||||
Map<String,Object> result = papGastrointestinalService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
//assertEquals(59,((PapGastrointestinal) result.get("papGastrointestinal")).getTglInput().getMinutes());
|
|
||||||
assertEquals("15 update",((PapGastrointestinal) result.get("papGastrointestinal")).getLingkarPerut());
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapGastrointestinalVO populateModelVO() throws ParseException{
|
|
||||||
PapGastrointestinalVO papGastrointestinalVO = new PapGastrointestinalVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
|
|
||||||
papGastrointestinalVO.setTglInput(generateDate());
|
|
||||||
papGastrointestinalVO.setPasien(pasienVO);
|
|
||||||
papGastrointestinalVO.setIsNormal(true);
|
|
||||||
papGastrointestinalVO.setLingkarPerut("15");
|
|
||||||
|
|
||||||
return papGastrointestinalVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapGastrointestinalVO populateModelVOUpdate() throws ParseException{
|
|
||||||
PapGastrointestinalVO papGastrointestinalVO = new PapGastrointestinalVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
papGastrointestinalVO.setTglInput(generateDate());
|
|
||||||
papGastrointestinalVO.setPasien(pasienVO);
|
|
||||||
papGastrointestinalVO.setLingkarPerut("15 update");
|
|
||||||
papGastrointestinalVO.setIsNormal(false);
|
|
||||||
|
|
||||||
return papGastrointestinalVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testPopulate() throws ParseException{
|
|
||||||
/*Cek Method Populate*/
|
|
||||||
PapGastrointestinalVO papGastrointestinalVO = populateModelVO();
|
|
||||||
assertNotNull(papGastrointestinalVO);
|
|
||||||
|
|
||||||
/*Cek Dao*/
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Converter*/
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate() throws ParseException{
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 11:40:39 PM";
|
|
||||||
|
|
||||||
Date date = formatter.parse(dateInString);
|
|
||||||
return date;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,143 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.converter.RegistrasiPelayananPasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.RegistrasiPelayananPasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapGenatalia;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.entities.RegistrasiPelayananPasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapGenataliaService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapGenataliaVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.RegistrasiPelayananPasienVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapGenataliaServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapGenataliaService papGenataliaService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
|
|
||||||
// @Autowired
|
|
||||||
// private RegistrasiPelayananPasienDao registrasiPelayananPasienDao;
|
|
||||||
// @Autowired RegistrasiPelayananPasienConverter registrasiPelayananPasienConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddGenatalia() throws ParseException {
|
|
||||||
PapGenataliaVO papGenataliaVO = populateModelVO();
|
|
||||||
Map<String,Object> result = papGenataliaService.addGenatalia(papGenataliaVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
assertEquals("Test Status Genatalia",((PapGenatalia) result.get("papGenatalia")).getStatus());
|
|
||||||
assertNotEquals("Test Status Genatalia Error",((PapGenatalia) result.get("papGenatalia")).getStatus());
|
|
||||||
assertEquals("Test Keterangan Genatalia",((PapGenatalia) result.get("papGenatalia")).getKeterangan());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateGenatalia() throws ParseException {
|
|
||||||
PapGenataliaVO papGenataliaVO = populateModelVO();
|
|
||||||
Map<String,Object> result = papGenataliaService.addGenatalia(papGenataliaVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapGenataliaVO papGenataliaVOUpdate = populateModelVOUpdate();
|
|
||||||
papGenataliaVOUpdate.setNoRec(((PapGenatalia) result.get("papGenatalia")).getNoRec());
|
|
||||||
assertNotNull(papGenataliaVOUpdate);
|
|
||||||
assertEquals(papGenataliaVOUpdate.getNoRec(),((PapGenatalia) result.get("papGenatalia")).getNoRec());
|
|
||||||
|
|
||||||
Map<String,Object> resultUpdate = papGenataliaService.addGenatalia(papGenataliaVOUpdate);
|
|
||||||
assertEquals("Test Status Genatalia Update",((PapGenatalia) resultUpdate.get("papGenatalia")).getStatus());
|
|
||||||
assertNotEquals("Test Status Genatalia Error",((PapGenatalia) resultUpdate.get("papGenatalia")).getStatus());
|
|
||||||
assertEquals("Test Keterangan Genatalia Update",((PapGenatalia) resultUpdate.get("papGenatalia")).getKeterangan());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPopulate() throws ParseException{
|
|
||||||
/*Cek Method Populate*/
|
|
||||||
PapGenataliaVO papGenataliaVO = populateModelVO();
|
|
||||||
assertNotNull(papGenataliaVO);
|
|
||||||
|
|
||||||
/*Cek Dao*/
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Converter*/
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
String noCm = "000001";
|
|
||||||
String tglInput = "2016-07-17 02:12:03";
|
|
||||||
Map<String,Object> result = papGenataliaService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private PapGenataliaVO populateModelVO() throws ParseException{
|
|
||||||
PapGenataliaVO papGenataliaVO = new PapGenataliaVO();
|
|
||||||
//RegistrasiPelayananPasien registrasiPelayananPasien = registrasiPelayananPasienDao.findOne("2c9090ad56014d2c0156014f2f020003");
|
|
||||||
//RegistrasiPelayananPasienVO registrasiPelayananPasienVO = registrasiPelayananPasienConverter.transferModelToVO(registrasiPelayananPasien, new RegistrasiPelayananPasienVO());
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
|
|
||||||
papGenataliaVO.setStatus("Test Status Genatalia");
|
|
||||||
papGenataliaVO.setKeterangan("Test Keterangan Genatalia");
|
|
||||||
papGenataliaVO.setTglInput(generateDate());
|
|
||||||
// papGenataliaVO.setRegistrasiPelayananPasien(registrasiPelayananPasienVO);
|
|
||||||
papGenataliaVO.setPasien(pasienVO);
|
|
||||||
|
|
||||||
return papGenataliaVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapGenataliaVO populateModelVOUpdate() throws ParseException{
|
|
||||||
PapGenataliaVO papGenataliaVO = new PapGenataliaVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
|
|
||||||
papGenataliaVO.setStatus("Test Status Genatalia Update");
|
|
||||||
papGenataliaVO.setKeterangan("Test Keterangan Genatalia Update");
|
|
||||||
papGenataliaVO.setTglInput(generateDate());
|
|
||||||
papGenataliaVO.setPasien(pasienVO);
|
|
||||||
|
|
||||||
return papGenataliaVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate() throws ParseException{
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 12:10:56 PM";
|
|
||||||
|
|
||||||
Date date = formatter.parse(dateInString);
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,270 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.converter.RuanganConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.RuanganDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapGigiMulut;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Ruangan;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapGigiMulutService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapBahanRestorasiVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapGigiKananDuaVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapGigiKananEmpatVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapGigiKananSatuVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapGigiKananTigaVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapGigiKiriDuaVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapGigiKiriEmpatVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapGigiKiriSatuVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapGigiKiriTigaVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapGigiMulutVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapKeadaanGigiVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapProtesaVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapRestorasiVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.RuanganVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
|
|
||||||
public class PapGigiMulutServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapGigiMulutService papGigiMulutService;
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
@Autowired
|
|
||||||
private RuanganDao ruanganDao;
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
@Autowired
|
|
||||||
private RuanganConverter ruanganConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddGigiMulut() throws ParseException {
|
|
||||||
PapGigiMulutVO papGigiMulutVO = populateModelVO();
|
|
||||||
assertNotNull(papGigiMulutVO);
|
|
||||||
Map<String,Object> result = papGigiMulutService.addGigiMulut(papGigiMulutVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
assertEquals("Setyo Wibudi",((PapGigiMulut) result.get("papGigiMulut")).getPasien().getNamaPasien());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateGigiMulut() throws ParseException {
|
|
||||||
PapGigiMulutVO papGigiMulutVO = populateModelVO();
|
|
||||||
Map<String,Object> result = papGigiMulutService.addGigiMulut(papGigiMulutVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapGigiMulutVO papGigiMulutVOUpdate = populateModelVOUpdate();
|
|
||||||
papGigiMulutVOUpdate.setNoRec(((PapGigiMulut) result.get("papGigiMulut")).getNoRec());
|
|
||||||
assertNotNull(papGigiMulutVOUpdate);
|
|
||||||
assertEquals(papGigiMulutVOUpdate.getNoRec(),((PapGigiMulut) result.get("papGigiMulut")).getNoRec());
|
|
||||||
|
|
||||||
Map<String,Object> resultUpdate = papGigiMulutService.addGigiMulut(papGigiMulutVOUpdate);
|
|
||||||
assertEquals(false,((PapGigiMulut) resultUpdate.get("papGigiMulut")).getStatusEnabled());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
String noCm = "000003";
|
|
||||||
String tglInput = "2013-06-07 11:40:39";
|
|
||||||
Map<String,Object> result = papGigiMulutService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindByNoCmAndTglRegistrasi() {
|
|
||||||
String noCm = "000003";
|
|
||||||
String tglRegistrasi = "2013-06-07 11:40:39";
|
|
||||||
//Map<String,Object> result = papGigiMulutService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
Map<String,Object> result = papGigiMulutService.findRegistrasiPelayananPasienByNoCmAndTglRegistrasi(noCm,(short) 0, DateUtil.toDate(tglRegistrasi));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindPasienByNoCm() {
|
|
||||||
String noCm = "000003";
|
|
||||||
Map<String,Object> result = papGigiMulutService.findPasienByNoCm(noCm);
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private PapGigiMulutVO populateModelVO() throws ParseException{
|
|
||||||
PapGigiMulutVO papGigiMulutVO = new PapGigiMulutVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
papGigiMulutVO.setPasien(pasienVO);
|
|
||||||
|
|
||||||
PapKeadaanGigiVO papKeadaanGigiVO= new PapKeadaanGigiVO();
|
|
||||||
papKeadaanGigiVO.setId(1);
|
|
||||||
papGigiMulutVO.setPapKeadaanGigi(papKeadaanGigiVO);
|
|
||||||
|
|
||||||
PapGigiKiriSatuVO papGigiKiriSatuVO= new PapGigiKiriSatuVO();
|
|
||||||
papGigiKiriSatuVO.setTujuhbelas("tujuhbelas");
|
|
||||||
papGigiMulutVO.setPapGigiKiriSatu(papGigiKiriSatuVO);
|
|
||||||
|
|
||||||
PapGigiKiriDuaVO papGigiKiriDuaVO= new PapGigiKiriDuaVO();
|
|
||||||
papGigiKiriDuaVO.setLimalima("limalima");
|
|
||||||
papGigiMulutVO.setPapGigiKiriDua(papGigiKiriDuaVO);
|
|
||||||
|
|
||||||
PapGigiKiriTigaVO papGigiKiriTigaVO= new PapGigiKiriTigaVO();
|
|
||||||
papGigiKiriTigaVO.setDelapandua("delapandua");
|
|
||||||
papGigiMulutVO.setPapGigiKiriTiga(papGigiKiriTigaVO);
|
|
||||||
|
|
||||||
PapGigiKiriEmpatVO papGigiKiriEmpatVO= new PapGigiKiriEmpatVO();
|
|
||||||
papGigiKiriEmpatVO.setEmpatdua("empatdua");
|
|
||||||
papGigiMulutVO.setPapGigiKiriEmpat(papGigiKiriEmpatVO);
|
|
||||||
|
|
||||||
PapGigiKananSatuVO papGigiKananSatuVO= new PapGigiKananSatuVO();
|
|
||||||
papGigiKananSatuVO.setDuadua("duadua");
|
|
||||||
papGigiMulutVO.setPapGigiKananSatu(papGigiKananSatuVO);
|
|
||||||
|
|
||||||
PapGigiKananDuaVO papGigiKananDuaVO= new PapGigiKananDuaVO();
|
|
||||||
papGigiKananDuaVO.setEnamlima("enamlima");
|
|
||||||
papGigiMulutVO.setPapGigiKananDua(papGigiKananDuaVO);
|
|
||||||
|
|
||||||
PapGigiKananTigaVO papGigiKananTigaVO= new PapGigiKananTigaVO();
|
|
||||||
papGigiKananTigaVO.setTujuhempat("tujuhempat");
|
|
||||||
papGigiMulutVO.setPapGigiKananTiga(papGigiKananTigaVO);
|
|
||||||
|
|
||||||
PapGigiKananEmpatVO papGigiKananEmpatVO= new PapGigiKananEmpatVO();
|
|
||||||
papGigiKananEmpatVO.setTigadua("tigadua");
|
|
||||||
papGigiMulutVO.setPapGigiKananEmpat(papGigiKananEmpatVO);
|
|
||||||
|
|
||||||
PapRestorasiVO papRestorasiVO= new PapRestorasiVO();
|
|
||||||
papRestorasiVO.setId(1);
|
|
||||||
papGigiMulutVO.setPapRestorasi(papRestorasiVO);
|
|
||||||
|
|
||||||
PapBahanRestorasiVO papBahanRestorasiVO= new PapBahanRestorasiVO();
|
|
||||||
papBahanRestorasiVO.setId(1);
|
|
||||||
papGigiMulutVO.setPapBahanRestorasi(papBahanRestorasiVO);
|
|
||||||
|
|
||||||
PapProtesaVO papProtesaVO= new PapProtesaVO();
|
|
||||||
papProtesaVO.setId(1);
|
|
||||||
papGigiMulutVO.setPapProtesa(papProtesaVO);
|
|
||||||
|
|
||||||
papGigiMulutVO.setTglInput(generateDate());
|
|
||||||
papGigiMulutVO.setStatusEnabled(true);
|
|
||||||
|
|
||||||
return papGigiMulutVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapGigiMulutVO populateModelVOUpdate() throws ParseException{
|
|
||||||
PapGigiMulutVO papGigiMulutVO = new PapGigiMulutVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
papGigiMulutVO.setPasien(pasienVO);
|
|
||||||
|
|
||||||
PapKeadaanGigiVO papKeadaanGigiVO= new PapKeadaanGigiVO();
|
|
||||||
papKeadaanGigiVO.setId(1);
|
|
||||||
papGigiMulutVO.setPapKeadaanGigi(papKeadaanGigiVO);
|
|
||||||
|
|
||||||
PapGigiKiriSatuVO papGigiKiriSatuVO= new PapGigiKiriSatuVO();
|
|
||||||
papGigiKiriSatuVO.setTujuhbelas("tujuhbelas");
|
|
||||||
papGigiMulutVO.setPapGigiKiriSatu(papGigiKiriSatuVO);
|
|
||||||
|
|
||||||
PapGigiKiriDuaVO papGigiKiriDuaVO= new PapGigiKiriDuaVO();
|
|
||||||
papGigiKiriDuaVO.setLimalima("limalima");
|
|
||||||
papGigiMulutVO.setPapGigiKiriDua(papGigiKiriDuaVO);
|
|
||||||
|
|
||||||
PapGigiKiriTigaVO papGigiKiriTigaVO= new PapGigiKiriTigaVO();
|
|
||||||
papGigiKiriTigaVO.setDelapandua("delapandua");
|
|
||||||
papGigiMulutVO.setPapGigiKiriTiga(papGigiKiriTigaVO);
|
|
||||||
|
|
||||||
PapGigiKiriEmpatVO papGigiKiriEmpatVO= new PapGigiKiriEmpatVO();
|
|
||||||
papGigiKiriEmpatVO.setEmpatdua("empatdua");
|
|
||||||
papGigiMulutVO.setPapGigiKiriEmpat(papGigiKiriEmpatVO);
|
|
||||||
|
|
||||||
PapGigiKananSatuVO papGigiKananSatuVO= new PapGigiKananSatuVO();
|
|
||||||
papGigiKananSatuVO.setDuadua("duadua");
|
|
||||||
papGigiMulutVO.setPapGigiKananSatu(papGigiKananSatuVO);
|
|
||||||
|
|
||||||
PapGigiKananDuaVO papGigiKananDuaVO= new PapGigiKananDuaVO();
|
|
||||||
papGigiKananDuaVO.setEnamlima("enamlima");
|
|
||||||
papGigiMulutVO.setPapGigiKananDua(papGigiKananDuaVO);
|
|
||||||
|
|
||||||
PapGigiKananTigaVO papGigiKananTigaVO= new PapGigiKananTigaVO();
|
|
||||||
papGigiKananTigaVO.setTujuhempat("tujuhempat");
|
|
||||||
papGigiMulutVO.setPapGigiKananTiga(papGigiKananTigaVO);
|
|
||||||
|
|
||||||
PapGigiKananEmpatVO papGigiKananEmpatVO= new PapGigiKananEmpatVO();
|
|
||||||
papGigiKananEmpatVO.setTigadua("tigadua");
|
|
||||||
papGigiMulutVO.setPapGigiKananEmpat(papGigiKananEmpatVO);
|
|
||||||
|
|
||||||
PapRestorasiVO papRestorasiVO= new PapRestorasiVO();
|
|
||||||
papRestorasiVO.setId(1);
|
|
||||||
papGigiMulutVO.setPapRestorasi(papRestorasiVO);
|
|
||||||
|
|
||||||
PapBahanRestorasiVO papBahanRestorasiVO= new PapBahanRestorasiVO();
|
|
||||||
papBahanRestorasiVO.setId(1);
|
|
||||||
papGigiMulutVO.setPapBahanRestorasi(papBahanRestorasiVO);
|
|
||||||
|
|
||||||
PapProtesaVO papProtesaVO= new PapProtesaVO();
|
|
||||||
papProtesaVO.setId(1);
|
|
||||||
papGigiMulutVO.setPapProtesa(papProtesaVO);
|
|
||||||
|
|
||||||
papGigiMulutVO.setTglInput(generateDate());
|
|
||||||
papGigiMulutVO.setStatusEnabled(false);
|
|
||||||
|
|
||||||
return papGigiMulutVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testPopulate() throws ParseException{
|
|
||||||
/*Cek Method Populate*/
|
|
||||||
PapGigiMulutVO papGigiMulutVO = populateModelVO();
|
|
||||||
assertNotNull(papGigiMulutVO);
|
|
||||||
|
|
||||||
|
|
||||||
/*Cek Dao*/
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
Ruangan ruangan = ruanganDao.findOne(10);
|
|
||||||
assertNotNull(ruangan);
|
|
||||||
assertEquals("Klinik Psikologi",ruangan.getNamaRuangan());
|
|
||||||
|
|
||||||
/*Cek Converter*/
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
|
|
||||||
RuanganVO ruanganVO = ruanganConverter.transferModelToVO(ruangan,new RuanganVO());
|
|
||||||
assertNotNull(ruanganVO);
|
|
||||||
//assertEquals("Klinik Psikologi",pasienVO.getNamaExternal());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate() throws ParseException{
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 11:40:39 PM";
|
|
||||||
|
|
||||||
Date date = formatter.parse(dateInString);
|
|
||||||
return date;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,159 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapIntegumen;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapIntegumenService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapIntegumenVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.StatusAdaTidakAdaVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.WarnaKulitVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapIntegumenServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapIntegumenService papIntegumenService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddIntegumen() {
|
|
||||||
PapIntegumenVO papIntegumenVO = populateModel();
|
|
||||||
Map<String,Object> result = papIntegumenService.addIntegumen(papIntegumenVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
assertEquals("Normal",((PapIntegumen) result.get("papIntegumen")).getWarnaKulit().getName());
|
|
||||||
assertEquals("Tidak ada",((PapIntegumen) result.get("papIntegumen")).getKelainan().getName());
|
|
||||||
assertEquals("Tidak ada",((PapIntegumen) result.get("papIntegumen")).getResikoDekubitos().getName());
|
|
||||||
assertEquals("Tidak ada",((PapIntegumen) result.get("papIntegumen")).getLuka().getName());
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",((PapIntegumen) result.get("papIntegumen")).getPasien().getNamaPasien());
|
|
||||||
assertTrue(((PapIntegumen) result.get("papIntegumen")).getIsNormal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateIntegumen() {
|
|
||||||
PapIntegumenVO papIntegumenVO = populateModel();
|
|
||||||
Map<String,Object> result = papIntegumenService.addIntegumen(papIntegumenVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapIntegumenVO papIntegumenVOUpdate = populateModelUpdate();
|
|
||||||
Map<String,Object> resultUpdate = papIntegumenService.addIntegumen(papIntegumenVOUpdate);
|
|
||||||
assertNotNull(resultUpdate);
|
|
||||||
assertEquals("Pucat",((PapIntegumen) resultUpdate.get("papIntegumen")).getWarnaKulit().getName());
|
|
||||||
assertEquals("Ada",((PapIntegumen) resultUpdate.get("papIntegumen")).getKelainan().getName());
|
|
||||||
assertEquals("Ada",((PapIntegumen) resultUpdate.get("papIntegumen")).getResikoDekubitos().getName());
|
|
||||||
assertEquals("Ada",((PapIntegumen) resultUpdate.get("papIntegumen")).getLuka().getName());
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",((PapIntegumen) resultUpdate.get("papIntegumen")).getPasien().getNamaPasien());
|
|
||||||
assertFalse(((PapIntegumen) resultUpdate.get("papIntegumen")).getIsNormal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
String noCm = "000000000000005";
|
|
||||||
String tglInput = "2016-07-17 04:26:00";
|
|
||||||
Map<String,Object> result = papIntegumenService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void populateModelTest(){
|
|
||||||
/*Cek Pasien Dao*/
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Pasien Converter*/
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Populate*/
|
|
||||||
PapIntegumenVO papIntegumenVO = populateModel();
|
|
||||||
assertEquals("Normal",papIntegumenVO.getWarnaKulit().getName());
|
|
||||||
assertEquals("Tidak ada",papIntegumenVO.getKelainan().getName());
|
|
||||||
assertEquals("Tidak ada",papIntegumenVO.getResikoDekubitos().getName());
|
|
||||||
assertEquals("Tidak ada",papIntegumenVO.getLuka().getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapIntegumenVO populateModel(){
|
|
||||||
PapIntegumenVO papIntegumenVO = new PapIntegumenVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
WarnaKulitVO warnaKulitVO = new WarnaKulitVO();
|
|
||||||
warnaKulitVO.setId(1);
|
|
||||||
warnaKulitVO.setName("Normal");
|
|
||||||
StatusAdaTidakAdaVO statusAdaTidakAdaVO = new StatusAdaTidakAdaVO();
|
|
||||||
statusAdaTidakAdaVO.setId(1);
|
|
||||||
statusAdaTidakAdaVO.setName("Tidak ada");
|
|
||||||
|
|
||||||
papIntegumenVO.setTglInput(generateDate());
|
|
||||||
papIntegumenVO.setPasien(pasienVO);
|
|
||||||
papIntegumenVO.setWarnaKulit(warnaKulitVO);
|
|
||||||
papIntegumenVO.setKelainan(statusAdaTidakAdaVO);
|
|
||||||
papIntegumenVO.setResikoDekubitos(statusAdaTidakAdaVO);
|
|
||||||
papIntegumenVO.setLuka(statusAdaTidakAdaVO);
|
|
||||||
papIntegumenVO.setIsNormal(true);
|
|
||||||
return papIntegumenVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapIntegumenVO populateModelUpdate(){
|
|
||||||
PapIntegumenVO papIntegumenVO = new PapIntegumenVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
WarnaKulitVO warnaKulitVO = new WarnaKulitVO();
|
|
||||||
warnaKulitVO.setId(2);
|
|
||||||
warnaKulitVO.setName("Pucat");
|
|
||||||
StatusAdaTidakAdaVO statusAdaTidakAdaVO = new StatusAdaTidakAdaVO();
|
|
||||||
statusAdaTidakAdaVO.setId(2);
|
|
||||||
statusAdaTidakAdaVO.setName("Ada");
|
|
||||||
papIntegumenVO.setIsNormal(false);
|
|
||||||
|
|
||||||
papIntegumenVO.setTglInput(generateDate());
|
|
||||||
papIntegumenVO.setPasien(pasienVO);
|
|
||||||
papIntegumenVO.setWarnaKulit(warnaKulitVO);
|
|
||||||
papIntegumenVO.setKelainan(statusAdaTidakAdaVO);
|
|
||||||
papIntegumenVO.setResikoDekubitos(statusAdaTidakAdaVO);
|
|
||||||
papIntegumenVO.setLuka(statusAdaTidakAdaVO);
|
|
||||||
return papIntegumenVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate(){
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 12:10:56 PM";
|
|
||||||
|
|
||||||
Date date = null;
|
|
||||||
try {
|
|
||||||
date = formatter.parse(dateInString);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,160 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.converter.RegistrasiPelayananPasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.RegistrasiPelayananPasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapKeluhanTambahan;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.entities.RegistrasiPelayananPasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapKeluhanTambahanService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapKeluhanTambahanVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.RegistrasiPelayananPasienVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapKeluhanTambahanServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapKeluhanTambahanService papKeluhanTambahanService;
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
@Autowired
|
|
||||||
private RegistrasiPelayananPasienDao registrasiPelayananpasienDao;
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
@Autowired
|
|
||||||
private RegistrasiPelayananPasienConverter registrasiPelayananPasienConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddKeluhanTambahan() throws ParseException {
|
|
||||||
PapKeluhanTambahanVO papKeluhanTambahanVO = populateModelVO();
|
|
||||||
assertNotNull(papKeluhanTambahanVO);
|
|
||||||
Map<String,Object> result = papKeluhanTambahanService.addKeluhanTambahan(papKeluhanTambahanVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
assertEquals("Keluhan tambahan",((PapKeluhanTambahan) result.get("papKeluhanTambahan")).getKeluhanTambahan());
|
|
||||||
//assertEquals("Setyo Wibudi",((PapKeluhanTambahan) result.get("papKeluhanTambahan")).getPasien().getNamaPasien());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateKeluhanTambahan() throws ParseException {
|
|
||||||
PapKeluhanTambahanVO papKeluhanTambahanVO = populateModelVO();
|
|
||||||
Map<String,Object> result = papKeluhanTambahanService.addKeluhanTambahan(papKeluhanTambahanVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapKeluhanTambahanVO papKeluhanTambahanVOUpdate = populateModelVOUpdate();
|
|
||||||
papKeluhanTambahanVOUpdate.setNoRec(((PapKeluhanTambahan) result.get("papKeluhanTambahan")).getNoRec());
|
|
||||||
assertNotNull(papKeluhanTambahanVOUpdate);
|
|
||||||
assertEquals(papKeluhanTambahanVOUpdate.getNoRec(),((PapKeluhanTambahan) result.get("papKeluhanTambahan")).getNoRec());
|
|
||||||
|
|
||||||
Map<String,Object> resultUpdate = papKeluhanTambahanService.addKeluhanTambahan(papKeluhanTambahanVOUpdate);
|
|
||||||
assertEquals(false,((PapKeluhanTambahan) resultUpdate.get("papKeluhanTambahan")).getStatusEnabled());
|
|
||||||
assertEquals("Keluhan tambahan update",((PapKeluhanTambahan) resultUpdate.get("papKeluhanTambahan")).getKeluhanTambahan());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
String noCm = "000000000000005";
|
|
||||||
String tglInput = "2016-07-21 00:24:30";
|
|
||||||
Map<String,Object> result = papKeluhanTambahanService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
assertEquals("keluhan Pertama",((PapKeluhanTambahan) result.get("papKeluhanTambahan")).getKeluhanTambahan());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindPasienByNoCmAndTglKeluhan() {
|
|
||||||
String noCm = "000000000000005";
|
|
||||||
String tglKeluhan = "2016-07-21 00:23:37";
|
|
||||||
Map<String,Object> result = papKeluhanTambahanService.findByNoCmAndTglkeluhan(DateUtil.toDate(tglKeluhan), noCm);
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
//assertEquals("keluhan pertama",((PapKeluhanTambahan) result.get("papKeluhanTambahan")).getKeluhanTambahan());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapKeluhanTambahanVO populateModelVO() throws ParseException{
|
|
||||||
PapKeluhanTambahanVO papKeluhanTambahanVO = new PapKeluhanTambahanVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
|
|
||||||
RegistrasiPelayananPasien registrasiPelayananPasien = registrasiPelayananpasienDao.findOne("2c9090ad56014d2c0156014f2f020003");
|
|
||||||
RegistrasiPelayananPasienVO registrasiPelayananPasienVO = registrasiPelayananPasienConverter.transferModelToVO(registrasiPelayananPasien,new RegistrasiPelayananPasienVO());
|
|
||||||
|
|
||||||
//papKeluhanTambahanVO.setRegistrasiPelayananPasien(registrasiPelayananPasienVO);
|
|
||||||
// papKeluhanTambahanVO.setPasien(pasienVO);
|
|
||||||
papKeluhanTambahanVO.setKeluhanTambahan("Keluhan tambahan");
|
|
||||||
papKeluhanTambahanVO.setTglInput(generateDate());
|
|
||||||
papKeluhanTambahanVO.setTglMerasaKeluhan(generateDate());
|
|
||||||
papKeluhanTambahanVO.setStatusEnabled(true);
|
|
||||||
|
|
||||||
return papKeluhanTambahanVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapKeluhanTambahanVO populateModelVOUpdate() throws ParseException{
|
|
||||||
PapKeluhanTambahanVO papKeluhanTambahanVO = new PapKeluhanTambahanVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
|
|
||||||
RegistrasiPelayananPasien registrasiPelayananPasien = registrasiPelayananpasienDao.findOne("2c9090ad56014d2c0156014f2f020003");
|
|
||||||
RegistrasiPelayananPasienVO registrasiPelayananPasienVO = registrasiPelayananPasienConverter.transferModelToVO(registrasiPelayananPasien,new RegistrasiPelayananPasienVO());
|
|
||||||
|
|
||||||
//papKeluhanTambahanVO.setRegistrasiPelayananPasien(registrasiPelayananPasienVO);
|
|
||||||
papKeluhanTambahanVO.setTglInput(generateDate());
|
|
||||||
papKeluhanTambahanVO.setTglMerasaKeluhan(generateDate());
|
|
||||||
//papKeluhanTambahanVO.setPasien(pasienVO);
|
|
||||||
papKeluhanTambahanVO.setStatusEnabled(false);
|
|
||||||
papKeluhanTambahanVO.setKeluhanTambahan("Keluhan tambahan update");
|
|
||||||
|
|
||||||
return papKeluhanTambahanVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testPopulate() throws ParseException{
|
|
||||||
/*Cek Method Populate*/
|
|
||||||
PapKeluhanTambahanVO papKeluhanTambahanVO = populateModelVO();
|
|
||||||
assertNotNull(papKeluhanTambahanVO);
|
|
||||||
|
|
||||||
|
|
||||||
/*Cek Dao*/
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Converter*/
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
|
|
||||||
assertEquals("Keluhan tambahan",papKeluhanTambahanVO.getKeluhanTambahan());
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate() throws ParseException{
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 11:40:39 PM";
|
|
||||||
|
|
||||||
Date date = formatter.parse(dateInString);
|
|
||||||
return date;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,138 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapKeluhanUtama;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapKeluhanUtamaService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapKeluhanUtamaVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapKeluhanUtamaServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapKeluhanUtamaService papKeluhanUtamaService;
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddKeluhanUtama() throws ParseException {
|
|
||||||
PapKeluhanUtamaVO papKeluhanUtamaVO = populateModelVO();
|
|
||||||
assertNotNull(papKeluhanUtamaVO);
|
|
||||||
Map<String,Object> result = papKeluhanUtamaService.addKeluhanUtama(papKeluhanUtamaVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
assertEquals("Keluhan utama",((PapKeluhanUtama) result.get("papKeluhanUtama")).getKeluhanUtama());
|
|
||||||
// assertEquals("Setyo Wibudi",((PapKeluhanUtama) result.get("papKeluhanUtama")).getPasien().getNamaPasien());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateKeluhanUtama() throws ParseException {
|
|
||||||
PapKeluhanUtamaVO papKeluhanUtamaVO = populateModelVO();
|
|
||||||
Map<String,Object> result = papKeluhanUtamaService.addKeluhanUtama(papKeluhanUtamaVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapKeluhanUtamaVO papKeluhanUtamaVOUpdate = populateModelVOUpdate();
|
|
||||||
papKeluhanUtamaVOUpdate.setNoRec(((PapKeluhanUtama) result.get("papKeluhanUtama")).getNoRec());
|
|
||||||
assertNotNull(papKeluhanUtamaVOUpdate);
|
|
||||||
assertEquals(papKeluhanUtamaVOUpdate.getNoRec(),((PapKeluhanUtama) result.get("papKeluhanUtama")).getNoRec());
|
|
||||||
|
|
||||||
Map<String,Object> resultUpdate = papKeluhanUtamaService.addKeluhanUtama(papKeluhanUtamaVOUpdate);
|
|
||||||
assertEquals(false,((PapKeluhanUtama) resultUpdate.get("papKeluhanUtama")).getStatusEnabled());
|
|
||||||
assertEquals("Keluhan utama update",((PapKeluhanUtama) resultUpdate.get("papKeluhanUtama")).getKeluhanUtama());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
String noCm = "000000000000005";
|
|
||||||
String tglInput = "2016-07-17 04:26:00";
|
|
||||||
Map<String,Object> result = papKeluhanUtamaService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
assertEquals("6786867867",((PapKeluhanUtama) result.get("papKeluhanUtama")).getKeluhanUtama());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindPasienByNoCm() {
|
|
||||||
String noCm = "000000000000005";
|
|
||||||
Map<String,Object> result = papKeluhanUtamaService.findPasienByNoCm(noCm);
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
assertEquals("6786867867",((PapKeluhanUtama) result.get("papKeluhanUtama")).getKeluhanUtama());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapKeluhanUtamaVO populateModelVO() throws ParseException{
|
|
||||||
PapKeluhanUtamaVO papKeluhanUtamaVO = new PapKeluhanUtamaVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
//papKeluhanUtamaVO.setPasien(pasienVO);
|
|
||||||
papKeluhanUtamaVO.setKeluhanUtama("Keluhan utama");
|
|
||||||
papKeluhanUtamaVO.setTglInput(generateDate());
|
|
||||||
papKeluhanUtamaVO.setStatusEnabled(true);
|
|
||||||
|
|
||||||
return papKeluhanUtamaVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapKeluhanUtamaVO populateModelVOUpdate() throws ParseException{
|
|
||||||
PapKeluhanUtamaVO papKeluhanUtamaVO = new PapKeluhanUtamaVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
papKeluhanUtamaVO.setTglInput(generateDate());
|
|
||||||
//papKeluhanUtamaVO.setPasien(pasienVO);
|
|
||||||
papKeluhanUtamaVO.setStatusEnabled(false);
|
|
||||||
papKeluhanUtamaVO.setKeluhanUtama("Keluhan utama update");
|
|
||||||
|
|
||||||
return papKeluhanUtamaVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testPopulate() throws ParseException{
|
|
||||||
/*Cek Method Populate*/
|
|
||||||
PapKeluhanUtamaVO papKeluhanUtamaVO = populateModelVO();
|
|
||||||
assertNotNull(papKeluhanUtamaVO);
|
|
||||||
|
|
||||||
|
|
||||||
/*Cek Dao*/
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Converter*/
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
|
|
||||||
assertEquals("Keluhan utama",papKeluhanUtamaVO.getKeluhanUtama());
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate() throws ParseException{
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 11:40:39 PM";
|
|
||||||
|
|
||||||
Date date = formatter.parse(dateInString);
|
|
||||||
return date;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,158 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapIntegumen;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapMuskuloskeletal;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapMuskuloskeletalService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.GerakanAnakVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapMuskuloskeletalVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.StatusAdaTidakAdaVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapMuskuloskeletalServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapMuskuloskeletalService papMuskuloskeletalService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddMuskuloskeletal() {
|
|
||||||
PapMuskuloskeletalVO papMuskuloskeletalVO = populateModel();
|
|
||||||
Map<String,Object> result = papMuskuloskeletalService.addMuskuloskeletal(papMuskuloskeletalVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",((PapMuskuloskeletal) result.get("papMuskuloskeletal")).getPasien().getNamaPasien());
|
|
||||||
assertEquals("Tidak ada",((PapMuskuloskeletal) result.get("papMuskuloskeletal")).getKelainanTulang().getName());
|
|
||||||
assertEquals("Bebas",((PapMuskuloskeletal) result.get("papMuskuloskeletal")).getGerakanAnak().getName());
|
|
||||||
assertNotNull(((PapMuskuloskeletal) result.get("papMuskuloskeletal")).getTglInput());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateMuskuloskeletal() {
|
|
||||||
PapMuskuloskeletalVO papMuskuloskeletalVO = populateModel();
|
|
||||||
Map<String,Object> result = papMuskuloskeletalService.addMuskuloskeletal(papMuskuloskeletalVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapMuskuloskeletalVO papMuskuloskeletalVOUpdate = populateModelUpdate();
|
|
||||||
Map<String,Object> resultUpdate = papMuskuloskeletalService.addMuskuloskeletal(papMuskuloskeletalVOUpdate);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",((PapMuskuloskeletal) resultUpdate.get("papMuskuloskeletal")).getPasien().getNamaPasien());
|
|
||||||
assertEquals("Ada",((PapMuskuloskeletal) resultUpdate.get("papMuskuloskeletal")).getKelainanTulang().getName());
|
|
||||||
assertEquals("Terbatas",((PapMuskuloskeletal) resultUpdate.get("papMuskuloskeletal")).getGerakanAnak().getName());
|
|
||||||
assertNotNull(((PapMuskuloskeletal) resultUpdate.get("papMuskuloskeletal")).getTglInput());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
String noCm = "000001";
|
|
||||||
String tglInput = "2013-06-07 12:10:56";
|
|
||||||
Map<String,Object> result = papMuskuloskeletalService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPopulateModel(){
|
|
||||||
/*Cek Pasien Dao*/
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Pasien Converter*/
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Atribut VO*/
|
|
||||||
StatusAdaTidakAdaVO statusAdaTidakAdaVO = new StatusAdaTidakAdaVO();
|
|
||||||
statusAdaTidakAdaVO.setId(1);
|
|
||||||
statusAdaTidakAdaVO.setName("Tidak Ada");
|
|
||||||
assertNotNull(statusAdaTidakAdaVO);
|
|
||||||
assertEquals(String.valueOf(1), String.valueOf(statusAdaTidakAdaVO.getId()));
|
|
||||||
assertEquals("Tidak Ada",statusAdaTidakAdaVO.getName());
|
|
||||||
GerakanAnakVO gerakanAnakVO = new GerakanAnakVO();
|
|
||||||
gerakanAnakVO.setId(1);
|
|
||||||
gerakanAnakVO.setName("Bebas");
|
|
||||||
assertEquals(String.valueOf(1), String.valueOf(gerakanAnakVO.getId()));
|
|
||||||
assertNotNull(gerakanAnakVO);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public PapMuskuloskeletalVO populateModel(){
|
|
||||||
PapMuskuloskeletalVO papMuskuloskeletalVO = new PapMuskuloskeletalVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
StatusAdaTidakAdaVO statusAdaTidakAdaVO = new StatusAdaTidakAdaVO();
|
|
||||||
statusAdaTidakAdaVO.setId(1);
|
|
||||||
statusAdaTidakAdaVO.setName("Tidak ada");
|
|
||||||
GerakanAnakVO gerakanAnakVO = new GerakanAnakVO();
|
|
||||||
gerakanAnakVO.setId(1);
|
|
||||||
gerakanAnakVO.setName("Bebas");
|
|
||||||
|
|
||||||
papMuskuloskeletalVO.setIsNormal(true);
|
|
||||||
papMuskuloskeletalVO.setKelainanTulang(statusAdaTidakAdaVO);
|
|
||||||
papMuskuloskeletalVO.setPasien(pasienVO);
|
|
||||||
papMuskuloskeletalVO.setTglInput(generateDate());
|
|
||||||
papMuskuloskeletalVO.setGerakanAnak(gerakanAnakVO);
|
|
||||||
return papMuskuloskeletalVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PapMuskuloskeletalVO populateModelUpdate(){
|
|
||||||
PapMuskuloskeletalVO papMuskuloskeletalVO = new PapMuskuloskeletalVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
StatusAdaTidakAdaVO statusAdaTidakAdaVO = new StatusAdaTidakAdaVO();
|
|
||||||
statusAdaTidakAdaVO.setId(2);
|
|
||||||
statusAdaTidakAdaVO.setName("Ada");
|
|
||||||
GerakanAnakVO gerakanAnakVO = new GerakanAnakVO();
|
|
||||||
gerakanAnakVO.setId(2);
|
|
||||||
gerakanAnakVO.setName("Terbatas");
|
|
||||||
|
|
||||||
papMuskuloskeletalVO.setKelainanTulang(statusAdaTidakAdaVO);
|
|
||||||
papMuskuloskeletalVO.setPasien(pasienVO);
|
|
||||||
papMuskuloskeletalVO.setTglInput(new Date());
|
|
||||||
papMuskuloskeletalVO.setGerakanAnak(gerakanAnakVO);
|
|
||||||
return papMuskuloskeletalVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate(){
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 12:10:56 PM";
|
|
||||||
|
|
||||||
Date date = null;
|
|
||||||
try {
|
|
||||||
date = formatter.parse(dateInString);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,113 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapNeurologi;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapNeurologiService;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapNeurologiVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapNeurologiServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapNeurologiService papNeurologiService;
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testAddNeurologi() throws ParseException {
|
|
||||||
PapNeurologiVO papNeurologiVO = populateModelVO();
|
|
||||||
assertNotNull(papNeurologiVO);
|
|
||||||
Map<String,Object> result = papNeurologiService.addNeurologi(papNeurologiVO);
|
|
||||||
//assertEquals("15",((PapNeurologi) result.get("papNeurologi")).getLingkarPerut());
|
|
||||||
assertEquals(true,((PapNeurologi) result.get("papNeurologi")).getIsNormal());
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateNeurologi() throws ParseException {
|
|
||||||
PapNeurologiVO papNeurologiVO = populateModelVO();
|
|
||||||
Map<String,Object> result = papNeurologiService.addNeurologi(papNeurologiVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapNeurologiVO papNeurologiVOUpdate = populateModelVOUpdate();
|
|
||||||
papNeurologiVOUpdate.setNoRec(((PapNeurologi) result.get("papNeurologi")).getNoRec());
|
|
||||||
assertNotNull(papNeurologiVOUpdate);
|
|
||||||
assertEquals(papNeurologiVOUpdate.getNoRec(),((PapNeurologi) result.get("papNeurologi")).getNoRec());
|
|
||||||
|
|
||||||
Map<String,Object> resultUpdate = papNeurologiService.addNeurologi(papNeurologiVOUpdate);
|
|
||||||
assertEquals(false,((PapNeurologi) resultUpdate.get("papNeurologi")).getIsNormal());
|
|
||||||
assertEquals(false,((PapNeurologi) resultUpdate.get("papNeurologi")).getStatusEnabled());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private PapNeurologiVO populateModelVO() throws ParseException{
|
|
||||||
PapNeurologiVO papNeurologiVO = new PapNeurologiVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
|
|
||||||
papNeurologiVO.setTglInput(generateDate());
|
|
||||||
papNeurologiVO.setPasien(pasienVO);
|
|
||||||
papNeurologiVO.setIsNormal(true);
|
|
||||||
papNeurologiVO.setStatusEnabled(true);
|
|
||||||
|
|
||||||
return papNeurologiVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapNeurologiVO populateModelVOUpdate() throws ParseException{
|
|
||||||
PapNeurologiVO papNeurologiVO = new PapNeurologiVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
papNeurologiVO.setTglInput(generateDate());
|
|
||||||
papNeurologiVO.setPasien(pasienVO);
|
|
||||||
papNeurologiVO.setIsNormal(false);
|
|
||||||
papNeurologiVO.setStatusEnabled(false);
|
|
||||||
|
|
||||||
return papNeurologiVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testPopulate() throws ParseException{
|
|
||||||
/*Cek Method Populate*/
|
|
||||||
PapNeurologiVO papNeurologiVO = populateModelVO();
|
|
||||||
assertNotNull(papNeurologiVO);
|
|
||||||
|
|
||||||
/*Cek Dao*/
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Converter*/
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate() throws ParseException{
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 11:40:39 PM";
|
|
||||||
|
|
||||||
Date date = formatter.parse(dateInString);
|
|
||||||
return date;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,189 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapPernapasan;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapPernapasanService;
|
|
||||||
import com.jasamedika.medifirst2000.service.PasienService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.DataAlatBantuNafasVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapPernapasanVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.StatusAdaTidakAdaVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.StatusNormalTidakNormalVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.StatusRegulerIrregulerVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapPernapasanServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapPernapasanService papPernapasanService;
|
|
||||||
@Autowired
|
|
||||||
private PasienService pasienService;
|
|
||||||
@Autowired
|
|
||||||
public PasienDao pasienDao;
|
|
||||||
@Autowired
|
|
||||||
public PasienConverter pasienConverter;
|
|
||||||
//public PasienVO pasienVO;
|
|
||||||
|
|
||||||
@Transactional
|
|
||||||
@Test
|
|
||||||
public void testAddPernapasan() throws ParseException {
|
|
||||||
|
|
||||||
PapPernapasanVO papPernapasanVO = populateModelVO();
|
|
||||||
assertNotNull(papPernapasanVO);
|
|
||||||
Map<String,Object> result = papPernapasanService.addPernapasan(papPernapasanVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
assertEquals(true,((PapPernapasan) result.get("papPernapasan")).getIsNormal());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdatePernapasan() throws ParseException {
|
|
||||||
PapPernapasanVO papPernapasanVO = populateModelVO();
|
|
||||||
Map<String,Object> result = papPernapasanService.addPernapasan(papPernapasanVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapPernapasanVO papPernapasanVOUpdate = populateModelVOUpdate();
|
|
||||||
papPernapasanVOUpdate.setNoRec(((PapPernapasan) result.get("papPernapasan")).getNoRec());
|
|
||||||
assertNotNull(papPernapasanVOUpdate);
|
|
||||||
assertEquals(papPernapasanVOUpdate.getNoRec(),((PapPernapasan) result.get("papPernapasan")).getNoRec());
|
|
||||||
|
|
||||||
Map<String,Object> resultUpdate = papPernapasanService.addPernapasan(papPernapasanVOUpdate);
|
|
||||||
assertEquals(false,((PapPernapasan) resultUpdate.get("papPernapasan")).getIsNormal());
|
|
||||||
assertEquals(false,((PapPernapasan) resultUpdate.get("papPernapasan")).getStatusEnabled());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
String noCm = "000000000000005";
|
|
||||||
String tglInput = "2016-07-17 04:26:00";
|
|
||||||
Map<String,Object> result = papPernapasanService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapPernapasanVO populateModelVO() throws ParseException{
|
|
||||||
PapPernapasanVO papPernapasanVO = new PapPernapasanVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
papPernapasanVO.setPasien(pasienVO);
|
|
||||||
|
|
||||||
final String uuid = UUID.randomUUID().toString().replaceAll("-", "");
|
|
||||||
papPernapasanVO.setNoRec(uuid);
|
|
||||||
|
|
||||||
DataAlatBantuNafasVO alatBantuNafasVO = new DataAlatBantuNafasVO();
|
|
||||||
alatBantuNafasVO.setId(1);
|
|
||||||
papPernapasanVO.setAlatBantuNafas(alatBantuNafasVO);
|
|
||||||
|
|
||||||
StatusNormalTidakNormalVO bentukDadaVO = new StatusNormalTidakNormalVO();
|
|
||||||
bentukDadaVO.setId(1);
|
|
||||||
papPernapasanVO.setBentukDada(bentukDadaVO);
|
|
||||||
|
|
||||||
StatusRegulerIrregulerVO iramaVO = new StatusRegulerIrregulerVO();
|
|
||||||
iramaVO.setId(1);
|
|
||||||
papPernapasanVO.setIrama(iramaVO);
|
|
||||||
|
|
||||||
StatusAdaTidakAdaVO retraksiDadaVO = new StatusAdaTidakAdaVO();
|
|
||||||
retraksiDadaVO.setId(1);
|
|
||||||
papPernapasanVO.setRetraksiDada(retraksiDadaVO);
|
|
||||||
|
|
||||||
papPernapasanVO.setTglInput(generateDate());
|
|
||||||
|
|
||||||
StatusNormalTidakNormalVO polaNapasVO = new StatusNormalTidakNormalVO();
|
|
||||||
polaNapasVO.setId(1);
|
|
||||||
papPernapasanVO.setPolaNapas(polaNapasVO);
|
|
||||||
|
|
||||||
StatusNormalTidakNormalVO suaraNapasVO = new StatusNormalTidakNormalVO();
|
|
||||||
suaraNapasVO.setId(1);
|
|
||||||
papPernapasanVO.setSuaraNapas(suaraNapasVO);
|
|
||||||
|
|
||||||
StatusAdaTidakAdaVO nafasKupingHidungVO = new StatusAdaTidakAdaVO();
|
|
||||||
nafasKupingHidungVO.setId(1);
|
|
||||||
papPernapasanVO.setNafasKupingHidung(nafasKupingHidungVO);
|
|
||||||
|
|
||||||
StatusAdaTidakAdaVO sianosisVO = new StatusAdaTidakAdaVO();
|
|
||||||
sianosisVO.setId(1);
|
|
||||||
papPernapasanVO.setSianosis(sianosisVO);
|
|
||||||
papPernapasanVO.setKdProfile((short) 897);
|
|
||||||
papPernapasanVO.setIsNormal(true);
|
|
||||||
papPernapasanVO.setStatusEnabled(true);
|
|
||||||
|
|
||||||
return papPernapasanVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapPernapasanVO populateModelVOUpdate() throws ParseException{
|
|
||||||
PapPernapasanVO papPernapasanVO = new PapPernapasanVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
papPernapasanVO.setPasien(pasienVO);
|
|
||||||
|
|
||||||
final String uuid = UUID.randomUUID().toString().replaceAll("-", "");
|
|
||||||
papPernapasanVO.setNoRec(uuid);
|
|
||||||
|
|
||||||
DataAlatBantuNafasVO alatBantuNafasVO = new DataAlatBantuNafasVO();
|
|
||||||
alatBantuNafasVO.setId(1);
|
|
||||||
papPernapasanVO.setAlatBantuNafas(alatBantuNafasVO);
|
|
||||||
|
|
||||||
StatusNormalTidakNormalVO bentukDadaVO = new StatusNormalTidakNormalVO();
|
|
||||||
bentukDadaVO.setId(1);
|
|
||||||
papPernapasanVO.setBentukDada(bentukDadaVO);
|
|
||||||
|
|
||||||
StatusRegulerIrregulerVO iramaVO = new StatusRegulerIrregulerVO();
|
|
||||||
iramaVO.setId(1);
|
|
||||||
papPernapasanVO.setIrama(iramaVO);
|
|
||||||
|
|
||||||
StatusAdaTidakAdaVO retraksiDadaVO = new StatusAdaTidakAdaVO();
|
|
||||||
retraksiDadaVO.setId(1);
|
|
||||||
papPernapasanVO.setRetraksiDada(retraksiDadaVO);
|
|
||||||
|
|
||||||
papPernapasanVO.setTglInput(generateDate());
|
|
||||||
|
|
||||||
StatusNormalTidakNormalVO polaNapasVO = new StatusNormalTidakNormalVO();
|
|
||||||
polaNapasVO.setId(1);
|
|
||||||
papPernapasanVO.setPolaNapas(polaNapasVO);
|
|
||||||
|
|
||||||
StatusNormalTidakNormalVO suaraNapasVO = new StatusNormalTidakNormalVO();
|
|
||||||
suaraNapasVO.setId(1);
|
|
||||||
papPernapasanVO.setSuaraNapas(suaraNapasVO);
|
|
||||||
|
|
||||||
StatusAdaTidakAdaVO nafasKupingHidungVO = new StatusAdaTidakAdaVO();
|
|
||||||
nafasKupingHidungVO.setId(1);
|
|
||||||
papPernapasanVO.setNafasKupingHidung(nafasKupingHidungVO);
|
|
||||||
|
|
||||||
StatusAdaTidakAdaVO sianosisVO = new StatusAdaTidakAdaVO();
|
|
||||||
sianosisVO.setId(1);
|
|
||||||
papPernapasanVO.setSianosis(sianosisVO);
|
|
||||||
papPernapasanVO.setKdProfile((short) 890);
|
|
||||||
papPernapasanVO.setIsNormal(false);
|
|
||||||
papPernapasanVO.setStatusEnabled(false);
|
|
||||||
|
|
||||||
return papPernapasanVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate() throws ParseException{
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 12:10:56 PM";
|
|
||||||
|
|
||||||
Date date = formatter.parse(dateInString);
|
|
||||||
return date;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,145 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapRehabilitasi;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapRehabilitasiService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapRehabilitasiVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
|
|
||||||
public class PapRehabilitasiServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapRehabilitasiService papRehabilitasiService;
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddRehabilitasi() throws ParseException {
|
|
||||||
PapRehabilitasiVO papRehabilitasiVO = populateModelVO();
|
|
||||||
assertNotNull(papRehabilitasiVO);
|
|
||||||
Map<String,Object> result = papRehabilitasiService.addRehabilitasi(papRehabilitasiVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
assertEquals("Setyo Wibudi",((PapRehabilitasi) result.get("papRehabilitasi")).getPasien().getNamaPasien());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateRehabilitasi() throws ParseException {
|
|
||||||
PapRehabilitasiVO papRehabilitasiVO = populateModelVO();
|
|
||||||
Map<String,Object> result = papRehabilitasiService.addRehabilitasi(papRehabilitasiVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapRehabilitasiVO papRehabilitasiVOUpdate = populateModelVOUpdate();
|
|
||||||
papRehabilitasiVOUpdate.setNoRec(((PapRehabilitasi) result.get("papRehabilitasi")).getNoRec());
|
|
||||||
assertNotNull(papRehabilitasiVOUpdate);
|
|
||||||
assertEquals(papRehabilitasiVOUpdate.getNoRec(),((PapRehabilitasi) result.get("papRehabilitasi")).getNoRec());
|
|
||||||
|
|
||||||
Map<String,Object> resultUpdate = papRehabilitasiService.addRehabilitasi(papRehabilitasiVOUpdate);
|
|
||||||
assertEquals(false,((PapRehabilitasi) resultUpdate.get("papRehabilitasi")).getStatusEnabled());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
String noCm = "000003";
|
|
||||||
String tglInput = "2013-06-07 11:40:39";
|
|
||||||
Map<String,Object> result = papRehabilitasiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindByNoCmAndTglRegistrasi() {
|
|
||||||
String noCm = "000001";
|
|
||||||
String tglRegistrasi = "2016-07-17 02:12:03";
|
|
||||||
//Map<String,Object> result = papRehabilitasiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
Map<String,Object> result = papRehabilitasiService.findRegistrasiPelayananPasienByNoCmAndTglRegistrasi(noCm,(short) 0, DateUtil.toDate(tglRegistrasi));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindPasienByNoCm() {
|
|
||||||
String noCm = "000000000000002";
|
|
||||||
Map<String,Object> result = papRehabilitasiService.findPasienByNoCm(noCm);
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private PapRehabilitasiVO populateModelVO() throws ParseException{
|
|
||||||
PapRehabilitasiVO papRehabilitasiVO = new PapRehabilitasiVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
papRehabilitasiVO.setPasien(pasienVO);
|
|
||||||
papRehabilitasiVO.setTglInput(generateDate());
|
|
||||||
papRehabilitasiVO.setStatusEnabled(true);
|
|
||||||
|
|
||||||
return papRehabilitasiVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapRehabilitasiVO populateModelVOUpdate() throws ParseException{
|
|
||||||
PapRehabilitasiVO papRehabilitasiVO = new PapRehabilitasiVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
papRehabilitasiVO.setTglInput(generateDate());
|
|
||||||
papRehabilitasiVO.setPasien(pasienVO);
|
|
||||||
papRehabilitasiVO.setStatusEnabled(false);
|
|
||||||
|
|
||||||
return papRehabilitasiVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testPopulate() throws ParseException{
|
|
||||||
/*Cek Method Populate*/
|
|
||||||
PapRehabilitasiVO papRehabilitasiVO = populateModelVO();
|
|
||||||
assertNotNull(papRehabilitasiVO);
|
|
||||||
|
|
||||||
|
|
||||||
/*Cek Dao*/
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Converter*/
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate() throws ParseException{
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 11:40:39 PM";
|
|
||||||
|
|
||||||
Date date = formatter.parse(dateInString);
|
|
||||||
return date;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,142 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapSirkulasi;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapGenatalia;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.AgamaService;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapSirkulasiService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapSirkulasiVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.StatusAdaTidakAdaVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
|
|
||||||
public class PapSirkulasiServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapSirkulasiService papSirkulasiService;
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddSirkulasi() throws ParseException {
|
|
||||||
PapSirkulasiVO papSirkulasiVO = populateModelVO();
|
|
||||||
assertNotNull(papSirkulasiVO);
|
|
||||||
Map<String,Object> result = papSirkulasiService.addSirkulasi(papSirkulasiVO);
|
|
||||||
assertEquals(true,((PapSirkulasi) result.get("papSirkulasi")).getIsNormal());
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateSirkulasi() throws ParseException {
|
|
||||||
PapSirkulasiVO papSirkulasiVO = populateModelVO();
|
|
||||||
Map<String,Object> result = papSirkulasiService.addSirkulasi(papSirkulasiVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapSirkulasiVO papSirkulasiVOUpdate = populateModelVOUpdate();
|
|
||||||
papSirkulasiVOUpdate.setNoRec(((PapSirkulasi) result.get("papSirkulasi")).getNoRec());
|
|
||||||
assertNotNull(papSirkulasiVOUpdate);
|
|
||||||
assertEquals(papSirkulasiVOUpdate.getNoRec(),((PapSirkulasi) result.get("papSirkulasi")).getNoRec());
|
|
||||||
|
|
||||||
Map<String,Object> resultUpdate = papSirkulasiService.addSirkulasi(papSirkulasiVOUpdate);
|
|
||||||
assertEquals(false,((PapSirkulasi) resultUpdate.get("papSirkulasi")).getIsNormal());
|
|
||||||
assertEquals(false,((PapSirkulasi) resultUpdate.get("papSirkulasi")).getStatusEnabled());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private PapSirkulasiVO populateModelVO() throws ParseException{
|
|
||||||
PapSirkulasiVO papSirkulasiVO = new PapSirkulasiVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
|
|
||||||
StatusAdaTidakAdaVO sianosisVO = new StatusAdaTidakAdaVO();
|
|
||||||
sianosisVO.setName("Tidak ada");
|
|
||||||
sianosisVO.setId(1);
|
|
||||||
papSirkulasiVO.setSianosis(sianosisVO);
|
|
||||||
|
|
||||||
StatusAdaTidakAdaVO pucatVO = new StatusAdaTidakAdaVO();
|
|
||||||
pucatVO.setName("Tidak ada");
|
|
||||||
pucatVO.setId(1);
|
|
||||||
papSirkulasiVO.setPucat(pucatVO);
|
|
||||||
|
|
||||||
papSirkulasiVO.setTglInput(generateDate());
|
|
||||||
papSirkulasiVO.setPasien(pasienVO);
|
|
||||||
papSirkulasiVO.setIsNormal(true);
|
|
||||||
papSirkulasiVO.setStatusEnabled(true);
|
|
||||||
|
|
||||||
return papSirkulasiVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
String noCm = "000000000000005";
|
|
||||||
String tglInput = "2016-07-17 04:26:00";
|
|
||||||
Map<String,Object> result = papSirkulasiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
|
||||||
assertNotNull(result);
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapSirkulasiVO populateModelVOUpdate() throws ParseException{
|
|
||||||
PapSirkulasiVO papSirkulasiVO = new PapSirkulasiVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(547);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
papSirkulasiVO.setTglInput(generateDate());
|
|
||||||
papSirkulasiVO.setPasien(pasienVO);
|
|
||||||
papSirkulasiVO.setIsNormal(false);
|
|
||||||
papSirkulasiVO.setStatusEnabled(false);
|
|
||||||
|
|
||||||
return papSirkulasiVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testPopulate() throws ParseException{
|
|
||||||
/*Cek Method Populate*/
|
|
||||||
PapSirkulasiVO papSirkulasiVO = populateModelVO();
|
|
||||||
assertNotNull(papSirkulasiVO);
|
|
||||||
|
|
||||||
/*Cek Dao*/
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Converter*/
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate() throws ParseException{
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 11:40:39 PM";
|
|
||||||
|
|
||||||
Date date = formatter.parse(dateInString);
|
|
||||||
return date;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,146 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapSkriningGizi;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapSkriningGiziService;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapSkriningGiziVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapSkriningGiziServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapSkriningGiziService papSkriningGiziService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddSkriningGizi() {
|
|
||||||
PapSkriningGiziVO vo = populateModel();
|
|
||||||
Map<String,Object> result = papSkriningGiziService.addSkriningGizi(vo);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapSkriningGizi papSkriningGizi = (PapSkriningGizi) result.get("papSkriningGizi");
|
|
||||||
assertNotNull(papSkriningGizi);
|
|
||||||
assertEquals(generateDate(),papSkriningGizi.getTglInput());
|
|
||||||
assertEquals(String.valueOf((float) 170),String.valueOf(papSkriningGizi.getTinggiBadan()));
|
|
||||||
assertEquals(String.valueOf((float) 68),String.valueOf(papSkriningGizi.getBeratBadan()));
|
|
||||||
assertEquals(String.valueOf((float) 60),String.valueOf(papSkriningGizi.getLingkarKepala()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateSkriningGizi() {
|
|
||||||
PapSkriningGiziVO vo = populateModel();
|
|
||||||
Map<String,Object> result = papSkriningGiziService.addSkriningGizi(vo);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapSkriningGiziVO voUpdate = populateModel();
|
|
||||||
voUpdate.setBeratBadan((float) 100);
|
|
||||||
voUpdate.setTinggiBadan((float) 100);
|
|
||||||
voUpdate.setLingkarKepala((float) 100);
|
|
||||||
|
|
||||||
Map<String,Object> resultUpdate = papSkriningGiziService.addSkriningGizi(voUpdate);
|
|
||||||
assertNotNull(resultUpdate);
|
|
||||||
|
|
||||||
PapSkriningGizi papSkriningGizi = (PapSkriningGizi) resultUpdate.get("papSkriningGizi");
|
|
||||||
assertNotNull(papSkriningGizi);
|
|
||||||
assertEquals(generateDate(),papSkriningGizi.getTglInput());
|
|
||||||
assertEquals(String.valueOf((float) 100),String.valueOf(papSkriningGizi.getTinggiBadan()));
|
|
||||||
assertEquals(String.valueOf((float) 100),String.valueOf(papSkriningGizi.getBeratBadan()));
|
|
||||||
assertEquals(String.valueOf((float) 100),String.valueOf(papSkriningGizi.getLingkarKepala()));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
Date date = generateDatefromString("06/07/2013 12:10:56");
|
|
||||||
Map<String,Object> result = papSkriningGiziService.findByNoCmAndTglInput("000001", date);
|
|
||||||
assertNotNull(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPopulateModel(){
|
|
||||||
/*Cek Pasien Dao*/
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Pasien Converter*/
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Populate Model*/
|
|
||||||
PapSkriningGiziVO vo = populateModel();
|
|
||||||
assertNotNull(vo);
|
|
||||||
assertEquals(generateDate(),vo.getTglInput());
|
|
||||||
assertEquals(String.valueOf((float) 170),String.valueOf(vo.getTinggiBadan()));
|
|
||||||
assertEquals(String.valueOf((float) 68),String.valueOf(vo.getBeratBadan()));
|
|
||||||
assertEquals(String.valueOf((float) 60),String.valueOf(vo.getLingkarKepala()));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapSkriningGiziVO populateModel(){
|
|
||||||
PapSkriningGiziVO vo = new PapSkriningGiziVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
|
|
||||||
// vo.setPasien(pasienVO);
|
|
||||||
vo.setTglInput(generateDate());
|
|
||||||
vo.setTinggiBadan((float) 170);
|
|
||||||
vo.setBeratBadan((float) 68);
|
|
||||||
vo.setLingkarKepala((float) 60);
|
|
||||||
return vo;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate(){
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 12:10:56 PM";
|
|
||||||
|
|
||||||
Date date = null;
|
|
||||||
try {
|
|
||||||
date = formatter.parse(dateInString);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDatefromString(String string){
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
|
|
||||||
|
|
||||||
Date date = null;
|
|
||||||
try {
|
|
||||||
date = formatter.parse(string);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,179 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.DataLokasiNyeri;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapMuskuloskeletal;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapSkriningNyeri;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapSkriningNyeriService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.DataLokasiNyeriVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.DataTipeNyeriVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapSkriningNyeriVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.StatusAdaTidakAdaVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapSkriningNyeriServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapSkriningNyeriService papSkriningNyeriService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddSkriningNyeri() {
|
|
||||||
PapSkriningNyeriVO papSkrinigNyeriVO = populateModel();
|
|
||||||
Map<String,Object> result = papSkriningNyeriService.addSkriningNyeri(papSkrinigNyeriVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
PapSkriningNyeri papSkriningNyeri = ((PapSkriningNyeri) result.get("papSkriningNyeri"));
|
|
||||||
// assertNotNull(papSkriningNyeri);
|
|
||||||
// assertNotNull(papSkriningNyeri.getPasien());
|
|
||||||
// assertEquals("Reynaldi Ramadhani Pratama",((PapSkriningNyeri) result.get("papSkriningNyeri")).getPasien().getNamaPasien());
|
|
||||||
// assertEquals("Frekuensi",((PapSkriningNyeri) result.get("papSkriningNyeri")).getFrekuensi());
|
|
||||||
// assertEquals("Durasi",((PapSkriningNyeri) result.get("papSkriningNyeri")).getDurasi());
|
|
||||||
// assertEquals("Tidak ada",((PapSkriningNyeri) result.get("papSkriningNyeri")).getRasaNyeri().getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateSkriningNyeri() {
|
|
||||||
PapSkriningNyeriVO papSkrinigNyeriVO = populateModel();
|
|
||||||
Map<String,Object> result = papSkriningNyeriService.addSkriningNyeri(papSkrinigNyeriVO);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapSkriningNyeriVO papSkrinigNyeriVOUpdate = populateModel();
|
|
||||||
papSkrinigNyeriVOUpdate.setDurasi("Durasi Update");
|
|
||||||
papSkrinigNyeriVOUpdate.setFrekuensi("Frekuensi Update");
|
|
||||||
Map<String,Object> resultUpdate = papSkriningNyeriService.addSkriningNyeri(papSkrinigNyeriVOUpdate);
|
|
||||||
assertNotNull(resultUpdate);
|
|
||||||
|
|
||||||
// PapSkriningNyeri papSkriningNyeri = ((PapSkriningNyeri) resultUpdate.get("papSkriningNyeri"));
|
|
||||||
// assertNotNull(papSkriningNyeri);
|
|
||||||
// assertNotNull(papSkriningNyeri.getPasien());
|
|
||||||
|
|
||||||
// assertEquals("Frekuensi",((PapSkriningNyeri) resultUpdate.get("papSkriningNyeri")).getFrekuensi());
|
|
||||||
// assertEquals("Durasi",((PapSkriningNyeri) resultUpdate.get("papSkriningNyeri")).getDurasi());
|
|
||||||
// assertEquals("Tidak ada",((PapSkriningNyeri) resultUpdate.get("papSkriningNyeri")).getRasaNyeri().getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
Map<String,Object> result = papSkriningNyeriService.findByNoCmAndTglInput("000000000000005", DateUtil.toDate("2016-07-17 04:26:00"));
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindRegistrasiPelayananPasienByNoCmAndTglRegistrasi() {
|
|
||||||
Map<String,Object> result = papSkriningNyeriService.findByNoCmAndTglInput("000000000000005", DateUtil.toDate("2016-07-17 04:26:00"));
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testfindRegistrasiPelayanaPasien() {
|
|
||||||
Map<String,Object> result = papSkriningNyeriService.findRegistrasiPelayananPasienByNoCmAndTglRegistrasi("000000000000005",(short) 0, DateUtil.toDate("2016-07-17 05:41:29"));
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
// assertTrue(dataFound);
|
|
||||||
assertFalse(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindPasienByNoCm() {
|
|
||||||
Map<String,Object> result = papSkriningNyeriService.findPasienByNoCm("000000000000005");
|
|
||||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPopulateModel(){
|
|
||||||
/*Cek Pasien Dao*/
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
assertNotNull(pasien);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Pasien Converter*/
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
assertNotNull(pasienVO);
|
|
||||||
assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
|
|
||||||
/*Cek Atribut VO*/
|
|
||||||
StatusAdaTidakAdaVO statusAdaTidakAdaVO = new StatusAdaTidakAdaVO();
|
|
||||||
statusAdaTidakAdaVO.setId(1);
|
|
||||||
statusAdaTidakAdaVO.setName("Tidak Ada");
|
|
||||||
assertNotNull(statusAdaTidakAdaVO);
|
|
||||||
assertEquals(String.valueOf(1), String.valueOf(statusAdaTidakAdaVO.getId()));
|
|
||||||
assertEquals("Tidak Ada",statusAdaTidakAdaVO.getName());
|
|
||||||
|
|
||||||
/*Cek PopulateModel*/
|
|
||||||
PapSkriningNyeriVO papSkriningNyeriVO = populateModel();
|
|
||||||
assertEquals("Frekuensi",papSkriningNyeriVO.getFrekuensi());
|
|
||||||
assertEquals("Durasi",papSkriningNyeriVO.getDurasi());
|
|
||||||
assertEquals("Lokasi nyeri 1",papSkriningNyeriVO.getLokasiNyeri().getName());
|
|
||||||
assertEquals("Terus menerus",papSkriningNyeriVO.getTypeNyeri().getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapSkriningNyeriVO populateModel(){
|
|
||||||
PapSkriningNyeriVO papSkriningNyeriVO = new PapSkriningNyeriVO();
|
|
||||||
Pasien pasien = pasienDao.findOne(544);
|
|
||||||
PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
StatusAdaTidakAdaVO statusAdaTidakAdaVO = new StatusAdaTidakAdaVO();
|
|
||||||
statusAdaTidakAdaVO.setId(1);
|
|
||||||
statusAdaTidakAdaVO.setName("Tidak ada");
|
|
||||||
DataLokasiNyeriVO dataLokasiNyeriVO = new DataLokasiNyeriVO();
|
|
||||||
dataLokasiNyeriVO.setId(1);
|
|
||||||
dataLokasiNyeriVO.setName("Lokasi nyeri 1");
|
|
||||||
DataTipeNyeriVO dataTypeNyeriVO = new DataTipeNyeriVO();
|
|
||||||
dataTypeNyeriVO.setId(1);
|
|
||||||
dataTypeNyeriVO.setName("Terus menerus");
|
|
||||||
|
|
||||||
papSkriningNyeriVO.setFrekuensi("Frekuensi");
|
|
||||||
papSkriningNyeriVO.setRasaNyeri(statusAdaTidakAdaVO);
|
|
||||||
papSkriningNyeriVO.setDurasi("Durasi");
|
|
||||||
papSkriningNyeriVO.setTypeNyeri(dataTypeNyeriVO);
|
|
||||||
papSkriningNyeriVO.setLokasiNyeri(dataLokasiNyeriVO);
|
|
||||||
//papSkriningNyeriVO.setPasien(pasienVO);
|
|
||||||
papSkriningNyeriVO.setTglInput(generateDate());
|
|
||||||
return papSkriningNyeriVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate(){
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 12:10:56 PM";
|
|
||||||
|
|
||||||
Date date = null;
|
|
||||||
try {
|
|
||||||
date = formatter.parse(dateInString);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,144 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.service.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
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 org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.converter.PasienConverter;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.PapTandaVital;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.service.PapTandaVitalService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PapTandaVitalVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
|
||||||
import com.jasamedika.medifirst2000.vo.StatusYaTidakVO;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class PapTandaVitalServiceImplTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PapTandaVitalService papTandaVitalService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienConverter pasienConverter;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testAddTandaVital() {
|
|
||||||
/*PapTandaVitalVO vo = populateModel();
|
|
||||||
Map<String,Object> result = papTandaVitalService.addTandaVital(vo);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapTandaVital papTandaVital = (PapTandaVital) result.get("papTandaVital");
|
|
||||||
//assertEquals("Reynaldi Ramadhani Pratama", papTandaVital.getPasien().getNamaPasien());
|
|
||||||
assertEquals("Tidak", papTandaVital.getKesadaran().getName());
|
|
||||||
assertEquals(generateDate(), papTandaVital.getTglInput());*/
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testUpdateTandaVital() {
|
|
||||||
/*PapTandaVitalVO vo = populateModel();
|
|
||||||
Map<String,Object> result = papTandaVitalService.addTandaVital(vo);
|
|
||||||
assertNotNull(result);
|
|
||||||
|
|
||||||
PapTandaVitalVO voUpdate = populateModel();
|
|
||||||
StatusYaTidakVO statusYaTidakVO = new StatusYaTidakVO();
|
|
||||||
statusYaTidakVO.setId(2);
|
|
||||||
statusYaTidakVO.setName("Ya");
|
|
||||||
voUpdate.setKesadaran(statusYaTidakVO);
|
|
||||||
Map<String,Object> resultUpdate = papTandaVitalService.addTandaVital(voUpdate);
|
|
||||||
assertNotNull(resultUpdate);
|
|
||||||
PapTandaVital papTandaVital = (PapTandaVital) resultUpdate.get("papTandaVital");
|
|
||||||
assertEquals("Ya",papTandaVital.getKesadaran().getName());*/
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindByNoCmAndTglInput() {
|
|
||||||
// Map<String,Object> result = papTandaVitalService.findByNoCmAndTglInput("000001", DateUtil.toDate("2013-06-07 12:10:56"));
|
|
||||||
// Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
// assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindRegistrasiPelayananPasienByNoCmAndTglRegistrasi() {
|
|
||||||
// Map<String,Object> result = papTandaVitalService.findRegistrasiPelayananPasienByNoCmAndTglRegistrasi("000000000000005",(short) 0, DateUtil.toDate("2016-07-17 04:26:00"));
|
|
||||||
// Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
// assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testFindPasienByNoCm() {
|
|
||||||
// Map<String,Object> result = papTandaVitalService.findPasienByNoCm("000000000000005");
|
|
||||||
// Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
|
||||||
// assertTrue(dataFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void testPopulateModel(){
|
|
||||||
// /*Cek Pasien Dao*/
|
|
||||||
// Pasien pasien = pasienDao.findOne(544);
|
|
||||||
// assertNotNull(pasien);
|
|
||||||
// assertEquals("Reynaldi Ramadhani Pratama",pasien.getNamaPasien());
|
|
||||||
//
|
|
||||||
// /*Cek Pasien Converter*/
|
|
||||||
// PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
// assertNotNull(pasienVO);
|
|
||||||
// assertEquals("Reynaldi Ramadhani Pratama",pasienVO.getNamaPasien());
|
|
||||||
//
|
|
||||||
// /*Cek VO*/
|
|
||||||
// PapTandaVitalVO vo = populateModel();
|
|
||||||
// //assertEquals("Reynaldi Ramadhani Pratama", vo.getPasien().getNamaPasien());
|
|
||||||
// assertEquals("Tidak", vo.getKesadaran().getName());
|
|
||||||
// assertEquals(generateDate(), vo.getTglInput());
|
|
||||||
}
|
|
||||||
|
|
||||||
private PapTandaVitalVO populateModel(){
|
|
||||||
PapTandaVitalVO vo = new PapTandaVitalVO();
|
|
||||||
// Pasien pasien = pasienDao.findOne(544);
|
|
||||||
// PasienVO pasienVO = pasienConverter.transferModelToVO(pasien,new PasienVO());
|
|
||||||
// StatusYaTidakVO statusYaTidakVO = new StatusYaTidakVO();
|
|
||||||
// statusYaTidakVO.setId(1);
|
|
||||||
// statusYaTidakVO.setName("Tidak");
|
|
||||||
//
|
|
||||||
// //vo.setPasien(pasienVO);
|
|
||||||
// vo.setKesadaran(statusYaTidakVO);
|
|
||||||
// vo.setTglInput(generateDate());
|
|
||||||
return vo;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date generateDate(){
|
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("EEEE, MMM dd, yyyy HH:mm:ss a");
|
|
||||||
String dateInString = "Friday, Jun 7, 2013 12:10:56 PM";
|
|
||||||
|
|
||||||
Date date = null;
|
|
||||||
try {
|
|
||||||
date = formatter.parse(dateInString);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="AdditionalModuleElements">
|
|
||||||
<content url="file://$MODULE_DIR$" dumb="true">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.util;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The Class AgeCalculatorTest.
|
|
||||||
*
|
|
||||||
* @author Roberto
|
|
||||||
*/
|
|
||||||
public class AgeCalculatorTest {
|
|
||||||
|
|
||||||
//@Test
|
|
||||||
public void testGetAge() throws ParseException {
|
|
||||||
// SimpleDateFormat sdf = new SimpleDateFormat("dd-M-yyyy hh:mm:ss");
|
|
||||||
// String dateInString = "11-05-1989 10:20:56";
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("dd-M-yyyy");
|
|
||||||
String dateInString = "11-05-1989";
|
|
||||||
Date birthDate = sdf.parse(dateInString);
|
|
||||||
assertEquals(AgeCalculator.calculateAge(birthDate).getDays(), 0);
|
|
||||||
assertEquals(AgeCalculator.calculateAge(birthDate).getMonths(), 0);
|
|
||||||
assertEquals(AgeCalculator.calculateAge(birthDate).getYears(), 27);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.util;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertFalse;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The Class DateUtilTest.
|
|
||||||
*
|
|
||||||
* @author Roberto
|
|
||||||
*/
|
|
||||||
public class CommonUtilTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testCheckEquality() {
|
|
||||||
|
|
||||||
String object1 = "harkit";
|
|
||||||
String object2 = "Harkit";
|
|
||||||
assertFalse(CommonUtil.checkEquality(object1, object2));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.util;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The Class CurrencyUtilTest.
|
|
||||||
*
|
|
||||||
* @author Roberto
|
|
||||||
*/
|
|
||||||
public class CurrencyUtilTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testGetPriceInINA() {
|
|
||||||
|
|
||||||
double input = 10000000;
|
|
||||||
assertNotNull(CurrencyUtil.getPriceInINA(input));
|
|
||||||
assertEquals(CurrencyUtil.getPriceInINA(input), "Rp. 10.000.000,00");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testGetPriceInUSD() {
|
|
||||||
|
|
||||||
double input = 100.25;
|
|
||||||
assertNotNull(CurrencyUtil.getPriceInUSD(input));
|
|
||||||
assertEquals(CurrencyUtil.getPriceInUSD(input), "$100.25");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.util;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The Class DateUtilTest.
|
|
||||||
*
|
|
||||||
* @author Roberto
|
|
||||||
*/
|
|
||||||
public class DateUtilTest {
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
// public void testGetAge() throws ParseException {
|
|
||||||
// SimpleDateFormat sdf = new SimpleDateFormat("dd-M-yyyy hh:mm:ss");
|
|
||||||
// String dateInString = "30-06-1976 10:20:56";
|
|
||||||
// Date birthDate = sdf.parse(dateInString);
|
|
||||||
// int result = DateUtil.getAge(birthDate);
|
|
||||||
// assertEquals(result, 40);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
// public void testGetMonthOf2Date() throws ParseException {
|
|
||||||
// SimpleDateFormat sdf = new SimpleDateFormat("dd-M-yyyy hh:mm:ss");
|
|
||||||
// String dateInString1 = "30-06-2016 10:20:56";
|
|
||||||
// Date date1 = sdf.parse(dateInString1);
|
|
||||||
// String dateInString2 = "30-05-2016 10:20:56";
|
|
||||||
// Date date2 = sdf.parse(dateInString2);
|
|
||||||
// int result = DateUtil.getMonthOf2Date(date1, date2);
|
|
||||||
// assertEquals(result, 1);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
// public void testFromExcelDateToDate() throws Exception {
|
|
||||||
// String date = "06-2016";
|
|
||||||
//
|
|
||||||
// SimpleDateFormat formatter = new SimpleDateFormat("MM-yyyy");
|
|
||||||
// assertEquals(date, formatter.format(DateUtil.fromExcelDateToDate(date)));
|
|
||||||
// }
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
// public void testGetFirstDate() throws Exception {
|
|
||||||
// SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
|
|
||||||
// System.out.println(DateUtil.getFirstLastDateOfMonth(new Date(), true));
|
|
||||||
// System.out.println(DateUtil.getFirstLastDateOfMonth(new Date(), false));
|
|
||||||
// assertEquals("01-03-2017", formatter.format(DateUtil.getFirstLastDateOfMonth(new Date(), true)));
|
|
||||||
// }
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
// public void testGetLastDate() throws Exception {
|
|
||||||
// SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
|
|
||||||
// System.out.println(DateUtil.getFirstLastDateOfMonth(new Date(), true));
|
|
||||||
// System.out.println(DateUtil.getFirstLastDateOfMonth(new Date(), false));
|
|
||||||
// assertEquals("31-03-2017", formatter.format(DateUtil.getFirstLastDateOfMonth(new Date(), false)));
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.util;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The Class DateUtilTest.
|
|
||||||
*
|
|
||||||
* @author Roberto
|
|
||||||
*/
|
|
||||||
public class IndonesiaNumberToWordsTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testConvert() {
|
|
||||||
long input = 92803;
|
|
||||||
String result = IndonesianNumberToWords.convert(input);
|
|
||||||
assertEquals(result, "sembilan puluh dua ribu delapan ratus tiga");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.util;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The Class PasswordUtilTest.
|
|
||||||
*
|
|
||||||
* @author Roberto
|
|
||||||
*/
|
|
||||||
public class PasswordUtilTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testGeneratePassword() throws NoSuchAlgorithmException,
|
|
||||||
UnsupportedEncodingException {
|
|
||||||
PasswordUtil passwordUtil = new PasswordUtil();
|
|
||||||
String password = "admin";
|
|
||||||
String encryptedPassword = passwordUtil.encryptPassword(password);
|
|
||||||
System.out.println("encryptedPassword (" + password + ") = "
|
|
||||||
+ encryptedPassword);
|
|
||||||
assertNotNull(encryptedPassword);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testPasswordEquals() throws
|
|
||||||
IOException {
|
|
||||||
PasswordUtil passwordUtil = new PasswordUtil();
|
|
||||||
String password = "admin";
|
|
||||||
String hashPassword = "9NEWRrb+A0sJ+41H+acQEy7rdY8=$GCZZyCy+Cs4=";
|
|
||||||
assertTrue(passwordUtil.isPasswordEqual(password, hashPassword));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.util;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The Class RegexUtilTest.
|
|
||||||
*
|
|
||||||
* @author Roberto
|
|
||||||
*/
|
|
||||||
public class RegexUtilTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testValidateIndonesiaPhoneNumber() throws ParseException {
|
|
||||||
assertTrue(StringUtil.validateIndonesiaPhoneNumber("082112345678"));
|
|
||||||
assertTrue(StringUtil.validateIndonesiaPhoneNumber("0821 1234567"));
|
|
||||||
assertTrue(StringUtil.validateIndonesiaPhoneNumber("021 1234567"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testValidateExampleNoRegistration() throws ParseException {
|
|
||||||
assertTrue(StringUtil.validateNoRegistrationExample("REG000001"));
|
|
||||||
assertTrue(StringUtil.validateNoRegistrationExample("REG000021"));
|
|
||||||
assertTrue(StringUtil.validateNoRegistrationExample("REG123456"));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.util;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The Class AgeCalculatorTest.
|
|
||||||
*
|
|
||||||
* @author Roberto
|
|
||||||
*/
|
|
||||||
public class StringUtilTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testNumberFormat() throws ParseException {
|
|
||||||
|
|
||||||
assertEquals(StringUtil.formatNumber("10", 4), "0010");
|
|
||||||
assertEquals(StringUtil.formatNumber("6", 2), "06");
|
|
||||||
|
|
||||||
assertEquals(StringUtil.formatNumber("16", 5), "00016");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,473 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.entities;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.logging.dao.JenisLogDao;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Salman
|
|
||||||
* @version 1.0.0
|
|
||||||
* @since 31/01/2024
|
|
||||||
*/
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration("classpath*:com/jasamedika/**/applicationContext.xml")
|
|
||||||
public class JenisLogTests {
|
|
||||||
private final Logger LOGGER = LoggerFactory.getLogger(JenisLogTests.class);
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private JenisLogDao jenisLogDao;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Transactional
|
|
||||||
public void initJenisLog() {
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Batal Bayar")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Batal Bayar");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Batal Input Master Barang Produksi")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Batal Input Master Barang Produksi");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Batal Input Pengajuan Pelatihan")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Batal Input Pengajuan Pelatihan");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Batal Keluhan Pelanggan")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Batal Keluhan Pelanggan");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Batal Kirim")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Batal Kirim");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Batal Penanganan Keluhan Pelanggan")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Batal Penanganan Keluhan Pelanggan");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Batal Penelitian Kegiatan Eksternal")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Batal Penelitian Kegiatan Eksternal");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Batal Penelitian Kegiatan Pegawai")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Batal Penelitian Kegiatan Pegawai");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Batal Rawat Inap")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Batal Rawat Inap");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Batal Usulan Permintaan Barang")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Batal Usulan Permintaan Barang");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("CPPT")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("CPPT");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Diagnosis")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Diagnosis");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Diskon Layanan")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Diskon Layanan");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Edit Registrasi")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Edit Registrasi");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Hapus ChartOfAccout")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Hapus ChartOfAccout");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Hapus Konsul")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Hapus Konsul");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Hapus Layanan")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Hapus Layanan");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Hapus Layanan Tidak Terklaim")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Hapus Layanan Tidak Terklaim");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Hapus Registrasi")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Hapus Registrasi");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Hapus Resep Apotik")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Hapus Resep Apotik");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Input Barang Kadaluarsa")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Input Barang Kadaluarsa");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Input Resep Apotik")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Input Resep Apotik");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Input SEP")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Input SEP");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Input Tindakan")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Input Tindakan");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Input/Ubah Petugas Layanan")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Input/Ubah Petugas Layanan");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Keluhan Pelanggan")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Keluhan Pelanggan");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Klaim Tindakan Tidak Terklaim")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Klaim Tindakan Tidak Terklaim");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Konsul Ruangan")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Konsul Ruangan");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Konsultasi")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Konsultasi");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Login User")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Login User");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Order Jadwal Bedah")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Order Jadwal Bedah");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Order Laboratorium")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Order Laboratorium");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Order Radiologi")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Order Radiologi");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Order Resep")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Order Resep");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Pasien Pindah")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Pasien Pindah");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Pasien Pulang")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Pasien Pulang");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Pendaftaran Pasien")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Pendaftaran Pasien");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Pengkajian Awal")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Pengkajian Awal");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Pengkajian Keperawatan")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Pengkajian Keperawatan");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Resume Medis")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Resume Medis");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Retur Resep Apotik")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Retur Resep Apotik");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Save SPPB Struk Order")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Save SPPB Struk Order");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Simpan EMR ICU")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Simpan EMR ICU");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Simpan Penelitian Kegiatan Eksternal")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Simpan Penelitian Kegiatan Eksternal");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Simpan Penelitian Kegiatan Pegawai")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Simpan Penelitian Kegiatan Pegawai");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Simpan Struk Pelayanan")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Simpan Struk Pelayanan");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Status Kehadiran Peserta Pelatihan")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Status Kehadiran Peserta Pelatihan");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Stok Opname")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Stok Opname");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Summary List")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Summary List");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Tambah Produk")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Tambah Produk");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Ubah Penelitian Kegiatan Eksternal")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Ubah Penelitian Kegiatan Eksternal");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Ubah Penelitian Kegiatan Pegawai")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Ubah Penelitian Kegiatan Pegawai");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Ubah Produk")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Ubah Produk");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Ubah Rekanan")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Ubah Rekanan");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Ubah Tgl Detail Registrasi")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Ubah Tgl Detail Registrasi");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Ubah Tgl Pelayanan")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Ubah Tgl Pelayanan");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Unverifikasi Pengajuan Pelatihan Bag SDM")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Unverifikasi Pengajuan Pelatihan Bag SDM");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Unverifikasi TataRekening")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Unverifikasi TataRekening");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Update NoStruk Terima Barang")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Update NoStruk Terima Barang");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Update Struk Pelayanan")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Update Struk Pelayanan");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Verifikasi Order Laboratorium")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Verifikasi Order Laboratorium");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Verifikasi Pengajuan Pelatihan Bag SDM")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Verifikasi Pengajuan Pelatihan Bag SDM");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
if (!jenisLogDao.existsByJenisLog("Verifikasi TataRekening")) {
|
|
||||||
JenisLog jenisLog = new JenisLog();
|
|
||||||
jenisLog.setJenisLog("Verifikasi TataRekening");
|
|
||||||
jenisLog.setStatusEnabled(true);
|
|
||||||
jenisLog.setKdProfile((short) 0);
|
|
||||||
jenisLogDao.save(jenisLog);
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info("Initiate jenis log data...!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
||||||
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
|
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
|
||||||
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
|
|
||||||
|
|
||||||
<bean id="tokenAuthenticationService" class="com.jasamedika.medifirst2000.security.service.TokenAuthenticationService" />
|
|
||||||
|
|
||||||
<!-- Configures interceptor -->
|
|
||||||
<mvc:interceptors>
|
|
||||||
<bean class="com.jasamedika.medifirst2000.interceptor.AppInterceptor" />
|
|
||||||
</mvc:interceptors>
|
|
||||||
|
|
||||||
</beans>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user