Skip to content

Commit

Permalink
add second test
Browse files Browse the repository at this point in the history
  • Loading branch information
klesarev committed Feb 15, 2021
1 parent 7cce0aa commit e6c254b
Show file tree
Hide file tree
Showing 77 changed files with 53 additions and 20 deletions.
Binary file modified .gradle/6.7/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/6.7/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/6.7/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/6.7/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/checksums/checksums.lock
Binary file not shown.
Binary file added .gradle/checksums/md5-checksums.bin
Binary file not shown.
Binary file added .gradle/checksums/sha1-checksums.bin
Binary file not shown.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ dependencies {
implementation 'org.apache.poi:poi:5.0.0'
implementation 'org.apache.poi:poi-ooxml:5.0.0'
implementation 'junit:junit:4.12'
implementation 'org.junit.jupiter:junit-jupiter:5.4.2'
}
Binary file added build/classes/kotlin/main/ApplicationKt$$$main.class
Binary file not shown.
Binary file modified build/classes/kotlin/main/ApplicationKt.class
Binary file not shown.
Binary file modified build/classes/kotlin/main/DrawerKt$toRGBA$1.class
Binary file not shown.
Binary file modified build/classes/kotlin/main/DrawerKt$writeImage$imgthread$1.class
Binary file not shown.
Binary file modified build/classes/kotlin/main/DrawerKt.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/classes/kotlin/test/ImageTest.class
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/build-history.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions build/kotlin/compileKotlin/caches-jvm/lookups/counters.tab
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
5
1
9
5
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.len
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.len
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab_i
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/last-build.bin
Binary file not shown.
Binary file modified build/kotlin/compileTestKotlin/build-history.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileTestKotlin/caches-jvm/jvm/kotlin/proto.tab
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileTestKotlin/caches-jvm/lookups/lookups.tab
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileTestKotlin/caches-jvm/lookups/lookups.tab_i
Binary file not shown.
Binary file modified build/kotlin/compileTestKotlin/last-build.bin
Binary file not shown.
11 changes: 8 additions & 3 deletions build/reports/tests/test/classes/ImageTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1>Class ImageTest</h1>
<tr>
<td>
<div class="infoBox" id="tests">
<div class="counter">1</div>
<div class="counter">2</div>
<p>tests</p>
</div>
</td>
Expand All @@ -41,7 +41,7 @@ <h1>Class ImageTest</h1>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.014s</div>
<div class="counter">0.104s</div>
<p>duration</p>
</div>
</td>
Expand Down Expand Up @@ -75,6 +75,11 @@ <h2>Tests</h2>
</tr>
</thead>
<tr>
<td class="success">testExceptionFile</td>
<td class="success">0.090s</td>
<td class="success">passed</td>
</tr>
<tr>
<td class="success">testHexToRgba</td>
<td class="success">0.014s</td>
<td class="success">passed</td>
Expand All @@ -89,7 +94,7 @@ <h2>Tests</h2>
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
</label>
</div>Generated by
<a href="http://www.gradle.org">Gradle 6.7</a> at 15 февр. 2021 г., 23:39:44</p>
<a href="http://www.gradle.org">Gradle 6.7</a> at 16 февр. 2021 г., 00:15:54</p>
</div>
</div>
</body>
Expand Down
14 changes: 7 additions & 7 deletions build/reports/tests/test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1>Test Summary</h1>
<tr>
<td>
<div class="infoBox" id="tests">
<div class="counter">1</div>
<div class="counter">2</div>
<p>tests</p>
</div>
</td>
Expand All @@ -38,7 +38,7 @@ <h1>Test Summary</h1>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.014s</div>
<div class="counter">0.104s</div>
<p>duration</p>
</div>
</td>
Expand Down Expand Up @@ -82,10 +82,10 @@ <h2>Packages</h2>
<td class="success">
<a href="packages/default-package.html">default-package</a>
</td>
<td>1</td>
<td>2</td>
<td>0</td>
<td>0</td>
<td>0.014s</td>
<td>0.104s</td>
<td class="success">100%</td>
</tr>
</tbody>
Expand All @@ -109,10 +109,10 @@ <h2>Classes</h2>
<td class="success">
<a href="classes/ImageTest.html">ImageTest</a>
</td>
<td>1</td>
<td>2</td>
<td>0</td>
<td>0</td>
<td>0.014s</td>
<td>0.104s</td>
<td class="success">100%</td>
</tr>
</tbody>
Expand All @@ -126,7 +126,7 @@ <h2>Classes</h2>
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
</label>
</div>Generated by
<a href="http://www.gradle.org">Gradle 6.7</a> at 15 февр. 2021 г., 23:39:44</p>
<a href="http://www.gradle.org">Gradle 6.7</a> at 16 февр. 2021 г., 00:15:54</p>
</div>
</div>
</body>
Expand Down
10 changes: 5 additions & 5 deletions build/reports/tests/test/packages/default-package.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1>Default package</h1>
<tr>
<td>
<div class="infoBox" id="tests">
<div class="counter">1</div>
<div class="counter">2</div>
<p>tests</p>
</div>
</td>
Expand All @@ -40,7 +40,7 @@ <h1>Default package</h1>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.014s</div>
<div class="counter">0.104s</div>
<p>duration</p>
</div>
</td>
Expand Down Expand Up @@ -80,10 +80,10 @@ <h2>Classes</h2>
<td class="success">
<a href="../classes/ImageTest.html">ImageTest</a>
</td>
<td>1</td>
<td>2</td>
<td>0</td>
<td>0</td>
<td>0.014s</td>
<td>0.104s</td>
<td class="success">100%</td>
</tr>
</table>
Expand All @@ -96,7 +96,7 @@ <h2>Classes</h2>
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
</label>
</div>Generated by
<a href="http://www.gradle.org">Gradle 6.7</a> at 15 февр. 2021 г., 23:39:44</p>
<a href="http://www.gradle.org">Gradle 6.7</a> at 16 февр. 2021 г., 00:15:54</p>
</div>
</div>
</body>
Expand Down
3 changes: 2 additions & 1 deletion build/test-results/test/TEST-ImageTest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="ImageTest" tests="1" skipped="0" failures="0" errors="0" timestamp="2021-02-15T20:39:44" hostname="DESKTOP-UE975S3" time="0.014">
<testsuite name="ImageTest" tests="2" skipped="0" failures="0" errors="0" timestamp="2021-02-15T21:15:54" hostname="DESKTOP-UE975S3" time="0.104">
<properties/>
<testcase name="testExceptionFile" classname="ImageTest" time="0.09"/>
<testcase name="testHexToRgba" classname="ImageTest" time="0.014"/>
<system-out><![CDATA[]]></system-out>
<system-err><![CDATA[]]></system-err>
Expand Down
Binary file modified build/test-results/test/binary/results.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/kotlin/Application.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import java.awt.image.BufferedImage.TYPE_INT_RGB
* Created by MrFox
*/

