json serialization : client & server

base64 encoded support + tests
new tests for schema parsers : complex type extending simple type

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@303 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2007-12-29 00:58:19 +00:00
parent b5310c5151
commit 4ac8b874cf
36 changed files with 3567 additions and 866 deletions

View File

@ -11,7 +11,9 @@ uses
test_support in '..\test_support.pas',
test_utilities in '..\test_utilities.pas',
testformatter_unit in '..\testformatter_unit.pas',
base_service_intf in '..\..\..\base_service_intf.pas';
base_service_intf in '..\..\..\base_service_intf.pas',
basex_encode in '..\..\..\basex_encode.pas',
test_basex_encode in '..\test_basex_encode.pas';
{$R *.res}

View File

@ -0,0 +1,38 @@
<?xml version="1.0"?>
<definitions name="wst_test"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="library1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="urn:wst-test">
<types>
<xsd:schema xmlns:n="urn:wst-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:wst-test">
<xsd:complexType name="TClassSampleType">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="intField" type="xsd:int">
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="TClassSampleTypeA">
<xsd:simpleContent>
<xsd:extension base="xsd:base64Binary">
<xsd:attribute name="floatField" type="xsd:float">
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:schema>
</types>
</definitions>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:n="urn:wst-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:wst-test">
<xsd:complexType name="TClassSampleType">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="intField" type="xsd:int">
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="TClassSampleTypeA">
<xsd:simpleContent>
<xsd:extension base="xsd:base64Binary">
<xsd:attribute name="floatField" type="xsd:float">
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:schema>

View File

