Class: TestSSL

### Home Classes Methods

### In Files

- test/test_ssl.rb

### Parent

Test::Unit::TestCase

### Methods

- #setup
- #teardown
- #test_ssl_0000
- #test_ssl_0010_parms
- #test_ssl_0020_noraise
- #test_ssl_0030_raise
- #test_ssl_0040_fsck

### 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.

# TestSSL

Main class for testing Stomp::SSLParams.

### Public Instance Methods

setup() click to toggle source

    # File test/test_ssl.rb, line 17
    def setup
      @conn = get_ssl_connection()
    end

teardown() click to toggle source

    # File test/test_ssl.rb, line 21
    def teardown
      @conn.disconnect if @conn && @conn.open? # allow tests to disconnect
    end

test_ssl_0000() click to toggle source

    # File test/test_ssl.rb, line 25
    def test_ssl_0000
      assert @conn.open?
    end

test_ssl_0010_parms() click to toggle source

Test SSLParams basic.

    # File test/test_ssl.rb, line 30
    def test_ssl_0010_parms
      ssl_params = Stomp::SSLParams.new
      assert ssl_params.ts_files.nil?
      assert ssl_params.cert_file.nil?
      assert ssl_params.key_file.nil?
      assert ssl_params.fsck.nil?
    end

test_ssl_0020_noraise() click to toggle source

Test using correct parameters.

    # File test/test_ssl.rb, line 39
    def test_ssl_0020_noraise
      assert_nothing_raised {
        ssl_parms = Stomp::SSLParams.new(:cert_file => "dummy1", :key_file => "dummy2")
      }
      assert_nothing_raised {
        ssl_parms = Stomp::SSLParams.new(:ts_files => "dummyts1")
      }
      assert_nothing_raised {
        ssl_parms = Stomp::SSLParams.new(:ts_files => "dummyts1",
          :cert_file => "dummy1", :key_file => "dummy2")
      }
    end

test_ssl_0030_raise() click to toggle source

Test using incorrect / incomplete parameters.

    # File test/test_ssl.rb, line 53
    def test_ssl_0030_raise
      assert_raise(Stomp::Error::SSLClientParamsError) {
        ssl_parms = Stomp::SSLParams.new(:cert_file => "dummy1")
      }
      assert_raise(Stomp::Error::SSLClientParamsError) {
        ssl_parms = Stomp::SSLParams.new(:key_file => "dummy2")
      }
    end

test_ssl_0040_fsck() click to toggle source

Test that :fsck works.

    # File test/test_ssl.rb, line 63
    def test_ssl_0040_fsck
      assert_raise(Stomp::Error::SSLNoCertFileError) {
        ssl_parms = Stomp::SSLParams.new(:cert_file => "dummy1",
          :key_file => "dummy2", :fsck => true)
      }
      assert_raise(Stomp::Error::SSLNoKeyFileError) {
        ssl_parms = Stomp::SSLParams.new(:cert_file => __FILE__,
          :key_file => "dummy2", :fsck => true)
      }
      assert_raise(Stomp::Error::SSLNoTruststoreFileError) {
        ssl_parms = Stomp::SSLParams.new(:ts_files => "/tmp/not-likely-here.txt",
          :fsck => true)
      }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.