Пример #1
0
    def test_mqcfif(self):
        """Test string filter MQCFIF.

        Also uses MQCFST, MQCFIN and MQCFIL as parameters
        """
        attrs = []  # type: List[pymqi.MQOpts]
        attrs.append(pymqi.CFST(Parameter=pymqi.CMQC.MQCA_Q_NAME, String=b'*'))
        attrs.append(
            pymqi.CFIN(Parameter=pymqi.CMQC.MQIA_Q_TYPE,
                       Value=pymqi.CMQC.MQQT_LOCAL))
        attrs.append(
            pymqi.CFIL(Parameter=pymqi.CMQCFC.MQIACF_Q_ATTRS,
                       Values=[
                           pymqi.CMQC.MQIA_CURRENT_Q_DEPTH,
                           pymqi.CMQC.MQCA_Q_DESC
                       ]))

        object_filters = []
        object_filters.append(
            pymqi.CFIF(Parameter=pymqi.CMQC.MQIA_CURRENT_Q_DEPTH,
                       Operator=pymqi.CMQCFC.MQCFOP_GREATER,
                       FilterValue=0))

        results = self.pcf.MQCMD_INQUIRE_Q(attrs, object_filters)

        self.assertTrue(results, 'Queue not found')
        for result in results:
            self.assertTrue(
                result[pymqi.CMQC.MQIA_CURRENT_Q_DEPTH] > 0,
                'Found Queue with depth {}'.format(
                    result[pymqi.CMQC.MQIA_CURRENT_Q_DEPTH]))
Пример #2
0
    def test_mqcfbs(self):
        """Test MQCFBS PCF byte string parameter.

        Also uses MQCFIN and MQCFIL as parameters
        """
        attrs = []  # type: List[pymqi.MQOpts]
        attrs.append(
            pymqi.CFBS(Parameter=pymqi.CMQCFC.MQBACF_GENERIC_CONNECTION_ID,
                       String=b''))
        attrs.append(
            pymqi.CFIN(Parameter=pymqi.CMQCFC.MQIACF_CONN_INFO_TYPE,
                       Value=pymqi.CMQCFC.MQIACF_CONN_INFO_CONN))
        attrs.append(
            pymqi.CFIL(Parameter=pymqi.CMQCFC.MQIACF_CONNECTION_ATTRS,
                       Values=[pymqi.CMQCFC.MQIACF_ALL]))

        object_filters = []
        object_filters.append(
            pymqi.CFIF(Parameter=pymqi.CMQC.MQIA_APPL_TYPE,
                       Operator=pymqi.CMQCFC.MQCFOP_EQUAL,
                       FilterValue=pymqi.CMQC.MQAT_USER))

        results = self.pcf.MQCMD_INQUIRE_CONNECTION(attrs, object_filters)

        self.assertGreater(len(results), 0)