diff --git a/sre/io.janusproject/io.janusproject.plugin/src/main/sarl/io/sarl/sre/boot/internal/services/LoggerCreatorModule.sarl b/sre/io.janusproject/io.janusproject.plugin/src/main/sarl/io/sarl/sre/boot/internal/services/LoggerCreatorModule.sarl index 77e1d7f84d..9e36fefda7 100644 --- a/sre/io.janusproject/io.janusproject.plugin/src/main/sarl/io/sarl/sre/boot/internal/services/LoggerCreatorModule.sarl +++ b/sre/io.janusproject/io.janusproject.plugin/src/main/sarl/io/sarl/sre/boot/internal/services/LoggerCreatorModule.sarl @@ -28,7 +28,6 @@ import io.bootique.BQModule import io.bootique.BQModuleProvider import io.sarl.sre.boot.configs.SreConfig import io.sarl.sre.services.logging.jul.JulLoggerCreator -import java.util.logging.Logger import javax.inject.Provider import javax.inject.Singleton import org.arakhne.afc.bootique.log4j.configs.Log4jIntegrationConfig @@ -57,10 +56,9 @@ class LoggerCreatorModule extends AbstractModule { @Provides @Singleton def provideLoggerCreator(loggingConfig : Provider, sreConfig : Provider, - injector : Injector, loggerProvider : Provider) : JulLoggerCreator { + injector : Injector) : JulLoggerCreator { var creator = new JulLoggerCreator( loggingConfig.get.level.toJul, - loggerProvider, sreConfig) injector.injectMembers(creator) return creator diff --git a/sre/io.janusproject/io.janusproject.plugin/src/main/sarl/io/sarl/sre/services/logging/jul/JulLoggerCreator.sarl b/sre/io.janusproject/io.janusproject.plugin/src/main/sarl/io/sarl/sre/services/logging/jul/JulLoggerCreator.sarl index b3df59a83b..5560734d98 100644 --- a/sre/io.janusproject/io.janusproject.plugin/src/main/sarl/io/sarl/sre/services/logging/jul/JulLoggerCreator.sarl +++ b/sre/io.janusproject/io.janusproject.plugin/src/main/sarl/io/sarl/sre/services/logging/jul/JulLoggerCreator.sarl @@ -22,9 +22,9 @@ package io.sarl.sre.services.logging.jul import io.sarl.sre.boot.configs.SreConfig import io.sarl.sre.boot.configs.subconfigs.LoggingConfig -import java.io.PrintStream import java.util.logging.Formatter import java.util.logging.Level +import java.util.logging.LogManager import java.util.logging.Logger import javax.inject.Provider @@ -38,80 +38,34 @@ import javax.inject.Provider */ class JulLoggerCreator { - val defaultLevel : Level + public val PLATFORM_LOGGER_NAME_PREFIX = "Janus-SRE" - val loggerProvider : Provider + val defaultLevel : Level val configProvider : Provider + val loggerProvider : (String)=>Logger + var config : LoggingConfig var defaultProgramName : String - var consoleFormatter : Formatter - var platformFormatter : Formatter /** Build a logger creator. * * @param defaultLevel the logging level for new loggers. - * @param loggerProvider the provider of loggers. * @param configProvider the provider of SRE configuration. + * @param loggerProvider the provider of loggers to use; if {@code null}, the default JUL log manager is used. */ - new (defaultLevel : Level, loggerProvider : Provider, configProvider : Provider) { + new (defaultLevel : Level, configProvider : Provider, loggerProvider : (String)=>Logger = null) { this.defaultLevel = defaultLevel - this.loggerProvider = loggerProvider this.configProvider = configProvider - } - - /** Replies the log formatter for the console messages. - * - * @return the log formatter, never {@code null}. - */ - synchronized def getConsoleFormatter : Formatter { - if (this.consoleFormatter === null) { - this.consoleFormatter = createConsoleFormatter - } - return this.consoleFormatter - } - - /** Change the log formatter for the console messages. - * - * @param formatter the log formatter, or {@code null} to use the default. - */ - synchronized def setConsoleFormatter(formatter : Formatter) { - this.consoleFormatter = formatter - } - - /** Create a formatter for the console messages. - * - * @return the newly created instance of formatter. - */ - protected def createConsoleFormatter : Formatter { - new JulPatternFormatter(this.loggingConfig.platformMessageFormat) - } - - /** - * Create a logger with the given output for the console. - * - * @param name the name of the new logger. - * @param output the output. - * @return the logger. - * @since 0.7.0 - */ - def createConsoleLogger(name : String, output : PrintStream) : Logger { - val logger = this.loggerProvider.get - val nhandler = new JulOutputStreamConsoleHandler(output, getConsoleFormatter) - var allHandlers = logger.handlers - if (allHandlers !== null) { - for (handler : allHandlers) { - logger.removeHandler(handler) - } + if (loggerProvider === null) { + this.loggerProvider = [ Logger::getLogger(it) ] + } else { + this.loggerProvider = loggerProvider } - logger.addHandler(nhandler) - logger.useParentHandlers = false - logger.level = this.defaultLevel - return logger } /** Replies the log formatter for the SRE kernel. @@ -162,7 +116,10 @@ class JulLoggerCreator { * @since 0.7.0 */ def createPlatformLogger() : Logger { - val logger = this.loggerProvider.get + LogManager::logManager.reset + val kernelId = this.configProvider.get.boot.rootContextID + val loggerName = PLATFORM_LOGGER_NAME_PREFIX + "-K-" + kernelId + val logger = this.loggerProvider.apply(loggerName) val stderr = new JulStandardErrorOutputConsoleHandler(getPlatformFormatter) stderr.level = Level::ALL val stdout = new JulStandardOutputConsoleHandler(getPlatformFormatter) @@ -176,7 +133,7 @@ class JulLoggerCreator { logger.addHandler(stderr) logger.addHandler(stdout) logger.useParentHandlers = false - logger.level = Level::ALL + logger.level = this.defaultLevel return logger } @@ -194,11 +151,11 @@ class JulLoggerCreator { } else { name } - val logger = Logger::getLogger(thename) + val logger = this.loggerProvider.apply(PLATFORM_LOGGER_NAME_PREFIX + "-M-" + thename) if (parent !== null) { logger.parent = parent + logger.useParentHandlers = true } - logger.useParentHandlers = true logger.level = this.defaultLevel return logger } diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/boot/bootstrap/BootstrapTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/boot/bootstrap/BootstrapTest.sarl index b44f6d3649..9ead0e1a4b 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/boot/bootstrap/BootstrapTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/boot/bootstrap/BootstrapTest.sarl @@ -46,6 +46,7 @@ import static io.sarl.sre.test.framework.Constants.* import static extension org.junit.jupiter.api.Assertions.* import static extension org.mockito.ArgumentCaptor.* import static extension org.mockito.Mockito.* +import org.junit.jupiter.api.RepeatedTest /** * @author $Author: sgalland$ @@ -62,6 +63,7 @@ import static extension org.mockito.Mockito.* @DisplayName("run: Bootstrap test") @Tag("sre-run") @Tag("janus") +@Tag("sre-run-tmp") class BootstrapTest { @Nullable @@ -76,7 +78,7 @@ class BootstrapTest { this.bootID = UUID::nameUUIDFromBytes(typeof(BootAgent1).name.bytes) } - @Test + @RepeatedTest(5) @DisplayName("Default context ID") def defaultContextUUID(extension rc : SreRunContext) { System::setProperty(VariableNames::toPropertyName(BootConfig::ROOT_CONTEXT_BOOT_TYPE_NAME), @@ -87,7 +89,7 @@ class BootstrapTest { assertEquals(defaultID, id) } - @Test + @RepeatedTest(5) @DisplayName("Name-based context ID") def bootContextUUID(extension rc : SreRunContext) { System::setProperty(VariableNames::toPropertyName(BootConfig::ROOT_CONTEXT_BOOT_TYPE_NAME), @@ -99,7 +101,7 @@ class BootstrapTest { assertEquals(bootID, id) } - @Test + @RepeatedTest(5) @DisplayName("Random context ID") def randomContextUUID(extension rc : SreRunContext) { System::setProperty(VariableNames::toPropertyName(BootConfig::ROOT_CONTEXT_BOOT_TYPE_NAME), @@ -111,7 +113,7 @@ class BootstrapTest { assertNotEquals(bootID, id) } - @Test + @RepeatedTest(5) @DisplayName("startAgentWithID(Class, UUID)") def startAgentWithID(extension rc : SreRunContext) { val kern = setupTheSreKernel(null, null) @@ -124,7 +126,7 @@ class BootstrapTest { id.assertEquals(actual) } - @Test + @RepeatedTest(5) @DisplayName("sreStopped") def sreStartedStopped(extension rc : SreRunContext) { val observer = typeof(SREListener).mock diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug794/mocks/AbstractSpawnerAgent.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug794/mocks/AbstractSpawnerAgent.sarl index 76231abfd7..0dbe456636 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug794/mocks/AbstractSpawnerAgent.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug794/mocks/AbstractSpawnerAgent.sarl @@ -56,6 +56,7 @@ abstract agent AbstractSpawnerAgent { buildAgentInitializationParameters) } + @SuppressWarnings("discouraged_occurrence_readonly_use") on AgentSpawned [occurrence.source.UUID == ID] { addResult(occurrence.agentID) } diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug861/mocks/BootAgent0.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug861/mocks/BootAgent0.sarl index 602658c54d..a13bda62ad 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug861/mocks/BootAgent0.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug861/mocks/BootAgent0.sarl @@ -27,6 +27,7 @@ import io.sarl.sre.test.framework.skills.TestingCapacity import io.sarl.sre.test.framework.skills.TestingSkill import io.sarl.sre.tests.runtime.internal.mocks.Bye +@SuppressWarnings("discouraged_occurrence_readonly_use") agent BootAgent0 { uses Lifecycle diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug861/mocks/BootAgent1.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug861/mocks/BootAgent1.sarl index 7335a71aa8..5c2a3530de 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug861/mocks/BootAgent1.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug861/mocks/BootAgent1.sarl @@ -27,6 +27,7 @@ import io.sarl.sre.test.framework.skills.TestingCapacity import io.sarl.sre.test.framework.skills.TestingSkill import java.util.concurrent.atomic.AtomicBoolean +@SuppressWarnings("discouraged_occurrence_readonly_use") agent BootAgent1 { uses Lifecycle diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug861/mocks/EmptyAgent1.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug861/mocks/EmptyAgent1.sarl index 517fcda229..822ff89033 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug861/mocks/EmptyAgent1.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug861/mocks/EmptyAgent1.sarl @@ -26,6 +26,7 @@ import io.sarl.core.Lifecycle import io.sarl.sre.test.framework.skills.TestingCapacity import io.sarl.sre.test.framework.skills.TestingSkill +@SuppressWarnings("discouraged_occurrence_readonly_use") agent EmptyAgent1 { uses DefaultContextInteractions, Lifecycle diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug973/mocks/AgentBug973.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug973/mocks/AgentBug973.sarl index 8c2c149d27..8fe1879bb0 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug973/mocks/AgentBug973.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug973/mocks/AgentBug973.sarl @@ -34,6 +34,7 @@ agent AgentBug973 { var theSkill : SkillBug973 + @SuppressWarnings("potential_field_synchronization_problem") on Initialize { setSkill(new TestingSkill(occurrence)) // Add a fake skill in order to have at least 2 registered skills diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug973/mocks/AgentBug973b.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug973/mocks/AgentBug973b.sarl index f4a47e38cd..31dc995d2f 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug973/mocks/AgentBug973b.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug973/mocks/AgentBug973b.sarl @@ -30,6 +30,7 @@ agent AgentBug973b { var theSkill : SkillBug973 + @SuppressWarnings("potential_field_synchronization_problem") on Initialize { setSkill(new TestingSkill(occurrence)) // Add a fake skill in order to have at least 2 registered skills diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug973/mocks/AgentBug973c.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug973/mocks/AgentBug973c.sarl index 824b231ee2..b8d89ddfb4 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug973/mocks/AgentBug973c.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug973/mocks/AgentBug973c.sarl @@ -33,6 +33,7 @@ agent AgentBug973c { var theSkill : SkillBug973 + @SuppressWarnings("potential_field_synchronization_problem") on Initialize { setSkill(new TestingSkill(occurrence)) // Add a fake skill in order to have at least 2 registered skills diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug977/Bug977Test.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug977/Bug977Test.sarl index 77103951f4..74f524efbb 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug977/Bug977Test.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/bugs/bug977/Bug977Test.sarl @@ -36,9 +36,10 @@ import org.junit.jupiter.api.RepetitionInfo import org.junit.jupiter.api.Tag import org.junit.jupiter.api.^extension.ExtendWith -import static extension io.sarl.tests.api.tools.TestAssertions.* import static io.sarl.sre.test.framework.Constants.* +import static extension io.sarl.tests.api.tools.TestAssertions.* + /** Tests for issue #977: Problem with multiple initialize event in Behavior inheritance demos. * *

See: https://github.com/sarl/sarl/issues/977 diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/OnSpaceDestroyedTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/OnSpaceDestroyedTest.sarl index 814f2ca9a2..0bf2096806 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/OnSpaceDestroyedTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/OnSpaceDestroyedTest.sarl @@ -31,10 +31,9 @@ import io.sarl.sre.tests.runtime.internal.mocks.SpaceDestroyedAgent0 import io.sarl.tests.api.extensions.ContextInitExtension import io.sarl.tests.api.extensions.JavaVersionCheckExtension import java.util.UUID -import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.DisplayName -import org.junit.jupiter.api.RepeatedTest import org.junit.jupiter.api.Tag +import org.junit.jupiter.api.Test import org.junit.jupiter.api.^extension.ExtendWith import static io.sarl.sre.test.framework.Constants.* @@ -42,7 +41,6 @@ import static io.sarl.sre.test.framework.Constants.* import static extension io.sarl.sre.tests.framework.SreTestUtilities.* import static extension io.sarl.tests.api.tools.TestAssertions.* import static extension org.junit.jupiter.api.Assertions.* -import org.junit.jupiter.api.Test /** * @author $Author: sgalland$ diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/ContextJoinedAgent0.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/ContextJoinedAgent0.sarl index 822907df2b..17bb0fbf42 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/ContextJoinedAgent0.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/ContextJoinedAgent0.sarl @@ -35,6 +35,7 @@ import io.sarl.sre.test.framework.skills.TestingSkill * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ +@SuppressWarnings("discouraged_occurrence_readonly_use", "potential_field_synchronization_problem") agent ContextJoinedAgent0 { uses Lifecycle, InnerContextAccess, DefaultContextInteractions diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/ContextJoinedAgent1.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/ContextJoinedAgent1.sarl index 107fd3700d..f3dcf13f76 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/ContextJoinedAgent1.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/ContextJoinedAgent1.sarl @@ -21,17 +21,15 @@ package io.sarl.sre.tests.runtime.internal.mocks -import io.sarl.core.Behaviors import io.sarl.core.ContextJoined import io.sarl.core.DefaultContextInteractions +import io.sarl.core.ExternalContextAccess import io.sarl.core.Initialize import io.sarl.core.InnerContextAccess import io.sarl.core.Lifecycle -import io.sarl.core.OpenEventSpace +import io.sarl.sre.services.context.Context import io.sarl.sre.test.framework.skills.TestingCapacity import io.sarl.sre.test.framework.skills.TestingSkill -import io.sarl.sre.services.context.Context -import io.sarl.core.ExternalContextAccess /** * @author $Author: sgalland$ @@ -39,6 +37,7 @@ import io.sarl.core.ExternalContextAccess * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ +@SuppressWarnings("potential_field_synchronization_problem", "discouraged_occurrence_readonly_use") agent ContextJoinedAgent1 { uses Lifecycle, InnerContextAccess, DefaultContextInteractions, ExternalContextAccess diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/JoinerAgent1.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/JoinerAgent1.sarl index 96f9cecc66..76a4f63fdb 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/JoinerAgent1.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/JoinerAgent1.sarl @@ -34,6 +34,7 @@ import io.sarl.sre.test.framework.skills.TestingSkill * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ +@SuppressWarnings("discouraged_occurrence_readonly_use") agent JoinerAgent1 { uses TestingCapacity, Schedules, Lifecycle diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/JoinerAgent3.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/JoinerAgent3.sarl index 81dab7e1b3..0aef3c78a5 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/JoinerAgent3.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/JoinerAgent3.sarl @@ -38,6 +38,7 @@ import java.util.UUID * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ +@SuppressWarnings("discouraged_occurrence_readonly_use") agent JoinerAgent3 { uses DefaultContextInteractions, Schedules, Behaviors, Lifecycle diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberJoinedAgent0.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberJoinedAgent0.sarl index fa3a08a2c1..26118ece44 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberJoinedAgent0.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberJoinedAgent0.sarl @@ -37,6 +37,7 @@ import static extension io.sarl.tests.api.tools.TestUtils.* * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ +@SuppressWarnings("potential_field_synchronization_problem", "discouraged_occurrence_readonly_use") agent MemberJoinedAgent0 { uses Lifecycle, InnerContextAccess, DefaultContextInteractions diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberJoinedAgent1.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberJoinedAgent1.sarl index 8197a16c82..fd989e3c8c 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberJoinedAgent1.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberJoinedAgent1.sarl @@ -39,6 +39,7 @@ import static extension io.sarl.tests.api.tools.TestUtils.* * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ +@SuppressWarnings("potential_field_synchronization_problem", "discouraged_occurrence_readonly_use") agent MemberJoinedAgent1 { uses Lifecycle, InnerContextAccess, DefaultContextInteractions, Behaviors diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberJoinedAgent2.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberJoinedAgent2.sarl index 82bc8c9c67..da4bbdab23 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberJoinedAgent2.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberJoinedAgent2.sarl @@ -37,6 +37,7 @@ import static extension io.sarl.tests.api.tools.TestUtils.* * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ +@SuppressWarnings("potential_field_synchronization_problem", "discouraged_occurrence_readonly_use") agent MemberJoinedAgent2 { uses Lifecycle, InnerContextAccess, DefaultContextInteractions diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberLeftAgent0.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberLeftAgent0.sarl index 408b120106..3549c7d26a 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberLeftAgent0.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberLeftAgent0.sarl @@ -38,6 +38,7 @@ import static extension io.sarl.sre.tests.framework.SreTestUtilities.* * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ +@SuppressWarnings("potential_field_synchronization_problem") agent MemberLeftAgent0 { uses Lifecycle, InnerContextAccess, DefaultContextInteractions diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberLeftAgent1.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberLeftAgent1.sarl index dd1ce4450f..d8d49d1e79 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberLeftAgent1.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/MemberLeftAgent1.sarl @@ -39,6 +39,7 @@ import static extension io.sarl.tests.api.tools.TestUtils.* * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ +@SuppressWarnings("potential_field_synchronization_problem", "discouraged_occurrence_readonly_use") agent MemberLeftAgent1 { uses Lifecycle, InnerContextAccess, DefaultContextInteractions, ExternalContextAccess diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpaceDestroyedAgent0.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpaceDestroyedAgent0.sarl index ab4f4a7b6d..3d4bbff927 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpaceDestroyedAgent0.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpaceDestroyedAgent0.sarl @@ -37,6 +37,7 @@ import io.sarl.sre.test.framework.skills.TestingSkill * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ +@SuppressWarnings("potential_field_synchronization_problem", "discouraged_occurrence_readonly_use") agent SpaceDestroyedAgent0 { uses DefaultContextInteractions, InnerContextAccess, Lifecycle, Behaviors diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent0.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent0.sarl index a3a13fb748..82e6fa17ed 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent0.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent0.sarl @@ -34,6 +34,7 @@ import io.sarl.sre.test.framework.skills.TestingSkill * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ +@SuppressWarnings("discouraged_occurrence_readonly_use") agent SpyAgent0 { uses Lifecycle, DefaultContextInteractions diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent1.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent1.sarl index 5631411e01..518f97a273 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent1.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent1.sarl @@ -34,6 +34,7 @@ import io.sarl.sre.test.framework.skills.TestingSkill * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ +@SuppressWarnings("discouraged_occurrence_readonly_use") agent SpyAgent1 { uses Lifecycle, DefaultContextInteractions diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent2.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent2.sarl index 4cdab8c285..00c7aec768 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent2.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent2.sarl @@ -34,6 +34,7 @@ import io.sarl.sre.test.framework.skills.TestingSkill * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ +@SuppressWarnings("discouraged_occurrence_readonly_use") agent SpyAgent2 { uses Lifecycle, DefaultContextInteractions diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent3.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent3.sarl index 06122ee880..5c9cdc92c1 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent3.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/internal/mocks/SpyAgent3.sarl @@ -34,6 +34,7 @@ import io.sarl.sre.test.framework.skills.TestingSkill * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ +@SuppressWarnings("discouraged_occurrence_readonly_use") agent SpyAgent3 { uses Lifecycle, DefaultContextInteractions diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/spaces/EventRoutingTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/spaces/EventRoutingTest.sarl index 9c7798234c..8122fce1fa 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/spaces/EventRoutingTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/spaces/EventRoutingTest.sarl @@ -59,8 +59,18 @@ class EventRoutingTest { @Test def unchangedEventSource_inspace(extension rc : SreRunContext) { - val kern = typeof(TargetAgent).setupTheSreKernel(null, null) - kern.startAgent(typeof(SourceAgent), agentInitializationParameters) + val kern = setupTheSreKernel(null, null) + + val ag1 = UUID::randomUUID + waitForAgentSpawned(ag1) [ + kern.startAgentWithID(typeof(TargetAgent), ag1, agentInitializationParameters) + ] + + val ag2 = UUID::randomUUID + waitForAgentSpawned(ag2) [ + kern.startAgentWithID(typeof(SourceAgent), ag2, agentInitializationParameters) + ] + waitForTheKernel(STANDARD_TIMEOUT) var adr = getFirstResultOfType(typeof(Address)) @@ -75,12 +85,20 @@ class EventRoutingTest { val kern = setupTheSreKernel(null, null) val ag1 = UUID::randomUUID - kern.startAgentWithID(typeof(TargetAgent), ag1, agentInitializationParameters) + waitForAgentSpawned(ag1) [ + kern.startAgentWithID(typeof(TargetAgent), ag1, agentInitializationParameters) + ] val ag2 = UUID::randomUUID - kern.startAgentWithID(typeof(TargetAgent), ag2, agentInitializationParameters) + waitForAgentSpawned(ag2) [ + kern.startAgentWithID(typeof(TargetAgent), ag2, agentInitializationParameters) + ] + + val ag3 = UUID::randomUUID + waitForAgentSpawned(ag3) [ + kern.startAgentWithID(typeof(SourceAgent), ag3, agentInitializationParameters) + ] - kern.startAgent(typeof(SourceAgent), agentInitializationParameters) waitForTheKernel(STANDARD_TIMEOUT) var adr1 = getResult(ag1, typeof(Address), 0) diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/spaces/mocks/SourceAgent2.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/spaces/mocks/SourceAgent2.sarl index bca7d67125..e59364b689 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/spaces/mocks/SourceAgent2.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/runtime/spaces/mocks/SourceAgent2.sarl @@ -37,6 +37,7 @@ import io.sarl.sre.test.framework.skills.TestingSkill * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ +@SuppressWarnings("discouraged_occurrence_readonly_use") agent SourceAgent2 { uses Behaviors, Lifecycle, Schedules, InnerContextAccess diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/KernelTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/KernelTest.sarl index 7f8dbb7b83..2fb3510f48 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/KernelTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/KernelTest.sarl @@ -64,6 +64,7 @@ import io.sarl.sre.boot.configs.SreConfig ]) @Tag("janus") @Tag("unit") +@Tag("sre-unit") @DisplayName("unit: Kernel test") class KernelTest { diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/boot/SreMainTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/boot/SreMainTest.sarl index 54669195aa..c232393c98 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/boot/SreMainTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/boot/SreMainTest.sarl @@ -77,6 +77,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: SreMain test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SreMainTest { public val DEFAULT_OPTIONS = #[ diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/AgentPlatformEventEmitterTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/AgentPlatformEventEmitterTest.sarl index e9496b344c..96ee6bfec3 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/AgentPlatformEventEmitterTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/AgentPlatformEventEmitterTest.sarl @@ -71,6 +71,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: AgentEventEmitter test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class AgentEventEmitterTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/ContextMemberPlatformEventEmitterTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/ContextMemberPlatformEventEmitterTest.sarl index a1d358b08c..950b6aa822 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/ContextMemberPlatformEventEmitterTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/ContextMemberPlatformEventEmitterTest.sarl @@ -67,6 +67,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: ContextMemberEventEmitter test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class ContextMemberEventEmitterTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/MutableBooleanTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/MutableBooleanTest.sarl index b07160bfc1..c58d3cc3e7 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/MutableBooleanTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/MutableBooleanTest.sarl @@ -47,6 +47,7 @@ import static extension org.junit.jupiter.api.Assertions.* @DisplayName("unit: MutableBoolean test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class MutableBooleanTest { @Test diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/SpaceParticipantPlatformEventEmitterTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/SpaceParticipantPlatformEventEmitterTest.sarl index 377619d163..3bd1e307da 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/SpaceParticipantPlatformEventEmitterTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/SpaceParticipantPlatformEventEmitterTest.sarl @@ -68,6 +68,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: SpaceParticipantEventEmitter test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SpaceParticipantEventEmitterTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/SpacePlatformEventEmitterTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/SpacePlatformEventEmitterTest.sarl index 1df1b5a4e4..530b59d422 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/SpacePlatformEventEmitterTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/SpacePlatformEventEmitterTest.sarl @@ -66,6 +66,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: SpaceEventEmitter test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SpaceEventEmitterTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/SubholonContextPlatformEventEmitterTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/SubholonContextPlatformEventEmitterTest.sarl index 1b084f6429..5e46902f80 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/SubholonContextPlatformEventEmitterTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/SubholonContextPlatformEventEmitterTest.sarl @@ -61,6 +61,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: SubHolonContextEventEmitter test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SubHolonContextEventEmitterTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/eventguard/BehaviorGuardEvaluatorRegistryTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/eventguard/BehaviorGuardEvaluatorRegistryTest.sarl index 8873b8eae6..b56cdfd8f0 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/eventguard/BehaviorGuardEvaluatorRegistryTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/eventguard/BehaviorGuardEvaluatorRegistryTest.sarl @@ -60,6 +60,7 @@ import io.sarl.lang.core.Behavior @DisplayName("unit: BehaviorGuardEvaluatorRegistry test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class BehaviorGuardEvaluatorRegistryTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/eventguard/BehaviorGuardEvaluatorTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/eventguard/BehaviorGuardEvaluatorTest.sarl index 01f00a1cd1..4895abac9c 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/eventguard/BehaviorGuardEvaluatorTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/eventguard/BehaviorGuardEvaluatorTest.sarl @@ -43,6 +43,7 @@ import static extension org.junit.jupiter.api.Assertions.* @DisplayName("unit: BehaviorGuardEvaluator test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class BehaviorGuardEvaluatorTest { @Test diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/eventguard/StaticBehaviorGuardEvaluatorDictionaryTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/eventguard/StaticBehaviorGuardEvaluatorDictionaryTest.sarl index 1ac6c6705b..f3384f69d8 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/eventguard/StaticBehaviorGuardEvaluatorDictionaryTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/internal/eventguard/StaticBehaviorGuardEvaluatorDictionaryTest.sarl @@ -49,6 +49,7 @@ import static extension org.junit.jupiter.api.Assertions.* @DisplayName("unit: StaticBehaviorGuardEvaluatorDictionary test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class StaticBehaviorGuardEvaluatorDictionaryTest { @Test diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/AgentNameTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/AgentNameTest.sarl index f44e55efef..571f2625e4 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/AgentNameTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/AgentNameTest.sarl @@ -54,6 +54,7 @@ import static extension org.mockito.Mockito.spy @DisplayName("unit: AgentName test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class AgentNameTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/AgentSchemeNameParserTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/AgentSchemeNameParserTest.sarl index 30cf864ad4..21294b6033 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/AgentSchemeNameParserTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/AgentSchemeNameParserTest.sarl @@ -56,6 +56,7 @@ import static extension org.junit.jupiter.api.Assertions.assertNull @DisplayName("unit: agent NameParser test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class AgentSchemeNameParserTest { protected static val CONTEXT_ID = "2a2c6de4-8327-431b-a916-97a05caafe14" diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/BehaviorNameTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/BehaviorNameTest.sarl index 8e28287e3c..5e8b67b4da 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/BehaviorNameTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/BehaviorNameTest.sarl @@ -56,6 +56,7 @@ import static extension org.mockito.Mockito.spy @DisplayName("unit: BehaviorName test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SkillNameTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/BehaviorSchemeNameParserTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/BehaviorSchemeNameParserTest.sarl index 262154bb4d..b1e64d2615 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/BehaviorSchemeNameParserTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/BehaviorSchemeNameParserTest.sarl @@ -58,6 +58,7 @@ import static extension org.junit.jupiter.api.Assertions.assertNull @DisplayName("unit: behavior NameParser test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class BehaviorSchemeNameParserTest { protected static val CONTEXT_ID = "2a2c6de4-8327-431b-a916-97a05caafe14" diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ContextNameTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ContextNameTest.sarl index 02d56ad0ee..59c510aeae 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ContextNameTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ContextNameTest.sarl @@ -54,6 +54,7 @@ import static extension org.mockito.Mockito.spy @DisplayName("unit: ContextName test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class ContextNameTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ContextSchemeNameParserTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ContextSchemeNameParserTest.sarl index d18199e02f..a050310e71 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ContextSchemeNameParserTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ContextSchemeNameParserTest.sarl @@ -56,6 +56,7 @@ import static extension org.junit.jupiter.api.Assertions.assertNull @DisplayName("unit: context NameParser test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class ContextSchemeNameParserTest { protected static val CONTEXT_ID = "2a2c6de4-8327-431b-a916-97a05caafe14" diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/INameParserTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/INameParserTest.sarl index 6b931562e6..fc16174d63 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/INameParserTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/INameParserTest.sarl @@ -48,6 +48,7 @@ import static extension org.junit.jupiter.api.Assertions.assertSame @DisplayName("unit: INameParser test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class INameParserTest { @Test diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/NameParserTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/NameParserTest.sarl index 4a061c4c45..e16165c26a 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/NameParserTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/NameParserTest.sarl @@ -56,6 +56,7 @@ import static extension org.junit.jupiter.api.Assertions.assertNull @DisplayName("unit: base NameParser test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class NameParserTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SarlNameTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SarlNameTest.sarl index 69d06304a7..8be55e9d17 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SarlNameTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SarlNameTest.sarl @@ -55,6 +55,7 @@ import static extension org.mockito.Mockito.spy @DisplayName("unit: SarlName test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SarlNameTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ServiceNameTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ServiceNameTest.sarl index 8a0e8a1039..fae4b746e9 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ServiceNameTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ServiceNameTest.sarl @@ -54,6 +54,7 @@ import static extension org.mockito.Mockito.spy @DisplayName("unit: ContextName test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class ContextNameTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ServiceSchemeNameParserTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ServiceSchemeNameParserTest.sarl index fdf703fd8e..0bfa2b7aab 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ServiceSchemeNameParserTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/ServiceSchemeNameParserTest.sarl @@ -56,6 +56,7 @@ import static extension org.junit.jupiter.api.Assertions.assertNull @DisplayName("unit: service NameParser test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class ServiceSchemeNameParserTest { val SERVICE_ID = typeof(LoggingService).name diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SkillNameTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SkillNameTest.sarl index f8f766eae8..2f86e081eb 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SkillNameTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SkillNameTest.sarl @@ -56,6 +56,7 @@ import static extension org.mockito.Mockito.spy @DisplayName("unit: SkillName test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SkillNameTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SkillSchemeNameParserTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SkillSchemeNameParserTest.sarl index e7e96c0392..eee71099a0 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SkillSchemeNameParserTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SkillSchemeNameParserTest.sarl @@ -57,6 +57,7 @@ import static extension org.junit.jupiter.api.Assertions.assertNull @DisplayName("unit: skill NameParser test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SkillSchemeNameParserTest { protected static val CONTEXT_ID = "2a2c6de4-8327-431b-a916-97a05caafe14" diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SpaceNameTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SpaceNameTest.sarl index d810f3f5b0..4789ebfa22 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SpaceNameTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SpaceNameTest.sarl @@ -54,6 +54,7 @@ import static extension org.mockito.Mockito.spy @DisplayName("unit: SpaceName test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SpaceNameTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SpaceSchemeNameParserTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SpaceSchemeNameParserTest.sarl index d7ede018be..4017e00061 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SpaceSchemeNameParserTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/naming/SpaceSchemeNameParserTest.sarl @@ -56,6 +56,7 @@ import static extension org.junit.jupiter.api.Assertions.assertNull @DisplayName("unit: space NameParser test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SpaceSchemeNameParserTest { protected static val CONTEXT_ID = "2a2c6de4-8327-431b-a916-97a05caafe14" diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/AbstractServiceManagerTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/AbstractServiceManagerTest.sarl index 4b9c3f7dcd..bc3bf70734 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/AbstractServiceManagerTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/AbstractServiceManagerTest.sarl @@ -40,7 +40,6 @@ import io.sarl.sre.tests.units.services.mocks.SreServ5Impl import io.sarl.tests.api.Nullable import io.sarl.tests.api.extensions.ContextInitExtension import io.sarl.tests.api.extensions.JavaVersionCheckExtension -import java.io.PrintStream import java.util.List import java.util.concurrent.atomic.AtomicInteger import java.util.logging.Logger @@ -113,7 +112,6 @@ abstract class AbstractServiceManagerTest { this.loggerCreator = typeof(JulLoggerCreator).mock when(this.loggerCreator.createPlatformLogger).thenReturn(this.logger) when(this.loggerCreator.createModuleLogger(any, typeof(Logger).any)).thenReturn(this.logger) - when(this.loggerCreator.createConsoleLogger(any, typeof(PrintStream).any)).thenReturn(this.logger) this.counter = new AtomicInteger this.counter2 = new AtomicInteger this.service1 = new SreServ1Impl(counter, counter2) diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/GoogleServiceManagerTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/GoogleServiceManagerTest.sarl index 265e318d6c..49f575e90e 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/GoogleServiceManagerTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/GoogleServiceManagerTest.sarl @@ -37,6 +37,7 @@ import org.junit.jupiter.api.Tag @DisplayName("unit: GoogleServiceManager test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class GoogleServiceManagerTest extends AbstractServiceManagerTest { override newServiceManagerInstance(loggerCreator : JulLoggerCreator, services : Iterable, diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/context/ContextTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/context/ContextTest.sarl index 9d08462c53..634fbb1654 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/context/ContextTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/context/ContextTest.sarl @@ -65,6 +65,7 @@ import static extension io.sarl.tests.api.tools.TestMockito.mock @DisplayName("unit: Context test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class ContextTest { var root : Agent diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/context/LocalSpaceRepositoryTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/context/LocalSpaceRepositoryTest.sarl index 77ce259cce..067e7ed8ef 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/context/LocalSpaceRepositoryTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/context/LocalSpaceRepositoryTest.sarl @@ -39,6 +39,7 @@ import org.junit.jupiter.api.Tag @DisplayName("unit: LocalSpaceRepository test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class LocalSpaceRepositoryTest extends AbstractSpaceRepositoryTest> { protected def newSpaceRepository : LocalSpaceRepository { diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/context/MemoryBasedContextServiceTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/context/MemoryBasedContextServiceTest.sarl index 79ae2690d3..f6b560ce55 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/context/MemoryBasedContextServiceTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/context/MemoryBasedContextServiceTest.sarl @@ -35,6 +35,7 @@ import org.junit.jupiter.api.Tag @DisplayName("unit: MemoryBasedContextService test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class MemoryBasedContextServiceTest extends AbstractInjectionBasedContextServiceTest { override newService(rootContext : Context) : MemoryBasedContextService { diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/JreExecutorServiceTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/JreExecutorServiceTest.sarl index 7ac95d1082..b4405d4947 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/JreExecutorServiceTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/JreExecutorServiceTest.sarl @@ -67,6 +67,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: JreExecutorService test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class JreExecutorServiceTest extends AbstractExecutorServiceTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/NotShutdownQuietThreadExecutorPolicyTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/NotShutdownQuietThreadExecutorPolicyTest.sarl index 7d6466849b..293df0aa87 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/NotShutdownQuietThreadExecutorPolicyTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/NotShutdownQuietThreadExecutorPolicyTest.sarl @@ -62,6 +62,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: not-shutdown QuietThreadExecutorPolicy test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class NotShutdownQuietThreadExecutorPolicyTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/NotShutdownVerboseThreadExecutorPolicyTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/NotShutdownVerboseThreadExecutorPolicyTest.sarl index dba3711607..7d12919522 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/NotShutdownVerboseThreadExecutorPolicyTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/NotShutdownVerboseThreadExecutorPolicyTest.sarl @@ -62,6 +62,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: not-shutdown VeboseThreadExecutorPolicy test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class NotShutdownVerboseThreadExecutorPolicyTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/ShutdownQuietThreadExecutorPolicyTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/ShutdownQuietThreadExecutorPolicyTest.sarl index d2796429de..72a180d687 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/ShutdownQuietThreadExecutorPolicyTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/ShutdownQuietThreadExecutorPolicyTest.sarl @@ -62,6 +62,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: shutdown QuietThreadExecutorPolicy test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class ShutdownQuietThreadExecutorPolicyTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/ShutdownVerboseThreadExecutorPolicyTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/ShutdownVerboseThreadExecutorPolicyTest.sarl index f27d144b96..8d308eda0a 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/ShutdownVerboseThreadExecutorPolicyTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/ShutdownVerboseThreadExecutorPolicyTest.sarl @@ -62,6 +62,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: shutdown VeboseThreadExecutorPolicy test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class ShutdownVerboseThreadExecutorPolicyTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/SreCallableTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/SreCallableTest.sarl index 4055a1a8f9..dec9aa8c5a 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/SreCallableTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/SreCallableTest.sarl @@ -58,6 +58,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: SreCallable test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SreCallableTest { @Mock diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/SreRunnableTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/SreRunnableTest.sarl index f3819708e7..7071cf548d 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/SreRunnableTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/executor/SreRunnableTest.sarl @@ -58,6 +58,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: SreRunnable test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SreRunnableTest { @Mock diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/infrastructure/BasicInfrastructureServiceTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/infrastructure/BasicInfrastructureServiceTest.sarl index 36bc1d9ca3..4c0dae4460 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/infrastructure/BasicInfrastructureServiceTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/infrastructure/BasicInfrastructureServiceTest.sarl @@ -48,6 +48,7 @@ import static org.junit.jupiter.api.Assertions.* @DisplayName("unit: BasicInfrastructureService test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class BasicInfrastructureServiceTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/AgentLifeTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/AgentLifeTest.sarl index 5fdb5d5065..6aaf3b70c5 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/AgentLifeTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/AgentLifeTest.sarl @@ -89,6 +89,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: AgentLife test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class AgentLifeTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/BasicSkillUninstallerTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/BasicSkillUninstallerTest.sarl index 585046dc37..a8c5151036 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/BasicSkillUninstallerTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/BasicSkillUninstallerTest.sarl @@ -62,6 +62,7 @@ import static extension org.mockito.Mockito.spy @DisplayName("unit: BasicSkillUninstaller test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") @SuppressWarnings("use_reserved_sarl_annotation") class BasicSkillUninstallerTest { diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/BehaviorTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/BehaviorTest.sarl index f560c9a49e..37893aa143 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/BehaviorTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/BehaviorTest.sarl @@ -52,6 +52,7 @@ import static extension io.sarl.tests.api.tools.TestMockito.mock @DisplayName("unit: Behavior test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class BehaviorTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/InjectionBasedLifecycleServiceTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/InjectionBasedLifecycleServiceTest.sarl index bd239c76af..4565392088 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/InjectionBasedLifecycleServiceTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/InjectionBasedLifecycleServiceTest.sarl @@ -44,6 +44,7 @@ import org.junit.jupiter.api.Tag @DisplayName("unit: InjectionBasedLifecycleService test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class InjectionBasedLifecycleServiceTest extends AbstractLifecycleServiceTest { override newService(executor : ExecutorService, logger : LoggingService, skillUninstaller : SkillUninstaller, diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/StandardLifecycleServiceTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/StandardLifecycleServiceTest.sarl index 231c94ee7d..0270a2e3b0 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/StandardLifecycleServiceTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/StandardLifecycleServiceTest.sarl @@ -44,6 +44,7 @@ import org.junit.jupiter.api.Tag @DisplayName("unit: StandardLifecycleService test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class StandardLifecycleServiceTest extends AbstractLifecycleServiceTest { override newService(executor : ExecutorService, logger : LoggingService, skillUninstaller : SkillUninstaller, diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/XAbstractCreatorFactoryTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/XAbstractCreatorFactoryTest.sarl index 0f6e2b7e4d..43bf0bbb2b 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/XAbstractCreatorFactoryTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/lifecycle/XAbstractCreatorFactoryTest.sarl @@ -51,6 +51,7 @@ import static extension org.junit.jupiter.api.Assertions.* ]) @Tag("janus") @Tag("unit") +@Tag("sre-unit") class XAbstractCreatorFactoryTest { @Test diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/logging/jul/JulLoggerCreatorTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/logging/jul/JulLoggerCreatorTest.sarl index e27b23dad6..fc4d5aa37f 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/logging/jul/JulLoggerCreatorTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/logging/jul/JulLoggerCreatorTest.sarl @@ -22,6 +22,7 @@ package io.sarl.sre.tests.units.services.logging.jul import io.sarl.sre.boot.configs.SreConfig +import io.sarl.sre.boot.configs.subconfigs.BootConfig import io.sarl.sre.boot.configs.subconfigs.LoggingConfig import io.sarl.sre.boot.configs.subconfigs.ServicesConfig import io.sarl.sre.services.logging.jul.JulLoggerCreator @@ -33,18 +34,19 @@ import java.util.UUID import java.util.logging.Level import java.util.logging.Logger import javax.inject.Provider +import org.eclipse.xtext.xbase.lib.Functions.Function1 import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Tag import org.junit.jupiter.api.Test import org.junit.jupiter.api.^extension.ExtendWith -import org.mockito.ArgumentCaptor -import static org.junit.jupiter.api.Assertions.* -import static org.mockito.Mockito.* +import static org.mockito.ArgumentMatchers.* import static extension io.sarl.tests.api.tools.TestMockito.mock -import static extension org.mockito.Mockito.times +import static extension org.junit.jupiter.api.Assertions.* +import static extension org.mockito.ArgumentCaptor.* +import static extension org.mockito.Mockito.* /** * @author $Author: sgalland$ @@ -60,13 +62,17 @@ import static extension org.mockito.Mockito.times @DisplayName("unit: JulLoggerCreator test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class JulLoggerCreatorTest { @Nullable - var loggerProvider : Provider + var loggerProvider : (String)=>Logger @Nullable - var logger : Logger + var logger0 : Logger + + @Nullable + var logger1 : Logger @Nullable var configProvider : Provider @@ -74,16 +80,32 @@ class JulLoggerCreatorTest { @Nullable var config : SreConfig + @SuppressWarnings("potential_inefficient_value_conversion") @BeforeEach def setUp : void { - this.loggerProvider = typeof(Provider).mock - this.logger = typeof(Logger).mock - when(this.loggerProvider.get).thenReturn(this.logger) + this.loggerProvider = typeof(Function1).mock + this.logger0 = typeof(Logger).mock + this.logger1 = typeof(Logger).mock + when(this.loggerProvider.apply(any)).thenAnswer [ + val name = it.getArgument(0) as String + if (name.contains("-K-")) { + return this.logger0 + } + if (name.contains("-M-")) { + return this.logger1 + } + return null + ] this.configProvider = typeof(Provider).mock this.config = typeof(SreConfig).mock when(this.configProvider.get).thenReturn(this.config) + var bootConfig = typeof(BootConfig).mock + when(this.config.boot).thenReturn(bootConfig) + + when(bootConfig.rootContextID).thenReturn(UUID::randomUUID) + var servicesConfig = typeof(ServicesConfig).mock when(this.config.services).thenReturn(servicesConfig) @@ -94,24 +116,26 @@ class JulLoggerCreatorTest { @Test def createPlatformLogger { - var expectedLevel = Level::ALL - var creator = new JulLoggerCreator(Level::CONFIG, this.loggerProvider, this.configProvider) + var expectedLevel = Level::CONFIG + var creator = new JulLoggerCreator(Level::CONFIG, this.configProvider, this.loggerProvider) var logger = creator.createPlatformLogger - assertSame(this.logger, logger) - var argument0 = ArgumentCaptor::forClass(typeof(Level)) - verify(logger, 1.times).level = argument0.capture - assertEquals(expectedLevel, argument0.value) + this.logger0.assertSame(logger) + var argument0 = typeof(Level).forClass + logger.verify(1.times).level = argument0.capture + expectedLevel.assertEquals(argument0.value) } @Test def createAgentLogger { var expectedLevel = Level::CONFIG - var creator = new JulLoggerCreator(Level::CONFIG, this.loggerProvider, this.configProvider) + var creator = new JulLoggerCreator(Level::CONFIG, this.configProvider, this.loggerProvider) var parent = creator.createPlatformLogger var name = UUID::randomUUID.toString var logger = creator.createModuleLogger(name, parent) - assertNotSame(this.logger, logger) - assertEquals(expectedLevel, logger.level) + this.logger1.assertSame(logger) + val actualLevel = typeof(Level).forClass + logger.verify.level = actualLevel.capture + expectedLevel.assertEquals(actualLevel.value) } } diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/AgentNamespaceFinderTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/AgentNamespaceFinderTest.sarl index 20ec610089..8064c87996 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/AgentNamespaceFinderTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/AgentNamespaceFinderTest.sarl @@ -65,6 +65,7 @@ import static extension org.junit.jupiter.api.Assertions.assertSame @DisplayName("unit: AgentNamespaceFinder test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class AgentNamespaceServiceTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/BehaviorNamespaceFinderTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/BehaviorNamespaceFinderTest.sarl index 139a548dc1..6ef4115294 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/BehaviorNamespaceFinderTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/BehaviorNamespaceFinderTest.sarl @@ -74,6 +74,7 @@ import static extension org.mockito.Mockito.spy @DisplayName("unit: BehaviorNamespaceFinder test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class BehaviorNamespaceFinderTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/ContextNamespaceFinderTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/ContextNamespaceFinderTest.sarl index e6c0a328dd..52e6eeab0e 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/ContextNamespaceFinderTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/ContextNamespaceFinderTest.sarl @@ -60,6 +60,7 @@ import static extension org.junit.jupiter.api.Assertions.assertSame @DisplayName("unit: ContextNamespaceFinder test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class ContextNamespaceFinderTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/FieldAccessTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/FieldAccessTest.sarl index c69a1b5b47..83b13be194 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/FieldAccessTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/FieldAccessTest.sarl @@ -53,6 +53,7 @@ import static extension org.junit.jupiter.api.Assertions.assertSame @DisplayName("unit: FieldAccess test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class FieldAccessTest { private static class ObjectMock { diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/FinderBasedNamespaceServiceTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/FinderBasedNamespaceServiceTest.sarl index 882d277fda..b6c5de7f7a 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/FinderBasedNamespaceServiceTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/FinderBasedNamespaceServiceTest.sarl @@ -75,6 +75,7 @@ import static extension org.mockito.Mockito.spy @DisplayName("unit: FinderBasedNamespaceService test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class FinderBasedNamespaceServiceTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/ServiceNamespaceFinderTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/ServiceNamespaceFinderTest.sarl index cec5e6bf43..98cddb90d5 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/ServiceNamespaceFinderTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/ServiceNamespaceFinderTest.sarl @@ -60,6 +60,7 @@ import static extension org.junit.jupiter.api.Assertions.assertSame @DisplayName("unit: ServiceNamespaceFinder test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class ServiceNamespaceFinderTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/SkillNamespaceFinderTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/SkillNamespaceFinderTest.sarl index f47b97bf29..0d6bf504f9 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/SkillNamespaceFinderTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/SkillNamespaceFinderTest.sarl @@ -68,6 +68,7 @@ import static extension org.mockito.Mockito.spy @DisplayName("unit: SkillNamespaceFinder test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SkillNamespaceFinderTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/SpaceNamespaceFinderTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/SpaceNamespaceFinderTest.sarl index 8d7e90d8b0..f7b78fc2b3 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/SpaceNamespaceFinderTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/namespace/SpaceNamespaceFinderTest.sarl @@ -62,6 +62,7 @@ import static extension org.junit.jupiter.api.Assertions.assertSame @DisplayName("unit: SpaceNamespaceFinder test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SpaceNamespaceFinderTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/probing/AsynchronousProbeServiceTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/probing/AsynchronousProbeServiceTest.sarl index c991fb33d9..2e28c7c8fa 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/probing/AsynchronousProbeServiceTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/probing/AsynchronousProbeServiceTest.sarl @@ -72,6 +72,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: AsynchronousProbeService test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class AsynchronousProbeServiceTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/probing/FieldProbeTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/probing/FieldProbeTest.sarl index 30bc8acc7d..53fe1c8064 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/probing/FieldProbeTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/probing/FieldProbeTest.sarl @@ -69,6 +69,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: FieldProbe test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class FieldProbeTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/probing/SynchronousProbeServiceTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/probing/SynchronousProbeServiceTest.sarl index c2aadb27b9..4cf66ec3a7 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/probing/SynchronousProbeServiceTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/probing/SynchronousProbeServiceTest.sarl @@ -71,6 +71,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: SynchronousProbeService test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SynchronousProbeServiceTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/time/JreTimeServiceTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/time/JreTimeServiceTest.sarl index affe9d76a8..36b1dad16e 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/time/JreTimeServiceTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/services/time/JreTimeServiceTest.sarl @@ -59,6 +59,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: JreTimeService test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class JreTimeServiceTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/SreDynamicSkillProviderTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/SreDynamicSkillProviderTest.sarl index 3c98175bb4..634db23868 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/SreDynamicSkillProviderTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/SreDynamicSkillProviderTest.sarl @@ -68,6 +68,7 @@ import static extension org.mockito.Mockito.* @DisplayName("unit: SreDynamicSkillProvider test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SreDynamicSkillProviderTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/BehaviorsSkillTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/BehaviorsSkillTest.sarl index 2abd2fa5b2..174f4f401b 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/BehaviorsSkillTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/BehaviorsSkillTest.sarl @@ -72,6 +72,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: BehaviorsSkill test") @Tag("janus") @Tag("unit") +@Tag("sre-unit") class BehaviorsSkillTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/DefaultContextInteractionsSkillTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/DefaultContextInteractionsSkillTest.sarl index 3ed081da2a..e952ada847 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/DefaultContextInteractionsSkillTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/DefaultContextInteractionsSkillTest.sarl @@ -66,6 +66,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: DefaultContextInteractionsSkill test") @Tag("janus") @Tag("unit") +@Tag("sre-unit") class DefaultContextInteractionsSkillTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/ExternalContextAccessSkillTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/ExternalContextAccessSkillTest.sarl index 6e6dc7a4bd..580e2dae16 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/ExternalContextAccessSkillTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/ExternalContextAccessSkillTest.sarl @@ -76,6 +76,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: ExternalContextAccessSkill test") @Tag("janus") @Tag("unit") +@Tag("sre-unit") class ExternalContextAccessSkillTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/InnerContextSkillTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/InnerContextSkillTest.sarl index 7981d1d750..c4ed7307ef 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/InnerContextSkillTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/InnerContextSkillTest.sarl @@ -71,6 +71,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: InnerContextSkill test") @Tag("janus") @Tag("unit") +@Tag("sre-unit") class InnerContextSkillTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/LifecycleSkillTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/LifecycleSkillTest.sarl index c6e65f6698..df5bc19cd4 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/LifecycleSkillTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/LifecycleSkillTest.sarl @@ -67,6 +67,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: LifecycleSkill test") @Tag("janus") @Tag("unit") +@Tag("sre-unit") class LifecycleSkillTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/LoggingSkillTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/LoggingSkillTest.sarl index 3a2b036227..c790d843a2 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/LoggingSkillTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/LoggingSkillTest.sarl @@ -66,6 +66,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: LoggingSkill test") @Tag("janus") @Tag("unit") +@Tag("sre-unit") class LoggingSkillTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/SchedulesSkillTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/SchedulesSkillTest.sarl index f8e5ace0e8..b152187b2c 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/SchedulesSkillTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/SchedulesSkillTest.sarl @@ -72,6 +72,7 @@ import static extension org.mockito.ArgumentMatchers.* @DisplayName("unit: SchedulesSkill test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") @SuppressWarnings("use_reserved_sarl_annotation") class SchedulesSkillTest { diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/TimeSkillTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/TimeSkillTest.sarl index 25aafe6f78..a89a00d72d 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/TimeSkillTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/bic/TimeSkillTest.sarl @@ -55,6 +55,7 @@ import static extension io.sarl.tests.api.tools.TestMockito.mock @DisplayName("unit: TimeSkill test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class TimeSkillTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/internal/EventBusTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/internal/EventBusTest.sarl index 0dee27738c..97b9b42181 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/internal/EventBusTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/internal/EventBusTest.sarl @@ -60,6 +60,7 @@ import static extension org.mockito.Mockito.* @DisplayName("unit: EventBus test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class EventBusTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/internal/InternalEventBusSkillTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/internal/InternalEventBusSkillTest.sarl index f9e234d5b4..5a7edcc529 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/internal/InternalEventBusSkillTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/internal/InternalEventBusSkillTest.sarl @@ -70,6 +70,7 @@ import static extension org.mockito.Mockito.verify @DisplayName("unit: InternalEventBusSkill test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class InternalEventBusSkillTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/internal/InternalSchedulesSkillTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/internal/InternalSchedulesSkillTest.sarl index 7591f80b55..c6feac1354 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/internal/InternalSchedulesSkillTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/skills/internal/InternalSchedulesSkillTest.sarl @@ -65,6 +65,7 @@ import java.util.Collection @DisplayName("unit: InternalSchedulesSkill test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class InternalSchedulesSkillTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/OpenLocalEventSpaceTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/OpenLocalEventSpaceTest.sarl index 404827bf58..b792c87e86 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/OpenLocalEventSpaceTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/OpenLocalEventSpaceTest.sarl @@ -68,6 +68,7 @@ import static extension org.mockito.MockitoAnnotations.initMocks @DisplayName("unit: OpenLocalEventSpace test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class OpenLocalEventSpaceTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/SreEventSpaceSpecificationTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/SreEventSpaceSpecificationTest.sarl index f0550ed891..71f50503a9 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/SreEventSpaceSpecificationTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/SreEventSpaceSpecificationTest.sarl @@ -62,6 +62,7 @@ import static extension org.mockito.MockitoAnnotations.initMocks @DisplayName("unit: SreEventSpaceSpecification test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SreEventSpaceSpecificationTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/SreOpenEventSpaceSpecificationTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/SreOpenEventSpaceSpecificationTest.sarl index 205a5c2daa..b2c0a0803f 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/SreOpenEventSpaceSpecificationTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/SreOpenEventSpaceSpecificationTest.sarl @@ -61,6 +61,7 @@ import static extension org.mockito.MockitoAnnotations.initMocks @DisplayName("unit: SreOpenEventSpaceSpecification test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class SreOpenEventSpaceSpecificationTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/XAbstractEventSpaceTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/XAbstractEventSpaceTest.sarl index 726eefdc61..7f9c1578d4 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/XAbstractEventSpaceTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/XAbstractEventSpaceTest.sarl @@ -70,6 +70,7 @@ import java.util.Set @DisplayName("unit: AbstractEventSpace test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class XAbstractEventSpaceTest { @Nullable diff --git a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/XAbstractSpaceTest.sarl b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/XAbstractSpaceTest.sarl index f48a3cbbd2..59d18ccdfc 100644 --- a/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/XAbstractSpaceTest.sarl +++ b/sre/io.janusproject/io.janusproject.tests/src/test/sarl/io/sarl/sre/tests/units/spaces/XAbstractSpaceTest.sarl @@ -49,6 +49,7 @@ import static org.junit.jupiter.api.Assertions.* @DisplayName("unit: AbstractSpace test") @Tag("unit") @Tag("janus") +@Tag("sre-unit") class XAbstractSpaceTest { @Test diff --git a/tests/io.sarl.sre.test.framework/src/main/sarl/io/sarl/sre/test/framework/context/SreRunContext.sarl b/tests/io.sarl.sre.test.framework/src/main/sarl/io/sarl/sre/test/framework/context/SreRunContext.sarl index c0734afdb5..0410a87166 100644 --- a/tests/io.sarl.sre.test.framework/src/main/sarl/io/sarl/sre/test/framework/context/SreRunContext.sarl +++ b/tests/io.sarl.sre.test.framework/src/main/sarl/io/sarl/sre/test/framework/context/SreRunContext.sarl @@ -46,6 +46,7 @@ import java.util.concurrent.atomic.AtomicReference import java.util.logging.Handler import java.util.logging.Level import java.util.logging.LogRecord +import java.util.logging.Logger import org.arakhne.afc.bootique.log4j.configs.Log4jIntegrationConfig import org.arakhne.afc.bootique.variables.VariableNames import org.eclipse.xtend.lib.annotations.Accessors @@ -376,41 +377,53 @@ class SreRunContext { this.bootstrap = SRE::getBootstrap this.rootContext = this.bootstrap.startWithoutAgent - val logger = this.bootstrap.kernelLogger + var logger = this.bootstrap.kernelLogger + while (logger !== null) { + if (logger.useParentHandlers) { + logger.clearLogger + } else { + logger.level = lvl + logger.resetLogger(tm) + } + logger = logger.parent + } + + onAgentSpawned [ + if (this.bootAgentId === null) { + this.bootAgentId = it.agentID + } + ] + + return this.bootstrap + } + + private def clearLogger(logger : Logger) { + for (handler : logger.handlers) { + logger.removeHandler(handler) + } + } + + private def resetLogger(logger : Logger, tm : LogTrackingMode) { switch (tm) { case SILENT: { - for (handler : logger.handlers) { - logger.removeHandler(handler) - } + logger.clearLogger logger.addHandler(IDDLE_LOG_HANDLER) } case STANDARD_LOGGER_BEHAVIOR: { // Do nothing special with the logger } case ADD_TO_AGENT_RESULTS: { - for (handler : logger.handlers) { - logger.removeHandler(handler) - } + logger.clearLogger logger.addHandler(LOG_IN_RESULTS_LOG_HANDLER) } case FAIL_ON_ERROR: { - for (handler : logger.handlers) { - logger.removeHandler(handler) - } + logger.clearLogger logger.addHandler(FAILURE_LOG_HANDLER) } case STANDARD_LOGGER_BEHAVIOR_AND_FAIL_ON_ERROR: { logger.addHandler(FAILURE_LOG_HANDLER) } } - - onAgentSpawned [ - if (this.bootAgentId === null) { - this.bootAgentId = it.agentID - } - ] - - return this.bootstrap } static val IDDLE_LOG_HANDLER = new Handler {