Skip to content

Commit 0007326

Browse files
Generate CBOR Protocol Tests along with other models for v1.0.5931.0 and Smithy v1.58.0
1 parent a026969 commit 0007326

File tree

115 files changed

+11502
-137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+11502
-137
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
{
3+
"core": {
4+
"changeLogMessages": [
5+
"Cbor protocol temp message"
6+
],
7+
"type": "patch",
8+
"updateMinimum": true
9+
}
10+
}

sdk/AWSSDK.NetFramework.sln

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,6 +1718,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RestXMLTest", "RestXMLTest"
17181718
EndProject
17191719
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AWSSDK.RestXMLTest.NetFramework", "test/Services/RestXMLTest/AWSSDK.RestXMLTest.NetFramework.csproj", "{CAFD261C-BE37-4CA7-9AA0-285CDB55F710}"
17201720
EndProject
1721+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RpcV2Protocol", "RpcV2Protocol", "{8F67194B-AE07-4423-8EA2-47CFABD6FA9F}"
1722+
EndProject
1723+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AWSSDK.RpcV2Protocol.NetFramework", "test/Services/RpcV2Protocol/AWSSDK.RpcV2Protocol.NetFramework.csproj", "{DA8AF270-82A5-4F67-B6D5-FF4B975CA843}"
1724+
EndProject
17211725
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UseServiceIdTestserviceId", "UseServiceIdTestserviceId", "{527CCE19-B9C3-4CDA-ACD7-125A39265631}"
17221726
EndProject
17231727
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AWSSDK.UseServiceIdTestserviceId.NetFramework", "test/Services/UseServiceIdTestserviceId/AWSSDK.UseServiceIdTestserviceId.NetFramework.csproj", "{21EF41CA-6BD3-4810-9970-7DB173E2A2A9}"
@@ -3466,6 +3470,10 @@ Global
34663470
{CAFD261C-BE37-4CA7-9AA0-285CDB55F710}.Debug|Any CPU.Build.0 = Debug|Any CPU
34673471
{CAFD261C-BE37-4CA7-9AA0-285CDB55F710}.Release|Any CPU.ActiveCfg = Release|Any CPU
34683472
{CAFD261C-BE37-4CA7-9AA0-285CDB55F710}.Release|Any CPU.Build.0 = Release|Any CPU
3473+
{DA8AF270-82A5-4F67-B6D5-FF4B975CA843}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3474+
{DA8AF270-82A5-4F67-B6D5-FF4B975CA843}.Debug|Any CPU.Build.0 = Debug|Any CPU
3475+
{DA8AF270-82A5-4F67-B6D5-FF4B975CA843}.Release|Any CPU.ActiveCfg = Release|Any CPU
3476+
{DA8AF270-82A5-4F67-B6D5-FF4B975CA843}.Release|Any CPU.Build.0 = Release|Any CPU
34693477
{21EF41CA-6BD3-4810-9970-7DB173E2A2A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34703478
{21EF41CA-6BD3-4810-9970-7DB173E2A2A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
34713479
{21EF41CA-6BD3-4810-9970-7DB173E2A2A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -4367,6 +4375,8 @@ Global
43674375
{562C6970-C310-4F9B-97FF-A999253350D7} = {7154877A-38C8-4432-B14F-4B9A5DA46303}
43684376
{3840562C-F910-48D4-8328-AD3BE254E4B4} = {939EC5C2-8345-43E2-8F97-72EEEBEEA0AB}
43694377
{CAFD261C-BE37-4CA7-9AA0-285CDB55F710} = {3840562C-F910-48D4-8328-AD3BE254E4B4}
4378+
{8F67194B-AE07-4423-8EA2-47CFABD6FA9F} = {939EC5C2-8345-43E2-8F97-72EEEBEEA0AB}
4379+
{DA8AF270-82A5-4F67-B6D5-FF4B975CA843} = {8F67194B-AE07-4423-8EA2-47CFABD6FA9F}
43704380
{527CCE19-B9C3-4CDA-ACD7-125A39265631} = {939EC5C2-8345-43E2-8F97-72EEEBEEA0AB}
43714381
{21EF41CA-6BD3-4810-9970-7DB173E2A2A9} = {527CCE19-B9C3-4CDA-ACD7-125A39265631}
43724382
{87D7508C-4786-48A6-8EF7-460153897415} = {12EC4E4B-7E2C-4B63-8EF9-7B959F82A89B}

sdk/AWSSDK.NetStandard.sln

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,6 +1714,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RestXMLTest", "RestXMLTest"
17141714
EndProject
17151715
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AWSSDK.RestXMLTest.NetStandard", "test/Services/RestXMLTest/AWSSDK.RestXMLTest.NetStandard.csproj", "{4C1561E4-BB07-4848-A914-622A3600A314}"
17161716
EndProject
1717+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RpcV2Protocol", "RpcV2Protocol", "{CCEB9760-D30F-42F7-BF96-33CE65363879}"
1718+
EndProject
1719+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AWSSDK.RpcV2Protocol.NetStandard", "test/Services/RpcV2Protocol/AWSSDK.RpcV2Protocol.NetStandard.csproj", "{8B1A55DD-0567-45A1-ACFF-F1F511B436C9}"
1720+
EndProject
17171721
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UseServiceIdTestserviceId", "UseServiceIdTestserviceId", "{D2C3BBC4-139C-74A6-7A6D-8EF91479A7B1}"
17181722
EndProject
17191723
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AWSSDK.UseServiceIdTestserviceId.NetStandard", "test/Services/UseServiceIdTestserviceId/AWSSDK.UseServiceIdTestserviceId.NetStandard.csproj", "{EBCA07C7-EFDC-4B6D-BDCB-78A5B65D224E}"
@@ -3458,6 +3462,10 @@ Global
34583462
{4C1561E4-BB07-4848-A914-622A3600A314}.Debug|Any CPU.Build.0 = Debug|Any CPU
34593463
{4C1561E4-BB07-4848-A914-622A3600A314}.Release|Any CPU.ActiveCfg = Release|Any CPU
34603464
{4C1561E4-BB07-4848-A914-622A3600A314}.Release|Any CPU.Build.0 = Release|Any CPU
3465+
{8B1A55DD-0567-45A1-ACFF-F1F511B436C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3466+
{8B1A55DD-0567-45A1-ACFF-F1F511B436C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
3467+
{8B1A55DD-0567-45A1-ACFF-F1F511B436C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
3468+
{8B1A55DD-0567-45A1-ACFF-F1F511B436C9}.Release|Any CPU.Build.0 = Release|Any CPU
34613469
{EBCA07C7-EFDC-4B6D-BDCB-78A5B65D224E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34623470
{EBCA07C7-EFDC-4B6D-BDCB-78A5B65D224E}.Debug|Any CPU.Build.0 = Debug|Any CPU
34633471
{EBCA07C7-EFDC-4B6D-BDCB-78A5B65D224E}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -4357,6 +4365,8 @@ Global
43574365
{83607637-1A7B-4E96-A569-919EE71467B5} = {647793C9-9D6B-4015-B2A8-CC23A21971BE}
43584366
{DAB1DE25-8227-ED20-53FC-3757627C61C3} = {939EC5C2-8345-43E2-8F97-72EEEBEEA0AB}
43594367
{4C1561E4-BB07-4848-A914-622A3600A314} = {DAB1DE25-8227-ED20-53FC-3757627C61C3}
4368+
{CCEB9760-D30F-42F7-BF96-33CE65363879} = {939EC5C2-8345-43E2-8F97-72EEEBEEA0AB}
4369+
{8B1A55DD-0567-45A1-ACFF-F1F511B436C9} = {CCEB9760-D30F-42F7-BF96-33CE65363879}
43604370
{D2C3BBC4-139C-74A6-7A6D-8EF91479A7B1} = {939EC5C2-8345-43E2-8F97-72EEEBEEA0AB}
43614371
{EBCA07C7-EFDC-4B6D-BDCB-78A5B65D224E} = {D2C3BBC4-139C-74A6-7A6D-8EF91479A7B1}
43624372
{7768CFF3-2FE7-43EB-8843-35F48ED3ED43} = {12EC4E4B-7E2C-4B63-8EF9-7B959F82A89B}

sdk/test/ProtocolTests/Generated/JSONRPC10/dotnet-protocol-test-codegen/GreetingWithErrors.cs

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,52 @@ public void AwsJson10InvalidGreetingErrorErrorResponse()
6363
Assert.AreEqual(errorResponse.StatusCode,(HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400));
6464
}
6565

66+
/// <summary>
67+
/// Parses a complex error with no message member
68+
/// </summary>
69+
[TestMethod]
70+
[TestCategory("ProtocolTest")]
71+
[TestCategory("ErrorTest")]
72+
[TestCategory("JsonRpc10")]
73+
public void AwsJson10ComplexErrorErrorResponse()
74+
{
75+
// Arrange
76+
var webResponseData = new WebResponseData();
77+
webResponseData.StatusCode = (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400);
78+
webResponseData.Headers["Content-Type"] = "application/x-amz-json-1.0";
79+
byte[] bytes = Encoding.ASCII.GetBytes("{\n \"__type\": \"aws.protocoltests.json10#ComplexError\",\n \"TopLevel\": \"Top level\",\n \"Nested\": {\n \"Foo\": \"bar\"\n }\n}");
80+
var stream = new MemoryStream(bytes);
81+
var context = new JsonUnmarshallerContext(stream,true,webResponseData);
82+
// Act
83+
var errorResponse = new GreetingWithErrorsResponseUnmarshaller().UnmarshallException(context, null, (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400));
84+
// Assert
85+
Assert.IsInstanceOfType(errorResponse, typeof(ComplexErrorException));
86+
Assert.AreEqual(errorResponse.StatusCode,(HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400));
87+
}
88+
89+
/// <summary>
90+
/// Parses a complex error with an empty body
91+
/// </summary>
92+
[TestMethod]
93+
[TestCategory("ProtocolTest")]
94+
[TestCategory("ErrorTest")]
95+
[TestCategory("JsonRpc10")]
96+
public void AwsJson10EmptyComplexErrorErrorResponse()
97+
{
98+
// Arrange
99+
var webResponseData = new WebResponseData();
100+
webResponseData.StatusCode = (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400);
101+
webResponseData.Headers["Content-Type"] = "application/x-amz-json-1.0";
102+
byte[] bytes = Encoding.ASCII.GetBytes("{\n \"__type\": \"aws.protocoltests.json10#ComplexError\"\n}");
103+
var stream = new MemoryStream(bytes);
104+
var context = new JsonUnmarshallerContext(stream,true,webResponseData);
105+
// Act
106+
var errorResponse = new GreetingWithErrorsResponseUnmarshaller().UnmarshallException(context, null, (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400));
107+
// Assert
108+
Assert.IsInstanceOfType(errorResponse, typeof(ComplexErrorException));
109+
Assert.AreEqual(errorResponse.StatusCode,(HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400));
110+
}
111+
66112
/// <summary>
67113
/// Serializes the X-Amzn-ErrorType header. For an example service,
68114
/// see Amazon EKS.
@@ -294,51 +340,5 @@ public void AwsJson10FooErrorWithDunderTypeUriAndNamespaceErrorResponse()
294340
Assert.AreEqual(errorResponse.StatusCode,(HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 500));
295341
}
296342

297-
/// <summary>
298-
/// Parses a complex error with no message member
299-
/// </summary>
300-
[TestMethod]
301-
[TestCategory("ProtocolTest")]
302-
[TestCategory("ErrorTest")]
303-
[TestCategory("JsonRpc10")]
304-
public void AwsJson10ComplexErrorErrorResponse()
305-
{
306-
// Arrange
307-
var webResponseData = new WebResponseData();
308-
webResponseData.StatusCode = (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400);
309-
webResponseData.Headers["Content-Type"] = "application/x-amz-json-1.0";
310-
byte[] bytes = Encoding.ASCII.GetBytes("{\n \"__type\": \"aws.protocoltests.json10#ComplexError\",\n \"TopLevel\": \"Top level\",\n \"Nested\": {\n \"Foo\": \"bar\"\n }\n}");
311-
var stream = new MemoryStream(bytes);
312-
var context = new JsonUnmarshallerContext(stream,true,webResponseData);
313-
// Act
314-
var errorResponse = new GreetingWithErrorsResponseUnmarshaller().UnmarshallException(context, null, (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400));
315-
// Assert
316-
Assert.IsInstanceOfType(errorResponse, typeof(ComplexErrorException));
317-
Assert.AreEqual(errorResponse.StatusCode,(HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400));
318-
}
319-
320-
/// <summary>
321-
/// Parses a complex error with an empty body
322-
/// </summary>
323-
[TestMethod]
324-
[TestCategory("ProtocolTest")]
325-
[TestCategory("ErrorTest")]
326-
[TestCategory("JsonRpc10")]
327-
public void AwsJson10EmptyComplexErrorErrorResponse()
328-
{
329-
// Arrange
330-
var webResponseData = new WebResponseData();
331-
webResponseData.StatusCode = (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400);
332-
webResponseData.Headers["Content-Type"] = "application/x-amz-json-1.0";
333-
byte[] bytes = Encoding.ASCII.GetBytes("{\n \"__type\": \"aws.protocoltests.json10#ComplexError\"\n}");
334-
var stream = new MemoryStream(bytes);
335-
var context = new JsonUnmarshallerContext(stream,true,webResponseData);
336-
// Act
337-
var errorResponse = new GreetingWithErrorsResponseUnmarshaller().UnmarshallException(context, null, (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400));
338-
// Assert
339-
Assert.IsInstanceOfType(errorResponse, typeof(ComplexErrorException));
340-
Assert.AreEqual(errorResponse.StatusCode,(HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400));
341-
}
342-
343343
}
344344
}

sdk/test/ProtocolTests/Generated/QueryProtocol/dotnet-protocol-test-codegen/GreetingWithErrors.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,47 +92,47 @@ public void QueryInvalidGreetingErrorErrorResponse()
9292
Assert.AreEqual(errorResponse.StatusCode,(HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400));
9393
}
9494

95-
/// <summary>
96-
/// Parses customized XML errors
97-
/// </summary>
9895
[TestMethod]
9996
[TestCategory("ProtocolTest")]
10097
[TestCategory("ErrorTest")]
10198
[TestCategory("AwsQuery")]
102-
public void QueryCustomizedErrorErrorResponse()
99+
public void QueryComplexErrorErrorResponse()
103100
{
104101
// Arrange
105102
var webResponseData = new WebResponseData();
106-
webResponseData.StatusCode = (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 402);
103+
webResponseData.StatusCode = (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400);
107104
webResponseData.Headers["Content-Type"] = "text/xml";
108-
byte[] bytes = Encoding.ASCII.GetBytes("<ErrorResponse>\n <Error>\n <Type>Sender</Type>\n <Code>Customized</Code>\n <Message>Hi</Message>\n </Error>\n <RequestId>foo-id</RequestId>\n</ErrorResponse>\n");
105+
byte[] bytes = Encoding.ASCII.GetBytes("<ErrorResponse>\n <Error>\n <Type>Sender</Type>\n <Code>ComplexError</Code>\n <TopLevel>Top level</TopLevel>\n <Nested>\n <Foo>bar</Foo>\n </Nested>\n </Error>\n <RequestId>foo-id</RequestId>\n</ErrorResponse>\n");
109106
var stream = new MemoryStream(bytes);
110107
var context = new XmlUnmarshallerContext(stream,true,webResponseData);
111108
// Act
112-
var errorResponse = new GreetingWithErrorsResponseUnmarshaller().UnmarshallException(context, null, (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 402));
109+
var errorResponse = new GreetingWithErrorsResponseUnmarshaller().UnmarshallException(context, null, (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400));
113110
// Assert
114-
Assert.IsInstanceOfType(errorResponse, typeof(CustomCodeErrorException));
115-
Assert.AreEqual(errorResponse.StatusCode,(HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 402));
111+
Assert.IsInstanceOfType(errorResponse, typeof(ComplexErrorException));
112+
Assert.AreEqual(errorResponse.StatusCode,(HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400));
116113
}
117114

115+
/// <summary>
116+
/// Parses customized XML errors
117+
/// </summary>
118118
[TestMethod]
119119
[TestCategory("ProtocolTest")]
120120
[TestCategory("ErrorTest")]
121121
[TestCategory("AwsQuery")]
122-
public void QueryComplexErrorErrorResponse()
122+
public void QueryCustomizedErrorErrorResponse()
123123
{
124124
// Arrange
125125
var webResponseData = new WebResponseData();
126-
webResponseData.StatusCode = (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400);
126+
webResponseData.StatusCode = (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 402);
127127
webResponseData.Headers["Content-Type"] = "text/xml";
128-
byte[] bytes = Encoding.ASCII.GetBytes("<ErrorResponse>\n <Error>\n <Type>Sender</Type>\n <Code>ComplexError</Code>\n <TopLevel>Top level</TopLevel>\n <Nested>\n <Foo>bar</Foo>\n </Nested>\n </Error>\n <RequestId>foo-id</RequestId>\n</ErrorResponse>\n");
128+
byte[] bytes = Encoding.ASCII.GetBytes("<ErrorResponse>\n <Error>\n <Type>Sender</Type>\n <Code>Customized</Code>\n <Message>Hi</Message>\n </Error>\n <RequestId>foo-id</RequestId>\n</ErrorResponse>\n");
129129
var stream = new MemoryStream(bytes);
130130
var context = new XmlUnmarshallerContext(stream,true,webResponseData);
131131
// Act
132-
var errorResponse = new GreetingWithErrorsResponseUnmarshaller().UnmarshallException(context, null, (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400));
132+
var errorResponse = new GreetingWithErrorsResponseUnmarshaller().UnmarshallException(context, null, (HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 402));
133133
// Assert
134-
Assert.IsInstanceOfType(errorResponse, typeof(ComplexErrorException));
135-
Assert.AreEqual(errorResponse.StatusCode,(HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 400));
134+
Assert.IsInstanceOfType(errorResponse, typeof(CustomCodeErrorException));
135+
Assert.AreEqual(errorResponse.StatusCode,(HttpStatusCode)Enum.ToObject(typeof(HttpStatusCode), 402));
136136
}
137137

138138
}

0 commit comments

Comments
 (0)