-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for native - not sure this is correct
- Loading branch information
Showing
3 changed files
with
1,065 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
package java.net | ||
|
||
import scalanative.annotation.stub | ||
|
||
class URLConnection { | ||
@stub | ||
|
||
def getLastModified(): scala.Long = ??? | ||
@stub | ||
|
||
def connect(): Unit = ??? | ||
@stub | ||
|
||
def getContentType(): String = ??? | ||
@stub | ||
|
||
def getInputStream(): java.io.InputStream = ??? | ||
@stub | ||
|
||
def setRequestProperty(key: String, value: String): Unit = ??? | ||
} |
44 changes: 44 additions & 0 deletions
44
sconfig/native/src/test/scala/org/ekrich/config/impl/ConfigDocumentFactoryJvmTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.ekrich.config.impl | ||
|
||
import java.io.{BufferedReader, FileReader} | ||
|
||
import org.ekrich.config.parser._ | ||
import org.junit.Assert._ | ||
import org.junit.Test | ||
|
||
import FileUtils._ | ||
|
||
class ConfigDocumentFactoryJvmTest extends TestUtils { | ||
|
||
@Test | ||
def configDocumentFileParse: Unit = { | ||
val configDocument = | ||
ConfigDocumentFactory.parseFile(resourceFile("/test03.conf")) | ||
val fileReader = new BufferedReader( | ||
new FileReader("src/test/resources/test03.conf") | ||
) | ||
var line = fileReader.readLine() | ||
val sb = new StringBuilder() | ||
while (line != null) { | ||
sb.append(line) | ||
sb.append("\n") | ||
line = fileReader.readLine() | ||
} | ||
fileReader.close() | ||
val fileText = sb.toString() | ||
assertEquals(fileText, defaultLineEndingsToUnix(configDocument.render)) | ||
} | ||
|
||
private def defaultLineEndingsToUnix(s: String): String = | ||
s.replaceAll(System.lineSeparator(), "\n") | ||
|
||
@Test | ||
def configDocumentReaderParse: Unit = { | ||
val configDocument = ConfigDocumentFactory.parseReader( | ||
new FileReader(resourceFile("/test03.conf")) | ||
) | ||
val configDocumentFile = | ||
ConfigDocumentFactory.parseFile(resourceFile("/test03.conf")) | ||
assertEquals(configDocumentFile.render, configDocument.render) | ||
} | ||
} |
Oops, something went wrong.