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>
|
<id>integration</id>
|
||||||
<properties>
|
<properties>
|
||||||
<!--The tests to run-->
|
<!--The tests to run-->
|
||||||
<groups>fast,integration</groups>
|
<groups>fast,unit,integration</groups>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
|
|
||||||
@ -454,7 +454,7 @@
|
|||||||
</build>
|
</build>
|
||||||
<properties>
|
<properties>
|
||||||
<!--The tests to run-->
|
<!--The tests to run-->
|
||||||
<groups>integration</groups>
|
<groups>fast,unit,integration</groups>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</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 static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
|
|
||||||
|
import annotations.UnitTest;
|
||||||
import electrosphere.logger.Logger;
|
import electrosphere.logger.Logger;
|
||||||
import electrosphere.logger.LoggerInterface;
|
import electrosphere.logger.LoggerInterface;
|
||||||
|
|
||||||
@ -19,13 +19,13 @@ public class ServiceManagerTests {
|
|||||||
LoggerInterface.loggerEngine = Mockito.mock(Logger.class);
|
LoggerInterface.loggerEngine = Mockito.mock(Logger.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@UnitTest
|
||||||
public void testInit(){
|
public void testInit(){
|
||||||
ServiceManager serviceManager = new ServiceManager();
|
ServiceManager serviceManager = new ServiceManager();
|
||||||
serviceManager.init();
|
serviceManager.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@UnitTest
|
||||||
public void testRegisterService(){
|
public void testRegisterService(){
|
||||||
ServiceManager serviceManager = new ServiceManager();
|
ServiceManager serviceManager = new ServiceManager();
|
||||||
serviceManager.init();
|
serviceManager.init();
|
||||||
@ -34,7 +34,7 @@ public class ServiceManagerTests {
|
|||||||
assertEquals(service1Mock,service1);
|
assertEquals(service1Mock,service1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@UnitTest
|
||||||
public void testRegisterTwoServices(){
|
public void testRegisterTwoServices(){
|
||||||
ServiceManager serviceManager = new ServiceManager();
|
ServiceManager serviceManager = new ServiceManager();
|
||||||
serviceManager.init();
|
serviceManager.init();
|
||||||
@ -46,7 +46,7 @@ public class ServiceManagerTests {
|
|||||||
assertEquals(service2Mock,service2);
|
assertEquals(service2Mock,service2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@UnitTest
|
||||||
public void testRegisterManyServices(){
|
public void testRegisterManyServices(){
|
||||||
ServiceManager serviceManager = new ServiceManager();
|
ServiceManager serviceManager = new ServiceManager();
|
||||||
serviceManager.init();
|
serviceManager.init();
|
||||||
@ -58,7 +58,7 @@ public class ServiceManagerTests {
|
|||||||
assertEquals(lastMock,lastService);
|
assertEquals(lastMock,lastService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@UnitTest
|
||||||
public void testInstantiate(){
|
public void testInstantiate(){
|
||||||
ServiceManager serviceManager = new ServiceManager();
|
ServiceManager serviceManager = new ServiceManager();
|
||||||
serviceManager.init();
|
serviceManager.init();
|
||||||
@ -75,7 +75,7 @@ public class ServiceManagerTests {
|
|||||||
Mockito.verify(service1Mock, Mockito.times(1)).init();
|
Mockito.verify(service1Mock, Mockito.times(1)).init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@UnitTest
|
||||||
public void testDestroy(){
|
public void testDestroy(){
|
||||||
ServiceManager serviceManager = new ServiceManager();
|
ServiceManager serviceManager = new ServiceManager();
|
||||||
serviceManager.init();
|
serviceManager.init();
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
package electrosphere.engine.signal;
|
package electrosphere.engine.signal;
|
||||||
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.mockito.ArgumentCaptor;
|
import org.mockito.ArgumentCaptor;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
|
|
||||||
|
import annotations.UnitTest;
|
||||||
import electrosphere.engine.signal.Signal.SignalType;
|
import electrosphere.engine.signal.Signal.SignalType;
|
||||||
import electrosphere.logger.Logger;
|
import electrosphere.logger.Logger;
|
||||||
import electrosphere.logger.LoggerInterface;
|
import electrosphere.logger.LoggerInterface;
|
||||||
@ -23,13 +23,13 @@ public class SignalSystemTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@UnitTest
|
||||||
public void testInit(){
|
public void testInit(){
|
||||||
SignalSystem signalSystem = new SignalSystem();
|
SignalSystem signalSystem = new SignalSystem();
|
||||||
signalSystem.init();
|
signalSystem.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@UnitTest
|
||||||
public void testRegister(){
|
public void testRegister(){
|
||||||
SignalSystem signalSystem = new SignalSystem();
|
SignalSystem signalSystem = new SignalSystem();
|
||||||
signalSystem.init();
|
signalSystem.init();
|
||||||
@ -40,7 +40,7 @@ public class SignalSystemTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@UnitTest
|
||||||
public void testPost(){
|
public void testPost(){
|
||||||
SignalSystem signalSystem = new SignalSystem();
|
SignalSystem signalSystem = new SignalSystem();
|
||||||
signalSystem.init();
|
signalSystem.init();
|
||||||
@ -53,7 +53,7 @@ public class SignalSystemTests {
|
|||||||
Mockito.verify(service, Mockito.times(1)).post(signalCaptor.capture());
|
Mockito.verify(service, Mockito.times(1)).post(signalCaptor.capture());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@UnitTest
|
||||||
public void testMultiPost(){
|
public void testMultiPost(){
|
||||||
SignalSystem signalSystem = new SignalSystem();
|
SignalSystem signalSystem = new SignalSystem();
|
||||||
signalSystem.init();
|
signalSystem.init();
|
||||||
@ -69,7 +69,7 @@ public class SignalSystemTests {
|
|||||||
Mockito.verify(service2, Mockito.times(1)).post(signalCaptor.capture());
|
Mockito.verify(service2, Mockito.times(1)).post(signalCaptor.capture());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@UnitTest
|
||||||
public void testPostFiltering(){
|
public void testPostFiltering(){
|
||||||
SignalSystem signalSystem = new SignalSystem();
|
SignalSystem signalSystem = new SignalSystem();
|
||||||
signalSystem.init();
|
signalSystem.init();
|
||||||
@ -89,7 +89,7 @@ public class SignalSystemTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@UnitTest
|
||||||
public void testDeregister(){
|
public void testDeregister(){
|
||||||
SignalSystem signalSystem = new SignalSystem();
|
SignalSystem signalSystem = new SignalSystem();
|
||||||
signalSystem.init();
|
signalSystem.init();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user