}
@Test
public void testEnumWithNestedClass()
{
JavaEnumSource javaEnum = Roaster
.parse(JavaEnumSource.class, "package org.example; public enum OuterEnum { " +
" FOO, BAR, BAZ; " +
" public class InnerClass1{ " +
" public class InnerClass3{}" +
" } " +
" public class InnerClass2{} " +
"}");
Assert.assertEquals("org.example.OuterEnum", javaEnum.getCanonicalName());
List<JavaSource<?>> nestedClasses = javaEnum.getNestedTypes();
JavaClassSource inner1 = (JavaClassSource) nestedClasses.get(0);
JavaClassSource inner2 = (JavaClassSource) nestedClasses.get(1);
Assert.assertEquals(javaEnum, inner1.getEnclosingType());
Assert.assertEquals("org.example.OuterEnum.InnerClass1", inner1.getCanonicalName());
Assert.assertEquals("org.example.OuterEnum$InnerClass1", inner1.getQualifiedName());