Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into bug/#3708/tests-xmi…
Browse files Browse the repository at this point in the history
…r-to-phi
  • Loading branch information
ArtemGet committed Jan 8, 2025
2 parents dda7c74 + c783fd2 commit a5e6a49
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 13 deletions.
23 changes: 23 additions & 0 deletions eo-maven-plugin/src/test/resources/junit-platform.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# The MIT License (MIT)
#
# Copyright (c) 2016-2025 Objectionary.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

junit.jupiter.execution.timeout.test.method.default = 3m
23 changes: 23 additions & 0 deletions eo-parser/src/test/resources/junit-platform.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# The MIT License (MIT)
#
# Copyright (c) 2016-2025 Objectionary.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

junit.jupiter.execution.timeout.test.method.default = 10s
5 changes: 5 additions & 0 deletions eo-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ SOFTWARE.
<artifactId>guava</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.artsok</groupId>
<artifactId>rerunner-jupiter</artifactId>
<version>2.1.6</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
25 changes: 13 additions & 12 deletions eo-runtime/src/test/java/EOorg/EOeolang/EOnet/EOsocketTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import com.jcabi.log.Logger;
import com.sun.jna.Native;
import com.sun.jna.ptr.IntByReference;
import io.github.artsok.RepeatedIfExceptionsTest;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
Expand Down Expand Up @@ -172,7 +173,7 @@ private static int randomPort() {
@DisabledOnOs({OS.MAC, OS.LINUX})
@Execution(ExecutionMode.SAME_THREAD)
final class WindowsSocketTest {
@Test
@RepeatedIfExceptionsTest(repeats = 3)
void connectsToLocalServerViaSyscall() throws IOException, InterruptedException {
final RandomServer server = new RandomServer().started();
final int started = this.startup();
Expand All @@ -199,7 +200,7 @@ void connectsToLocalServerViaSyscall() throws IOException, InterruptedException
}
}

@Test
@RepeatedIfExceptionsTest(repeats = 3)
void refusesConnectionViaSyscall() throws UnknownHostException {
final int started = this.startup();
try {
Expand All @@ -225,7 +226,7 @@ void refusesConnectionViaSyscall() throws UnknownHostException {
}
}

@Test
@RepeatedIfExceptionsTest(repeats = 3)
void bindsSocketSuccessfullyViaSyscall() throws UnknownHostException {
final int started = this.startup();
try {
Expand All @@ -249,7 +250,7 @@ void bindsSocketSuccessfullyViaSyscall() throws UnknownHostException {
}
}

@Test
@RepeatedIfExceptionsTest(repeats = 3)
void startsListenOnPosixSocket() throws UnknownHostException {
final int started = this.startup();
try {
Expand All @@ -274,7 +275,7 @@ void startsListenOnPosixSocket() throws UnknownHostException {
}
}

@Test
@RepeatedIfExceptionsTest(repeats = 3)
@SuppressWarnings("PMD.AvoidThrowingRawExceptionTypes")
void acceptsConnectionOnSocket() throws InterruptedException, UnknownHostException {
final int started = this.startup();
Expand Down Expand Up @@ -342,7 +343,7 @@ socket, addr, new IntByReference(addr.size())
}
}

@Test
@RepeatedIfExceptionsTest(repeats = 3)
@SuppressWarnings("PMD.AvoidThrowingRawExceptionTypes")
void sendsAndReceivesMessagesViaSyscalls()
throws InterruptedException, UnknownHostException {
Expand Down Expand Up @@ -532,7 +533,7 @@ private SockaddrIn sockaddr(final int port) throws UnknownHostException {
@DisabledOnOs(OS.WINDOWS)
@Execution(ExecutionMode.SAME_THREAD)
final class PosixSocketTest {
@Test
@RepeatedIfExceptionsTest(repeats = 3)
void connectsToLocalServerViaSyscall() throws IOException {
final RandomServer server = new RandomServer().started();
final int socket = this.openSocket();
Expand All @@ -553,7 +554,7 @@ void connectsToLocalServerViaSyscall() throws IOException {
}
}

@Test
@RepeatedIfExceptionsTest(repeats = 3)
void refusesConnectionViaSyscall() {
final int socket = this.openSocket();
try {
Expand All @@ -570,7 +571,7 @@ void refusesConnectionViaSyscall() {
}
}

@Test
@RepeatedIfExceptionsTest(repeats = 3)
void bindsSocketSuccessfullyViaSyscall() {
final int socket = this.openSocket();
try {
Expand All @@ -588,7 +589,7 @@ void bindsSocketSuccessfullyViaSyscall() {
}
}

@Test
@RepeatedIfExceptionsTest(repeats = 3)
void startsListenOnPosixSocket() {
final int socket = this.openSocket();
try {
Expand All @@ -607,7 +608,7 @@ void startsListenOnPosixSocket() {
}
}

@Test
@RepeatedIfExceptionsTest(repeats = 3)
void acceptsConnectionOnSocket() throws InterruptedException {
final AtomicInteger accept = new AtomicInteger(0);
final AtomicReference<String> error = new AtomicReference<>();
Expand Down Expand Up @@ -666,7 +667,7 @@ socket, addr, new IntByReference(addr.size())
}
}

@Test
@RepeatedIfExceptionsTest(repeats = 3)
void sendsAndReceivesMessagesViaSyscalls() throws InterruptedException {
final AtomicInteger received = new AtomicInteger(-1);
final AtomicReference<byte[]> bytes = new AtomicReference<>();
Expand Down
2 changes: 1 addition & 1 deletion eo-runtime/src/test/resources/junit-platform.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

junit.jupiter.execution.parallel.enabled = true
junit.jupiter.execution.timeout.test.method.default = 3m

0 comments on commit a5e6a49

Please sign in to comment.