@Test public void testTypeDeclaration() throws Exception { TypeDeclaration typeDec1 = new TypeDeclaration(TEST_NAME); TypeDeclaration typeDec2 = SerializationHelper.serializeObject(typeDec1); assertEquals(typeDec1, typeDec2); } }
@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 ); }
compilationID); TypeDeclaration typeDeclaration = new TypeDeclaration(); typeDeclaration.setRole(Role.Type.EVENT); typeDeclaration.setKind(TypeDeclaration.Kind.CLASS); TypeMetaInfo info = new TypeMetaInfo(typeDeclaration); TypeDeclaration typeDec = new TypeDeclaration(); typeDec.setRole(Role.Type.FACT); typeDec.setKind(TypeDeclaration.Kind.ENUM);
compilationID); TypeDeclaration typeDeclaration = new TypeDeclaration(); typeDeclaration.setRole(Role.Type.FACT); typeDeclaration.setKind(TypeDeclaration.Kind.CLASS); TypeMetaInfo info = new TypeMetaInfo(typeDeclaration); TypeDeclaration typeDec = new TypeDeclaration(); typeDec.setRole(Role.Type.FACT); typeDec.setKind(TypeDeclaration.Kind.ENUM);