Sha256: 8d1b0573ed31d471609c505eaeb4925d005af1d9070287282c8acd6ec802a8d5

Contents?: true

Size: 1.19 KB

Versions: 3

Compression:

Stored size: 1.19 KB

Contents

require 'test/unit'
require 'rubygems'
require 'rubeus'

# Test for Rubeus::Extensions::Javax::Swing
class TestBoxLayout < Test::Unit::TestCase
	include Rubeus::Swing

	# setup method
	def setup
	end

	# normal pattern with JFrame
	def test_new_normal_jframe
		assert_nothing_raised do
			JFrame.new do |f|
				f.layout = BoxLayout.new(:Y_AXIS)
			end
		end
	end

	# normal pattern with JPanel
	def test_new_normal_jpanel
		assert_nothing_raised do
			JFrame.new do |f|
				JPanel.new do |p|
					f.layout = BoxLayout.new(:Y_AXIS)
				end
			end
		end
	end

	# new without container
	def test_new_without_container
		assert_raise(ArgumentError) do
			BoxLayout.new(:Y_AXIS)
		end
	end

	# new with various axis
	def test_new_with_various_axis
		assert_nothing_raised do
			JFrame.new do |f|
				f.layout = BoxLayout.new(:X_AXIS)
				f.layout = BoxLayout.new(:Y_AXIS)
				f.layout = BoxLayout.new(:LINE_AXIS)
				f.layout = BoxLayout.new(:PAGE_AXIS)

				f.layout = BoxLayout.new(javax.swing.BoxLayout::X_AXIS)
				f.layout = BoxLayout.new(javax.swing.BoxLayout::Y_AXIS)
				f.layout = BoxLayout.new(javax.swing.BoxLayout::LINE_AXIS)
				f.layout = BoxLayout.new(javax.swing.BoxLayout::PAGE_AXIS)
			end
		end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubeus-0.0.9-java test/rubeus/extensions/javax/swing/test_box_layout.rb
rubeus-0.0.8-java test/rubeus/extensions/javax/swing/test_box_layout.rb
rubeus-0.0.7-java test/rubeus/extensions/javax/swing/test_box_layout.rb