Ejemplo n.º 1
0
 def test_form_dpe_name(self):
     test_case = ClaraUtils.form_dpe_name("192.168.0.1", ClaraLang.JAVA)
     self.assertTrue(ClaraUtils.is_dpe_name(test_case))
     self.assertEqual(test_case, "192.168.0.1_java")
     test_case = ClaraUtils.form_dpe_name("192.168.0.1", ClaraLang.JAVA, 8181)
     self.assertTrue(ClaraUtils.is_dpe_name(test_case))
     self.assertEqual(test_case, "192.168.0.1%8181_java")
Ejemplo n.º 2
0
    def exit_dpe(self, dpe_name):
        """Sends message to DPE and requesting to stop

        Args:
            dpe_name (String): name of the dpe to stop
        """
        if not ClaraUtils.is_dpe_name(dpe_name):
            raise MalformedCanonicalName("Malformed DPE name: %s" % dpe_name)

        topic = ClaraUtils.build_topic(CConstants.DPE, dpe_name)
        self.base.send(xMsgMessage(topic, CConstants.DPE_EXIT))