Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new system strings #210

Merged
merged 3 commits into from
May 9, 2019
Merged

Conversation

bchong95
Copy link
Contributor

@bchong95 bchong95 commented May 9, 2019

Added new system strings.

Tests already exist in:

JsonWriterTests.cs and JsonReaderTests.cs

SystemStringTest

It uses reflection so it automatically picks up the full set of strings:

        [TestMethod]
        [Owner("brchon")]
        public void SystemStringTest()
        {
            Type jsonBinaryEncodingType = typeof(JsonBinaryEncoding);
            FieldInfo systemStringsFieldInfo = jsonBinaryEncodingType.GetField("SystemStrings", BindingFlags.NonPublic | BindingFlags.Static);
            string[] systemStrings = (string[])systemStringsFieldInfo.GetValue(null);
            Assert.IsNotNull(systemStrings, "Failed to get system strings using reflection");

            int systemStringId = 0;
            foreach (string systemString in systemStrings)
            {
                string expectedString = "\"" + systemString + "\"";
                byte[] binaryOutput =
                {
                    BinaryFormat,
                    (byte)(JsonBinaryEncoding.TypeMarker.SystemString1ByteLengthMin + ((int)systemStringId)),
                };

                JsonTokenInfo[] tokensToWrite =
                {
                    JsonTokenInfo.String(systemString)
                };

                this.VerifyWriter(tokensToWrite, expectedString);
                this.VerifyWriter(tokensToWrite, binaryOutput);
                systemStringId++;
            }
        }

@bchong95 bchong95 requested a review from kirillg as a code owner May 9, 2019 00:13
@kirankumarkolli
Copy link
Member

Please port this to release branch also.

@kirankumarkolli kirankumarkolli merged commit bba1665 into master May 9, 2019
@kirankumarkolli kirankumarkolli deleted the users/brchon/PortingSystemStrings branch May 9, 2019 16:48
kirankumarkolli pushed a commit that referenced this pull request May 10, 2019
kirankumarkolli added a commit that referenced this pull request May 12, 2019
* added new system strings (#210)

* Ignoring TestLazyIndexAllTerms (#211)

* PartitionedCRUDTest ignored (#217)

* Exception-less Streaming API for non-existing NP container scenarios (#227)

* First cut of fix

* Refreshing syntax as per C#7

* ComosContextCore depenency on ExecUtils removed.
Few proxy methods from ExecUtils are removed.

* SDK version to 3.0.0.11-preview and Direct dependency to 3.0.0.27-preview

* Cherry pick 15a9e26 into 3.0.0.11_preview (#235)

* Query routing with partition key definition (#213)

* Fix breaks for the release

* Remove unused usings

* Adding a unit test to verify setting PartitionKeyDefinition works. (#226)

* More

* Fixes for query pipeline

* Some more fixes

* Np tests and quarantine open-partition tests

* small correction

* Direct contract test pruning

* Few test fixes

* Bug fix for paramaterised queries

* Including NP query tests

* One more test fix

* Fix for MixedModeTypoes unit test

* MixedMode multi-targeting tests clean.

* Enabling Distinct and TopOrderBy for NP.

* Quarantine TestQueryCrossPartitionAggregateFunctionsWithMixedTypes
kirankumarkolli added a commit that referenced this pull request May 12, 2019
* Raising version to 22-preview

* Merge master into release (CF Pull internal API) (#115)

* Assemblyinfo clean-up (#104)

* Signed build assembly info fix

* Assembly info clean-up

* Including test projects internal visible to (#107)

* Stand By Feed and ChangeFeed pull model (#105)

* Adding initial files

* Using Etag for continuation

* Removing unused

* Refactoring to reduce variables

* Refactoring to use CompositeToken

* Adding feed test

* Refactor through Options

* Adding public methods and comments

* Routing through the point transport handler

* Moving to outer if

* Adding split logic

* Adding unit tests

* Adding logic to detect invalid continuation tokens

* Adding JSON validation

* Routing based on PKRangeId

* Renaming and adding more tests

* Moving logic into the token

* Forcing refresh on split

* Addressing final coments

* Addressing feedback

* Added test to cover CT passing

* Refactoring and adding pkrangedelegate

* Argument checks

* Moving contract to CosmosRequestMessage

* Refactoring make EnsureInitialized async

* Moving tests to a new file

* Adding PKrange assert

* Refactored back to parameters outside Options

* UT split

* Adding Start* checks

* Adding new tests and renames

* Addressing comments

* Refactoring for cache tests

* Adding comments to tests

* Adding factory method

* Addressing comments

* Refactoring PKRange outside options

* Addressing comments

* Removing StartFromBeginning

* Removing extra lines

* Removing unnecessary ToList

* Raising version to 22-preview (#113)

* fix bugs

* Fixing signing issue

* Hot fixes for CosmosSerializationOptions and query partition key issues (#207)

* Hot fixes for CosmosSerializationOptions and query partition key.

* initial commit (#193)

* Fixed formatting

* added new system strings (#210)

* Ignoring TestLazyIndexAllTerms (#211)

* PartitionedCRUDTest ignored (#217)

* Exception-less Streaming API for non-existing NP container scenarios (#227)

* First cut of fix

* Refreshing syntax as per C#7

* ComosContextCore depenency on ExecUtils removed.
Few proxy methods from ExecUtils are removed.

* SDK version to 3.0.0.11-preview and Direct dependency to 3.0.0.27-preview

* Cherry pick 15a9e26 into 3.0.0.11_preview (#235)

* Query routing with partition key definition (#213)

* Fix breaks for the release

* Remove unused usings

* Adding a unit test to verify setting PartitionKeyDefinition works. (#226)

* More

* Revert "Fixing samples build break (#236)"

This reverts commit cda8903.

* Force samples to Nuget.org only

* Fixes for query pipeline

* Some more fixes

* Np tests and quarantine open-partition tests

* small correction

* Direct contract test pruning

* Few test fixes

* Bug fix for paramaterised queries

* Including NP query tests

* One more test fix

* Fix for MixedModeTypoes unit test

* MixedMode multi-targeting tests clean.

* Enabling Distinct and TopOrderBy for NP.

* Quarantine TestQueryCrossPartitionAggregateFunctionsWithMixedTypes

* Test fixes.

* BadRequestException fixes

* Owner attribute removed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants