use of com.enonic.xp.schema.content.ContentTypes in project xp by enonic.
the class ContentTypeServiceTest method testApplications.
@Test
public void testApplications() throws Exception {
initializeApps();
final ContentTypes types1 = this.service.getAll();
assertNotNull(types1);
assertEquals(24, types1.getSize());
final ContentTypes types2 = this.service.getByApplication(ApplicationKey.from("myapp1"));
assertNotNull(types2);
assertEquals(1, types2.getSize());
final ContentTypes types3 = this.service.getByApplication(ApplicationKey.from("myapp2"));
assertNotNull(types3);
assertEquals(1, types3.getSize());
final ContentType contentType = service.getByName(new GetContentTypeParams().contentTypeName("myapp1:tag"));
assertNotNull(contentType);
}
use of com.enonic.xp.schema.content.ContentTypes in project xp by enonic.
the class ContentTypeServiceTest method testEmpty.
@Test
public void testEmpty() {
final ContentTypes types1 = this.service.getAll();
assertNotNull(types1);
assertEquals(22, types1.getSize());
final ContentTypes types2 = this.service.getByApplication(ApplicationKey.from("other"));
assertNotNull(types2);
assertEquals(0, types2.getSize());
final ContentType contentType = service.getByName(new GetContentTypeParams().contentTypeName("other:mytype"));
assertEquals(null, contentType);
}
use of com.enonic.xp.schema.content.ContentTypes in project xp by enonic.
the class ContentTypeServiceTest method testSystemApplication.
@Test
public void testSystemApplication() {
ContentTypes contentTypes = this.service.getAll();
assertNotNull(contentTypes);
assertEquals(22, contentTypes.getSize());
ContentType contentType = service.getByName(new GetContentTypeParams().contentTypeName(ContentTypeName.folder()));
assertNotNull(contentType);
contentTypes = service.getByApplication(ApplicationKey.BASE);
assertNotNull(contentTypes);
assertEquals(contentTypes.getSize(), 5);
contentTypes = service.getByApplication(ApplicationKey.PORTAL);
assertNotNull(contentTypes);
assertEquals(contentTypes.getSize(), 4);
contentTypes = service.getByApplication(ApplicationKey.MEDIA_MOD);
assertNotNull(contentTypes);
assertEquals(contentTypes.getSize(), 13);
contentType = service.getByName(new GetContentTypeParams().contentTypeName(ContentTypeName.site()));
assertNotNull(contentType);
}
use of com.enonic.xp.schema.content.ContentTypes in project xp by enonic.
the class ContentTypeHandlerTest method testList.
@Test
public void testList() throws Exception {
final Form form = getForm();
Mockito.when(mixinService.inlineFormItems(Mockito.eq(form))).thenReturn(form);
final ContentTypes contentTypes = testContentTypes();
Mockito.when(contentTypeService.getAll()).thenReturn(contentTypes);
runFunction("/test/ContentTypeHandlerTest.js", "testList");
}
Aggregations