Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit 8577e5b

Browse files
authored
Merge pull request #167 from atoulme/windows_tests
Windows tests
2 parents 0551092 + d41f023 commit 8577e5b

File tree

4 files changed

+70
-5
lines changed

4 files changed

+70
-5
lines changed

.github/workflows/test-windows.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
name: test-windows
19+
20+
on:
21+
push:
22+
branches: [ master ]
23+
pull_request:
24+
branches: [ master ]
25+
26+
jobs:
27+
test-windows:
28+
runs-on: windows-latest
29+
steps:
30+
- uses: actions/checkout@v1
31+
with:
32+
submodules: true
33+
- name: Cache Gradle packages
34+
uses: actions/cache@v1
35+
with:
36+
path: ~/.gradle/caches
37+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
38+
restore-keys: ${{ runner.os }}-gradle
39+
- name: Cache Maven Repository
40+
uses: actions/cache@v1
41+
with:
42+
path: ~/.m2
43+
key: ${{ runner.os }}-m2-${{ hashFiles('**/dependency-versions.gradle') }}
44+
restore-keys: ${{ runner.os }}-m2
45+
- name: Set up JDK 11
46+
uses: actions/setup-java@v1
47+
with:
48+
java-version: 11
49+
- name: gradle test
50+
uses: eskatos/gradle-command-action@v1
51+
with:
52+
gradle-version: 6.3
53+
arguments: test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ eth-client/data2
4040
data
4141
ssb-keys
4242
docs_warning
43+
io/org

eth-client/src/test/kotlin/org/apache/tuweni/ethclient/EthereumClientConfigTest.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ import org.junit.jupiter.api.Assertions.assertEquals
2020
import org.junit.jupiter.api.Assertions.assertNotNull
2121
import org.junit.jupiter.api.Test
2222
import org.junit.jupiter.api.assertThrows
23-
import java.lang.IllegalArgumentException
2423
import java.nio.file.Paths
2524

2625
class EthereumClientConfigTest {
2726

2827
@Test
2928
fun testFileConfig() {
30-
val config =
31-
EthereumClientConfig.fromFile(Paths.get(EthereumClientConfigTest::class.java.getResource("/minimal.conf").path))
29+
val config = EthereumClientConfig.fromFile(
30+
Paths.get(EthereumClientConfigTest::class.java.getResource("/minimal.conf").toURI()))
3231
assertNotNull(config)
3332
}
3433

@@ -83,7 +82,10 @@ class EthereumClientConfigTest {
8382
@Test
8483
fun toToml() {
8584
val config = EthereumClientConfig.fromString("[storage.forui]\npath=\"data\"")
86-
assertEquals("[storage.forui]\npath = \"data\"\n", config.toToml())
85+
assertEquals(
86+
"[storage.forui]${System.lineSeparator()}path = \"data\"${System.lineSeparator()}",
87+
config.toToml()
88+
)
8789
}
8890

8991
@Test

toml/src/test/java/org/apache/tuweni/toml/MutableTomlArrayTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ void shouldGetLocalTime() {
143143
@Test
144144
void toJson() {
145145
MutableTomlArray array = new MutableTomlArray().append("foo", positionAt(1, 1)).append("bar", positionAt(10, 1));
146-
assertEquals("[\n \"foo\",\n \"bar\"\n]\n", array.toJson());
146+
assertEquals(
147+
"["
148+
+ System.lineSeparator()
149+
+ " \"foo\","
150+
+ System.lineSeparator()
151+
+ " \"bar\""
152+
+ System.lineSeparator()
153+
+ "]"
154+
+ System.lineSeparator(),
155+
array.toJson());
147156
}
148157
}

0 commit comments

Comments
 (0)