Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hertzbeat] add more unit test and test example #324

Merged
merged 7 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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