Mercurial > hg > y16 > e165725 > os > ex2.1
changeset 4:f3aec63a0b6f
testを作って失敗した
author | Masakiyo Okuhma <e165725@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 08 Nov 2017 18:10:41 +0900 |
parents | 3f37f8b2dbb3 |
children | 24a2485ce3be |
files | build.gradle src/test/java/jp/ac/uryukyu/ie/e165725/FileWriteTest.java |
diffstat | 2 files changed, 30 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/build.gradle Wed Nov 08 16:43:53 2017 +0900 +++ b/build.gradle Wed Nov 08 18:10:41 2017 +0900 @@ -9,42 +9,28 @@ mavenCentral() } -dependencies { - testCompile group: 'junit', name: 'junit', version: '4.12' -} -group 'FileWrite' -version '1.0-SNAPSHOT' - -apply plugin: 'java' - -sourceCompatibility = 1.8 - -repositories { - mavenCentral() -} +defaultTasks 'test' dependencies { - testCompile group: 'junit', name: 'junit', version: '4.12' -} -group 'FileWrite' -version '1.0-SNAPSHOT' - -apply plugin: 'java' - -sourceCompatibility = 1.8 - -repositories { - mavenCentral() + testCompile("org.junit.jupiter:junit-jupiter-api:5.0.0") + testRuntime("org.junit.jupiter:junit-jupiter-engine:5.0.0") } -dependencies { - testCompile group: 'junit', name: 'junit', version: '4.12' +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1' + } } +apply plugin: 'org.junit.platform.gradle.plugin' + + compileJava { options.compilerArgs << "-Werror" } jar { - // from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } manifest { attributes "Main-Class": "jp.ac.uryukyu.ie.e165725.FileWrite" attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': version
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/java/jp/ac/uryukyu/ie/e165725/FileWriteTest.java Wed Nov 08 18:10:41 2017 +0900 @@ -0,0 +1,17 @@ +package jp.ac.uryukyu.ie.e165725; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class FileWriteTest { + @Test + void getops() { + FileWrite fw = new FileWrite(); + String[] args = {"-b","--size","1234"}; + fw.getops(args); + assertEquals(fw.getWriteSize(),1234); + assertEquals(fw.isBuffering(),true); + //assertEquals(fw.isBuffering(),false); //failed + } + +} \ No newline at end of file