Skip to content

Commit

Permalink
[hertzbeat] add more unit test case and example (#324)
Browse files Browse the repository at this point in the history
  [manger] add mockito unit test

  [manger] add mockito unit test

  [hertzbeat] test framework demo

  [hertzbeat] test framework demo

  [hertzbeat] test framework demo
  • Loading branch information
tomsun28 committed Oct 4, 2022
1 parent 07e54de commit 1457617
Show file tree
Hide file tree
Showing 83 changed files with 2,360 additions and 120 deletions.
21 changes: 21 additions & 0 deletions alerter/src/test/java/com/usthe/alert/AlerterWorkerPoolTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.usthe.alert;

import com.usthe.alert.controller.AlertDefineController;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

/**
* Test case for {@link AlerterWorkerPool}
*/
class AlerterWorkerPoolTest {

@BeforeEach
void setUp() {
}

@Test
void executeJob() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.usthe.alert.controller;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

/**
* Test case for {@link AlertDefineController}
*/
class AlertDefineControllerTest {

@BeforeEach
void setUp() {
}

@Test
void addNewAlertDefine() {
}

@Test
void modifyAlertDefine() {
}

@Test
void getAlertDefine() {
}

@Test
void deleteAlertDefine() {
}

@Test
void applyAlertDefineMonitorsBind() {
}

@Test
void getAlertDefineMonitorsBind() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.usthe.alert.controller;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

/**
* Test case for {@link AlertDefinesController}
*/
class AlertDefinesControllerTest {

@BeforeEach
void setUp() {
}

@Test
void getAlertDefines() {
}

@Test
void deleteAlertDefines() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.usthe.alert.controller;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

/**
* Test case for {@link AlertsController}
*/
class AlertsControllerTest {

@BeforeEach
void setUp() {
}

@Test
void getAlerts() {
}

@Test
void deleteAlerts() {
}

@Test
void clearAllAlerts() {
}

@Test
void applyAlertDefinesStatus() {
}

@Test
void getAlertsSummary() {
}

@Test
void addNewAlertReport() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package com.usthe.alert.service;

import com.usthe.alert.controller.AlertDefineController;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

/**
* Test case for {@link AlertDefineService}
*/
class AlertDefineServiceTest {

@BeforeEach
void setUp() {
}

@Test
void validate() {
}

@Test
void addAlertDefine() {
}

@Test
void modifyAlertDefine() {
}

@Test
void deleteAlertDefine() {
}

@Test
void getAlertDefine() {
}

@Test
void deleteAlertDefines() {
}

@Test
void getMonitorBindAlertDefines() {
}

@Test
void applyBindAlertDefineMonitors() {
}

@Test
void testGetMonitorBindAlertDefines() {
}

@Test
void getAlertDefines() {
}

@Test
void getBindAlertDefineMonitors() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.usthe.alert.service;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

/**
* Test case for {@link AlertService}
*/
class AlertServiceTest {

@BeforeEach
void setUp() {
}

@Test
void addAlert() {
}

@Test
void getAlerts() {
}

@Test
void deleteAlerts() {
}

@Test
void clearAlerts() {
}

@Test
void editAlertStatus() {
}

@Test
void getAlertsSummary() {
}

@Test
void addNewAlertReport() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.usthe.alert.util;

import com.usthe.alert.service.AlertService;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

/**
* Test case for {@link AlertTemplateUtil}
*/
class AlertTemplateUtilTest {

@BeforeEach
void setUp() {
}

@Test
void render() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import com.google.gson.JsonElement;
import com.usthe.collector.dispatch.MetricsTaskDispatch;
import com.usthe.collector.util.CollectUtil;
import com.usthe.collector.util.SpringContextHolder;
import com.usthe.common.entity.job.Configmap;
import com.usthe.common.entity.job.Job;
import com.usthe.common.entity.job.Metrics;
import com.usthe.common.support.SpringContextHolder;
import com.usthe.common.util.AesUtil;
import com.usthe.common.util.CommonConstants;
import lombok.extern.slf4j.Slf4j;
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion collector/src/main/resources/META-INF/spring.factories
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ com.usthe.collector.dispatch.DispatchProperties,\
com.usthe.collector.dispatch.MetricsCollectorQueue,\
com.usthe.collector.dispatch.WorkerPool,\
com.usthe.collector.dispatch.entrance.internal.CollectJobService,\
com.usthe.collector.util.SpringContextHolder,\
com.usthe.collector.collect.database.JdbcSpiLoader,\
com.usthe.collector.collect.http.promethus.PrometheusParseCreater

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.usthe.collector.collect.common.cache;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

/**
* Test case for {@link CommonCache}
*/
class CommonCacheTest {

@BeforeEach
void setUp() {
}

@AfterEach
void tearDown() {
}

@Test
void addCache() {
}

@Test
void testAddCache() {
}

@Test
void getCache() {
}

@Test
void removeCache() {
}

@Test
void getInstance() {
}
}
Loading

0 comments on commit 1457617

Please sign in to comment.