Index: APPS/TBXWeb/impl/AbstractOrderHandler.cls.xml =================================================================== diff -u -r2 -r10 --- APPS/TBXWeb/impl/AbstractOrderHandler.cls.xml (.../AbstractOrderHandler.cls.xml) (revision 2) +++ APPS/TBXWeb/impl/AbstractOrderHandler.cls.xml (.../AbstractOrderHandler.cls.xml) (revision 10) @@ -68,7 +68,7 @@ . Do ..Logger.ErrorMail("PREPROCESSING_FAILED",$$ParseStatus^vhLib.System(stPreProcessing)) ; Ordertype order niet van het juiste begin type - If $$$ISERR(..OrderStartTypeValid()) Do Quit $$$ERROR($$$GeneralError,"WSOrder start type not correct") + If $$$ISERR(..OrderStartTypeValid()) Do Quit $$$ERROR($$$errStartTypeIncorrect,"WSOrder start type not correct") . Do ..Logger.ErrorMail("ORDERSTARTTYPE_INVALID",..WSOrd.%Id()_" : "_..WSOrd.BonType) If '(..IsValidWebDomain()) Do Quit $$$ERROR($$$GeneralError,"WSOrder has no valid WebDomain for this shop") Index: vhUnitTest/TestCase.cls.xml =================================================================== diff -u --- vhUnitTest/TestCase.cls.xml (revision 0) +++ vhUnitTest/TestCase.cls.xml (revision 10) @@ -0,0 +1,234 @@ + + + + +Adopted from InterSystems's %UnitTest.TestCase by logist (Dimas ltd., Russia) +Adapted to Van Hoecke's needs by JCL and FMA + +Test case class. All test cases are derived from here. +Every test method should start with prefix "Test". +%outUnitTest,vhUnitTest,vhLib.Macro +%outUnitTest,vhUnitTest +1 +%RegisteredObject +0 + + + + + +vhUnitTest.Manager + + + +AManager +%Status + + + + +%Status + + + + +%Status + + + + +aTestName:%String +%Status + + + + +aTestName:%String +%Status + + + + +Var +%Boolean + + + + +aAutoQuoted,aValue1,aValue2,aMessage +%Boolean + + + + +aAutoQuoted,aValue1,aValue2,aMessage +%Boolean + + + + +aAutoQuoted,aValue1,aValue2,aDifference,aMessage +%Boolean +(aDifference) + Do manager.LogAssert(success,"AssertAlmostEquals",aMessage) + Quit success +]]> + + + +aAutoQuoted,aValue,aMessage +%Boolean + + + + +aAutoQuoted,aValue,aMessage +%Boolean + + + + +aAutoQuoted,status,aMessage +%Status + "_$g(errorarray(1)) + Do manager.LogAssert(success,"AssertStatusOK",aMessage) + Quit success +]]> + + + +aAutoQuoted,status,aMessage +%Status + + + + +aMessage +%Status + + + + +aAutoQuoted,file1,file2,aMessage +%Boolean + + + + +message + + + + +1 +argline:%String,type:%String +1 +%String +$l(argline) s c=$e(argline,i) d + . i c="""" s q='q + . i c="(" s p=p+1 + . i c=")" s p=p-1 + . i c=",",q=0,p=0 s args($increment(piece))=$e(argline,ptr,i-1),ptr=i+1 + s args($increment(piece))=$e(argline,ptr,i-1) + i type="expr" q $g(args(1)) + i type="equals" q $g(args(1))_"=="_$g(args(2)) + q "" +]]> + + + Index: vhUnitTest/APPS/TBXWeb/impl/VHEPNOrderHandler.cls.xml =================================================================== diff -u --- vhUnitTest/APPS/TBXWeb/impl/VHEPNOrderHandler.cls.xml (revision 0) +++ vhUnitTest/APPS/TBXWeb/impl/VHEPNOrderHandler.cls.xml (revision 10) @@ -0,0 +1,54 @@ + + + +1 +vhUnitTest.TestCase +0 + + + +Oproepen via + do ##class(vhUnitTest.Manager).RunTest("/debug/display=all","APPS.TBXWeb.impl.VHEPNOrderHandler") + + + + + +WSOrdID:%String + + + + +BonType:%String="OFF" +1 +%String + + + + Index: APPS/TBXWeb.inc.rou =================================================================== diff -u -r2 -r10 --- APPS/TBXWeb.inc.rou (.../TBXWeb.inc.rou) (revision 2) +++ APPS/TBXWeb.inc.rou (.../TBXWeb.inc.rou) (revision 10) @@ -11,4 +11,7 @@ #Include APPS.TBXWeb.EMailAdressen #Include APPS.TBXWeb.DomeinNamen -#define Vertaling(%s,%t) ##class(Res.Vertaling).GetVertaling("TBW",%s,"L",%t) \ No newline at end of file +#define Vertaling(%s,%t) ##class(Res.Vertaling).GetVertaling("TBW",%s,"L",%t) + + +#define errStartTypeIncorrect 3001 \ No newline at end of file Index: vhUnitTest/WS/TBX/SFS/OrderServiceInternal.cls.xml =================================================================== diff -u --- vhUnitTest/WS/TBX/SFS/OrderServiceInternal.cls.xml (revision 0) +++ vhUnitTest/WS/TBX/SFS/OrderServiceInternal.cls.xml (revision 10) @@ -0,0 +1,25 @@ + + + +APPS.TBXWeb +1 +vhUnitTest.TestCase +0 + + + +Oproepen via + do ##class(vhUnitTest.Manager).RunTest("/debug/display=all","WS.TBX.SFS.OrderServiceInternal") + + + + + Index: vhUnitTest/Report.cls.xml =================================================================== diff -u --- vhUnitTest/Report.cls.xml (revision 0) +++ vhUnitTest/Report.cls.xml (revision 10) @@ -0,0 +1,286 @@ + + + +1 +%CSP.Page +0 + + + + +]]> + + + + +Adapted to Van Hoecke's needs by FMA (small change: reversed the order of the test runs in the report: most recent first). +1 +%Status +#(..HyperEventHead())#> + If namespace="" { Quit ..NoNameSpace() } + ElseIf index="" { Quit ..ShowIndices(namespace) } + ElseIf suite="" { Quit ..ShowSuites(namespace,index) } + ElseIf case="" { Quit ..ShowCases(namespace,index,suite) } + ElseIf method="" { Quit ..ShowMethods(namespace,index,suite,case) } + Else { Quit ..ShowAsserts(namespace,index,suite,case,method) } + &html<> + Quit $$$OK +]]> + + + +1 +%Status +Please Enter a NameSpace with NS parameter> + Quit $$$OK +]]> + + + +1 +namespace +%Status +",! + Write "function deleteSuite(namespace,index) {",! + Write " if ( confirm('Are you sure you want to delete this log?\nNameSpace='+namespace+'\nLogIndex='+index) ) {",! + Write " ",..HyperEventCall("..DeleteSuite","namespace,index",0),";",! + Write " document.location.reload();",! + Write " }",! + Write "}",! + Write "",! + &html<> + &html<
Unit Test Report
> + &html<> + &html<> + &html<
NameSpace: #(namespace)#
> + &html<
> + &html<> + &html<> + &html<> + &html<> + &html<> + &html<> + &html<> + Set index="" For Set index=$o(^|namespace|UnitTestLog(index),-1) Quit:index="" Do + . Set href="vhUnitTest.Report.cls?NS="_..EscapeURL(namespace)_"&INDEX="_index + . &html<> + . &html<> + . &html<> + . Set succ=0,fail=0 + . Set suite="" For Set suite=$o(^|namespace|UnitTestLog(index,suite)) Quit:suite="" Do + . . If ..IsSuccess(namespace,index,suite) { Set succ=succ+1 } Else { Set fail=fail+1 } + . If fail &html<> If 1 + . Else &html<> + . &html<> + . &html<> + &html<
Test IndexTest TimeStatus 
#(index)##($zdatetime(^|namespace|UnitTestLog(index),5,3))##(fail)# Test Suite#($s(fail=1:"",1:"s"))# FailedAll Test Suites Passed
> + Quit $$$OK +]]>
+
+ + +1 +namespace,index +%Status +> + &html<
Unit Test Report
> + If $d(^|namespace|UnitTestLog(index))=0 &html<
Log Entry Doesn't Exist!> Quit $$$OK + &html<> + &html<> + &html<> + &html<
NameSpace: #(namespace)#
LogIndex: #(index)# ( Test finished on #($zdatetime(^|namespace|UnitTestLog(index),5,3))# )
> + &html<
> + &html<> + &html<> + &html<> + &html<> + &html<> + Set suite="" For Set suite=$o(^|namespace|UnitTestLog(index,suite)) Quit:suite="" Do + . Set result=^|namespace|UnitTestLog(index,suite) + . Set href="vhUnitTest.Report.cls?NS="_..EscapeURL(namespace)_"&INDEX="_index_"&SUITE="_..EscapeURL(suite) + . &html<> + . If $data(^|namespace|UnitTestLog(index,suite))>1 + . If &html<> + . Else &html<> + . If ..IsSuccess(namespace,index,suite) { Set color="green",status="Passed" } Else { Set color="red",status="Failed" } + . If +result + . If &html<> + . Else &html<> + . &html<> + &html<
Test SuitesStatus
#(suite)##(suite)##(status)##(status_"
"_$p(result,":",2,99))#
> + Quit $$$OK +]]>
+
+ + +1 +namespace,index,suite +%Status +> + &html<
Unit Test Report
> + If $d(^|namespace|UnitTestLog(index,suite))=0 &html<
Log Entry Doesn't Exist!> Quit $$$OK + &html<> + &html<> + &html<> + &html<> + &html<
NameSpace: #(namespace)#
LogIndex: #(index)# ( Test finished on #($zdatetime(^|namespace|UnitTestLog(index),5,3))# )
TestSuite: #(suite)#
> + &html<
> + &html<> + &html<> + &html<> + &html<> + &html<> + Set case="" For Set case=$o(^|namespace|UnitTestLog(index,suite,case)) Quit:case="" Do + . Set result=^|namespace|UnitTestLog(index,suite,case) + . Set href="vhUnitTest.Report.cls?NS="_..EscapeURL(namespace)_"&INDEX="_index_"&SUITE="_..EscapeURL(suite)_"&CASE="_..EscapeURL(case) + . &html<> + . If $data(^|namespace|UnitTestLog(index,suite,case))>1 + . If &html<> + . Else &html<> + . If ..IsSuccess(namespace,index,suite,case) { Set color="green",status="Passed" } Else { Set color="red",status="Failed" } + . If +result + . If &html<> + . Else &html<> + . &html<> + &html<
Test CasesStatus
#(case)##(case)##(status)##(status_"
"_$p(result,":",2,99))#
> + Quit $$$OK +]]>
+
+ + +1 +namespace,index,suite,case +%Status +> + &html<
Unit Test Report
> + If $d(^|namespace|UnitTestLog(index,suite,case))=0 &html<
Log Entry Doesn't Exist!> Quit $$$OK + &html<> + &html<> + &html<> + &html<> + &html<> + &html<
NameSpace: #(namespace)#
LogIndex: #(index)# ( Test finished on #($zdatetime(^|namespace|UnitTestLog(index),5,3))# )
TestSuite: #(suite)#
TestCase: #(case)#
> + &html<
> + &html<> + &html<> + &html<> + &html<> // JCL - Method description toegevoegd + &html<> + &html<> + Set method="" For Set method=$o(^|namespace|UnitTestLog(index,suite,case,method)) Quit:method="" Do + . Set result=^|namespace|UnitTestLog(index,suite,case,method) + . Set href="vhUnitTest.Report.cls?NS="_..EscapeURL(namespace)_"&INDEX="_index_"&SUITE="_..EscapeURL(suite)_"&CASE="_..EscapeURL(case)_"&METHOD="_..EscapeURL(method) + . &html<> + . If $data(^|namespace|UnitTestLog(index,suite,case,method))>1 + . If &html<> + . Else &html<> + . If 1 + . If &html<> // JCL - Method description toegevoegd + . If ..IsSuccess(namespace,index,suite,case,method) { Set color="green",status="Passed" } Else { Set color="red",status="Failed" } + . If +result + . If &html<> + . Else &html<> + . &html<> + &html<
MethodsDescriptionStatus
#(method)#()#(method)#()#($$MethodDescription^vhLib(case,method))##(status)##(status_"
"_$p(result,":",2,99))#
> + Quit $$$OK +]]>
+
+ + +1 +namespace,index,suite,case,method +%Status +> + &html<
Unit Test Report
> + If $d(^|namespace|UnitTestLog(index,suite,case,method))=0 &html<
Log Entry Doesn't Exist!> Quit $$$OK + &html<> + &html<> + &html<> + &html<> + &html<> + &html<> + &html<
NameSpace: #(namespace)#
LogIndex: #(index)# ( Test finished on #($zdatetime(^|namespace|UnitTestLog(index),5,3))# )
TestSuite: #(suite)#
TestCase: #(case)#
Method: #(method)#()
> + &html<
> + &html<> + &html<> + &html<> + &html<> + &html<> + &html<> + Set action="" For Set action=$o(^|namespace|UnitTestLog(index,suite,case,method,action)) Quit:action="" Do + . Set result=^|namespace|UnitTestLog(index,suite,case,method,action) + . &html<> + . &html<> + . &html<> + . If ..IsSuccess(namespace,index,suite,case,method,action) { Set color="green",status="Passed" } Else { Set color="red",status="Failed" } + . &html<> + . &html<> + &html<
AssertsAssert DescriptionStatus
#($p(result,":",2))##($p(result,":",3,99))##(status)#
> + Quit $$$OK +]]>
+
+ + +1 +namespace,index +%Status + + + + +1 +namespace,index,suite,case,method,action +%Boolean + + + + +1 +%Boolean +1 + + +
+
Index: WS/TBX/SFS/OrderServiceInternal.cls.xml =================================================================== diff -u -r2 -r10 --- WS/TBX/SFS/OrderServiceInternal.cls.xml (.../OrderServiceInternal.cls.xml) (revision 2) +++ WS/TBX/SFS/OrderServiceInternal.cls.xml (.../OrderServiceInternal.cls.xml) (revision 10) @@ -4,7 +4,7 @@ Web service for SFS to confirm orders This is the internal version, called by our proxy running in the DMZ -vhLib.Macro +APPS.TBXWeb 1 %SOAP.WebService 0 @@ -15,20 +15,6 @@ OrderServiceInternal - - -URL for invoking the WebService. -http://iserv.vanhoecke.be/csp/hadev - - - -http://iserv.vanhoecke.be/csp/hadev - - - -http://cache02/csp/admin1 - - SOAP Namespace for the WebService @@ -71,9 +57,9 @@ If 'scSaved Do Do ..ReturnFault(##class(WS.WSServerFault).%New("Order not saved", ..#SERVICENAME, "CO")) . Do oLogger.Error("SAVE_wsORD","EDInr: "_EDInr_" not saved : "_$$ParseStatus^vhLib.System(scSaved)) - Set scOrdered = ##class(APPS.TBXWeb.OrderHandling).Order(wsID,"VHEPN","SFS") - If 'scOrdered Do Do ..ReturnFault(##class(WS.WSServerFault).%New("Order not confirmed", ..#SERVICENAME, "CO")) + If 'scOrdered Do Do ..ReturnFault(##class(WS.WSServerFault).%New(SFSMessage, ..#SERVICENAME, "CO")) + . Set SFSMessage = ..GetSFSMessage(scOrdered) . Do oLogger.Error("wsORD_ORDER","Order not confirmed : "_$$ParseStatus^vhLib.System(scOrdered)) Do oLogger.Info("wsORD_ORDER","Order "_EDInr_" ordered") @@ -83,5 +69,13 @@ //Quit ##class(ConfirmOrderResult).%New(EDInr,$$ProductieDagen^FLOWHALUX()) ]]> + + +1 +Status:%Status +%String + + Index: vhUnitTest/APPS/TBXWeb/TestActies.cls.xml =================================================================== diff -u --- vhUnitTest/APPS/TBXWeb/TestActies.cls.xml (revision 0) +++ vhUnitTest/APPS/TBXWeb/TestActies.cls.xml (revision 10) @@ -0,0 +1,305 @@ + + + + +Oproepen via + do ##class(vhUnitTest.Manager).RunTest("/debug/display=all","APPS.TBXWeb.TestActies") + +1 +vhUnitTest.TestCase +0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +BonType:%String="OFF",IngaveTijdstip:%String=$H,lbActies:%List +WS.TBX.Order + + + + Index: APPS/TBXWeb/impl/SFSOrderHandler.cls.xml =================================================================== diff -u -r2 -r10 --- APPS/TBXWeb/impl/SFSOrderHandler.cls.xml (.../SFSOrderHandler.cls.xml) (revision 2) +++ APPS/TBXWeb/impl/SFSOrderHandler.cls.xml (.../SFSOrderHandler.cls.xml) (revision 10) @@ -30,11 +30,7 @@ %Status + + + +Adopted from InterSystems's %UnitTest.Manager by logist (Dimas ltd., Russia) +Adapted to Van Hoecke's needs by JCL and FMA + +do ##class(vhUnitTest.Manager).RunTest() to run all tests. +You can turn on debug mode by do ##class(vhUnitTest.Manager).RunTest("/debug=1") +You can run unittest within a specific package using ##class(vhUnitTest.Manager).RunTest(,packagename) + +vhLib.Macro +1 +%RegisteredObject +0 + + + + + + + + + + + + + + + + + + + + +1 + + + +1 + + + +0 + + + +1 +qualifiers,package="" +%Status + + + + +1 +qualifiers,userparam="",package="" +%Status + + + + +1 + + + + + +suite:%String,class:%String +",2,32767))),method) + . . . Quit + . Goto AfterAllTests +MethErrorOnBeforeAllTests . Set zhend=$zh Do ..LogStateStatus($$$ERROR($$$CacheError,$ze_":"_$Text(@$Piece($ze,">",2,32767))),"OnBeforeAllTests") +AfterAllTests . Set:'..Debug $zt= "MethErrorOnAfterAllTests" + . Set sc=testcase.OnAfterAllTests() If $$$ISERR(sc) Do ..LogStateStatus(sc,"OnAfterAllTests") Quit + . Goto Einde +MethErrorOnAfterAllTests . Set zhend=$zh Do ..LogStateStatus($$$ERROR($$$CacheError,$ze_":"_$Text(@$Piece($ze,">",2,32767))),"OnAfterAllTests") Goto Einde +Einde + . Set $zt = "" + . Kill testcase + Do ..LogStateEnd(suite) + ; + Quit +]]> + + + +testsuite,testcase,testmethod + + + + +testsuite,testcase,testmethod + + + + +status,action + + + + +success,action,description + + + + +message + + + + +text,level + + + + +text + + + + +suite,case,method,action +%Boolean + + + + +suite,case,method,action +%Boolean + + + + + + + + + + + + +1 + + + + Index: WS/WebService.cls.xml =================================================================== diff -u --- WS/WebService.cls.xml (revision 0) +++ WS/WebService.cls.xml (revision 10) @@ -0,0 +1,57 @@ + + + + +Uitgebreide ErrorInfo bij SOAP fault +vhLib.Macro,WS.WebService,TECH.Error +1 +%SOAP.WebService +0 + + + +SERVICENAME - Should be the name of the service for which this is a proxy. +Override this parameter in the subclass. +dummy + + + +1 + + + + +The OnInternalFault method may be overridden by the user to change the default SOAP + fault returned by Cache for internal errors. +OnInternalFault is passed the fault which may be modified to suit the applications needs. +After OnInternalFault returns this fault will be sent to the SOAP client. +The %Status that represents the error is also passed. +1 +fault:%SOAP.Fault,status:%Status +1 +1 +"_$$$CRLF + Set detail=detail_" "_$$$CRLF + Set detail=detail_" "_$$$cvtHTML(%ErrorObject.ErrorCode)_""_$$$CRLF + Set:($L(%ErrorObject.UserText)) detail=detail_" "_$$$cvtHTML(%ErrorObject.UserText)_""_$$$CRLF + //Set:($$$UCase(%ErrorObject.Server)="CACHE02") detail=detail_" "_$$$cvtHTML(%ErrorObject.StackTrace)_""_$$$CRLF + Set detail=detail_" "_$$$cvtHTML(%ErrorObject.ErrorCode2)_""_$$$CRLF + Set detail=detail_" "_$$$cvtHTML(%ErrorObject.RemoteIP)_""_$$$CRLF + Set detail=detail_" "_$$$cvtHTML("device: "_%ErrorObject.Device_" job: "_%ErrorObject.Job)_""_$$$CRLF + Set detail=detail_" "_$$$CRLF + + Set fault.detail=detail + } +]]> + + + Index: TECH/SourceCodeUtils.cls.xml =================================================================== diff -u -r2 -r10 --- TECH/SourceCodeUtils.cls.xml (.../SourceCodeUtils.cls.xml) (revision 2) +++ TECH/SourceCodeUtils.cls.xml (.../SourceCodeUtils.cls.xml) (revision 10) @@ -23,6 +23,9 @@ set CSPFilename = ##class(TECH.CSP.CSPApplicatie).GetPhysicalFilename(InternalName) if $length(CSPFilename) set Exists = ##class(%File).Exists(CSPFilename) } + if ItemType = "project" { + set Exists = $data(^oddPROJECT(..StripExtension(InternalName)))>0 + } quit Exists ]]> @@ -67,6 +70,24 @@ ]]> + +1 +InternalName:%String +%Boolean + + + 1 InternalName:%String Index: vhDeploy/JCL/D201106291436.cls.xml =================================================================== diff -u --- vhDeploy/JCL/D201106291436.cls.xml (revision 0) +++ vhDeploy/JCL/D201106291436.cls.xml (revision 10) @@ -0,0 +1,25 @@ + + + +1 +svn.Deploy +0 + + +Instellen ConfigItem : APPS.TBXWeb.impl.SFSOrderHandler_PostHttpRequest + + + + +do ##class(vhDeploy.JCL.D201106291436).ExecCode() +1 + + + + Index: APPS/TBXWeb/OrderHandling.cls.xml =================================================================== diff -u -r2 -r10 --- APPS/TBXWeb/OrderHandling.cls.xml (.../OrderHandling.cls.xml) (revision 2) +++ APPS/TBXWeb/OrderHandling.cls.xml (.../OrderHandling.cls.xml) (revision 10) @@ -36,7 +36,7 @@ Set factory = ##class(OrderHandlerFactory).%New() Set blOH = factory.CreateOrderHandler(wsID,Shop,Requester) If '$IsObject(blOH) Do Quit $$$ERROR($$$GeneralError,"Could not create business logic object") - . Do Logger.ErrorMail("CREATE_OBJECT_FAIDED","wsID="_$G(wsID)_"Shop="_$G(Shop)_" ") + . Do Logger.ErrorMail("CREATE_OBJECT_FAILED","wsID="_$G(wsID)_"Shop="_$G(Shop)_" ") Set Logger = ""