Ejemplo n.º 1
0
    def testsubscribe(self):
        stdin = TestStdin()
        stdout = TestStdout(self)
        stdout.expect('CONNECTED')

        cli = StompCLI('127.0.0.1', 61613, username, password, 1.0, stdin,
                       stdout)

        time.sleep(3)

        stdout.expect(
            'Subscribing to "/queue/testsubscribe" with acknowledge set to "auto", id set to "1"'
        )
        cli.onecmd('subscribe /queue/testsubscribe')
        stdout.expect('MESSAGE')
        stdout.expect('this is a test')
        cli.onecmd('send /queue/testsubscribe this is a test')

        time.sleep(3)

        stdout.expect('Unsubscribing from "/queue/testsubscribe"')
        cli.onecmd('unsubscribe /queue/testsubscribe')

        try:
            cli.onecmd('quit')

            # fail if it doesn't exit
            self.fail()
        except SystemExit:
            pass
Ejemplo n.º 2
0
 def testsubscribe(self):
     stdin = TestStdin()
     stdout = TestStdout(self)
     stdout.expect('CONNECTED')
     
     cli = StompCLI('127.0.0.1', 61613, username, password, 1.0, stdin, stdout)
     
     time.sleep(3)
     
     stdout.expect('Subscribing to "/queue/testsubscribe" with acknowledge set to "auto", id set to "1"')
     cli.onecmd('subscribe /queue/testsubscribe')
     stdout.expect('MESSAGE')
     stdout.expect('this is a test')
     cli.onecmd('send /queue/testsubscribe this is a test')
     
     time.sleep(3)
     
     stdout.expect('Unsubscribing from "/queue/testsubscribe"')
     cli.onecmd('unsubscribe /queue/testsubscribe')
     
     try:
         cli.onecmd('quit')
         
         # fail if it doesn't exit
         self.fail()
     except SystemExit:
         pass
Ejemplo n.º 3
0
    def testsendfile(self):
        stdin = TestStdin()
        stdout = TestStdout(self)
        stdout.expect('CONNECTED')
        
        cli = StompCLI('127.0.0.1', 61613, username, password, 1.0, stdin, stdout)

        time.sleep(3)

        cli.onecmd('sendfile /queue/testsendfile stomp/test/test.txt')

        time.sleep(3)

        try:
            cli.onecmd('quit')

            # fail if it doesn't exit
            self.fail()
        except SystemExit:
            pass
Ejemplo n.º 4
0
    def testsendfile(self):
        stdin = TestStdin()
        stdout = TestStdout(self)
        stdout.expect('CONNECTED')

        cli = StompCLI('127.0.0.1', 61613, username, password, 1.0, stdin,
                       stdout)

        time.sleep(3)

        cli.onecmd('sendfile /queue/testsendfile stomp/test/test.txt')

        time.sleep(3)

        try:
            cli.onecmd('quit')

            # fail if it doesn't exit
            self.fail()
        except SystemExit:
            pass