From: <kk...@us...> - 2008-10-16 12:01:12
|
Revision: 1103 http://omc.svn.sourceforge.net/omc/?rev=1103&view=rev Author: kkaempf Date: 2008-10-16 12:01:07 +0000 (Thu, 16 Oct 2008) Log Message: ----------- testing environment for Ruby providers Modified Paths: -------------- cmpi-bindings/trunk/test/ruby/TestAtomProvider.sfcb.reg cmpi-bindings/trunk/test/ruby/setup.sh Added Paths: ----------- cmpi-bindings/trunk/test/ruby/TestAssocProvider.sfcb.reg cmpi-bindings/trunk/test/ruby/TestMethod.sfcb.reg cmpi-bindings/trunk/test/ruby/test_association_provider.rb cmpi-bindings/trunk/test/ruby/test_instance_provider.rb cmpi-bindings/trunk/test/ruby/test_method_provider.rb Removed Paths: ------------- cmpi-bindings/trunk/test/ruby/test_atom_provider.rb Added: cmpi-bindings/trunk/test/ruby/TestAssocProvider.sfcb.reg =================================================================== --- cmpi-bindings/trunk/test/ruby/TestAssocProvider.sfcb.reg (rev 0) +++ cmpi-bindings/trunk/test/ruby/TestAssocProvider.sfcb.reg 2008-10-16 12:01:07 UTC (rev 1103) @@ -0,0 +1,17 @@ +[TestAssoc_Group] + provider: TestAssociationProvider + location: rbCmpiProvider + type: instance + namespace: root/cimv2 + +[TestAssoc_User] + provider: TestAssociationProvider + location: rbCmpiProvider + type: instance + namespace: root/cimv2 + +[TestAssoc_MemberOfGroup] + provider: TestAssociationProvider + location: rbCmpiProvider + type: instance association + namespace: root/cimv2 Modified: cmpi-bindings/trunk/test/ruby/TestAtomProvider.sfcb.reg =================================================================== --- cmpi-bindings/trunk/test/ruby/TestAtomProvider.sfcb.reg 2008-10-16 12:00:31 UTC (rev 1102) +++ cmpi-bindings/trunk/test/ruby/TestAtomProvider.sfcb.reg 2008-10-16 12:01:07 UTC (rev 1103) @@ -1,5 +1,5 @@ [Test_Atom] - provider: TestAtomProvider + provider: TestInstanceProvider location: rbCmpiProvider type: instance namespace: root/cimv2 Added: cmpi-bindings/trunk/test/ruby/TestMethod.sfcb.reg =================================================================== --- cmpi-bindings/trunk/test/ruby/TestMethod.sfcb.reg (rev 0) +++ cmpi-bindings/trunk/test/ruby/TestMethod.sfcb.reg 2008-10-16 12:01:07 UTC (rev 1103) @@ -0,0 +1,5 @@ +[Test_Method] + provider: TestMethodProvider + location: rbCmpiProvider + type: instance method + namespace: root/cimv2 Modified: cmpi-bindings/trunk/test/ruby/setup.sh =================================================================== --- cmpi-bindings/trunk/test/ruby/setup.sh 2008-10-16 12:00:31 UTC (rev 1102) +++ cmpi-bindings/trunk/test/ruby/setup.sh 2008-10-16 12:01:07 UTC (rev 1103) @@ -39,9 +39,10 @@ ## Install Ruby providers: ## -__install TestMethod.rb /usr/lib/rbcim -__install TestAssocProvider.rb /usr/lib/rbcim -__install TestAtomProvider.rb /usr/lib/rbcim +__install test_method_provider.rb /usr/lib/rbcim +__install Test_Atom.rb /usr/lib/rbcim +__install test_association_provider.rb /usr/lib/rbcim +__install test_instance_provider.rb /usr/lib/rbcim if [ "$1" = "op" ]; then cimmof ../python/TestMethod.mof Added: cmpi-bindings/trunk/test/ruby/test_association_provider.rb =================================================================== --- cmpi-bindings/trunk/test/ruby/test_association_provider.rb (rev 0) +++ cmpi-bindings/trunk/test/ruby/test_association_provider.rb 2008-10-16 12:01:07 UTC (rev 1103) @@ -0,0 +1,24 @@ +# +# Ruby Provider for Associations +# +# Instruments the CIM class Test_Assoc +# + +module Cmpi + + # Instrument the CIM class TestAssoc + # + # + + class TestAssociationProvider < AssociationProvider +# require 'Test_Assoc' + include InstanceProviderIF + + # create new provider instance -> check with .mof file + def initialize broker + super + end + + end + +end Deleted: cmpi-bindings/trunk/test/ruby/test_atom_provider.rb =================================================================== --- cmpi-bindings/trunk/test/ruby/test_atom_provider.rb 2008-10-16 12:00:31 UTC (rev 1102) +++ cmpi-bindings/trunk/test/ruby/test_atom_provider.rb 2008-10-16 12:01:07 UTC (rev 1103) @@ -1,53 +0,0 @@ -# -# Ruby Provider for TestAtom -# -# Instruments the CIM class Test_Atom -# - -module Cmpi - - STDERR.puts "This is test_atom_provider.rb" - # Instrument the CIM class TestAtom - # - # Model an atom, For use with CIMOM and RbWbem Provider - # - - class TestAtomProvider < InstanceProvider - require 'Test_Atom' - - # create new provider instance -> check with .mof file - def initialize broker - @instances = {} - super - end - - # use i.e. 'include MethodProviderIF' to implement multiple MIs - def create_instance context, result, reference, newinst - STDERR.puts "TestAtomProvider.create_instance: #{reference}" - STDERR.puts "TestAtomProvider.create_instance: #{reference.key_count} keys" - reference.keys do |value,name| - STDERR.puts "Key #{name} = #{value}" - end - @instances[reference.to_s] = Test_Atom.new reference.get_key_at(0)[0]._value - result.return_objectpath reference - result.done - end - - def get_instance context, result, objname, plist - - plist = plist.join(',') if plist.respond_to? :join - - STDERR.puts "TestAtomProvider.get_instance: #{objname}: #{plist}" - instance = @instances[objname] - result.return_instance instance if instance - result.done - end - - def delete_instance context, result, objname - STDERR.puts "TestAtomProvider.delete_instance: #{objname}" - @instances.delete objname - end - - end - -end Copied: cmpi-bindings/trunk/test/ruby/test_instance_provider.rb (from rev 1090, cmpi-bindings/trunk/test/ruby/test_atom_provider.rb) =================================================================== --- cmpi-bindings/trunk/test/ruby/test_instance_provider.rb (rev 0) +++ cmpi-bindings/trunk/test/ruby/test_instance_provider.rb 2008-10-16 12:01:07 UTC (rev 1103) @@ -0,0 +1,55 @@ +# +# Ruby Provider for TestAtom +# +# Instruments the CIM class Test_Atom +# + +module Cmpi + + # Instrument the CIM class TestAtom + # + # Model an atom, For use with CIMOM and RbWbem Provider + # + + class TestInstanceProvider < InstanceProvider + require 'Test_Atom' + + # create new provider instance -> check with .mof file + def initialize broker + @instances = {} + super + end + + # use i.e. 'include MethodProviderIF' to implement multiple MIs + def create_instance context, result, reference, newinst + STDERR.puts "TestAtomProvider.create_instance: #{reference}" + STDERR.puts "TestAtomProvider.create_instance: #{reference.key_count} keys" + reference.keys do |value,name| + STDERR.puts "Key #{name} = #{value}" + end + @instances[reference.to_s] = Test_Atom.new reference.get_key_at(0)[0]._value + result.return_objectpath reference + result.done + true + end + + def get_instance context, result, objname, plist + + plist = plist.join(',') if plist.respond_to? :join + + STDERR.puts "TestAtomProvider.get_instance: #{objname}: #{plist}" + instance = @instances[objname] + result.return_instance instance if instance + result.done + true + end + + def delete_instance context, result, objname + STDERR.puts "TestAtomProvider.delete_instance: #{objname}" + @instances.delete objname + true + end + + end + +end Property changes on: cmpi-bindings/trunk/test/ruby/test_instance_provider.rb ___________________________________________________________________ Added: svn:mergeinfo + Added: cmpi-bindings/trunk/test/ruby/test_method_provider.rb =================================================================== --- cmpi-bindings/trunk/test/ruby/test_method_provider.rb (rev 0) +++ cmpi-bindings/trunk/test/ruby/test_method_provider.rb 2008-10-16 12:01:07 UTC (rev 1103) @@ -0,0 +1,21 @@ +# +# Ruby Provider for Methods +# +# Instruments the CIM class Test_Method +# + +module Cmpi + + # Instrument the CIM class TestMethod + # + + class TestMethodProvider < MethodProvider + include InstanceProviderIF + # create new provider instance -> check with .mof file + def initialize broker + super broker + end + + end + +end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |