-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* .travis.ymlの修正 * .travis.ymlの修正 (#8) * ライセンスバッチの追加 * .travis.ymlの修正 * バッチの修正 * バッチの修正 * 単体テストの自動生成プラグインをmavenに追加した。 * 単体テスト作成モジュール(evosuite)で作成したコードのうち、動作がおかしいものを修正した。 また、単体テストを実装に伴い、READMEも修正した。 * 玉田さん指摘, 修正していただいたpom.xmlファイル. これに変更することで, 生成されたコードは`separateClassLoader`がfalseで生成される. 変更したpomでコードを生成すると,前の時に比べて, `Main`のカバレッジは0%ではなくなった. * 修正を加えた`pom.xml`に修正したEvoSuiteによって生成された単体テストコード群. * カバレッジが低かったMainのテスト部分の修正をした。これによりJaCoCoのカバレッジは90%を超えた。 * カバレッジのバッチを取得するためにtravisを使って、Coverallsを実行するようにtravis.ymlを修正した。 * coverallsのバッチを追加したREADME * .travis.ymlを修正してテストをできるようにしていたが、書き方が間違っていたようである。そのため、動くのに必要なプログラムを修正した。 * jacocoによるカバレッジを出すつもりであったが、プラグインによるビルドがうまく行かないため,coberturaに切り替えた。 * 新しい圧縮形式zlibをするプログラムを追加した。 * 変更したファイルに出し忘れがあっため、追加でupする。(javadocのコメント付きファイル、verの数を増やしたMainファイル) * 新しく作った圧縮プログラム(ZlibCompressor)のテストファイルを作っていなかったため、新規に追加した。 * Zlibのテストに必要なファイルを用意してなかったため、追加でupする。 * テストプログラムにあった不具合の原因を修正した。 (拡張子の付け方を間違えていた。) * テスト実行時エラーとなる原因を修正した。(時間内に終了しなかったため処理を軽くした。)
- Loading branch information
Showing
12 changed files
with
273 additions
and
19 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
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
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
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
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
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
3 changes: 3 additions & 0 deletions
3
src/main/java/jp/ac/kyoto_su/ise/compressor/NoCompressorException.java
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
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
26 changes: 26 additions & 0 deletions
26
src/main/java/jp/ac/kyoto_su/ise/compressor/ZlibCompressor.java
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,26 @@ | ||
package jp.ac.kyoto_su.ise.compressor; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.OutputStream; | ||
|
||
import java.util.Scanner; | ||
import java.util.zip.*; | ||
import java.io.*; | ||
|
||
public class ZlibCompressor implements Compressor{ | ||
/** | ||
*zlib圧縮を実行するクラス。 | ||
*/ | ||
@Override | ||
public void compress(InputStream in, OutputStream out) throws IOException { | ||
OutputStream zlibOut = new DeflaterOutputStream(out); | ||
drain(in, zlibOut); | ||
// zlibOut.finish(); | ||
} | ||
|
||
@Override | ||
public String renameFile(String originalFileName) { | ||
return originalFileName + ".zlib"; | ||
} | ||
} |
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
57 changes: 57 additions & 0 deletions
57
src/test/java/jp/ac/kyoto_su/ise/compressor/ZlibCompressor_ESTest.java
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,57 @@ | ||
/* | ||
* This file was automatically generated by EvoSuite | ||
* Wed Jun 03 07:55:01 GMT 2020 | ||
*/ | ||
|
||
package jp.ac.kyoto_su.ise.compressor; | ||
|
||
import org.junit.Test; | ||
import static org.junit.Assert.*; | ||
import static org.evosuite.shaded.org.mockito.Mockito.*; | ||
import static org.evosuite.runtime.EvoAssertions.*; | ||
import java.io.InputStream; | ||
import java.io.OutputStream; | ||
import jp.ac.kyoto_su.ise.compressor.ZlibCompressor; | ||
import org.evosuite.runtime.EvoRunner; | ||
import org.evosuite.runtime.EvoRunnerParameters; | ||
import org.evosuite.runtime.ViolatedAssumptionAnswer; | ||
import org.junit.runner.RunWith; | ||
|
||
|
||
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) | ||
public class ZlibCompressor_ESTest extends ZlibCompressor_ESTest_scaffolding { | ||
|
||
@Test(timeout = 4000) | ||
public void test0() throws Throwable { | ||
ZlibCompressor ZlibCompressor0 = new ZlibCompressor(); | ||
InputStream inputStream0 = mock(InputStream.class, new ViolatedAssumptionAnswer()); | ||
doReturn((-315), (-315), (-1)).when(inputStream0).read(); | ||
OutputStream outputStream0 = mock(OutputStream.class, new ViolatedAssumptionAnswer()); | ||
ZlibCompressor0.compress(inputStream0, outputStream0); | ||
} | ||
|
||
@Test(timeout = 4000) | ||
public void test1() throws Throwable { | ||
ZlibCompressor ZlibCompressor0 = new ZlibCompressor(); | ||
OutputStream outputStream0 = mock(OutputStream.class, new ViolatedAssumptionAnswer()); | ||
// Undeclared exception! | ||
try { | ||
ZlibCompressor0.compress((InputStream) null, outputStream0); | ||
fail("Expecting exception: NullPointerException"); | ||
|
||
} catch(NullPointerException e) { | ||
// | ||
// no message in exception (getMessage() returned null) | ||
// | ||
verifyException("jp.ac.kyoto_su.ise.compressor.Compressor", e); | ||
} | ||
} | ||
|
||
@Test(timeout = 4000) | ||
public void test2() throws Throwable { | ||
ZlibCompressor ZlibCompressor0 = new ZlibCompressor(); | ||
String string0 = ZlibCompressor0.renameFile(""); | ||
assertEquals(".zlib", string0); | ||
} | ||
|
||
} |
Oops, something went wrong.