File tree 3 files changed +1065
-7
lines changed
test/scala/org/ekrich/config/impl
3 files changed +1065
-7
lines changed Original file line number Diff line number Diff line change 1
1
package java .net
2
2
3
- import scalanative .annotation .stub
4
-
5
3
class URLConnection {
6
- @ stub
4
+
7
5
def getLastModified (): scala.Long = ???
8
- @ stub
6
+
9
7
def connect (): Unit = ???
10
- @ stub
8
+
11
9
def getContentType (): String = ???
12
- @ stub
10
+
13
11
def getInputStream (): java.io.InputStream = ???
14
- @ stub
12
+
15
13
def setRequestProperty (key : String , value : String ): Unit = ???
16
14
}
Original file line number Diff line number Diff line change
1
+ package org .ekrich .config .impl
2
+
3
+ import java .io .{BufferedReader , FileReader }
4
+
5
+ import org .ekrich .config .parser ._
6
+ import org .junit .Assert ._
7
+ import org .junit .Test
8
+
9
+ import FileUtils ._
10
+
11
+ class ConfigDocumentFactoryJvmTest extends TestUtils {
12
+
13
+ @ Test
14
+ def configDocumentFileParse : Unit = {
15
+ val configDocument =
16
+ ConfigDocumentFactory .parseFile(resourceFile(" /test03.conf" ))
17
+ val fileReader = new BufferedReader (
18
+ new FileReader (" src/test/resources/test03.conf" )
19
+ )
20
+ var line = fileReader.readLine()
21
+ val sb = new StringBuilder ()
22
+ while (line != null ) {
23
+ sb.append(line)
24
+ sb.append(" \n " )
25
+ line = fileReader.readLine()
26
+ }
27
+ fileReader.close()
28
+ val fileText = sb.toString()
29
+ assertEquals(fileText, defaultLineEndingsToUnix(configDocument.render))
30
+ }
31
+
32
+ private def defaultLineEndingsToUnix (s : String ): String =
33
+ s.replaceAll(System .lineSeparator(), " \n " )
34
+
35
+ @ Test
36
+ def configDocumentReaderParse : Unit = {
37
+ val configDocument = ConfigDocumentFactory .parseReader(
38
+ new FileReader (resourceFile(" /test03.conf" ))
39
+ )
40
+ val configDocumentFile =
41
+ ConfigDocumentFactory .parseFile(resourceFile(" /test03.conf" ))
42
+ assertEquals(configDocumentFile.render, configDocument.render)
43
+ }
44
+ }
You can’t perform that action at this time.
0 commit comments