diff --git a/egklib/src/commonTest/kotlin/electionguard/decryptBallot/DecryptionWithNonceTest.kt b/egklib/src/commonTest/kotlin/electionguard/decryptBallot/DecryptionWithNonceTest.kt index e19f960b..d8a6bbb2 100644 --- a/egklib/src/commonTest/kotlin/electionguard/decryptBallot/DecryptionWithNonceTest.kt +++ b/egklib/src/commonTest/kotlin/electionguard/decryptBallot/DecryptionWithNonceTest.kt @@ -4,21 +4,23 @@ import com.github.michaelbull.result.Err import com.github.michaelbull.result.unwrap import electionguard.ballot.EncryptedBallot import electionguard.ballot.makeContestData -import electionguard.core.* +import electionguard.core.ElGamalPublicKey +import electionguard.core.UInt256 +import electionguard.core.productionGroup +import electionguard.core.testResourcesDir import electionguard.encrypt.Encryptor import electionguard.encrypt.submit import electionguard.input.RandomBallotProvider import electionguard.publish.readElectionRecord import electionguard.util.ErrorMessages -import kotlin.test.Ignore import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFalse import kotlin.test.assertNotNull -@Ignore // I/O is not supported in browser tests + class DecryptionWithNonceTest { - val input = "src/commonTest/data/workflow/allAvailableJson" + val input = "$testResourcesDir/workflow/allAvailableJson" private val nballots = 20 /** test DecryptionWithPrimaryNonce: encrypt ballot, decrypt with master nonce, check match. */ diff --git a/egklib/src/commonTest/kotlin/electionguard/decryptBallot/EncryptDecryptBallotTest.kt b/egklib/src/commonTest/kotlin/electionguard/decryptBallot/EncryptDecryptBallotTest.kt index 55c2dc60..04278a79 100644 --- a/egklib/src/commonTest/kotlin/electionguard/decryptBallot/EncryptDecryptBallotTest.kt +++ b/egklib/src/commonTest/kotlin/electionguard/decryptBallot/EncryptDecryptBallotTest.kt @@ -19,10 +19,10 @@ import kotlin.math.roundToInt import kotlin.test.* /** Test KeyCeremony Trustee generation and recovered decryption. */ -@Ignore // I/O is not supported in browser tests + class EncryptDecryptBallotTest { val group = productionGroup() - val configDir = "src/commonTest/data/startConfigJson" + val configDir = "$testResourcesDir/startConfigJson" val outputDir = "testOut/RecoveredDecryptionTest" val trusteeDir = "$outputDir/private_data" diff --git a/egklib/src/commonTest/kotlin/electionguard/encrypt/AddBallotSyncTest.kt b/egklib/src/commonTest/kotlin/electionguard/encrypt/AddBallotSyncTest.kt index 8d123793..4b43ebdb 100644 --- a/egklib/src/commonTest/kotlin/electionguard/encrypt/AddBallotSyncTest.kt +++ b/egklib/src/commonTest/kotlin/electionguard/encrypt/AddBallotSyncTest.kt @@ -2,17 +2,18 @@ package electionguard.encrypt import electionguard.ballot.EncryptedBallot import electionguard.core.productionGroup +import electionguard.core.testResourcesDir import electionguard.input.RandomBallotProvider import electionguard.publish.makePublisher import electionguard.publish.readElectionRecord import electionguard.util.ErrorMessages import kotlin.test.* -@Ignore // I/O is not supported in browser tests + class AddBallotSyncTest { val group = productionGroup() - val inputProto = "src/commonTest/data/workflow/allAvailableProto" - val inputJson = "src/commonTest/data/workflow/allAvailableJson" + val inputProto = "$testResourcesDir/workflow/allAvailableProto" + val inputJson = "$testResourcesDir/workflow/allAvailableJson" val outputDirTop = "testOut/encrypt/AddBallotSyncTest" val nballots = 4 diff --git a/egklib/src/commonTest/kotlin/electionguard/encrypt/AddEncryptedBallotJsonTest.kt b/egklib/src/commonTest/kotlin/electionguard/encrypt/AddEncryptedBallotJsonTest.kt index c52cb7ef..34c25c3e 100644 --- a/egklib/src/commonTest/kotlin/electionguard/encrypt/AddEncryptedBallotJsonTest.kt +++ b/egklib/src/commonTest/kotlin/electionguard/encrypt/AddEncryptedBallotJsonTest.kt @@ -1,18 +1,18 @@ package electionguard.encrypt import electionguard.ballot.EncryptedBallot -import electionguard.core.* +import electionguard.core.productionGroup +import electionguard.core.testResourcesDir import electionguard.input.RandomBallotProvider import electionguard.publish.makePublisher import electionguard.publish.readElectionRecord import electionguard.util.ErrorMessages -import kotlin.test.Ignore import kotlin.test.Test import kotlin.test.assertNotNull -@Ignore // I/O is not supported in browser tests + class AddEncryptedBallotJsonTest { - val input = "src/commonTest/data/workflow/allAvailableJson" + val input = "$testResourcesDir/workflow/allAvailableJson" val outputDirJson = "testOut/encrypt/addEncryptedBallotJson" val nballots = 4 diff --git a/egklib/src/commonTest/kotlin/electionguard/encrypt/AddEncryptedBallotTest.kt b/egklib/src/commonTest/kotlin/electionguard/encrypt/AddEncryptedBallotTest.kt index 07ad15d8..62704773 100644 --- a/egklib/src/commonTest/kotlin/electionguard/encrypt/AddEncryptedBallotTest.kt +++ b/egklib/src/commonTest/kotlin/electionguard/encrypt/AddEncryptedBallotTest.kt @@ -13,10 +13,10 @@ import electionguard.util.Stats import electionguard.verifier.VerifyEncryptedBallots import kotlin.test.* -@Ignore // I/O is not supported in browser tests + class AddEncryptedBallotTest { val group = productionGroup() - val input = "src/commonTest/data/workflow/allAvailableJson" + val input = "$testResourcesDir/workflow/allAvailableJson" val outputDir = "testOut/encrypt/addEncryptedBallot" val nballots = 4 diff --git a/egklib/src/commonTest/kotlin/electionguard/encrypt/AddEncryptedUnorderedTest.kt b/egklib/src/commonTest/kotlin/electionguard/encrypt/AddEncryptedUnorderedTest.kt index 8238a622..663a5752 100644 --- a/egklib/src/commonTest/kotlin/electionguard/encrypt/AddEncryptedUnorderedTest.kt +++ b/egklib/src/commonTest/kotlin/electionguard/encrypt/AddEncryptedUnorderedTest.kt @@ -1,20 +1,20 @@ package electionguard.encrypt import electionguard.ballot.EncryptedBallot -import electionguard.core.* +import electionguard.core.productionGroup +import electionguard.core.testResourcesDir import electionguard.input.RandomBallotProvider import electionguard.publish.makePublisher import electionguard.publish.readElectionRecord import electionguard.util.ErrorMessages import kotlin.random.Random -import kotlin.test.Ignore import kotlin.test.Test import kotlin.test.assertNotNull -@Ignore // I/O is not supported in browser tests + class AddEncryptedUnorderedTest { val group = productionGroup() - val input = "src/commonTest/data/workflow/allAvailableJson" + val input = "$testResourcesDir/workflow/allAvailableJson" val outputDirProto = "testOut/encrypt/AddEncryptedUnorderedTest" val nballots = 3 diff --git a/egklib/src/commonTest/kotlin/electionguard/encrypt/EncryptTest.kt b/egklib/src/commonTest/kotlin/electionguard/encrypt/EncryptTest.kt index 6e8f10e2..753aaee3 100644 --- a/egklib/src/commonTest/kotlin/electionguard/encrypt/EncryptTest.kt +++ b/egklib/src/commonTest/kotlin/electionguard/encrypt/EncryptTest.kt @@ -1,17 +1,22 @@ package electionguard.encrypt -import electionguard.core.* +import electionguard.core.ElGamalPublicKey +import electionguard.core.UInt256 +import electionguard.core.hashFunction +import electionguard.core.productionGroup +import electionguard.core.runTest +import electionguard.core.testResourcesDir +import electionguard.core.toElementModQ import electionguard.publish.readElectionRecord import electionguard.util.ErrorMessages import kotlinx.coroutines.test.TestResult -import kotlin.test.Ignore import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull -@Ignore // I/O is not supported in browser tests + class EncryptTest { - val input = "src/commonTest/data/workflow/allAvailableJson" + val input = "$testResourcesDir/workflow/allAvailableJson" // sanity check that encryption doesnt barf @Test diff --git a/egklib/src/commonTest/kotlin/electionguard/encrypt/EncryptionNonceTest.kt b/egklib/src/commonTest/kotlin/electionguard/encrypt/EncryptionNonceTest.kt index 1f692f8a..1dc048b6 100644 --- a/egklib/src/commonTest/kotlin/electionguard/encrypt/EncryptionNonceTest.kt +++ b/egklib/src/commonTest/kotlin/electionguard/encrypt/EncryptionNonceTest.kt @@ -2,20 +2,26 @@ package electionguard.encrypt import electionguard.ballot.Manifest import electionguard.ballot.PlaintextBallot -import electionguard.core.* +import electionguard.core.ElGamalPublicKey +import electionguard.core.GroupContext +import electionguard.core.UInt256 +import electionguard.core.getSystemTimeInMillis +import electionguard.core.hashFunction +import electionguard.core.productionGroup +import electionguard.core.testResourcesDir +import electionguard.core.toElementModQ import electionguard.input.RandomBallotProvider import electionguard.publish.readElectionRecord import electionguard.util.ErrorMessages import kotlin.math.roundToInt -import kotlin.test.Ignore import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull /** Verify the embedded nonces in an Encrypted Ballot. */ -@Ignore // I/O is not supported in browser tests + class EncryptionNonceTest { - val input = "src/commonTest/data/workflow/allAvailableJson" + val input = "$testResourcesDir/workflow/allAvailableJson" val nballots = 11 @Test diff --git a/egklib/src/commonTest/kotlin/electionguard/input/RandomBallotProviderTest.kt b/egklib/src/commonTest/kotlin/electionguard/input/RandomBallotProviderTest.kt index c68f4fe1..e7106c60 100644 --- a/egklib/src/commonTest/kotlin/electionguard/input/RandomBallotProviderTest.kt +++ b/egklib/src/commonTest/kotlin/electionguard/input/RandomBallotProviderTest.kt @@ -1,18 +1,18 @@ package electionguard.input import electionguard.core.productionGroup +import electionguard.core.testResourcesDir import electionguard.publish.readElectionRecord -import kotlin.test.Ignore import kotlin.test.Test -import kotlin.test.assertFailsWith import kotlin.test.assertEquals +import kotlin.test.assertFailsWith + -@Ignore // I/O is not supported in browser tests class RandomBallotProviderTest { @Test fun testBadStyle() { - val inputDir = "src/commonTest/data/workflow/allAvailableJson" + val inputDir = "$testResourcesDir/workflow/allAvailableJson" val group = productionGroup() val electionRecord = readElectionRecord(group, inputDir)