Class: TestURLLogins

### Home Classes Methods

### In Files

- test/test_urlogin.rb

### Parent

Test::Unit::TestCase

### Methods

- #setup
- #teardown
- #test_0010_stomp_urls
- #test_0020_failover_badparms
- #test_0020_failover_urls

### Included Modules

- TestBase

### Files

- CHANGELOG.rdoc
- LICENSE

### Class/Module Index

Quicksearch

- Stomp
- Stomp::Client
- Stomp::Connection
- Stomp::Error
- Stomp::Error::ConnectReadTimeout
- Stomp::Error::DuplicateSubscription
- Stomp::Error::InvalidFormat
- Stomp::Error::InvalidHeartBeatHeaderError
- Stomp::Error::InvalidMessageLength
- Stomp::Error::InvalidServerCommand
- Stomp::Error::LoggerConnectionError
- Stomp::Error::MalformedFailoverOptionsError
- Stomp::Error::MaxReconnectAttempts
- Stomp::Error::MessageIDRequiredError
- Stomp::Error::NilMessageError
- Stomp::Error::NoCurrentConnection
- Stomp::Error::PacketParsingTimeout
- Stomp::Error::ProtocolError11p
- Stomp::Error::ProtocolErrorConnect
- Stomp::Error::SSLClientParamsError
- Stomp::Error::SSLNoCertFileError
- Stomp::Error::SSLNoKeyFileError
- Stomp::Error::SSLNoTruststoreFileError
- Stomp::Error::SSLUnreadableCertFileError
- Stomp::Error::SSLUnreadableKeyFileError
- Stomp::Error::SSLUnreadableTruststoreFileError
- Stomp::Error::SocketOpenTimeout
- Stomp::Error::StompServerError
- Stomp::Error::SubscriptionRequiredError
- Stomp::Error::UTF8ValidationError
- Stomp::Error::UnsupportedProtocolError
- Stomp::HeaderCodec
- Stomp::Message
- Stomp::SSLParams
- Client11Example1
- Client11PutGet1
- Connection11Example1
- Connection11Example2
- ExampleConsumer
- ExamplePublisher
- ExampleRubyCiphers
- ExampleSSL1
- ExampleSSL1C
- ExampleSSL2
- ExampleSSL2C
- ExampleSSL3
- ExampleSSL3C
- ExampleSSL4
- ExampleSSL4C
- ExampleTopicConsumer
- ExampleTopicPublisher
- Hash
- HeartBeatExample1
- LoggerExample
- Object
- Publish11Example1
- Receive11Example1
- Receive11Example2
- RepeatedHeadersExample
- SSLLoggerExample
- Slogger
- Stomp11Common
- TestBase
- TestClient
- TestConnection
- TestConnection1P
- TestMessage
- TestSSL
- TestURLLogins
- Tlogger

No matching classes.

# TestURLLogins

Main class for testing Stomp::Client URL based Logins.

### Public Instance Methods

setup() click to toggle source

    # File test/test_urlogin.rb, line 17
    def setup
      hostname = host()
      portnum = port()
      sslpn = ssl_port()
      @tdstomp = [
            "stomp://guestl:guestp@#{hostname}:#{portnum}",
            "stomp://#{hostname}:#{portnum}",
            "stomp://@#{hostname}:#{portnum}",
            "stomp://f@#$$%^&*()_+=o.o:@#{hostname}:#{portnum}",
            'stomp://f@#$$%^&*()_+=o.o::b~!@#$%^&*()+-_=?:<>,.@@' + hostname + ":#{portnum}",
      ]
      @tdfailover = [
        "failover://(stomp://#{hostname}:#{portnum})",
        "failover://(stomp+ssl://#{hostname}:#{sslpn})",
        "failover://(stomp://#{hostname}:#{portnum})",
        "failover://(stomp://#{hostname}:#{portnum})?whatup=doc&coyote=kaboom",
        "failover://(stomp://#{hostname}:#{portnum})?whatup=doc",
        "failover://(stomp://#{hostname}:#{portnum})?whatup=doc&coyote=kaboom&randomize=true",
        'failover://(stomp://f@#$$%^&*()_+=o.o::b~!@#$%^&*()+-_=?:<>,.@@' + "localhost" + ":#{portnum}" + ")",
        'failover://(stomp://f@#$$%^&*()_+=o.o::b~!@#$%^&*()+-_=:<>,.@@' + "localhost" + ":#{portnum}" + ")",
        'failover://(stomp://f@#$$%^&*()_+=o.o::b~!@#$%^&*()+-_=?:<>,.@@' + "localhost" + ":#{portnum}" + ")?a=b",
        'failover://(stomp://f@#$$%^&*()_+=o.o::b~!@#$%^&*()+-_=:<>,.@@' + "localhost" + ":#{portnum}" + ")?c=d&e=f",
        "failover://(stomp://usera:passa@#{hostname}:#{portnum})",
        "failover://(stomp+ssl://usera:passa@#{hostname}:#{sslpn})",
        "failover://(stomp://usera:@#{hostname}:#{portnum})",
        "failover://(stomp://#{hostname}:#{portnum},stomp://#{hostname}:#{portnum})",
        "failover://(stomp://usera:passa@#{hostname}:#{portnum},stomp://#{hostname}:#{portnum})",
        "failover://(stomp://usera:@#{hostname}:#{portnum},stomp://#{hostname}:#{portnum})",
        "failover://(stomp://usera:@#{hostname}:#{portnum},stomp+ssl://#{hostname}:#{sslpn})",
        "failover://(stomp://#{hostname}:#{portnum},stomp://#{hostname}:#{portnum})?a=b&c=d",
        "failover://(stomp://#{hostname}:#{portnum},stomp://#{hostname}:#{portnum})?a=b&c=d&connect_timeout=2020",
      ]

      @badparms = "failover://(stomp://#{hostname}:#{portnum})?a=b&noequal"
    end

teardown() click to toggle source

    # File test/test_urlogin.rb, line 53
    def teardown
      @client.close if @client && @client.open? # allow tests to close
    end

test_0010_stomp_urls() click to toggle source

test stomp:// URLs

    # File test/test_urlogin.rb, line 58
    def test_0010_stomp_urls()
      @tdstomp.each_with_index do |url, ndx|
        c = Stomp::Client.new(url)
        assert !c.nil?, url
        assert c.open?, url
        c.close
      end
    end

test_0020_failover_badparms() click to toggle source

test failover:// with bad parameters

    # File test/test_urlogin.rb, line 78
    def test_0020_failover_badparms()
      assert_raise(Stomp::Error::MalformedFailoverOptionsError) {
        c = Stomp::Client.new(@badparms)
      }
    end

test_0020_failover_urls() click to toggle source

test failover:// urls

    # File test/test_urlogin.rb, line 68
    def test_0020_failover_urls()
      @tdfailover.each_with_index do |url, ndx|
        c = Stomp::Client.new(url)
        assert !c.nil?, url
        assert c.open?, url
        c.close
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.