Index: APPS/Halux/Planning/Pitching/impl/BatchPitchDataExporter.cls.xml =================================================================== diff -u -r71508 -r71699 --- APPS/Halux/Planning/Pitching/impl/BatchPitchDataExporter.cls.xml (.../BatchPitchDataExporter.cls.xml) (revision 71508) +++ APPS/Halux/Planning/Pitching/impl/BatchPitchDataExporter.cls.xml (.../BatchPitchDataExporter.cls.xml) (revision 71699) @@ -3,6 +3,11 @@ TECH.RegisteredObject + +APPS.Halux.PPS.MES.MESService +1 + + APPS.Halux.Planning.Pitching.impl.BatchPitchedRepository 1 @@ -24,12 +29,13 @@ -BatchPitchedRepository:APPS.Halux.Planning.Pitching.impl.BatchPitchedRepository="",BatchPitchExportedRepository:APPS.Halux.Planning.Pitching.impl.BatchPitchExportedRepository="",BatchNaarObjectiveUitvoeringInfoRepository:APPS.Halux.PPS.Activiteit.impl.common.dto.BatchNaarObjectiveUitvoeringInfoRepository="",Logger:vhLib.Logger="" +MESService:APPS.Halux.PPS.MES.MESService="",BatchPitchedRepository:APPS.Halux.Planning.Pitching.impl.BatchPitchedRepository="",BatchPitchExportedRepository:APPS.Halux.Planning.Pitching.impl.BatchPitchExportedRepository="",BatchNaarObjectiveUitvoeringInfoRepository:APPS.Halux.PPS.Activiteit.impl.common.dto.BatchNaarObjectiveUitvoeringInfoRepository="",Logger:vhLib.Logger="" 1 1 %Status 1 @@ -64,6 +73,8 @@ #dim BatchPitchExportedIterator As TECH.Iterator = ..BatchPitchExportedRepository.ZoekViaBatchId(BatchId) #dim BatchPitchExportList As %ListOfObjects = ##class(TECH.ListUtils).IteratorToList(BatchPitchExportedIterator) + Do ##class(Tools.Wlip).%New(26).String("BatchPitchExported" _ BatchPitchExportList.Size) + If (BatchPitchExportList.Size = 1) { #dim BatchPitchExportedDto As APPS.Halux.Planning.Pitching.dto.BatchPitchExported = BatchPitchExportList.GetAt(1) Set IsBatchExported = BatchPitchExportedDto.IsExported @@ -79,6 +90,11 @@ ]]> + + + + Batch:APPS.Halux.common.impl.BatchImpl 1 Index: vhUnitTest/APPS/Halux/Planning/Pitching/impl/BatchPitchDataExporter/ExporteerBatchPitchedDataNaarObjective/Test.cls.xml =================================================================== diff -u -r71508 -r71699 --- vhUnitTest/APPS/Halux/Planning/Pitching/impl/BatchPitchDataExporter/ExporteerBatchPitchedDataNaarObjective/Test.cls.xml (.../Test.cls.xml) (revision 71508) +++ vhUnitTest/APPS/Halux/Planning/Pitching/impl/BatchPitchDataExporter/ExporteerBatchPitchedDataNaarObjective/Test.cls.xml (.../Test.cls.xml) (revision 71699) @@ -3,23 +3,72 @@ vhUnitTest.TestCase + +vhTest.Mock.APPS.Halux.PPS.MES.MESService +1 + + + +vhTest.Mock.APPS.Halux.common.Batch +1 + + + +%Integer +1 + + + + + + + +aTestCase:%String + + + + + + + @@ -30,23 +79,19 @@ #dim IsReedsGestart As %Boolean = $$$True #dim IsExported As %Boolean = $$$True - Set BatchMock = ##class(vhTest.Mock.APPS.Halux.common.Batch).%New() - Do BatchMock.VerwachtMethodCall("IsReedsGestart").DanReturn(IsReedsGestart) - Do BatchMock.VerwachtMethodCall("GeefID").DanReturn(DummyBatchId) - Do BatchMock.VerwachtMethodCall("GeefCategorie").ExactAantalKeer(0) - - #dim BatchesPitched As TECH.ListIterator = ..GeefBatchesPitchedIterator(BatchMock) - Set BatchPitchedRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchedRepository).%New() - Do BatchPitchedRepositoryMock.VerwachtMethodCall("ZoekAlle").ExactAantalKeer(1).DanReturn(BatchesPitched) + Do ..BatchMock.VerwachtMethodCall("IsReedsGestart").DanReturn(IsReedsGestart) + Do ..BatchMock.VerwachtMethodCall("GeefID").DanReturn(DummyBatchId) + Do ..BatchMock.VerwachtMethodCall("GeefCategorie").ExactAantalKeer(0) + #dim BatchPitchedRepositoryMock As BatchPitchedRepositoryMock = ..GeefBatchPitchedRepositoryMock(..BatchMock) #dim BatchesExported As TECH.ListIterator = ..GeefBatchesExportedIterator(DummyBatchId, IsExported) Set BatchPitchExportRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchExportedRepository).%New() Do BatchPitchExportRepositoryMock.VerwachtMethodCall("ZoekViaBatchId", DummyBatchId).ExactAantalKeer(1).DanReturn(BatchesExported) - Set BatchPitchDataExporter = ##class(APPS.Halux.Planning.Pitching.impl.BatchPitchDataExporter).%New(BatchPitchedRepositoryMock, BatchPitchExportRepositoryMock) + Set BatchPitchDataExporter = ##class(APPS.Halux.Planning.Pitching.impl.BatchPitchDataExporter).%New(..MESServiceStub ,BatchPitchedRepositoryMock, BatchPitchExportRepositoryMock) Do BatchPitchDataExporter.ExporteerBatchPitchedDataNaarObjective() - Do BatchMock.Verifieer() + Do ..BatchMock.Verifieer() Do BatchPitchedRepositoryMock.Verifieer() Do BatchPitchExportRepositoryMock.Verifieer() ]]> @@ -58,15 +103,11 @@ #dim IsReedsGestart As %Boolean = $$$True #dim IsExported As %Boolean = $$$False - Set BatchMock = ##class(vhTest.Mock.APPS.Halux.common.Batch).%New() - Do BatchMock.VerwachtMethodCall("IsReedsGestart").DanReturn(IsReedsGestart) - Do BatchMock.VerwachtMethodCall("GeefID").DanReturn(DummyBatchId) - Do BatchMock.VerwachtMethodCall("GeefCategorie").ExactAantalKeer(1).DanReturn("Legrabox") + Do ..BatchMock.VerwachtMethodCall("IsReedsGestart").DanReturn(IsReedsGestart) + Do ..BatchMock.VerwachtMethodCall("GeefID").DanReturn(DummyBatchId) + Do ..BatchMock.VerwachtMethodCall("GeefCategorie").ExactAantalKeer(1).DanReturn("Legrabox") + #dim BatchPitchedRepositoryMock As BatchPitchedRepositoryMock = ..GeefBatchPitchedRepositoryMock(..BatchMock) - #dim BatchesPitched As TECH.ListIterator = ..GeefBatchesPitchedIterator(BatchMock) - Set BatchPitchedRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchedRepository).%New() - Do BatchPitchedRepositoryMock.VerwachtMethodCall("ZoekAlle").ExactAantalKeer(1).DanReturn(BatchesPitched) - #dim BatchesExported As TECH.ListIterator = ..GeefBatchesExportedIterator(DummyBatchId, IsExported) #dim BatchesExportedLijst As %ListOfObjects = ##class(TECH.ListUtils).IteratorToList(BatchesExported) Set BatchPitchExportedRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchExportedRepository).%New() @@ -76,10 +117,10 @@ Set BatchNaarObjectiveUitvoeringInfoRepositoryMock = ##class(vhTest.Mock.APPS.Halux.PPS.Activiteit.impl.common.dto.BatchNaarObjectiveUitvoeringInfoRepository).%New() Do BatchNaarObjectiveUitvoeringInfoRepositoryMock.VerwachtMethodCall("ZoekViaBatchId", DummyBatchId).ExactAantalKeer(1).DanReturn(..GeefLegeUitvoeringInfoIterator()) - Set BatchPitchDataExporter = ##class(APPS.Halux.Planning.Pitching.impl.BatchPitchDataExporter).%New(BatchPitchedRepositoryMock, BatchPitchExportedRepositoryMock, BatchNaarObjectiveUitvoeringInfoRepositoryMock) + Set BatchPitchDataExporter = ##class(APPS.Halux.Planning.Pitching.impl.BatchPitchDataExporter).%New(..MESServiceStub, BatchPitchedRepositoryMock, BatchPitchExportedRepositoryMock, BatchNaarObjectiveUitvoeringInfoRepositoryMock) Do BatchPitchDataExporter.ExporteerBatchPitchedDataNaarObjective() - Do BatchMock.Verifieer() + Do ..BatchMock.Verifieer() Do BatchPitchedRepositoryMock.Verifieer() Do BatchPitchExportedRepositoryMock.Verifieer() Do BatchNaarObjectiveUitvoeringInfoRepositoryMock.Verifieer() @@ -93,14 +134,10 @@ #dim IsExported As %Boolean = $$$False #dim AantalBatchesExported As %Integer = 0 - Set BatchMock = ##class(vhTest.Mock.APPS.Halux.common.Batch).%New() - Do BatchMock.VerwachtMethodCall("IsReedsGestart").DanReturn(IsReedsGestart) - Do BatchMock.VerwachtMethodCall("GeefID").DanReturn(DummyBatchId) - Do BatchMock.VerwachtMethodCall("GeefCategorie").ExactAantalKeer(1).DanReturn("Legrabox") - - #dim BatchesPitched As TECH.ListIterator = ..GeefBatchesPitchedIterator(BatchMock) - Set BatchPitchedRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchedRepository).%New() - Do BatchPitchedRepositoryMock.VerwachtMethodCall("ZoekAlle").ExactAantalKeer(1).DanReturn(BatchesPitched) + Do ..BatchMock.VerwachtMethodCall("IsReedsGestart").DanReturn(IsReedsGestart) + Do ..BatchMock.VerwachtMethodCall("GeefID").DanReturn(DummyBatchId) + Do ..BatchMock.VerwachtMethodCall("GeefCategorie").ExactAantalKeer(1).DanReturn("Legrabox") + #dim BatchPitchedRepositoryMock As BatchPitchedRepositoryMock = ..GeefBatchPitchedRepositoryMock(..BatchMock) #dim BatchesExported As TECH.ListIterator = ..GeefBatchesExportedIterator(DummyBatchId, IsExported, AantalBatchesExported) Set BatchPitchExportedRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchExportedRepository).%New() @@ -110,10 +147,10 @@ Set BatchNaarObjectiveUitvoeringInfoRepositoryMock = ##class(vhTest.Mock.APPS.Halux.PPS.Activiteit.impl.common.dto.BatchNaarObjectiveUitvoeringInfoRepository).%New() Do BatchNaarObjectiveUitvoeringInfoRepositoryMock.VerwachtMethodCall("ZoekViaBatchId", DummyBatchId).ExactAantalKeer(1).DanReturn(..GeefLegeUitvoeringInfoIterator()) - Set BatchPitchDataExporter = ##class(APPS.Halux.Planning.Pitching.impl.BatchPitchDataExporter).%New(BatchPitchedRepositoryMock, BatchPitchExportedRepositoryMock, BatchNaarObjectiveUitvoeringInfoRepositoryMock) + Set BatchPitchDataExporter = ##class(APPS.Halux.Planning.Pitching.impl.BatchPitchDataExporter).%New(..MESServiceStub, BatchPitchedRepositoryMock, BatchPitchExportedRepositoryMock, BatchNaarObjectiveUitvoeringInfoRepositoryMock) Do BatchPitchDataExporter.ExporteerBatchPitchedDataNaarObjective() - Do BatchMock.Verifieer() + Do ..BatchMock.Verifieer() Do BatchPitchedRepositoryMock.Verifieer() Do BatchPitchExportedRepositoryMock.Verifieer() Do BatchNaarObjectiveUitvoeringInfoRepositoryMock.Verifieer() @@ -128,13 +165,11 @@ #dim AantalBatchesExported As %Integer = 2 Set BatchMock = ##class(vhTest.Mock.APPS.Halux.common.Batch).%New() + Do BatchMock.IndienMethodCall("GeefLijn").DanReturn(..#Lijn) Do BatchMock.VerwachtMethodCall("IsReedsGestart").DanReturn(IsReedsGestart) Do BatchMock.VerwachtMethodCall("GeefID").DanReturn(DummyBatchId) - Do BatchMock.VerwachtMethodCall("GeefCategorie").ExactAantalKeer(0) - - #dim BatchesPitched As TECH.ListIterator = ..GeefBatchesPitchedIterator(BatchMock) - Set BatchPitchedRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchedRepository).%New() - Do BatchPitchedRepositoryMock.VerwachtMethodCall("ZoekAlle").ExactAantalKeer(1).DanReturn(BatchesPitched) + Do BatchMock.VerwachtMethodCall("GeefCategorie").ExactAantalKeer(0) + #dim BatchPitchedRepositoryMock As BatchPitchedRepositoryMock = ..GeefBatchPitchedRepositoryMock(BatchMock) #dim BatchesExported As TECH.ListIterator = ..GeefBatchesExportedIterator(DummyBatchId, IsExported, AantalBatchesExported) Set BatchPitchExportRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchExportedRepository).%New() @@ -145,7 +180,8 @@ #dim Substring = ##class(TECH.ListUtils).CreateListOfDataTypes("De batch kan niet naar Objective verzonden worden aangezien er reeds meerdere zijn verzonden voor BatchId '12345'.") Do ..ZetVerwachteExceptie(##class(Tools.Test.VerwachteExceptie).%New("TECH.Exceptions.DataCorruptException",Substring)) - Set BatchPitchDataExporter = ##class(APPS.Halux.Planning.Pitching.impl.BatchPitchDataExporter).%New(BatchPitchedRepositoryMock, BatchPitchExportRepositoryMock,, LoggerMock) + + Set BatchPitchDataExporter = ##class(APPS.Halux.Planning.Pitching.impl.BatchPitchDataExporter).%New(..MESServiceStub, BatchPitchedRepositoryMock, BatchPitchExportRepositoryMock,, LoggerMock) Do BatchPitchDataExporter.ExporteerBatchPitchedDataNaarObjective() Do BatchMock.Verifieer() @@ -154,6 +190,20 @@ ]]> + +BatchMock:vhTest.Mock.APPS.Halux.common.Batch +1 +vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchedRepository + + + BatchMock:vhTest.Mock.APPS.Halux.common.Batch 1