Sha256: 0a7df43a275412c3b9343e0115eb78cb005956f7a5551301aa150b75a654a9f4

Contents?: true

Size: 1.97 KB

Versions: 219

Compression:

Stored size: 1.97 KB

Contents

$:.unshift File.join(File.dirname(__FILE__),"..","lib")

require 'test/unit'
require 'rgen/ecore/ecore'
require 'rgen/array_extensions'

class ECoreSelfTest < Test::Unit::TestCase
  include RGen::ECore
  
  def test_simple
    assert_equal \
      %w(lowerBound ordered unique upperBound many required eType).sort,
      ETypedElement.ecore.eStructuralFeatures.name.sort
      
    assert_equal \
      EClassifier.ecore,
      ETypedElement.ecore.eStructuralFeatures.find{|f| f.name=="eType"}.eType
    assert_equal %w(ENamedElement), ETypedElement.ecore.eSuperTypes.name

    assert_equal \
      EModelElement.ecore,
      EModelElement.ecore.eStructuralFeatures.find{|f| f.name=="eAnnotations"}.eOpposite.eType

    assert_equal \
      %w(eType),
      ETypedElement.ecore.eReferences.name
      
    assert_equal \
      %w(lowerBound ordered unique upperBound many required).sort,
      ETypedElement.ecore.eAttributes.name.sort
      
    assert RGen::ECore.ecore.is_a?(EPackage)
    assert_equal "ECore", RGen::ECore.ecore.name
    assert_equal "RGen", RGen::ECore.ecore.eSuperPackage.name
    assert_equal %w(ECore), RGen.ecore.eSubpackages.name
    assert_equal\
      %w(EObject EModelElement EAnnotation ENamedElement ETypedElement 
        EStructuralFeature EAttribute EClassifier EDataType EEnum EEnumLiteral EFactory
        EOperation EPackage EParameter EReference EStringToStringMapEntry EClass 
        ETypeArgument EGenericType).sort,
      RGen::ECore.ecore.eClassifiers.name.sort
      
    assert_equal "false", EAttribute.ecore.eAllAttributes.
      find{|a|a.name == "derived"}.defaultValueLiteral
    assert_equal false, EAttribute.ecore.eAllAttributes.
      find{|a|a.name == "derived"}.defaultValue

    assert_nil EAttribute.ecore.eAllAttributes.
      find{|a|a.name == "defaultValueLiteral"}.defaultValueLiteral
    assert_nil EAttribute.ecore.eAllAttributes.
      find{|a|a.name == "defaultValueLiteral"}.defaultValue

  end
end

Version data entries

219 entries across 219 versions & 3 rubygems

Version Path
puppet-3.7.4-x64-mingw32 lib/puppet/vendor/rgen/test/ecore_self_test.rb
puppet-3.7.3 lib/puppet/vendor/rgen/test/ecore_self_test.rb
puppet-3.7.3-x86-mingw32 lib/puppet/vendor/rgen/test/ecore_self_test.rb
puppet-3.7.3-x64-mingw32 lib/puppet/vendor/rgen/test/ecore_self_test.rb
puppet-3.7.2 lib/puppet/vendor/rgen/test/ecore_self_test.rb
puppet-3.7.2-x86-mingw32 lib/puppet/vendor/rgen/test/ecore_self_test.rb
puppet-3.7.2-x64-mingw32 lib/puppet/vendor/rgen/test/ecore_self_test.rb
puppet-3.7.1 lib/puppet/vendor/rgen/test/ecore_self_test.rb
puppet-3.7.1-x86-mingw32 lib/puppet/vendor/rgen/test/ecore_self_test.rb
puppet-3.7.1-x64-mingw32 lib/puppet/vendor/rgen/test/ecore_self_test.rb
puppet-3.7.0 lib/puppet/vendor/rgen/test/ecore_self_test.rb
puppet-3.7.0-x86-mingw32 lib/puppet/vendor/rgen/test/ecore_self_test.rb
puppet-3.7.0-x64-mingw32 lib/puppet/vendor/rgen/test/ecore_self_test.rb
rgen-0.7.0 test/ecore_self_test.rb
rgen-0.6.6 test/ecore_self_test.rb
rgen-0.6.5 test/ecore_self_test.rb
rgen-0.6.2 test/ecore_self_test.rb
rgen-0.6.1 test/ecore_self_test.rb
rgen-0.6.0 test/ecore_self_test.rb