add unit test tag
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
81ce8b7a4d
commit
f7c4693dc7
4
pom.xml
4
pom.xml
@ -432,7 +432,7 @@
|
||||
<id>integration</id>
|
||||
<properties>
|
||||
<!--The tests to run-->
|
||||
<groups>fast,integration</groups>
|
||||
<groups>fast,unit,integration</groups>
|
||||
</properties>
|
||||
</profile>
|
||||
|
||||
@ -454,7 +454,7 @@
|
||||
</build>
|
||||
<properties>
|
||||
<!--The tests to run-->
|
||||
<groups>integration</groups>
|
||||
<groups>fast,unit,integration</groups>
|
||||
</properties>
|
||||
</profile>
|
||||
|
||||
|
||||
21
src/test/java/annotations/UnitTest.java
Normal file
21
src/test/java/annotations/UnitTest.java
Normal file
@ -0,0 +1,21 @@
|
||||
package annotations;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* A unit test
|
||||
*/
|
||||
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Tag("unit")
|
||||
@Test
|
||||
public @interface UnitTest {
|
||||
|
||||
}
|
||||
@ -3,9 +3,9 @@ package electrosphere.engine.service;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import annotations.UnitTest;
|
||||
import electrosphere.logger.Logger;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
|
||||
@ -19,13 +19,13 @@ public class ServiceManagerTests {
|
||||
LoggerInterface.loggerEngine = Mockito.mock(Logger.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
@UnitTest
|
||||
public void testInit(){
|
||||
ServiceManager serviceManager = new ServiceManager();
|
||||
serviceManager.init();
|
||||
}
|
||||
|
||||
@Test
|
||||
@UnitTest
|
||||
public void testRegisterService(){
|
||||
ServiceManager serviceManager = new ServiceManager();
|
||||
serviceManager.init();
|
||||
@ -34,7 +34,7 @@ public class ServiceManagerTests {
|
||||
assertEquals(service1Mock,service1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@UnitTest
|
||||
public void testRegisterTwoServices(){
|
||||
ServiceManager serviceManager = new ServiceManager();
|
||||
serviceManager.init();
|
||||
@ -46,7 +46,7 @@ public class ServiceManagerTests {
|
||||
assertEquals(service2Mock,service2);
|
||||
}
|
||||
|
||||
@Test
|
||||
@UnitTest
|
||||
public void testRegisterManyServices(){
|
||||
ServiceManager serviceManager = new ServiceManager();
|
||||
serviceManager.init();
|
||||
@ -58,7 +58,7 @@ public class ServiceManagerTests {
|
||||
assertEquals(lastMock,lastService);
|
||||
}
|
||||
|
||||
@Test
|
||||
@UnitTest
|
||||
public void testInstantiate(){
|
||||
ServiceManager serviceManager = new ServiceManager();
|
||||
serviceManager.init();
|
||||
@ -75,7 +75,7 @@ public class ServiceManagerTests {
|
||||
Mockito.verify(service1Mock, Mockito.times(1)).init();
|
||||
}
|
||||
|
||||
@Test
|
||||
@UnitTest
|
||||
public void testDestroy(){
|
||||
ServiceManager serviceManager = new ServiceManager();
|
||||
serviceManager.init();
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
package electrosphere.engine.signal;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import annotations.UnitTest;
|
||||
import electrosphere.engine.signal.Signal.SignalType;
|
||||
import electrosphere.logger.Logger;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
@ -23,13 +23,13 @@ public class SignalSystemTests {
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@UnitTest
|
||||
public void testInit(){
|
||||
SignalSystem signalSystem = new SignalSystem();
|
||||
signalSystem.init();
|
||||
}
|
||||
|
||||
@Test
|
||||
@UnitTest
|
||||
public void testRegister(){
|
||||
SignalSystem signalSystem = new SignalSystem();
|
||||
signalSystem.init();
|
||||
@ -40,7 +40,7 @@ public class SignalSystemTests {
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@UnitTest
|
||||
public void testPost(){
|
||||
SignalSystem signalSystem = new SignalSystem();
|
||||
signalSystem.init();
|
||||
@ -53,7 +53,7 @@ public class SignalSystemTests {
|
||||
Mockito.verify(service, Mockito.times(1)).post(signalCaptor.capture());
|
||||
}
|
||||
|
||||
@Test
|
||||
@UnitTest
|
||||
public void testMultiPost(){
|
||||
SignalSystem signalSystem = new SignalSystem();
|
||||
signalSystem.init();
|
||||
@ -69,7 +69,7 @@ public class SignalSystemTests {
|
||||
Mockito.verify(service2, Mockito.times(1)).post(signalCaptor.capture());
|
||||
}
|
||||
|
||||
@Test
|
||||
@UnitTest
|
||||
public void testPostFiltering(){
|
||||
SignalSystem signalSystem = new SignalSystem();
|
||||
signalSystem.init();
|
||||
@ -89,7 +89,7 @@ public class SignalSystemTests {
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@UnitTest
|
||||
public void testDeregister(){
|
||||
SignalSystem signalSystem = new SignalSystem();
|
||||
signalSystem.init();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user