Exemplo n.º 1
0
 def test_client_Client_processRequest_some_browseNext_request(self):
     
     originalRequest = BrowseRequest(1) 
     
     originalRequest.targets[0].address = self.address_StaticScalar
     originalRequest.serviceSettingsGiven = True
     browseSettings = pyuaf.client.settings.BrowseSettings()
     browseSettings.maxReferencesToReturn = 3 # ridiculously low, to force automatic BrowseNext calls
     browseSettings.maxAutoBrowseNext = 0     # meaning: no automatic BrowseNext
     originalRequest.serviceSettings = browseSettings
     
     result = self.client.processRequest(originalRequest)
     
     self.assertTrue( result.overallStatus.isGood() )
     
     self.assertTrue( len(result.targets[0].continuationPoint) > 0 )
     
     noOfManualBrowseNext = 0
     
     while len(result.targets[0].continuationPoint) > 0:
         
         nextRequest = BrowseNextRequest(1)
         nextRequest.targets[0].address           = originalRequest.targets[0].address
         nextRequest.targets[0].continuationPoint = result.targets[0].continuationPoint
             
         result = self.client.processRequest(nextRequest)
         
         self.assertTrue( result.overallStatus.isGood() )
         
         noOfManualBrowseNext += 1
     
     self.assertGreaterEqual( noOfManualBrowseNext , 3 )
Exemplo n.º 2
0
    def test_client_Client_processRequest_some_browseNext_request(self):

        originalRequest = BrowseRequest(1)

        originalRequest.targets[0].address = self.address_StaticScalar
        originalRequest.serviceSettingsGiven = True
        browseSettings = pyuaf.client.settings.BrowseSettings()
        browseSettings.maxReferencesToReturn = 3  # ridiculously low, to force automatic BrowseNext calls
        browseSettings.maxAutoBrowseNext = 0  # meaning: no automatic BrowseNext
        originalRequest.serviceSettings = browseSettings

        result = self.client.processRequest(originalRequest)

        self.assertTrue(result.overallStatus.isGood())

        self.assertTrue(len(result.targets[0].continuationPoint) > 0)

        noOfManualBrowseNext = 0

        while len(result.targets[0].continuationPoint) > 0:

            nextRequest = BrowseNextRequest(1)
            nextRequest.targets[0].address = originalRequest.targets[0].address
            nextRequest.targets[0].continuationPoint = result.targets[
                0].continuationPoint

            result = self.client.processRequest(nextRequest)

            self.assertTrue(result.overallStatus.isGood())

            noOfManualBrowseNext += 1

        self.assertGreaterEqual(noOfManualBrowseNext, 3)
Exemplo n.º 3
0
 def test_client_Client_processRequest_some_browse_request(self):
     
     request = BrowseRequest(3) 
     
     request.targets[0].address = self.address_Demo
     request.targets[1].address = self.address_StaticScalar
     request.targets[2].address = self.address_DynamicScalar
     request.serviceSettingsGiven = True
     browseSettings = pyuaf.client.settings.BrowseSettings()
     browseSettings.maxReferencesToReturn = 3 # ridiculously low, to force automatic BrowseNext calls
     browseSettings.maxAutoBrowseNext = 100
     request.serviceSettings = browseSettings 
     
     result = self.client.processRequest(request)
     
     self.assertTrue( result.overallStatus.isGood() )
     self.assertGreaterEqual( len(result.targets[0].references) , 5 )
     self.assertGreaterEqual( len(result.targets[1].references) , 5 )
     self.assertGreaterEqual( len(result.targets[2].references) , 5 )