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

Commit

Permalink
Merge pull request #167 from atoulme/windows_tests
Browse files Browse the repository at this point in the history
Windows tests
  • Loading branch information
atoulme authored Nov 14, 2020
2 parents 0551092 + d41f023 commit 8577e5b
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 5 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: test-windows

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Cache Maven Repository
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/dependency-versions.gradle') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: gradle test
uses: eskatos/gradle-command-action@v1
with:
gradle-version: 6.3
arguments: test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ eth-client/data2
data
ssb-keys
docs_warning
io/org
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows
import java.lang.IllegalArgumentException
import java.nio.file.Paths

class EthereumClientConfigTest {

@Test
fun testFileConfig() {
val config =
EthereumClientConfig.fromFile(Paths.get(EthereumClientConfigTest::class.java.getResource("/minimal.conf").path))
val config = EthereumClientConfig.fromFile(
Paths.get(EthereumClientConfigTest::class.java.getResource("/minimal.conf").toURI()))
assertNotNull(config)
}

Expand Down Expand Up @@ -83,7 +82,10 @@ class EthereumClientConfigTest {
@Test
fun toToml() {
val config = EthereumClientConfig.fromString("[storage.forui]\npath=\"data\"")
assertEquals("[storage.forui]\npath = \"data\"\n", config.toToml())
assertEquals(
"[storage.forui]${System.lineSeparator()}path = \"data\"${System.lineSeparator()}",
config.toToml()
)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ void shouldGetLocalTime() {
@Test
void toJson() {
MutableTomlArray array = new MutableTomlArray().append("foo", positionAt(1, 1)).append("bar", positionAt(10, 1));
assertEquals("[\n \"foo\",\n \"bar\"\n]\n", array.toJson());
assertEquals(
"["
+ System.lineSeparator()
+ " \"foo\","
+ System.lineSeparator()
+ " \"bar\""
+ System.lineSeparator()
+ "]"
+ System.lineSeparator(),
array.toJson());
}
}

0 comments on commit 8577e5b

Please sign in to comment.