Sha256: 05256cd3d4f35daeb2b4055bf82479f12883a7f2d63276390446946fa3f186b7

Contents?: true

Size: 1.9 KB

Versions: 6

Compression:

Stored size: 1.9 KB

Contents

require 'torquebox-naming-container'
require 'torquebox-naming'

require 'torquebox/messaging/message_broker'

describe TorqueBox::Messaging::MessageBroker do

  describe "basics" do

    before(:each) do
      @container = TorqueBox::Container::Foundation.new
      @container.enable( TorqueBox::Naming::NamingService ) {|config| config.export=false}
      @container.enable( TorqueBox::Messaging::MessageBroker ) {|config| config.data_dir = "#{Dir.pwd}/target"}
      begin
        @container.start
      rescue => e
        puts e
        puts e.backtrace
        raise e
      end
    end

    after(:each) do
      @container.stop
    end

    it "should have an RMIClassProvider" do
      @container['RMIClassProvider'].should_not be_nil
    end

    it "should have a QueuesYamlParsingDeployer" do
      @container['QueuesYamlParsingDeployer'].should_not be_nil
    end
  end

  describe "deployments" do
    before(:each) do
      #TorqueBox::Naming.configure_local
      @container = TorqueBox::Container::Foundation.new
      @container.enable( TorqueBox::Naming::NamingService ) {|config| config.export=false}
      @container.enable( TorqueBox::Messaging::MessageBroker ) {|config| config.data_dir = "#{Dir.pwd}/target"}
      begin
        @container.start
      rescue => e
        puts e
        puts e.backtrace
        raise e
      end
      @deployments = []
    end

    after(:each) do
      @deployments.reverse.each do |deployment|
        @container.undeploy( deployment )
      end
      @container.stop
    end

    it "should be able to deploy a queues.yml" do
      @deployments << @container.deploy( File.join( File.dirname(__FILE__), 'queues.yml' ) )
      @container.process_deployments(true)
    end

    it "should be able to deploy a messaging.yml" do
      @deployments << @container.deploy( File.join( File.dirname(__FILE__), 'messaging.yml' ) )
      @container.process_deployments(true)
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
torquebox-messaging-container-1.1.1-java spec/message_broker_spec.rb
torquebox-messaging-container-1.1-java spec/message_broker_spec.rb
torquebox-messaging-container-1.0.1-java spec/message_broker_spec.rb
torquebox-messaging-container-1.0.0-java spec/message_broker_spec.rb
torquebox-messaging-container-1.0.0.CR2-java spec/message_broker_spec.rb
torquebox-messaging-container-1.0.0.CR1-java spec/message_broker_spec.rb