Class: MetamodelFromEcoreTest

Inherits:
MetamodelBuilderTest show all
Defined in:
lib/puppet/vendor/rgen/test/metamodel_from_ecore_test.rb

Overview

this test suite runs all the tests of MetamodelBuilderTest with the TestMetamodel replaced by the result of feeding its ecore model through ECoreToRuby

Constant Summary collapse

MetamodelFromEcore =
RGen::ECore::ECoreToRuby.new.create_module(test_ecore)

Instance Method Summary collapse

Methods inherited from MetamodelBuilderTest

#checkAnnotation, #test_abstract, #test_all_contents, #test_all_contents_prune, #test_all_contents_with_block, #test_annotations, #test_clear_by_array_assignment, #test_clear_by_array_assignment_uni, #test_conainer_many_bi_steal, #test_conainer_many_bi_steal_rev, #test_conainer_one_bi, #test_conainer_one_bi_nil, #test_conainer_one_bi_nil_rev, #test_conainer_one_bi_rev, #test_conainer_one_uni, #test_container_generic, #test_container_many_bi, #test_container_many_uni, #test_direct_nl, #test_direct_ws, #test_disconnectContainer_many, #test_disconnectContainer_many_uni, #test_disconnectContainer_one, #test_disconnectContainer_one_uni, #test_duplicate_containment_bidir_otherrole_many, #test_duplicate_containment_bidir_otherrole_one, #test_duplicate_containment_bidir_samerole_many, #test_duplicate_containment_bidir_samerole_one, #test_duplicate_containment_unidir_otherrole_many, #test_duplicate_containment_unidir_otherrole_one, #test_duplicate_containment_unidir_samerole_many, #test_duplicate_containment_unidir_samerole_one, #test_ecore_identity, #test_explicit_endswithws, #test_explicit_indent, #test_float, #test_genericAccess, #test_has_attr, #test_has_many, #test_has_many_insert, #test_has_one, #test_indent_string, #test_inheritance, #test_isset_many_add, #test_isset_many_remove, #test_isset_ref, #test_isset_ref_many, #test_isset_set_to_default, #test_isset_set_to_nil, #test_long, #test_many_attr, #test_many_attr_insert, #test_many_to_many, #test_many_to_many_insert, #test_one_to_many, #test_one_to_many2, #test_one_to_many_insert, #test_one_to_many_replace1, #test_one_to_many_replace2, #test_one_to_one, #test_one_to_one_replace, #test_opposite_assoc_on_first_write, #test_performance, #test_proxies_has_many, #test_proxies_has_one, #test_proxies_many_to_many, #test_proxies_one_to_many, #test_proxies_one_to_one, #test_proxy, #test_setNilOrRemoveAllGeneric, #test_setNilOrRemoveGeneric, #test_unset_marshal, #test_unset_nil, #test_unset_ref, #test_unset_ref_many, #test_unset_string

Instance Method Details

#mmObject



28
29
30
# File 'lib/puppet/vendor/rgen/test/metamodel_from_ecore_test.rb', line 28

def mm
  MetamodelFromEcore
end

#test_bad_default_value_literalObject

alternative implementation for dynamic variant



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/puppet/vendor/rgen/test/metamodel_from_ecore_test.rb', line 33

def test_bad_default_value_literal
  package = RGen::ECore::EPackage.new(:name => "Package1", :eClassifiers => [
    RGen::ECore::EClass.new(:name => "Class1", :eStructuralFeatures => [
      RGen::ECore::EAttribute.new(:name => "value", :eType => RGen::ECore::EInt, :defaultValueLiteral => "x")])])
  mod = RGen::ECore::ECoreToRuby.new.create_module(package)
  obj = mod::Class1.new
  # the error is raised only when the feature is lazily constructed
  assert_raise StandardError do
    obj.value
  end
end