2 %% Licensed to the Apache Software Foundation (ASF) under one
3 %% or more contributor license agreements. See the NOTICE file
4 %% distributed with this work for additional information
5 %% regarding copyright ownership. The ASF licenses this file
6 %% to you under the Apache License, Version 2.0 (the
7 %% "License"); you may not use this file except in compliance
8 %% with the License. You may obtain a copy of the License at
10 %% http://www.apache.org/licenses/LICENSE-2.0
12 %% Unless required by applicable law or agreed to in writing,
13 %% software distributed under the License is distributed on an
14 %% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 %% KIND, either express or implied. See the License for the
16 %% specific language governing permissions and limitations
20 -module(legacy_names_test).
23 -include_lib("eunit/include/eunit.hrl").
25 -include("gen-erl/legacyNames_constants.hrl").
27 record_generation_test_() ->
29 {"capitalizedStruct record", ?_assertMatch(
30 {capitalizedStruct, _, _},
31 #capitalizedStruct{id=null,message=null}
35 struct_info_test_() ->
37 {"capitalizedStruct extended definition", ?_assertEqual(
39 {1, undefined, i32, 'id', undefined},
40 {2, undefined, string, 'message', undefined}
42 legacyNames_types:struct_info_ext(capitalizedStruct)
44 {"listCapitalizedStructs extended definition", ?_assertEqual(
46 {1, undefined, {list, {struct, {'legacyNames_types', 'capitalizedStruct'}}}, 'structs', []}
48 legacyNames_types:struct_info_ext(listCapitalizedStructs)
52 service_info_test_() ->
54 {"names params", ?_assertEqual(
56 {1, {struct, {'legacyNames_types', 'capitalizedStruct'}}},
57 {2, {struct, {'legacyNames_types', 'capitalizedStruct'}}}
59 legacyNames_thrift:function_info(names, params_type)
61 {"names reply", ?_assertEqual(
62 {struct, {'legacyNames_types', 'listCapitalizedStructs'}},
63 legacyNames_thrift:function_info(names, reply_type)
65 {"names exceptions", ?_assertEqual(
66 {struct, [{1, {struct, {'legacyNames_types', 'xception'}}}]},
67 legacyNames_thrift:function_info(names, exceptions)