#!/usr/bin/env python
import coral


c=coral.meta.UML14.Class()


t=c.__type__().getCorrespondingElement()


print 1
print coral.meta.UML14.Class

assert t==coral.meta.UML14.Class

print c

assert t.name=="Class"

print 2
print c
print 2.1
assert c.oclIsKindOf(coral.meta.UML14.Class)
print 3
# oclIsKindOf should be polymorphic
assert c.oclIsKindOf(coral.lang.UML14.Class)
print 3
assert c.oclIsKindOf(coral.meta.UML14.Class)

print 3
for x in coral.meta.UML14.Class.properties:
    print x.name

print 4
print coral.meta.UML14.Class.properties["isActive"].isBag

assert not coral.meta.UML14.Class.properties["isActive"].isBag



def printMMName(m):
    print m.name,m.version,m.revision


l=coral.meta.UML14

print l.Class

printMMName(coral.meta.UML14)

l2=coral.meta("UML",1,4)


assert l==l2

# test enumerations

print coral.meta.UML14.AggregationKind.none

assert coral.meta.UML14.AggregationKind.none==coral.lang.UML14.AggregationKind.none
