Add TestVectorModels: native Java data classes for test vector harness#2279
Draft
rishav-karanjit wants to merge 5 commits into
Draft
Add TestVectorModels: native Java data classes for test vector harness#2279rishav-karanjit wants to merge 5 commits into
rishav-karanjit wants to merge 5 commits into
Conversation
What: Replaces Dafny-generated datatypes from JsonConfig_Compile (Record, LargeRecord, TableConfig, SimpleQuery, ComplexQuery, ComplexTest, IoTest, WriteTest, DecryptTest, RoundTripTest, ConfigPair) with idiomatic Java. Decisions: - Used public final fields instead of getters (test harness code, not public API) - Dafny Option<string> → nullable String (simpler for Java 8 target) - Dafny seq<T> → List<T>, map<K,V> → Map<K,V> - Dafny nat (BigInteger) → int for Record.number (test vectors won't exceed int range) - Dafny ConfigName type alias → plain String - Dafny tuple (ConfigName, ConfigName) → ConfigPair class - DynamoDbTableEncryptionConfig references the native SDK model type directly - AttributeValue uses AWS SDK v2 type (software.amazon.awssdk.services.dynamodb.model) - Added TABLE_NAME and HASH_NAME constants (from Dafny source) Not included: JSON parsing logic, factory methods, test runners (future PRs) Verification: gradle compileJava passes (BUILD SUCCESSFUL)
What: Replaces Dafny-generated datatypes from JsonConfig_Compile (Record, LargeRecord, TableConfig, SimpleQuery, ComplexQuery, ComplexTest, IoTest, WriteTest, DecryptTest, RoundTripTest, ConfigPair) with idiomatic Java. Decisions: - Used public final fields (test harness code, not public API) - Dafny Option<string> → nullable String (commented) - Dafny seq<T> → List<T>, map<K,V> → Map<K,V> - Dafny nat (BigInteger) → int for Record.number - Dafny ConfigName type alias → plain String - Dafny tuple (ConfigName, ConfigName) → ConfigPair class - DynamoDbTableEncryptionConfig references the native SDK model type directly - AttributeValue uses AWS SDK v2 type - All collections defensively copied (Collections.unmodifiableList/Map) - Objects.requireNonNull on all required fields - equals/hashCode on Record and TableConfig (used in assertions) - Java 8 compatible (no List.copyOf, no records, no @nullable annotation) Not included: JSON parsing logic, factory methods, test runners (future PRs) Verification: gradle compileJava passes (BUILD SUCCESSFUL)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: Replaces Dafny-generated datatypes from JsonConfig_Compile (Record, LargeRecord, TableConfig, SimpleQuery, ComplexQuery, ComplexTest, IoTest, WriteTest, DecryptTest, RoundTripTest, ConfigPair) with idiomatic Java.
Decisions:
Not included: JSON parsing logic, factory methods, test runners (future PRs)
Verification: gradle compileJava passes (BUILD SUCCESSFUL)
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.