indexing
	cluster:	"configuration"
	namespace:"candidate"
	description: "Test bed for configuration cluster."
	original_author: "Justin Finnerty"
	original_date: "August 2005"
	current_date: "$Date: 2005/09/27 06:13:19 $"
	current_author: "$Author: finnerty $"
	revision: "$Revision: 2.3 $"
   --  $Log: test_conf.ge,v $
   --  Revision 2.3  2005/09/27 06:13:19  finnerty
   --  Updated to use GOBO and work with SE and VE
   --
   --  Revision 2.2  2005/09/03 11:06:12  finnerty
   --  Updated to conform to cursors/containers in the GOBO library and
   --  test programs compile with SE and VE.
   --
   --  Revision 2.1  2005/09/02 07:21:21  finnerty
   --  Renamed test_conf.e to test_conf.ge for gepp
   --
   --  Revision 2.0  2005/08/26 23:20:16  finnerty
   --  == alpha version ==
   --
   --  Revision 1.2  2005/08/21 11:53:54  finnerty
   --  Alpha 1 version
   --
   --  Revision 1.1  2005/08/16 12:12:11  finnerty
   --  Unit testing for configuration cluster.
   --
   --
class TEST_CONF
	-- Test classes in the configuration cluster..

#ifdef SE
insert
#else
inherit
#endif
   UNIT_TEST
   CONFIGURATION_STATUS
	KL_SHARED_STANDARD_FILES

creation {ANY}
	main

feature {}
	-- Test method
	main is
			-- Method to create stand-alone program to test classes in 
			-- FSO cluster

		local
			l_conf_option: CONFIGURATION_OPTION
		do
			-- Create a FSO_PROPERTIES object and report attributes 
			config_manager.set_application_name ("test_conf")
			config_manager.set_help ("A test-bed for the configuration cluster")
			config_manager.set_help_short ("Test for configuration" )
			config_manager.add_std_help
			config_manager.add_std_conf
			
			!!l_conf_option.make("test1"
										, "This option is here to test options with non-optional arguments"
										, "Test with required argument")
			config_manager.force (l_conf_option, l_conf_option.name)
			!!l_conf_option.make("test2"
										, "This option is here to test options with optional arguments"
										, "Test with optional argument")
			l_conf_option.set_default_value ("NLDHKH")
			config_manager.force (l_conf_option, l_conf_option.name)
			config_manager.process
			if config_manager.status = Die then
				print_int ("Status is 'die': ", Die)
			elseif config_manager.status = Continue then
				print_int ("Status is 'Continue': ", Continue)
			elseif config_manager.status = Bad_option then
				print_int ("Status is 'Bad_option': ", Bad_option)
			elseif config_manager.status = Continue then
				print_int ("Status is 'Continue': ", Continue)
			else
				print_int ("Unknown status", config_manager.status)
			end
		end

feature {NONE}

feature {NONE}
	-- General implementation procedures
	Width: INTEGER is 22

	frozen print_right(a_title: STRING; a_num: INTEGER) is
		local
			l_width: INTEGER
		do
			l_width := a_num - a_title.count
			if l_width > 0 then
				from
				variant
					l_width
				until
					l_width <= 0
				loop
					std.output.put_character (' ')
					l_width := l_width - 1
				end
			end
			std.output.put_string (a_title)
		end

	frozen print_int(a_title: STRING; a_num: INTEGER) is
		do
			print_right(a_title, Width)
			std.output.put_integer (a_num)
			std.output.put_new_line
		end

	frozen print_string(a_title, a_str: STRING;) is
		do
			print_right(a_title, Width)
			std.output.put_string (a_str)
			std.output.put_new_line
		end

	frozen print_bool(a_title: STRING; a_bit: BOOLEAN) is
		do
			print_right(a_title, Width)
			std.output.put_boolean (a_bit)
			std.output.put_new_line
		end
end -- class TEST_CONF
