Skip to content

Conversation

@JanBobolz
Copy link
Member

New version now works as follows:

  • Instead of writing a parameter class and adding it to this insane list in StandaloneTest, parameter classes are now automatically gathered using reflection.
  • By default, I'd now recommend only one parameter class per package instead of per class.
  • Parameter classes are now actually called StandaloneReprSubTest. Subclasses implement any number of public methods that are then automatically called at test time. The methods' task is to instantiate a StandaloneRepresentable object and then call StandaloneReprSubTest::test on it.

Example:

public class EncryptionStandaloneReprTests extends StandaloneReprSubTest {
    Group group = new CountingGroup("testgroup", 128);
    ElgamalKEM elgamalKEM = new ElgamalKEM(group, new SHA256HashFunction());

    public void testElGamal() {
        test(elgamalKEM);
        test(new ElgamalEncryption(group));
    }

    public void testStreamingHybrid() {
        test(new StreamingHybridEncryptionScheme(new StreamingCBCAES(), elgamalKEM));
    }
}

@JanBobolz JanBobolz added the enhancement New feature or request label Feb 26, 2021
@JanBobolz JanBobolz requested a review from rheitjoh February 26, 2021 14:00
@JanBobolz JanBobolz self-assigned this Feb 26, 2021
@JanBobolz JanBobolz merged commit 48b2140 into master Feb 27, 2021
@JanBobolz JanBobolz deleted the standalonetest branch February 27, 2021 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants