From d2778ddc78a37971b7e571720be969c2edd064e7 Mon Sep 17 00:00:00 2001 From: jackdaw Date: Wed, 16 Nov 2016 11:08:31 +0900 Subject: [PATCH 1/3] remove hello package --- src/main/java/hello/HelloController.java | 55 ------- src/main/java/hello/JPAConfiguration.java | 17 -- src/main/java/hello/entity/Member.java | 60 ------- .../hello/repository/MemberRepository.java | 19 --- src/test/java/hello/HelloControllerTest.java | 155 ------------------ .../repository/MemberRepositoryTest.java | 73 --------- 6 files changed, 379 deletions(-) delete mode 100644 src/main/java/hello/HelloController.java delete mode 100644 src/main/java/hello/JPAConfiguration.java delete mode 100644 src/main/java/hello/entity/Member.java delete mode 100644 src/main/java/hello/repository/MemberRepository.java delete mode 100644 src/test/java/hello/HelloControllerTest.java delete mode 100644 src/test/java/hello/repository/MemberRepositoryTest.java diff --git a/src/main/java/hello/HelloController.java b/src/main/java/hello/HelloController.java deleted file mode 100644 index c2bc6c8..0000000 --- a/src/main/java/hello/HelloController.java +++ /dev/null @@ -1,55 +0,0 @@ -package hello; - -import hello.entity.Member; -import hello.repository.MemberRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * Created by jackdaw on 16. 11. 9. - */ -@RestController -public class HelloController { - - @Autowired - MemberRepository memberRepository; - -// @RequestMapping("/member") -// public List index() { -// return memberRepository.findAll(); -// } - - @RequestMapping(value = "/member/{id}", method = RequestMethod.GET) - public Member get(@PathVariable(value = "id") long id) { - return memberRepository.findOne(id); - } - - @RequestMapping(value = "/member", method = RequestMethod.GET) - @ResponseBody - public List getList() { - return memberRepository.findAll(); - } - -// @RequestMapping(value = "/member/{id}", method = RequestMethod.PATCH) -// @ResponseBody -// public Member patch(@PathVariable(value = "id") long id, @RequestBody Member member) { -// memberRepository.save(member); -// return member; -// } -// -// @RequestMapping(value = "/member/{id}", method = RequestMethod.PUT) -// @ResponseBody -// public Member update(@PathVariable(value = "id") long id, @RequestBody Member member) { -// memberRepository.save(member); -// return member; -// } -// -// @RequestMapping(value = "/member/{id}", method = RequestMethod.DELETE) -// @ResponseBody -// public List delete(@PathVariable(value = "id") long id) { -// memberRepository.delete(id); -// return memberRepository.findAll(); -// } -} diff --git a/src/main/java/hello/JPAConfiguration.java b/src/main/java/hello/JPAConfiguration.java deleted file mode 100644 index 6003460..0000000 --- a/src/main/java/hello/JPAConfiguration.java +++ /dev/null @@ -1,17 +0,0 @@ -package hello; - - -/** - * Created by jackdaw on 16. 11. 11. - */ -//@Configuration -//public class JPAConfiguration extends RepositoryRestMvcConfiguration { -// -// @Override -// protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) { -// config.exposeIdsFor(Member.class); -// //config.setDefaultMediaType(MediaType.APPLICATION_JSON); -// //config.useHalAsDefaultJsonMediaType(false); -// } -//} - diff --git a/src/main/java/hello/entity/Member.java b/src/main/java/hello/entity/Member.java deleted file mode 100644 index 1fda6a3..0000000 --- a/src/main/java/hello/entity/Member.java +++ /dev/null @@ -1,60 +0,0 @@ -package hello.entity; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import javax.persistence.*; - -/** - * Created by jackdaw on 16. 11. 10. - */ - -@Entity -@JsonIgnoreProperties(ignoreUnknown = true) -public class Member { - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private long id; - - @Column - private String name; - - @Column - private int age; - - public Member() {} - - public Member(String name, int age) { - this.name = name; - this.age = age; - } - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - @Override - public String toString() { - return "[" + id + "] name = " + name + ", age = " + age; - } - -} diff --git a/src/main/java/hello/repository/MemberRepository.java b/src/main/java/hello/repository/MemberRepository.java deleted file mode 100644 index 4657b03..0000000 --- a/src/main/java/hello/repository/MemberRepository.java +++ /dev/null @@ -1,19 +0,0 @@ -package hello.repository; - -import hello.entity.Member; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; - -/** - * Created by jackdaw on 16. 11. 10. - */ - -@RepositoryRestResource(collectionResourceRel = "member", path = "member") -public interface MemberRepository extends JpaRepository { -// List findByNameAndAgeLessThan(String name, int age); -// -// @Query("select t from Member t where name=:name and age < :age") -// List findByNameAndAgeLessThanSQL(@Param("name") String name, @Param("age") int age); -// -// List findByNameAndAgeLessThanOrderByAgeDesc(String name, int age); -} diff --git a/src/test/java/hello/HelloControllerTest.java b/src/test/java/hello/HelloControllerTest.java deleted file mode 100644 index 7cb72f8..0000000 --- a/src/test/java/hello/HelloControllerTest.java +++ /dev/null @@ -1,155 +0,0 @@ -package hello; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.loafle.bridge.Application; -import hello.entity.Member; -import hello.repository.MemberRepository; -import org.apache.log4j.Logger; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.WebIntegrationTest; -import org.springframework.http.MediaType; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.MvcResult; - -import java.util.List; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standaloneSetup; - -/** - * Created by jackdaw on 16. 11. 10. - */ - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = Application.class) -@WebIntegrationTest -public class HelloControllerTest { - - private MockMvc mockMvc; -// @Autowired -// MemberRe controller; - @Autowired - MemberRepository repo; - Logger logger = Logger.getLogger(this.getClass()); - - @Before - public void setUp() throws Exception { - mockMvc = standaloneSetup(repo).build(); - repo.save(new Member("1",1)); - repo.save(new Member("2",2)); - repo.save(new Member("2",2)); - } - - private String jsonStringFromObject(Object object) throws JsonProcessingException { - ObjectMapper mapper = new ObjectMapper(); - return mapper.writeValueAsString(object); - } - - @After - public void tearDown() throws Exception { - repo.deleteAll(); - } - - @Test - public void index() throws Exception { - - String jsonString = jsonStringFromObject(repo.findAll()); - logger.info(jsonString); - mockMvc.perform(get("/member")).andExpect(status().isOk()).andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON)) - .andExpect(content().string(equalTo(jsonString))); - } - - @Test - public void getMember() throws Exception { - List list = repo.findAll(); - String jsonString = this.jsonStringFromObject(list.get(0)); - logger.info(jsonString); - mockMvc.perform(get("/member/{id}", list.get(0).getId())) - .andExpect(status().isOk()) - .andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON)) - .andExpect(content().string(equalTo(jsonString))); - } - - @Test - public void createMember() throws Exception { - Member b = new Member("111",1111); - String jsonString = this.jsonStringFromObject(b); - - MvcResult result = mockMvc.perform(post("/member") - .contentType(MediaType.APPLICATION_JSON) - .content(jsonString)) - .andExpect(status().isOk()) - .andReturn(); - - logger.info(result.getResponse().getContentAsString()); - } - - @Test - public void patchMember() throws Exception { - List list = repo.findAll(); - String jsonString = this.jsonStringFromObject(list.get(0)); - logger.info(jsonString); - list.get(0).setName("test"); - list.get(0).setAge(9999); - jsonString = this.jsonStringFromObject(list.get(0)); - - - MvcResult result = mockMvc.perform( - patch("/member/{id}",list.get(0).getId()). - contentType(MediaType.APPLICATION_JSON). - content(jsonString)). - andExpect(status().isOk()). - andReturn(); - logger.info(result.getResponse().getContentAsString()); - } - - @Test - public void updateMember() throws Exception { - List list = repo.findAll(); - String jsonString = this.jsonStringFromObject(list.get(0)); - logger.info(jsonString); - list.get(0).setName("test"); - list.get(0).setAge(9999); - jsonString = this.jsonStringFromObject(list.get(0)); - - - MvcResult result = mockMvc.perform( - put("/member/{id}",list.get(0).getId()). - contentType(MediaType.APPLICATION_JSON). - content(jsonString)). - andExpect(status().isOk()). - andReturn(); - logger.info(result.getResponse().getContentAsString()); - } - - @Test - public void deleteMember() throws Exception { - List list = repo.findAll(); - - long id = list.get(0).getId(); - String jsonString = this.jsonStringFromObject(list); - - list.remove(0); - String compareString = this.jsonStringFromObject(list); - - mockMvc.perform(delete("/member/{id}", id) - .content(jsonString)) - .andExpect(status().isOk()) - .andExpect(content().string(equalTo(compareString))); - - - - - } - -} \ No newline at end of file diff --git a/src/test/java/hello/repository/MemberRepositoryTest.java b/src/test/java/hello/repository/MemberRepositoryTest.java deleted file mode 100644 index a1ca9de..0000000 --- a/src/test/java/hello/repository/MemberRepositoryTest.java +++ /dev/null @@ -1,73 +0,0 @@ -package hello.repository; - -import com.loafle.bridge.Application; -import hello.entity.Member; -import org.junit.After; -import org.junit.Before; -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 java.util.List; - -import static org.junit.Assert.assertEquals; - -/** - * Created by jackdaw on 16. 11. 10. - */ - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = Application.class) -public class MemberRepositoryTest { - @Autowired - MemberRepository repo; - - @Before - public void setup() { - repo.deleteAll(); - repo.save(new Member("1",1)); - repo.save(new Member("2",2)); - repo.save(new Member("3",3)); - repo.save(new Member("4",4)); - repo.save(new Member("5",5)); - } - - @After - public void down() { - repo.deleteAll(); - } - - @Test - public void create() { - Member m = new Member("test",1); - Member n = repo.save(m); - - assertEquals(m.getId(),n.getId()); - } - - @Test - public void getAll() { - assertEquals(repo.findAll().size(),5); - } - - @Test - public void delete() { - List l = repo.findAll(); - Member m = l.get(0); - repo.delete(m.getId()); - assertEquals(repo.findAll().size(),4); - } - - @Test - public void update() { - List l = repo.findAll(); - Member m = l.get(0); - m.setName("TTTTT"); - - Member n = repo.save(m); - assertEquals(m.getName(),n.getName()); - } - -} \ No newline at end of file From ea914f8ce733d02dae6ca016dc4c62dfda7886fd Mon Sep 17 00:00:00 2001 From: geek Date: Wed, 16 Nov 2016 11:36:57 +0900 Subject: [PATCH 2/3] timeout added --- .../loafle/bridge/discoveryport/constant/DirectionType.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/loafle/bridge/discoveryport/constant/DirectionType.java b/src/main/java/com/loafle/bridge/discoveryport/constant/DirectionType.java index eaf430b..9592114 100644 --- a/src/main/java/com/loafle/bridge/discoveryport/constant/DirectionType.java +++ b/src/main/java/com/loafle/bridge/discoveryport/constant/DirectionType.java @@ -5,7 +5,8 @@ package com.loafle.bridge.discoveryport.constant; */ public enum DirectionType { Send("S"), - Recv("R"); + Recv("R"), + Timeout("T"); private String stringValue; DirectionType(String string) {stringValue = string;} From 04da526b058282663df3a85fd661c7d4cbb769aa Mon Sep 17 00:00:00 2001 From: jackdaw Date: Wed, 16 Nov 2016 12:23:21 +0900 Subject: [PATCH 3/3] . --- .../discoveryport/constant/PortType.java | 3 +- .../discoveryport/entity/DiscoveryPort.java | 33 +++++++-- .../entity/ServiceScanHistory.java | 22 ++++-- .../DiscoveryServiceController.java | 16 +++++ .../entity/DiscoveryService.java | 68 +++++++++++++++++++ .../DiscoveryServiceRepository.java | 9 ++- .../DiscoveryServiceRepositoryTest.java | 48 +++++++++++++ 7 files changed, 183 insertions(+), 16 deletions(-) create mode 100644 src/test/java/com/loafle/bridge/discoveryservice/repository/DiscoveryServiceRepositoryTest.java diff --git a/src/main/java/com/loafle/bridge/discoveryport/constant/PortType.java b/src/main/java/com/loafle/bridge/discoveryport/constant/PortType.java index b07ac23..62966b1 100644 --- a/src/main/java/com/loafle/bridge/discoveryport/constant/PortType.java +++ b/src/main/java/com/loafle/bridge/discoveryport/constant/PortType.java @@ -6,7 +6,8 @@ package com.loafle.bridge.discoveryport.constant; public enum PortType { TCP("TCP"), - UDP("UDP"); + UDP("UDP"), + TLS("TLS"); private String stringValue; PortType(String string) {stringValue = string;} diff --git a/src/main/java/com/loafle/bridge/discoveryport/entity/DiscoveryPort.java b/src/main/java/com/loafle/bridge/discoveryport/entity/DiscoveryPort.java index cb4d574..520b18b 100644 --- a/src/main/java/com/loafle/bridge/discoveryport/entity/DiscoveryPort.java +++ b/src/main/java/com/loafle/bridge/discoveryport/entity/DiscoveryPort.java @@ -10,28 +10,44 @@ import java.util.List; public class DiscoveryPort { @Id - @Column(name = "ID") @GeneratedValue(strategy = GenerationType.AUTO) private long id; // @ManyToOne // @JoinColumn(name = "HOST_ID", nullable = false) // private DiscoveryHost host; - - @Column(name = "PORT_TYPE",nullable = false) +//public DiscoveryHost getHost() { +// return host; +//} +// +// public void setHost(DiscoveryHost host) { +// this.host = host; +// } + @Column(nullable = false) @Enumerated(EnumType.STRING) private PortType portType; - @Column(name = "PORT_NUMBER",nullable = false) + @Column(nullable = false) private short portNumber; - @OneToMany(mappedBy = "port" , fetch = FetchType.LAZY) + @OneToMany(mappedBy = "port") private List histories; - @Column(name = "CREATE_DATE", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, insertable = false, updatable = false) +// @OneToMany(mappedBy = "port") +// private List services; +// +// public List getServices() { +// return services; +// } +// +// public void setServices(List services) { +// this.services = services; +// } + + @Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, insertable = false, updatable = false) private Date createDate; - @Column(name = "UPDATE_DATE", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, insertable = false) + @Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false) private Date updateDate; @@ -83,6 +99,9 @@ public class DiscoveryPort { } public Date getUpdateDate() { + if (this.updateDate == null) { + this.updateDate = new Date(); + } return updateDate; } diff --git a/src/main/java/com/loafle/bridge/discoveryport/entity/ServiceScanHistory.java b/src/main/java/com/loafle/bridge/discoveryport/entity/ServiceScanHistory.java index 555758f..21e1150 100644 --- a/src/main/java/com/loafle/bridge/discoveryport/entity/ServiceScanHistory.java +++ b/src/main/java/com/loafle/bridge/discoveryport/entity/ServiceScanHistory.java @@ -13,28 +13,38 @@ import java.util.Date; public class ServiceScanHistory { @Id - @Column(name = "ID") @GeneratedValue(strategy = GenerationType.AUTO) private long id; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "PORT_ID") + @JoinColumn private DiscoveryPort port; - @Column(name = "SERVICE_NAME", nullable = false) + @Column(nullable = false) private String serviceName; - @Column(name = "DIRECTION", nullable = false) + @Column(nullable = false) @Enumerated(EnumType.STRING) private DirectionType direction; - @Column(name = "CREATE_DATE", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, insertable = false, updatable = false) + @Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, insertable = false, updatable = false) private Date createDate; @Lob - @Column(name = "PACKET", nullable = false) + @Column(nullable = false) private byte[] packet; + @Column + private String description; + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + public ServiceScanHistory() {} public ServiceScanHistory(DiscoveryPort port, String serviceName, DirectionType direction, byte[] packet, Date createAt) { diff --git a/src/main/java/com/loafle/bridge/discoveryservice/controller/DiscoveryServiceController.java b/src/main/java/com/loafle/bridge/discoveryservice/controller/DiscoveryServiceController.java index 69bb0b4..ccee053 100644 --- a/src/main/java/com/loafle/bridge/discoveryservice/controller/DiscoveryServiceController.java +++ b/src/main/java/com/loafle/bridge/discoveryservice/controller/DiscoveryServiceController.java @@ -1,7 +1,23 @@ package com.loafle.bridge.discoveryservice.controller; +import com.loafle.bridge.discoveryservice.entity.DiscoveryService; +import com.loafle.bridge.discoveryservice.repository.DiscoveryServiceRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + /** * Created by root on 16. 11. 15. */ +@RestController public class DiscoveryServiceController { + @Autowired + DiscoveryServiceRepository repository; + + @RequestMapping(value = "/discoveryService/{id}", method = RequestMethod.GET) + public DiscoveryService get(@PathVariable(value = "id") long id) { + return repository.findOne(id); + } } diff --git a/src/main/java/com/loafle/bridge/discoveryservice/entity/DiscoveryService.java b/src/main/java/com/loafle/bridge/discoveryservice/entity/DiscoveryService.java index 774b5dc..fc81375 100644 --- a/src/main/java/com/loafle/bridge/discoveryservice/entity/DiscoveryService.java +++ b/src/main/java/com/loafle/bridge/discoveryservice/entity/DiscoveryService.java @@ -1,7 +1,75 @@ package com.loafle.bridge.discoveryservice.entity; +import com.loafle.bridge.discoveryport.constant.PortType; + +import javax.persistence.*; +import java.util.Date; + /** * Created by root on 16. 11. 15. */ +@Entity public class DiscoveryService { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private long id; + +// @ManyToOne +// @JoinColumn(nullable = false) +// private DiscoveryPort port; +// public DiscoveryPort getPort() { +// return port; +// } +// +// public void setPort(DiscoveryPort port) { +// this.port = port; +// } + + @Column(nullable = false) + @Enumerated(EnumType.STRING) + private PortType portType; + + @Column(nullable = false) + private String serviceName; + + @Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, insertable = false, updatable = false) + private Date createDate; + + @Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false) + private Date updateDate; + + public DiscoveryService() {} + + public DiscoveryService(PortType t, String serviceName) { + this.portType = t; + this.serviceName = serviceName; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public Date getUpdateDate() { + if (this.updateDate == null) { + this.updateDate = new Date(); + } + return updateDate; + } + + public void setUpdateDate(Date updateDate) { + this.updateDate = updateDate; + } } diff --git a/src/main/java/com/loafle/bridge/discoveryservice/repository/DiscoveryServiceRepository.java b/src/main/java/com/loafle/bridge/discoveryservice/repository/DiscoveryServiceRepository.java index 6e0b671..fb1427b 100644 --- a/src/main/java/com/loafle/bridge/discoveryservice/repository/DiscoveryServiceRepository.java +++ b/src/main/java/com/loafle/bridge/discoveryservice/repository/DiscoveryServiceRepository.java @@ -1,7 +1,12 @@ package com.loafle.bridge.discoveryservice.repository; +import com.loafle.bridge.discoveryservice.entity.DiscoveryService; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + /** * Created by root on 16. 11. 15. */ -public class DiscoveryServiceRepository { -} +@RepositoryRestResource(collectionResourceRel = "discoveryService", path = "discoveryService") +public interface DiscoveryServiceRepository extends JpaRepository { +} \ No newline at end of file diff --git a/src/test/java/com/loafle/bridge/discoveryservice/repository/DiscoveryServiceRepositoryTest.java b/src/test/java/com/loafle/bridge/discoveryservice/repository/DiscoveryServiceRepositoryTest.java new file mode 100644 index 0000000..980e898 --- /dev/null +++ b/src/test/java/com/loafle/bridge/discoveryservice/repository/DiscoveryServiceRepositoryTest.java @@ -0,0 +1,48 @@ +package com.loafle.bridge.discoveryservice.repository; + +import com.loafle.bridge.Application; +import com.loafle.bridge.discoveryport.constant.PortType; +import com.loafle.bridge.discoveryservice.entity.DiscoveryService; +import org.apache.log4j.Logger; +import org.junit.After; +import org.junit.Before; +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 java.util.List; + +import static org.junit.Assert.assertEquals; + +/** + * Created by root on 16. 11. 16. + */ + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = Application.class) +public class DiscoveryServiceRepositoryTest { + + @Autowired + private DiscoveryServiceRepository repo; + private Logger log = Logger.getLogger(this.getClass()); + + @Before + public void Before() { + repo.save(new DiscoveryService(PortType.TLS,"HTTP")); + repo.save(new DiscoveryService(PortType.TCP,"WMI")); + repo.save(new DiscoveryService(PortType.UDP,"DNS")); + } + + @After + public void After() { + repo.deleteAll(); + } + + @Test + public void TestBefore() { + List l = repo.findAll(); + assertEquals(3, l.size()); + } +} \ No newline at end of file