Merge remote-tracking branch 'origin/master'

This commit is contained in:
geek 2017-06-26 16:10:54 +09:00
commit 7daa3fd741
3 changed files with 62 additions and 1 deletions

View File

@ -0,0 +1,12 @@
package com.loafle.overflow.module.probe.dao;
import com.loafle.overflow.module.probe.model.ProbeTask;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by snoop on 17. 6. 26.
*/
@Repository
public interface ProbeTaskDAO extends JpaRepository<ProbeTask, Long> {
}

View File

@ -3,6 +3,7 @@ package com.loafle.overflow.meta.dao;
import com.loafle.overflow.AppConfig; import com.loafle.overflow.AppConfig;
import com.loafle.overflow.JdbcConfiguration; import com.loafle.overflow.JdbcConfiguration;
import com.loafle.overflow.meta.model.MetaProbeTaskType; import com.loafle.overflow.meta.model.MetaProbeTaskType;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -24,7 +25,7 @@ public class MetaProbeTaskTypeDAOTest {
@Autowired @Autowired
private MetaProbeTaskTypeDAO metaProbeTaskTypeDAO; private MetaProbeTaskTypeDAO metaProbeTaskTypeDAO;
@Ignore
@Test @Test
public void Create() { public void Create() {

View File

@ -0,0 +1,48 @@
package com.loafle.overflow.module.probe.dao;
import com.loafle.overflow.AppConfig;
import com.loafle.overflow.JdbcConfiguration;
import com.loafle.overflow.meta.model.MetaProbeTaskType;
import com.loafle.overflow.module.probe.model.Probe;
import com.loafle.overflow.module.probe.model.ProbeTask;
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 static org.junit.Assert.*;
/**
* Created by snoop on 17. 6. 26.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
public class ProbeTaskDAOTest {
@Autowired
private ProbeTaskDAO probeTaskDAO;
@Test
public void Create() {
ProbeTask probeTask = new ProbeTask();
MetaProbeTaskType typeDiscovery = new MetaProbeTaskType();
typeDiscovery.setId((short)1);
probeTask.setMetaProbeTaskType(typeDiscovery);
probeTask.setData("");
Probe probe = new Probe();
probe.setId(1);
probeTask.setProbe(probe);
this.probeTaskDAO.save(probeTask);
}
}