Skip to content

Commit

Permalink
Remove to_xml
Browse files Browse the repository at this point in the history
  • Loading branch information
d-m-u committed Mar 5, 2020
1 parent 1a3ba3a commit f7ec387
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 159 deletions.
8 changes: 0 additions & 8 deletions app/models/miq_ae_datastore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,6 @@ def self.export(tenant)
temp_export.unlink
end

def self.export_class(namespace, class_name)
XmlExport.class_to_xml(namespace, class_name)
end

def self.export_namespace(namespace)
XmlExport.namespace_to_xml(namespace)
end

def self.reset
_log.info("Clearing datastore")
[MiqAeClass, MiqAeField, MiqAeInstance, MiqAeNamespace, MiqAeMethod, MiqAeValue].each(&:delete_all)
Expand Down
60 changes: 0 additions & 60 deletions app/models/miq_ae_datastore/xml_export.rb

This file was deleted.

3 changes: 0 additions & 3 deletions spec/miq_ae_collect_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
ws = MiqAeEngine.instantiate("/TEST/COLLECT/INFO#get_months", @user)
expect(ws).not_to be_nil

# puts ws.to_xml
months = ws.root("months")
expect(months).not_to be_nil
expect(months.class.to_s).to eq("Hash")
Expand All @@ -34,7 +33,6 @@
it "collects weekdays" do
ws = MiqAeEngine.instantiate("/TEST/COLLECT/INFO#get_weekdays", @user)
expect(ws).not_to be_nil
# puts ws.to_xml
weekdays = ws.root("weekdays")
expect(weekdays).not_to be_nil
expect(weekdays.class.to_s).to eq("Hash")
Expand All @@ -51,7 +49,6 @@

ws = MiqAeEngine.instantiate("/TEST/COLLECT/INFO#get_weekdays", @user)
expect(ws).not_to be_nil
# puts ws.to_xml
weekdays = ws.root("weekdays")
expect(weekdays).not_to be_nil
expect(weekdays.class.to_s).to eq("Array")
Expand Down
17 changes: 0 additions & 17 deletions spec/miq_ae_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,6 @@
MiqAeDatastore.reset
end

it "#to_xml" do
args = {'nil_arg' => nil, 'float_arg' => 5.98,
'int_arg' => 10, 'string_arg' => 'Stringy',
'svc_vm' => MiqAeMethodService::MiqAeServiceManageIQ_Providers_Vmware_InfraManager_Vm.find(@vm.id)}

@miq_obj.process_args_as_attributes(args)
validate_xml(@miq_obj.to_xml, args)
end

def validate_xml(xml, args)
hash = Hash.from_xml(xml)
attrs = hash['MiqAeObject']['MiqAeAttribute']
args.each do |key, value|
expect(find_match(attrs, key, value)).to be_truthy
end
end

def find_match(attrs, key, value)
item = attrs.detect { |i| i['name'] == key }
return false unless item
Expand Down
5 changes: 0 additions & 5 deletions spec/miq_ae_state_machine_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
expect(ws.root['ae_result']).to eq('ok')
expect(ws.root['ae_state']).to eq('final')

# puts ws.to_xml
# puts "Old Provision Technique took #{t1 - t0} seconds"
end

Expand All @@ -36,7 +35,6 @@
expect(ws).not_to be_nil
expect(ws.root['ae_result']).to eq('ok')
expect(ws.root['ae_state']).to eq('')
# puts ws.to_xml
# puts "New Provision Technique took #{t1 - t0} seconds"
end

Expand All @@ -52,7 +50,6 @@
expect(ws).not_to be_nil
expect(ws.root['ae_result']).to eq('error')
expect(ws.root['ae_state']).to eq('ProvisionCheck')
# puts ws.to_xml
end

it "raises exception properly during a provision request" do
Expand All @@ -68,7 +65,6 @@
expect(ws).not_to be_nil
expect(ws.root['ae_result']).to eq('error')
expect(ws.root['ae_state']).to eq('ProvisionCheck')
# puts ws.to_xml
end

it "properly overrides class values with instance values, when they are present" do
Expand All @@ -84,7 +80,6 @@
# t1 = Time.now

expect(ws).not_to be_nil
# puts ws.to_xml
# puts "New Provision (with instance override) Technique took #{t1 - t0} seconds"
end

Expand Down
66 changes: 0 additions & 66 deletions spec/models/miq_ae_datastore/xml_export_spec.rb

This file was deleted.

0 comments on commit f7ec387

Please sign in to comment.