@ -0,0 +1,159 @@
{ This file is part of the Web Service Toolkit
Copyright (c) 2006, 2007 by Inoussa OUEDRAOGO
This file is provide under modified LGPL licence
( the files COPYING.modifiedLGPL and COPYING.LGPL).
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
}
{$INCLUDE wst_global.inc}
unit test_basex_encode;
interface
uses
Classes, SysUtils,
{$IFDEF FPC}
fpcunit, testregistry,
{$ELSE}
TestFrameWork,
{$ENDIF}
TypInfo,
wst_types, basex_encode;
type
TTest_Base64 = class(TTestCase)
protected
procedure Check_Encode(const AIn, AExpect : string);
procedure Check_Decode(const AIn, AExpect : string; const AOptions : TBaseXOptions = [xoDecodeIgnoreIllegalChar]);
published
procedure Encode_empty();
procedure Encode_f();
procedure Encode_fo();
procedure Encode_foo();
procedure Encode_foob();
procedure Encode_fooba();
procedure Encode_foobar();
procedure Decode_f();
procedure Decode_fo();
procedure Decode_foo();
procedure Decode_foob();
procedure Decode_fooba();
procedure Decode_foobar();
procedure Decode_illegal_char();
end;
implementation
{ TTest_Base64 }
procedure TTest_Base64.Check_Decode(const AIn, AExpect: string; const AOptions : TBaseXOptions);
var
locRes : string;
begin
locRes := Base64Decode(AIn,AOptions);
CheckEquals(AExpect,locRes);
end;
procedure TTest_Base64.Check_Encode(const AIn, AExpect: string);
var
locRes : string;
begin
locRes := Base64Encode(AIn);
CheckEquals(AExpect,locRes);
end;
procedure TTest_Base64.Decode_f();
begin
Check_Decode('Zg==','f');
end;
procedure TTest_Base64.Decode_fo();
begin
Check_Decode('Zm8=','fo');
end;
procedure TTest_Base64.Decode_foo();
begin
Check_Decode('Zm9v','foo');
end;
procedure TTest_Base64.Decode_foob();
begin
Check_Decode('Zm9vYg==','foob');
end;
procedure TTest_Base64.Decode_fooba();
begin
Check_Decode('Zm9vYmE=','fooba');
end;
procedure TTest_Base64.Decode_foobar();
begin
Check_Decode('Zm9vYmFy','foobar');
end;
procedure TTest_Base64.Decode_illegal_char();
var
ok : Boolean;
begin
ok := False;
try
Check_Decode('Zm9'#200'vY' + sLineBreak + 'm'#0'Fy','foobar',[]);
except
on e : EBase64Exception do
ok := True;
end;
CheckEquals(True,ok);
Check_Decode('Zm9'#200'vY' + sLineBreak + 'm'#0'Fy','foobar',[xoDecodeIgnoreIllegalChar]);
end;
procedure TTest_Base64.Encode_empty();
begin
Check_Encode('','');
end;
procedure TTest_Base64.Encode_f();
begin
Check_Encode('f','Zg==');
end;
procedure TTest_Base64.Encode_fo();
begin
Check_Encode('fo','Zm8=');
end;
procedure TTest_Base64.Encode_foo();
begin
Check_Encode('foo','Zm9v');
end;
procedure TTest_Base64.Encode_foob();
begin
Check_Encode('foob','Zm9vYg==');
end;
procedure TTest_Base64.Encode_fooba();
begin
Check_Encode('fooba','Zm9vYmE=');
end;
procedure TTest_Base64.Encode_foobar();
var
a, b : string;
begin
a := 'foobar';
b := 'Zm9vYmFy';
Check_Encode(a,b);
//Check_Encode('foobar','Zm9vYmFy');
end;
initialization
RegisterTest('Encoding',TTest_Base64.Suite);
end.

View File

@ -36,6 +36,7 @@ type
function LoadComplexType_Class_Schema() : TwstPasTreeContainer;virtual;abstract;
function LoadComplexType_Class_Embedded_Schema() : TwstPasTreeContainer;virtual;abstract;
function LoadComplexType_Class_Extend_Simple_Schema() : TwstPasTreeContainer;virtual;abstract;
function LoadComplexType_Record_Schema() : TwstPasTreeContainer;virtual;abstract;
function LoadComplexType_Record_Embedded_Schema() : TwstPasTreeContainer;virtual;abstract;
@ -51,6 +52,7 @@ type
procedure ComplexType_Class();
procedure ComplexType_Class_Embedded();
procedure ComplexType_Class_Extend_Simple_Schema();
procedure ComplexType_Record();
procedure ComplexType_Record_Embedded();
@ -73,6 +75,7 @@ type
function LoadComplexType_Class_Schema() : TwstPasTreeContainer;override;
function LoadComplexType_Class_Embedded_Schema() : TwstPasTreeContainer;override;
function LoadComplexType_Class_Extend_Simple_Schema() : TwstPasTreeContainer;override;
function LoadComplexType_Record_Schema() : TwstPasTreeContainer;override;
function LoadComplexType_Record_Embedded_Schema() : TwstPasTreeContainer;override;
@ -95,6 +98,7 @@ type
function LoadComplexType_Class_Schema() : TwstPasTreeContainer;override;
function LoadComplexType_Class_Embedded_Schema() : TwstPasTreeContainer;override;
function LoadComplexType_Class_Extend_Simple_Schema() : TwstPasTreeContainer;override;
function LoadComplexType_Record_Schema() : TwstPasTreeContainer;override;
function LoadComplexType_Record_Embedded_Schema() : TwstPasTreeContainer;override;
@ -113,6 +117,7 @@ const
x_complexType_SampleArrayItemType = 'TArrayItemType';
x_complexType_SampleDerivedType = 'TClassSampleDerivedType';
x_complexType_SampleClassType = 'TClassSampleType';
x_complexType_SampleClassTypeA = 'TClassSampleTypeA';
x_complexType_SampleClassTypeAll = 'TClassSampleTypeAll';
x_complexType_SampleClass = 'TClassSample';
@ -123,6 +128,7 @@ const
x_complexType_array_sequence = 'complex_array_sequence';
x_complexType_array_sequence_embedded = 'complex_array_sequence_embedded';
x_complexType_class = 'complex_class';
x_complexType_extend_simple = 'complex_class_extend_simple';
x_complexType_class_embedded = 'complex_class_embedded';
x_complexType_record = 'complex_record';
x_complexType_record_embedded = 'complex_record_embedded';
@ -544,6 +550,75 @@ begin
end;
end;
procedure TTest_CustomXsdParser.ComplexType_Class_Extend_Simple_Schema();
var
tr : TwstPasTreeContainer;
clsType : TPasClassType;
procedure CheckProperty(const AName,ATypeName : string; const AFieldType : TPropertyType);
var
prp : TPasProperty;
begin
prp := FindMember(clsType,AName) as TPasProperty;
CheckNotNull(prp);
CheckEquals(AName,prp.Name);
CheckEquals(AName,tr.GetExternalName(prp));
CheckNotNull(prp.VarType);
CheckEquals(ATypeName,tr.GetExternalName(prp.VarType));
CheckEquals(PropertyType_Att[AFieldType],tr.IsAttributeProperty(prp));
end;
var
mdl : TPasModule;
ls : TList;
elt : TPasElement;
aliasType : TPasAliasType;
i : Integer;
prpLs : TList;
begin
prpLs := TList.Create();
try
tr := LoadComplexType_Class_Extend_Simple_Schema();
mdl := tr.FindModule(x_targetNamespace);
CheckNotNull(mdl);
CheckEquals(x_complexType_extend_simple,mdl.Name);
CheckEquals(x_targetNamespace,tr.GetExternalName(mdl));
ls := mdl.InterfaceSection.Declarations;
CheckEquals(2,ls.Count);
elt := tr.FindElement(x_complexType_SampleClassType);
CheckNotNull(elt,x_complexType_SampleClassType);
CheckEquals(x_complexType_SampleClassType,elt.Name);
CheckEquals(x_complexType_SampleClassType,tr.GetExternalName(elt));
CheckIs(elt,TPasClassType);
clsType := elt as TPasClassType;
prpLs.Clear();
for i := 0 to Pred(clsType.Members.Count) do begin
if TPasElement(clsType.Members[i]).InheritsFrom(TPasProperty) then
prpLs.Add(clsType.Members[i]);
end;
CheckEquals(1,prpLs.Count);
CheckProperty(x_intField,'int',ptAttribute);
elt := tr.FindElement(x_complexType_SampleClassTypeA);
CheckNotNull(elt,x_complexType_SampleClassTypeA);
CheckEquals(x_complexType_SampleClassTypeA,elt.Name);
CheckEquals(x_complexType_SampleClassTypeA,tr.GetExternalName(elt));
CheckIs(elt,TPasClassType);
clsType := elt as TPasClassType;
prpLs.Clear();
for i := 0 to Pred(clsType.Members.Count) do begin
if TPasElement(clsType.Members[i]).InheritsFrom(TPasProperty) then
prpLs.Add(clsType.Members[i]);
end;
CheckEquals(1,prpLs.Count);
CheckProperty(x_floatField,'float',ptAttribute);
finally
FreeAndNil(prpLs);
end;
end;
procedure TTest_CustomXsdParser.ComplexType_Record();
var
tr : TwstPasTreeContainer;
@ -950,6 +1025,11 @@ begin
Result := ParseDoc(x_complexType_class_embedded);
end;
function TTest_XsdParser.LoadComplexType_Class_Extend_Simple_Schema( ) : TwstPasTreeContainer;
begin
Result := ParseDoc(x_complexType_extend_simple);
end;
function TTest_XsdParser.LoadComplexType_Record_Schema(): TwstPasTreeContainer;
begin
Result := ParseDoc(x_complexType_record);
@ -1023,6 +1103,11 @@ begin
Result := ParseDoc(x_complexType_class_embedded);
end;
function TTest_WsdlParser.LoadComplexType_Class_Extend_Simple_Schema() : TwstPasTreeContainer;
begin
Result := ParseDoc(x_complexType_extend_simple);
end;
function TTest_WsdlParser.LoadComplexType_Record_Schema(): TwstPasTreeContainer;
begin
Result := ParseDoc(x_complexType_record);

View File

@ -331,8 +331,27 @@ type
procedure Equal();
end;
{ TTest_TBase64StringRemotable }
TTest_TBase64StringRemotable = class(TTestCase)
published
procedure test_Assign();
procedure Equal();
procedure SetBinaryData();
procedure SetEncodedString();
end;
{ TTest_TBase64StringExtRemotable }
TTest_TBase64StringExtRemotable = class(TTestCase)
published
procedure Equal();
procedure SetBinaryData();
procedure SetEncodedString();
end;
implementation
uses Math;
uses Math, basex_encode;
function RandomValue(const AMaxlen: Integer): ansistring;
var
@ -2291,6 +2310,214 @@ begin
end;
end;
{ TTest_TBase64StringRemotable }
procedure TTest_TBase64StringRemotable.test_Assign();
const ITER = 100;
var
i : Integer;
a, b : TBase64StringRemotable;
begin
b := nil;
a := TBase64StringRemotable.Create();
try
b := TBase64StringRemotable.Create();
for i := 1 to ITER do begin
a.BinaryData := RandomValue(Random(500));
b.Assign(a);
CheckEquals(a.BinaryData, b.BinaryData);
CheckEquals(a.EncodedString, b.EncodedString);
end;
finally
FreeAndNil(b);
FreeAndNil(a);
end;
end;
procedure TTest_TBase64StringRemotable.Equal();
const ITER = 100;
var
i : Integer;
a, b : TBase64StringRemotable;
c : TClass_A;
begin
c := nil;
b := nil;
a := TBase64StringRemotable.Create();
try
b := TBase64StringRemotable.Create();
CheckEquals(False, a.Equal(nil));
c := TClass_A.Create();
CheckEquals(False, a.Equal(c));
a.BinaryData := 'wst';
b.BinaryData := 'azerty';
CheckEquals(False, a.Equal(b));
CheckEquals(False, b.Equal(a));
for i := 1 to ITER do begin
a.BinaryData := RandomValue(Random(500));
b.BinaryData := a.BinaryData;
CheckEquals(True, a.Equal(b));
CheckEquals(True, b.Equal(a));
end;
finally
FreeAndNil(c);
FreeAndNil(b);
FreeAndNil(a);
end;
end;
procedure TTest_TBase64StringRemotable.SetBinaryData();
const ITER = 100;
var
i : Integer;
a : TBase64StringRemotable;
s, es : string;
begin
a := TBase64StringRemotable.Create();
try
s := ''; es := Base64Encode(s);
a.BinaryData := s;
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
for i := 1 to ITER do begin
s := RandomValue(Random(500)); es := Base64Encode(s);
a.BinaryData := s;
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
end;
finally
FreeAndNil(a);
end;
end;
procedure TTest_TBase64StringRemotable.SetEncodedString();
const ITER = 100;
var
i : Integer;
a : TBase64StringRemotable;
s, es : string;
begin
a := TBase64StringRemotable.Create();
try
s := ''; es := Base64Encode(s);
a.EncodedString := es;
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
for i := 1 to ITER do begin
s := RandomValue(Random(500)); es := Base64Encode(s);
a.EncodedString := es;
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
end;
finally
FreeAndNil(a);
end;
end;
{ TTest_TBase64StringExtRemotable }
procedure TTest_TBase64StringExtRemotable.Equal();
const ITER = 100;
var
i : Integer;
a, b : TBase64StringExtRemotable;
c : TClass_A;
begin
c := nil;
b := nil;
a := TBase64StringExtRemotable.Create();
try
b := TBase64StringExtRemotable.Create();
CheckEquals(False, a.Equal(nil));
c := TClass_A.Create();
CheckEquals(False, a.Equal(c));
a.BinaryData := 'wst';
b.BinaryData := 'azerty';
CheckEquals(False, a.Equal(b));
CheckEquals(False, b.Equal(a));
for i := 1 to ITER do begin
a.BinaryData := RandomValue(Random(500));
b.BinaryData := a.BinaryData;
CheckEquals(True, a.Equal(b));
CheckEquals(True, b.Equal(a));
end;
finally
FreeAndNil(c);
FreeAndNil(b);
FreeAndNil(a);
end;
end;
procedure TTest_TBase64StringExtRemotable.SetBinaryData();
const ITER = 100;
var
i : Integer;
a : TBase64StringExtRemotable;
s, es : string;
begin
a := TBase64StringExtRemotable.Create();
try
s := ''; es := Base64Encode(s);
a.BinaryData := s;
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
for i := 1 to ITER do begin
s := RandomValue(Random(500)); es := Base64Encode(s);
a.BinaryData := s;
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
end;
finally
FreeAndNil(a);
end;
end;
procedure TTest_TBase64StringExtRemotable.SetEncodedString();
const ITER = 100;
var
i : Integer;
a : TBase64StringExtRemotable;
s, es : string;
begin
a := TBase64StringExtRemotable.Create();
try
s := ''; es := Base64Encode(s);
a.EncodedString := es;
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
for i := 1 to ITER do begin
s := RandomValue(Random(500)); es := Base64Encode(s);
a.EncodedString := es;
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
CheckEquals(s,a.BinaryData);
CheckEquals(es,a.EncodedString);
end;
finally
FreeAndNil(a);
end;
end;
initialization
RegisterTest('Support',TTest_TBaseComplexRemotable.Suite);
RegisterTest('Support',TTest_TStringBufferRemotable.Suite);
@ -2316,6 +2543,9 @@ initialization
RegisterTest('Support',TTest_TArrayOfFloatCurrencyRemotable.Suite);
RegisterTest('Support',TTest_TBaseObjectArrayRemotable.Suite);
RegisterTest('Support',TTest_TBase64StringRemotable.Suite);
RegisterTest('Support',TTest_TBase64StringExtRemotable.Suite);
end.

View File

@ -24,7 +24,11 @@ uses
TestFrameWork, ActiveX,
{$ENDIF}
TypInfo,
base_service_intf, wst_types, server_service_intf, service_intf;
base_service_intf, wst_types, server_service_intf, service_intf
{$IFDEF FPC}
, fpjson, jsonparser, base_json_formatter, json_formatter, server_service_json
{$ENDIF}
;
type
@ -340,6 +344,7 @@ type
TTestFormatter = class(TTestFormatterSimpleType)
protected
class function GetFormaterName() : string;virtual;abstract;
class function SupportNamedArrayItem() : Boolean;virtual;
published
procedure Test_Int_WithClass;
@ -410,6 +415,7 @@ type
TTestSOAPFormatter= class(TTestFormatter)
protected
class function GetFormaterName() : string;override;
class function SupportNamedArrayItem() : Boolean;override;
function CreateFormatter(ARootType : PTypeInfo):IFormatterBase;override;
published
procedure test_WriteBuffer();
@ -439,6 +445,18 @@ type
procedure test_WriteBuffer();
end;
{ TTestJsonRpcFormatter }
TTestJsonRpcFormatter= class(TTestFormatter)
protected
class function GetFormaterName() : string;override;
function CreateFormatter(ARootType : PTypeInfo):IFormatterBase;override;
function Support_ComplextType_with_SimpleContent():Boolean;override;
function Support_nil():Boolean;override;
published
//procedure test_WriteBuffer();
end;
{ TTestArray }
TTestArray= class(TTestCase)
@ -508,6 +526,17 @@ type
procedure ExceptBlock_client();
end;
{ TTest_JsonRpcFormatterExceptionBlock }
TTest_JsonRpcFormatterExceptionBlock = class(TTestCase)
protected
function CreateFormatter():IFormatterResponse;
function CreateFormatterClient():IFormatterClient;
published
procedure ExceptBlock_server();
procedure ExceptBlock_client();
end;
{ TTest_TStringBufferRemotable }
TTest_TStringBufferRemotable = class(TTestCase)
@ -1185,6 +1214,11 @@ begin
End;
end;
class function TTestFormatter.SupportNamedArrayItem() : Boolean;
begin
Result := False;
end;
procedure TTestFormatter.Test_Int_WithClass;
Var
f : IFormatterBase;
@ -1370,7 +1404,7 @@ begin
f.EndScope();
s := TMemoryStream.Create();
f.SaveToStream(s); s.SaveToFile(ClassName + '.txt');
f.SaveToStream(s); s.SaveToFile(ClassName + '.Test_CplxInt64SimpleContent_WithClass.txt');
FreeAndNil(a);
a := TClass_CplxSimpleContent.Create();
@ -2896,7 +2930,7 @@ begin
f.BeginObject('Root',TypeInfo(TClass_A));
f.Put('a',TypeInfo(TClass_A),a);
f.Put('b',TypeInfo(TClass_A),b);
f.Put('intv',TypeInfo(TArrayOfStringRemotable),intv);
f.Put('intv',TypeInfo(TArrayOfStringRemotableSample),intv);
f.EndScope();
s := TMemoryStream.Create();
@ -2906,7 +2940,7 @@ begin
FreeAndNil(intv);
ls := TStringList.Create();
f := CreateFormatter(TypeInfo(TClass_A));
f := CreateFormatter(TypeInfo(TClass_A)); s.SaveToFile(ClassName + '.test_GetScopeItemNames.xml');
s.Position := 0;
f.LoadFromStream(s);
x := 'Root';
@ -2936,7 +2970,8 @@ begin
x := 'intv';
f.BeginArrayRead(x,TypeInfo(TArrayOfStringRemotableSample),asScoped,'OI');
CheckEquals(3, f.GetScopeItemNames(ls), 'GetScopeItemNames.Count(intv)');
//Check( ls.IndexOf('OI') >= 0 );
if SupportNamedArrayItem() then
Check( ls.IndexOf('OI') >= 0, 'Named item' );
f.EndScopeRead();
f.EndScopeRead();
@ -3016,6 +3051,11 @@ begin
Result := 'SOAP';
end;
class function TTestSOAPFormatter.SupportNamedArrayItem() : Boolean;
begin
Result := True;
end;
procedure TTestSOAPFormatter.test_WriteBuffer();
const
s_XML_BUFFER =
@ -4204,6 +4244,116 @@ begin
end;
end;
{ TTestJsonRpcFormatter }
class function TTestJsonRpcFormatter.GetFormaterName() : string;
begin
Result := 'json';
end;
function TTestJsonRpcFormatter.CreateFormatter(ARootType : PTypeInfo) : IFormatterBase;
begin
{$IFDEF FPC}
Result := TJsonRpcBaseFormatter.Create();
Result.BeginObject('root',nil);
{$ENDIF}
end;
function TTestJsonRpcFormatter.Support_ComplextType_with_SimpleContent() : Boolean;
begin
Result := True;
end;
function TTestJsonRpcFormatter.Support_nil() : Boolean;
begin
Result := False;
end;
{ TTest_JsonRpcFormatterExceptionBlock }
function TTest_JsonRpcFormatterExceptionBlock.CreateFormatter() : IFormatterResponse;
begin
Result := server_service_json.TJsonRpcFormatter.Create() as IFormatterResponse;
end;
function TTest_JsonRpcFormatterExceptionBlock.CreateFormatterClient() : IFormatterClient;
begin
{$IFDEF FPC}
Result := json_formatter.TJsonRpcFormatter.Create() as IFormatterClient;
{$ENDIF}
end;
procedure TTest_JsonRpcFormatterExceptionBlock.ExceptBlock_server();
const VAL_CODE = '1210'; VAL_MSG = 'This is a sample exception message.';
var
f : IFormatterResponse;
strm : TMemoryStream;
locParser : TJSONParser;
root, errorNodeObj : TJSONObject;
errorNode, tmpNode : TJSONData;
excpt_code, excpt_msg : string;
begin
root := nil;
f := CreateFormatter();
f.BeginExceptionList(VAL_CODE,VAL_MSG);
f.EndExceptionList();
locParser := nil;
strm := TMemoryStream.Create();
try
f.SaveToStream(strm); strm.SaveToFile('TTest_JsonRpcFormatterExceptionBlock.ExceptBlock_server.txt');
strm.Position := 0;
locParser := TJSONParser.Create(strm);
root := locParser.Parse() as TJSONObject;
Check(Assigned(root));
errorNode := root.Elements[s_json_error];
Check(Assigned(errorNode),'Error');
Check(errorNode.JSONType() = jtObject);
errorNodeObj := errorNode as TJSONObject;
Check(errorNodeObj.IndexOfName(s_json_code) >= 0, s_json_code);
Check(errorNodeObj.IndexOfName(s_json_message) >= 0, s_json_message);
excpt_code := errorNodeObj.Elements[s_json_code].AsString;
excpt_msg := errorNodeObj.Elements[s_json_message].AsString;
CheckEquals(VAL_CODE,excpt_code,'faultCode');
CheckEquals(VAL_MSG,excpt_msg,'faultString');
finally
locParser.Free();
FreeAndNil(strm);
root.Free();
end;
end;
procedure TTest_JsonRpcFormatterExceptionBlock.ExceptBlock_client();
const
VAL_CODE = '1210'; VAL_MSG = 'This is a sample exception message.';
VAL_STREAM = '{ "result" : null, "error" : { "code" : ' + VAL_CODE + ', "message" : "' + VAL_MSG + '" } }';
var
f : IFormatterClient;
strm : TStringStream;
excpt_code, excpt_msg : string;
begin
excpt_code := '';
excpt_msg := '';
f := CreateFormatterClient();
strm := TStringStream.Create(VAL_STREAM);
try
strm.Position := 0;
f.LoadFromStream(strm);
try
f.BeginCallRead(nil);
Check(False,'BeginCallRead() should raise an exception.');
except
on e : EJsonRpcException do begin
excpt_code := e.FaultCode;
excpt_msg := e.FaultString;
end;
end;
CheckEquals(VAL_CODE,excpt_code,'faultCode');
CheckEquals(VAL_MSG,excpt_msg,'faultString');
finally
FreeAndNil(strm);
end;
end;
initialization
RegisterStdTypes();
GetTypeRegistry().Register(sXSD_NS,TypeInfo(TTestEnum),'TTestEnum').RegisterExternalPropertyName('teOne', '1');
@ -4254,35 +4404,23 @@ initialization
RegisterAttributeProperty(TypeInfo(TTestSmallRecord),'fieldWord');
RegisterAttributeProperty(TypeInfo(TTestRecord),'fieldWord');
RegisterTest('Support',TTestArray.Suite);
RegisterTest('Serializer',TTestSOAPFormatter.Suite);
RegisterTest('Serializer',TTestBinaryFormatter.Suite);
RegisterTest('Support',TTest_TBaseComplexRemotable.Suite);
RegisterTest('Serializer',TTestSOAPFormatterAttributes.Suite);
RegisterTest('Serializer',TTestBinaryFormatterAttributes.Suite);
RegisterTest('Serializer',TTestXmlRpcFormatterAttributes.Suite);
RegisterTest('Serializer',TTestXmlRpcFormatter.Suite);
RegisterTest('Serializer',TTest_SoapFormatterExceptionBlock.Suite);
RegisterTest('Serializer',TTest_XmlRpcFormatterExceptionBlock.Suite);
RegisterTest('Serializer',TTest_BinaryFormatterExceptionBlock.Suite);
RegisterTest('Serializer',TTest_TStringBufferRemotable.Suite);
{$IFDEF FPC}
RegisterTest(TTestArray);
RegisterTest(TTestSOAPFormatter);
RegisterTest(TTestBinaryFormatter);
RegisterTest(TTest_TBaseComplexRemotable);
RegisterTest(TTestSOAPFormatterAttributes);
RegisterTest(TTestBinaryFormatterAttributes);
RegisterTest(TTestXmlRpcFormatterAttributes);
RegisterTest(TTestXmlRpcFormatter);
RegisterTest(TTest_SoapFormatterExceptionBlock);
RegisterTest(TTest_XmlRpcFormatterExceptionBlock);
RegisterTest(TTest_BinaryFormatterExceptionBlock);
RegisterTest(TTest_TStringBufferRemotable);
{$ELSE}
RegisterTest(TTestArray.Suite);
RegisterTest(TTestSOAPFormatter.Suite);
RegisterTest(TTestBinaryFormatter.Suite);
RegisterTest(TTest_TBaseComplexRemotable.Suite);
RegisterTest(TTestSOAPFormatterAttributes.Suite);
RegisterTest(TTestBinaryFormatterAttributes.Suite);
RegisterTest(TTestXmlRpcFormatterAttributes.Suite);
RegisterTest(TTestXmlRpcFormatter.Suite);
RegisterTest(TTest_SoapFormatterExceptionBlock.Suite);
RegisterTest(TTest_XmlRpcFormatterExceptionBlock.Suite);
RegisterTest(TTest_BinaryFormatterExceptionBlock.Suite);
RegisterTest(TTest_TStringBufferRemotable.Suite);
RegisterTest('Serializer',TTestJsonRpcFormatter.Suite);
RegisterTest('Serializer',TTest_JsonRpcFormatterExceptionBlock.Suite);
{$ENDIF}
end.

View File

@ -7,7 +7,7 @@
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
<ActiveEditorIndexAtStart Value="12"/>
<ActiveEditorIndexAtStart Value="6"/>
</General>
<PublishOptions>
<Version Value="2"/>
@ -27,7 +27,7 @@
<PackageName Value="FPCUnitTestRunner"/>
</Item1>
</RequiredPackages>
<Units Count="53">
<Units Count="47">
<Unit0>
<Filename Value="wst_test_suite.lpr"/>
<IsPartOfProject Value="True"/>
@ -40,12 +40,12 @@
<Filename Value="testformatter_unit.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="testformatter_unit"/>
<CursorPos X="27" Y="1293"/>
<TopLine Value="1291"/>
<CursorPos X="17" Y="3717"/>
<TopLine Value="3715"/>
<EditorIndex Value="0"/>
<UsageCount Value="200"/>
<Bookmarks Count="1">
<Item0 X="17" Y="1099" ID="3"/>
<Item0 X="17" Y="1128" ID="3"/>
</Bookmarks>
<Loaded Value="True"/>
</Unit1>
@ -53,16 +53,18 @@
<Filename Value="..\..\server_service_soap.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="server_service_soap"/>
<CursorPos X="8" Y="182"/>
<TopLine Value="161"/>
<CursorPos X="3" Y="83"/>
<TopLine Value="81"/>
<EditorIndex Value="2"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\..\soap_formatter.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="soap_formatter"/>
<CursorPos X="41" Y="31"/>
<TopLine Value="17"/>
<CursorPos X="1" Y="260"/>
<TopLine Value="246"/>
<EditorIndex Value="1"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
@ -71,21 +73,23 @@
<Filename Value="..\..\base_binary_formatter.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="base_binary_formatter"/>
<CursorPos X="46" Y="1584"/>
<TopLine Value="1579"/>
<CursorPos X="24" Y="27"/>
<TopLine Value="7"/>
<EditorIndex Value="10"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit4>
<Unit5>
<Filename Value="..\..\base_service_intf.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="base_service_intf"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="10"/>
<CursorPos X="1" Y="4086"/>
<TopLine Value="4072"/>
<EditorIndex Value="13"/>
<UsageCount Value="200"/>
<Bookmarks Count="2">
<Item0 X="33" Y="1156" ID="0"/>
<Item1 X="5" Y="1210" ID="1"/>
<Item0 X="33" Y="1201" ID="0"/>
<Item1 X="5" Y="1255" ID="1"/>
</Bookmarks>
<Loaded Value="True"/>
</Unit5>
@ -93,9 +97,9 @@
<Filename Value="..\..\base_soap_formatter.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="base_soap_formatter"/>
<CursorPos X="20" Y="1658"/>
<TopLine Value="1649"/>
<EditorIndex Value="2"/>
<CursorPos X="3" Y="37"/>
<TopLine Value="23"/>
<EditorIndex Value="7"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit6>
@ -103,9 +107,9 @@
<Filename Value="..\..\binary_formatter.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="binary_formatter"/>
<CursorPos X="35" Y="33"/>
<TopLine Value="14"/>
<EditorIndex Value="4"/>
<CursorPos X="9" Y="177"/>
<TopLine Value="169"/>
<EditorIndex Value="9"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit7>
@ -113,20 +117,19 @@
<Filename Value="..\..\binary_streamer.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="binary_streamer"/>
<CursorPos X="95" Y="90"/>
<CursorPos X="1" Y="14"/>
<TopLine Value="1"/>
<UsageCount Value="200"/>
<Bookmarks Count="1">
<Item0 X="38" Y="487" ID="2"/>
</Bookmarks>
</Unit8>
<Unit9>
<Filename Value="..\..\server_binary_formatter.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="server_binary_formatter"/>
<CursorPos X="9" Y="123"/>
<TopLine Value="27"/>
<CursorPos X="1" Y="24"/>
<TopLine Value="12"/>
<EditorIndex Value="3"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit9>
<Unit10>
<Filename Value="..\..\metadata_repository.pas"/>
@ -158,12 +161,10 @@
<UnitName Value="parserdefs"/>
<CursorPos X="1" Y="1024"/>
<TopLine Value="1010"/>
<EditorIndex Value="5"/>
<UsageCount Value="202"/>
<Bookmarks Count="1">
<Item0 X="18" Y="1133" ID="2"/>
</Bookmarks>
<Loaded Value="True"/>
</Unit13>
<Unit14>
<Filename Value="..\..\metadata_wsdl.pas"/>
@ -182,309 +183,323 @@
<UsageCount Value="203"/>
</Unit15>
<Unit16>
<Filename Value="..\..\service_intf.pas"/>
<UnitName Value="service_intf"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="7"/>
</Unit16>
<Unit17>
<Filename Value="test_parserdef.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="test_parserdef"/>
<CursorPos X="93" Y="76"/>
<TopLine Value="11"/>
<UsageCount Value="200"/>
</Unit17>
<Unit18>
</Unit16>
<Unit17>
<Filename Value="..\..\base_xmlrpc_formatter.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="base_xmlrpc_formatter"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<CursorPos X="14" Y="1589"/>
<TopLine Value="1587"/>
<EditorIndex Value="5"/>
<UsageCount Value="200"/>
</Unit18>
<Unit19>
<Loaded Value="True"/>
</Unit17>
<Unit18>
<Filename Value="..\..\ws_helper\pascal_parser_intf.pas"/>
<UnitName Value="pascal_parser_intf"/>
<CursorPos X="3" Y="174"/>
<TopLine Value="165"/>
<UsageCount Value="59"/>
</Unit19>
<Unit20>
<Filename Value="..\..\..\..\..\..\lazarus_23_215\fpc\2.1.5\source\packages\fcl-xml\src\dom.pp"/>
<UnitName Value="DOM"/>
<CursorPos X="38" Y="225"/>
<TopLine Value="203"/>
<UsageCount Value="6"/>
</Unit20>
<Unit21>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-base\src\inc\contnrs.pp"/>
<UnitName Value="contnrs"/>
<CursorPos X="3" Y="1376"/>
<TopLine Value="1370"/>
<UsageCount Value="6"/>
</Unit21>
<Unit22>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\inc\objpash.inc"/>
<CursorPos X="8" Y="142"/>
<TopLine Value="197"/>
<UsageCount Value="6"/>
</Unit22>
<Unit23>
<CursorPos X="62" Y="217"/>
<TopLine Value="200"/>
<EditorIndex Value="14"/>
<UsageCount Value="98"/>
<Loaded Value="True"/>
</Unit18>
<Unit19>
<Filename Value="..\..\wst_fpc_xml.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="wst_fpc_xml"/>
<CursorPos X="65" Y="85"/>
<TopLine Value="56"/>
<UsageCount Value="201"/>
</Unit23>
<Unit24>
</Unit19>
<Unit20>
<Filename Value="test_utilities.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="test_utilities"/>
<CursorPos X="59" Y="740"/>
<TopLine Value="714"/>
<EditorIndex Value="11"/>
<TopLine Value="711"/>
<EditorIndex Value="15"/>
<UsageCount Value="207"/>
<Loaded Value="True"/>
</Unit24>
<Unit25>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-fpcunit\src\DUnitCompatibleInterface.inc"/>
<CursorPos X="21" Y="9"/>
<TopLine Value="1"/>
<UsageCount Value="2"/>
</Unit25>
<Unit26>
</Unit20>
<Unit21>
<Filename Value="..\..\server_service_xmlrpc.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="server_service_xmlrpc"/>
<CursorPos X="38" Y="33"/>
<TopLine Value="27"/>
<UsageCount Value="214"/>
</Unit26>
<Unit27>
</Unit21>
<Unit22>
<Filename Value="test_parsers.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="test_parsers"/>
<CursorPos X="50" Y="24"/>
<TopLine Value="1"/>
<EditorIndex Value="7"/>
<CursorPos X="33" Y="1106"/>
<TopLine Value="1106"/>
<UsageCount Value="200"/>
<Loaded Value="True"/>
</Unit27>
<Unit28>
</Unit22>
<Unit23>
<Filename Value="..\..\ws_helper\xsd_parser.pas"/>
<UnitName Value="xsd_parser"/>
<CursorPos X="17" Y="190"/>
<TopLine Value="188"/>
<UsageCount Value="35"/>
</Unit28>
<Unit29>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="58"/>
</Unit23>
<Unit24>
<Filename Value="..\..\ws_helper\parserutils.pas"/>
<UnitName Value="parserutils"/>
<CursorPos X="98" Y="94"/>
<TopLine Value="71"/>
<UsageCount Value="27"/>
</Unit29>
<Unit30>
<Filename Value="..\..\..\..\..\..\lazarus_23_2.2.1\fpc\2.2.1\source\packages\fcl-fpcunit\src\testregistry.pp"/>
<UnitName Value="testregistry"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="18"/>
<UsageCount Value="2"/>
</Unit30>
<Unit31>
<Filename Value="..\..\..\..\..\..\lazarus_23_2.2.1\fpc\2.2.1\source\packages\fcl-fpcunit\src\fpcunit.pp"/>
<UnitName Value="fpcunit"/>
<CursorPos X="33" Y="438"/>
<TopLine Value="431"/>
<UsageCount Value="5"/>
</Unit31>
<Unit32>
<UsageCount Value="20"/>
</Unit24>
<Unit25>
<Filename Value="..\..\ws_helper\ws_parser_imp.pas"/>
<UnitName Value="ws_parser_imp"/>
<CursorPos X="14" Y="91"/>
<TopLine Value="77"/>
<UsageCount Value="34"/>
</Unit32>
<Unit33>
<CursorPos X="71" Y="386"/>
<TopLine Value="363"/>
<UsageCount Value="57"/>
</Unit25>
<Unit26>
<Filename Value="..\..\ws_helper\wsdl_generator.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="wsdl_generator"/>
<CursorPos X="27" Y="146"/>
<TopLine Value="124"/>
<UsageCount Value="219"/>
</Unit33>
<Unit34>
</Unit26>
<Unit27>
<Filename Value="..\..\ws_helper\xsd_generator.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="xsd_generator"/>
<CursorPos X="3" Y="81"/>
<TopLine Value="261"/>
<EditorIndex Value="6"/>
<UsageCount Value="202"/>
<Loaded Value="True"/>
</Unit34>
<Unit35>
</Unit27>
<Unit28>
<Filename Value="..\..\ws_helper\xsd_consts.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="xsd_consts"/>
<CursorPos X="8" Y="78"/>
<TopLine Value="51"/>
<UsageCount Value="201"/>
</Unit35>
<Unit36>
</Unit28>
<Unit29>
<Filename Value="..\..\ws_helper\wsdl_parser.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="wsdl_parser"/>
<CursorPos X="28" Y="845"/>
<TopLine Value="835"/>
<UsageCount Value="135"/>
</Unit36>
<Unit37>
<CursorPos X="49" Y="21"/>
<TopLine Value="1"/>
<UsageCount Value="200"/>
</Unit29>
<Unit30>
<Filename Value="..\..\base_json_formatter.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="base_json_formatter"/>
<CursorPos X="7" Y="383"/>
<TopLine Value="367"/>
<EditorIndex Value="8"/>
<UsageCount Value="188"/>
<CursorPos X="22" Y="23"/>
<TopLine Value="1"/>
<EditorIndex Value="11"/>
<UsageCount Value="237"/>
<Loaded Value="True"/>
</Unit37>
<Unit38>
</Unit30>
<Unit31>
<Filename Value="..\..\fcl-json\src\fpjson.pp"/>
<UnitName Value="fpjson"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="330"/>
<UsageCount Value="42"/>
</Unit38>
<Unit39>
<Filename Value="..\..\wst_types.pas"/>
<UnitName Value="wst_types"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="13"/>
<UsageCount Value="6"/>
</Unit39>
<Unit40>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\rtl\inc\systemh.inc"/>
<CursorPos X="3" Y="389"/>
<TopLine Value="375"/>
<UsageCount Value="6"/>
</Unit40>
<Unit41>
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\xmlwrite.pp"/>
<UnitName Value="XMLWrite"/>
<CursorPos X="9" Y="609"/>
<TopLine Value="586"/>
<UsageCount Value="6"/>
</Unit41>
<Unit42>
<UsageCount Value="35"/>
</Unit31>
<Unit32>
<Filename Value="..\..\library_imp_utils.pas"/>
<UnitName Value="library_imp_utils"/>
<CursorPos X="82" Y="43"/>
<TopLine Value="19"/>
<EditorIndex Value="13"/>
<UsageCount Value="67"/>
<CursorPos X="92" Y="21"/>
<TopLine Value="1"/>
<EditorIndex Value="17"/>
<UsageCount Value="100"/>
<Loaded Value="True"/>
</Unit42>
<Unit43>
<Filename Value="..\..\..\..\..\..\lazarus_23_2.2.1\fpc\2.2.1\source\packages\fcl-xml\src\dom.pp"/>
<UnitName Value="DOM"/>
<CursorPos X="22" Y="351"/>
<TopLine Value="336"/>
<UsageCount Value="1"/>
</Unit43>
<Unit44>
</Unit32>
<Unit33>
<Filename Value="test_support.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="test_support"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<EditorIndex Value="12"/>
<UsageCount Value="107"/>
<CursorPos X="3" Y="109"/>
<TopLine Value="95"/>
<EditorIndex Value="16"/>
<UsageCount Value="188"/>
<Loaded Value="True"/>
</Unit44>
<Unit45>
<Filename Value="..\..\..\..\..\..\..\lazarus\fpc\2.2.1\source\packages\fcl-fpcunit\src\testutils.pp"/>
<UnitName Value="testutils"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="14"/>
<UsageCount Value="3"/>
</Unit45>
<Unit46>
<Filename Value="..\..\..\..\..\..\..\lazarus\fpc\2.2.1\source\packages\fcl-fpcunit\src\DUnitCompatibleInterface.inc"/>
<CursorPos X="21" Y="9"/>
<TopLine Value="1"/>
<UsageCount Value="3"/>
</Unit46>
<Unit47>
</Unit33>
<Unit34>
<Filename Value="..\..\..\..\..\..\..\lazarus\fpc\2.2.1\source\packages\fcl-fpcunit\src\fpcunit.pp"/>
<UnitName Value="fpcunit"/>
<CursorPos X="1" Y="446"/>
<TopLine Value="432"/>
<UsageCount Value="7"/>
</Unit47>
<Unit48>
<Filename Value="..\..\..\..\..\..\..\lazarus\fpc\2.2.1\source\rtl\objpas\math.pp"/>
<UnitName Value="math"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="59"/>
<UsageCount Value="3"/>
</Unit48>
<Unit49>
<UsageCount Value="9"/>
</Unit34>
<Unit35>
<Filename Value="..\..\..\..\..\..\..\lazarus\fpc\2.2.1\source\rtl\objpas\typinfo.pp"/>
<UnitName Value="typinfo"/>
<CursorPos X="19" Y="270"/>
<TopLine Value="256"/>
<CursorPos X="20" Y="38"/>
<TopLine Value="24"/>
<UsageCount Value="8"/>
</Unit49>
<Unit50>
</Unit35>
<Unit36>
<Filename Value="..\..\xmlrpc_formatter.pas"/>
<UnitName Value="xmlrpc_formatter"/>
<CursorPos X="1" Y="169"/>
<TopLine Value="155"/>
<EditorIndex Value="3"/>
<UsageCount Value="30"/>
<EditorIndex Value="8"/>
<UsageCount Value="70"/>
<Loaded Value="True"/>
</Unit50>
<Unit51>
<Filename Value="..\..\..\..\..\..\..\lazarus\fpc\2.2.1\source\rtl\objpas\classes\classesh.inc"/>
<CursorPos X="15" Y="344"/>
<TopLine Value="330"/>
<UsageCount Value="7"/>
</Unit51>
<Unit52>
</Unit36>
<Unit37>
<Filename Value="..\..\..\..\..\..\..\lazarus\fpc\2.2.1\source\packages\fcl-json\src\fpjson.pp"/>
<UnitName Value="fpjson"/>
<CursorPos X="3" Y="265"/>
<TopLine Value="320"/>
<EditorIndex Value="9"/>
<UsageCount Value="29"/>
<CursorPos X="17" Y="312"/>
<TopLine Value="317"/>
<EditorIndex Value="12"/>
<UsageCount Value="69"/>
<Loaded Value="True"/>
</Unit52>
</Unit37>
<Unit38>
<Filename Value="..\..\basex_encode.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="basex_encode"/>
<CursorPos X="45" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="101"/>
</Unit38>
<Unit39>
<Filename Value="test_basex_encode.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="test_basex_encode"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="101"/>
</Unit39>
<Unit40>
<Filename Value="..\..\..\..\..\..\..\lazarus\fpc\2.2.1\source\packages\fcl-json\src\jsonparser.pp"/>
<UnitName Value="jsonparser"/>
<CursorPos X="35" Y="22"/>
<TopLine Value="6"/>
<UsageCount Value="15"/>
</Unit40>
<Unit41>
<Filename Value="..\..\..\..\..\..\..\lazarus\fpc\2.2.1\source\packages\fcl-fpcunit\src\testregistry.pp"/>
<UnitName Value="testregistry"/>
<CursorPos X="11" Y="32"/>
<TopLine Value="24"/>
<UsageCount Value="8"/>
</Unit41>
<Unit42>
<Filename Value="..\..\wst_global.inc"/>
<CursorPos X="22" Y="17"/>
<TopLine Value="1"/>
<UsageCount Value="8"/>
</Unit42>
<Unit43>
<Filename Value="..\..\..\..\..\..\..\lazarus\fpc\2.2.1\source\packages\fcl-base\src\inc\contnrs.pp"/>
<UnitName Value="contnrs"/>
<CursorPos X="3" Y="1403"/>
<TopLine Value="1398"/>
<UsageCount Value="9"/>
</Unit43>
<Unit44>
<Filename Value="..\..\..\..\..\..\..\lazarus\fpc\2.2.1\source\packages\fcl-json\src\jsonscanner.pp"/>
<UnitName Value="jsonscanner"/>
<CursorPos X="11" Y="258"/>
<TopLine Value="210"/>
<UsageCount Value="10"/>
</Unit44>
<Unit45>
<Filename Value="..\..\json_formatter.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="json_formatter"/>
<CursorPos X="3" Y="66"/>
<TopLine Value="43"/>
<EditorIndex Value="6"/>
<UsageCount Value="34"/>
<Loaded Value="True"/>
</Unit45>
<Unit46>
<Filename Value="..\..\server_service_json.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="server_service_json"/>
<CursorPos X="60" Y="54"/>
<TopLine Value="40"/>
<EditorIndex Value="4"/>
<UsageCount Value="30"/>
<Loaded Value="True"/>
</Unit46>
</Units>
<JumpHistory Count="5" HistoryIndex="4">
<JumpHistory Count="16" HistoryIndex="15">
<Position1>
<Filename Value="test_support.pas"/>
<Caret Line="927" Column="13" TopLine="908"/>
<Filename Value="..\..\server_binary_formatter.pas"/>
<Caret Line="135" Column="45" TopLine="113"/>
</Position1>
<Position2>
<Filename Value="test_support.pas"/>
<Caret Line="2149" Column="5" TopLine="2117"/>
<Filename Value="..\..\json_formatter.pas"/>
<Caret Line="52" Column="3" TopLine="50"/>
</Position2>
<Position3>
<Filename Value="test_support.pas"/>
<Caret Line="2156" Column="27" TopLine="2146"/>
<Filename Value="..\..\server_service_json.pas"/>
<Caret Line="56" Column="49" TopLine="45"/>
</Position3>
<Position4>
<Filename Value="..\..\base_service_intf.pas"/>
<Caret Line="4591" Column="12" TopLine="4577"/>
<Filename Value="..\..\server_service_json.pas"/>
<Caret Line="57" Column="46" TopLine="36"/>
</Position4>
<Position5>
<Filename Value="test_support.pas"/>
<Caret Line="2111" Column="1" TopLine="2104"/>
<Filename Value="..\..\server_service_json.pas"/>
<Caret Line="21" Column="16" TopLine="4"/>
</Position5>
<Position6>
<Filename Value="..\..\json_formatter.pas"/>
<Caret Line="165" Column="6" TopLine="151"/>
</Position6>
<Position7>
<Filename Value="..\..\json_formatter.pas"/>
<Caret Line="166" Column="11" TopLine="145"/>
</Position7>
<Position8>
<Filename Value="..\..\binary_formatter.pas"/>
<Caret Line="177" Column="9" TopLine="169"/>
</Position8>
<Position9>
<Filename Value="testformatter_unit.pas"/>
<Caret Line="3717" Column="17" TopLine="3715"/>
</Position9>
<Position10>
<Filename Value="..\..\soap_formatter.pas"/>
<Caret Line="240" Column="8" TopLine="223"/>
</Position10>
<Position11>
<Filename Value="..\..\json_formatter.pas"/>
<Caret Line="29" Column="35" TopLine="7"/>
</Position11>
<Position12>
<Filename Value="..\..\server_service_json.pas"/>
<Caret Line="21" Column="16" TopLine="4"/>
</Position12>
<Position13>
<Filename Value="..\..\soap_formatter.pas"/>
<Caret Line="271" Column="14" TopLine="246"/>
</Position13>
<Position14>
<Filename Value="..\..\json_formatter.pas"/>
<Caret Line="170" Column="11" TopLine="157"/>
</Position14>
<Position15>
<Filename Value="..\..\json_formatter.pas"/>
<Caret Line="194" Column="48" TopLine="174"/>
</Position15>
<Position16>
<Filename Value="..\..\json_formatter.pas"/>
<Caret Line="189" Column="34" TopLine="174"/>
</Position16>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>

View File

@ -17,7 +17,8 @@ uses
metadata_generator, parserdefs, server_service_intf, metadata_wsdl,
test_parserdef, base_xmlrpc_formatter, wst_fpc_xml, test_utilities,
server_service_xmlrpc, test_parsers, wsdl_generator, xsd_generator,
xsd_consts, base_json_formatter, wsdl_parser, test_support;
xsd_consts, base_json_formatter, wsdl_parser, test_support, basex_encode,
test_basex_encode, json_formatter, server_service_json;
Const
ShortOpts = 'alh';