/** simple case. */ @Test public void simple() { Class<? extends DirectFileOutputDescription> aClass = generate(new Description("Testing", name(MockData.class))); assertThat(DirectFileOutputDescription.class.isAssignableFrom(aClass), is(true)); assertThat(Modifier.isAbstract(aClass.getModifiers()), is(true)); assertThat(aClass, hasGetter("getModelType")); assertThat(aClass, not(hasGetter("getBasePath"))); assertThat(aClass, not(hasGetter("getResourcePattern"))); assertThat(aClass, not(hasGetter("getFormat"))); }
/** * generate concrete class. * * @throws Exception if failed */ @Test public void concrete() throws Exception { Description description = new Description("Testing", name(MockData.class)); description.setBasePath("base-path"); description.setResourcePattern("*"); description.setFormatClassName(name(MockDataFormat.class)); Class<? extends DirectFileOutputDescription> aClass = generate(description); assertThat(DirectFileOutputDescription.class.isAssignableFrom(aClass), is(true)); assertThat(Modifier.isAbstract(aClass.getModifiers()), is(false)); DirectFileOutputDescription object = aClass.newInstance(); assertThat(object.getModelType(), is((Object) MockData.class)); assertThat(object.getBasePath(), is("base-path")); assertThat(object.getResourcePattern(), is("*")); assertThat(object.getOrder(), is(Arrays.<String>asList())); assertThat(object.getDeletePatterns(), is(Arrays.<String>asList())); assertThat(object.getFormat(), is((Object) MockDataFormat.class)); }
@Test public void testModifiers() throws Exception { for (Class<?> type : standardTypes) { assertThat(describe(type).getModifiers(), is(type.getModifiers())); } }