@Test public void testMask() { TypeDeclaration tdeclr = new TypeDeclaration(CImpl.class.getName() ); assertEquals( 0, tdeclr.getSetMask() ); tdeclr.setRole( Role.Type.EVENT ); assertEquals( TypeDeclaration.ROLE_BIT, tdeclr.getSetMask() & TypeDeclaration.ROLE_BIT ); assertFalse( TypeDeclaration.TYPESAFE_BIT == ( tdeclr.getSetMask() & TypeDeclaration.TYPESAFE_BIT ) ); assertFalse( TypeDeclaration.FORMAT_BIT == ( tdeclr.getSetMask() & TypeDeclaration.FORMAT_BIT ) ); tdeclr.setTypesafe( false ); assertEquals( TypeDeclaration.ROLE_BIT, tdeclr.getSetMask() & TypeDeclaration.ROLE_BIT ); assertEquals( TypeDeclaration.TYPESAFE_BIT, tdeclr.getSetMask() & TypeDeclaration.TYPESAFE_BIT ); assertFalse( TypeDeclaration.FORMAT_BIT == ( tdeclr.getSetMask() & TypeDeclaration.FORMAT_BIT ) ); tdeclr = new TypeDeclaration(CImpl.class.getName() ); tdeclr.setTypesafe( true ); assertFalse( TypeDeclaration.ROLE_BIT == ( tdeclr.getSetMask() & TypeDeclaration.ROLE_BIT ) ); assertEquals( TypeDeclaration.TYPESAFE_BIT, tdeclr.getSetMask() & TypeDeclaration.TYPESAFE_BIT ); assertFalse( TypeDeclaration.FORMAT_BIT == ( tdeclr.getSetMask() & TypeDeclaration.FORMAT_BIT ) ); tdeclr.setFormat( Format.POJO ); assertFalse( TypeDeclaration.ROLE_BIT == ( tdeclr.getSetMask() & TypeDeclaration.ROLE_BIT ) ); assertEquals( TypeDeclaration.TYPESAFE_BIT, tdeclr.getSetMask() & TypeDeclaration.TYPESAFE_BIT ); assertEquals( TypeDeclaration.FORMAT_BIT, tdeclr.getSetMask() & TypeDeclaration.FORMAT_BIT ); }
typeDeclaration.setKind(TypeDeclaration.Kind.CLASS); typeDeclaration.setValid(true); typeDeclaration.setFormat(TypeDeclaration.Format.POJO); typeDeclaration.setNature(TypeDeclaration.Nature.DECLARATION); TypeMetaInfo info = new TypeMetaInfo(typeDeclaration); typeDec.setKind(TypeDeclaration.Kind.ENUM); typeDec.setValid(true); typeDec.setFormat(TypeDeclaration.Format.TEMPLATE); typeDec.setNature(TypeDeclaration.Nature.DEFINITION); TypeMetaInfo infoTwo = new TypeMetaInfo(typeDec);
typeDeclaration.setKind(TypeDeclaration.Kind.CLASS); typeDeclaration.setValid(true); typeDeclaration.setFormat(TypeDeclaration.Format.POJO); typeDeclaration.setNature(TypeDeclaration.Nature.DECLARATION); TypeMetaInfo info = new TypeMetaInfo(typeDeclaration); typeDec.setKind(TypeDeclaration.Kind.ENUM); typeDec.setValid(true); typeDec.setFormat(TypeDeclaration.Format.TEMPLATE); typeDec.setNature(TypeDeclaration.Nature.DEFINITION); TypeMetaInfo infoTwo = new TypeMetaInfo(typeDec);