fun main() {
suspend fun main() {


// получаем массив из xlsx файла - лист "editor"
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/Drawer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import java.awt.Color
import java.awt.image.BufferedImage
import java.io.File
import java.io.FileInputStream
import java.io.FileNotFoundException
import java.lang.Exception
import java.util.ArrayList
import javax.imageio.ImageIO
Expand Down Expand Up @@ -96,8 +97,8 @@ fun writeImage(img: BufferedImage, file: String) {
try {
imgthread.start()
} catch (ex: Exception) {
ex.printStackTrace()
imgthread.interrupt()
throw FileNotFoundException(ex.message)
}
}

Expand Down
25 changes: 25 additions & 0 deletions src/test/kotlin/ImageTest.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
import kotlinx.coroutines.runBlocking
import org.junit.Assert
import org.junit.Test
import java.awt.Color
import java.awt.image.BufferedImage
import java.awt.image.BufferedImage.TYPE_INT_ARGB
import java.io.FileNotFoundException
import org.junit.jupiter.api.Assertions.assertAll
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.Assertions.assertThrows
import org.junit.jupiter.api.Assertions.assertTimeout
import org.junit.jupiter.api.Assertions.assertTimeoutPreemptively
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.assertThrows
import java.awt.image.BufferedImage.TYPE_INT_RGB
import java.io.File
import javax.imageio.ImageIO


class ImageTest {


@Test
fun testHexToRgba() {
Assert.assertEquals("HextoRGBA", Color(204,18,223), toRGBA("FFCC12DF"))
Assert.assertEquals("HextoRGBA", Color(16,201,38), toRGBA("FF10C926"))
}

@Test
fun testExceptionFile() {
assertThrows(Exception::class.java) {
runBlocking {
FileDataHelper().getContentAsync("D:/bubub.txt")
}
}
}

}

0 comments on commit e6c254b

Please sign in to comment.