aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
authorshentao <shentao@chinamobile.com>2017-09-20 21:32:03 +0800
committershentao <shentao@chinamobile.com>2017-09-20 21:32:14 +0800
commit3132da22b04febc6df23504f82e0f8b13d163697 (patch)
treef948a464fdee9afdc6a0bf59667f84eaedc96585 /src/test/java
parentc4163c72a1ffb6742dd203e197f76fefe9baa9f9 (diff)
Upload monitor service code for usecase-ui
Change-Id: I0e437747bbeba94d93da47b9b7dc1e4f53cc78f3 Issue-Id: USECASEUI-41 Signed-off-by: shentao <shentao@chinamobile.com>
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/onap/usecaseui/server/UsecaseuiServerApplicationTests.java45
1 files changed, 43 insertions, 2 deletions
diff --git a/src/test/java/org/onap/usecaseui/server/UsecaseuiServerApplicationTests.java b/src/test/java/org/onap/usecaseui/server/UsecaseuiServerApplicationTests.java
index 34aad8e2..4fc3e747 100644
--- a/src/test/java/org/onap/usecaseui/server/UsecaseuiServerApplicationTests.java
+++ b/src/test/java/org/onap/usecaseui/server/UsecaseuiServerApplicationTests.java
@@ -15,16 +15,57 @@
*/
package org.onap.usecaseui.server;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.onap.usecaseui.server.bean.AlarmsHeader;
+import org.onap.usecaseui.server.bean.AlarmsInformation;
+import org.onap.usecaseui.server.service.AlarmsHeaderService;
+import org.onap.usecaseui.server.service.AlarmsInformationService;
+import org.onap.usecaseui.server.service.impl.AlarmsHeaderServiceImpl;
+import org.onap.usecaseui.server.service.impl.AlarmsInformationServiceImpl;
+import org.onap.usecaseui.server.util.Page;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class UsecaseuiServerApplicationTests {
-
+
+// @Autowired
+// AlarmsInformationService info;
+
+ @Autowired
+ AlarmsHeaderService alarm;
+
@Test
- public void contextLoads() {
+ public void contextLoads() throws ParseException {
+// AlarmsInformation in= new AlarmsInformation();
+// Date date =new Date();
+// in.setName("name");
+// in.setEventId("eventId");
+// in.setValue("value");
+// in.setCreateTime(date);
+// in.setUpdateTime(date);
+// String d=info.saveAlarmsInformation(in);
+// String d=info.updateAlarmsInformation(in);
+
+// int c=alarm.getAllCount();
+
+ AlarmsHeader a = new AlarmsHeader();
+// a.setVersion("1");
+ a.setDomain("3");
+// SimpleDateFormat e =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+// a.setCreateTime(e.parse("2017-09-03 15:25:11"));
+ Page<AlarmsHeader> b = alarm.queryAlarmsHeader(a, 1, 5);
+ String c =b.getList().get(0).getEventName();
+ System.out.println("============"+c);
+ Assert.assertEquals("2", c);
+
}
}