Search in sources :

Example 6 with Mixin

use of com.enonic.xp.schema.mixin.Mixin in project xp by enonic.

the class MixinServiceImplTest method testApplications.

@Test
public void testApplications() {
    initializeApps();
    final Mixins types1 = this.service.getAll();
    assertNotNull(types1);
    assertEquals(8, types1.getSize());
    final Mixins types2 = this.service.getByApplication(ApplicationKey.from("myapp1"));
    assertNotNull(types2);
    assertEquals(2, types2.getSize());
    final Mixins types3 = this.service.getByApplication(ApplicationKey.from("myapp2"));
    assertNotNull(types3);
    assertEquals(6, types3.getSize());
    final Mixin mixin = service.getByName(MixinName.from("myapp2:mixin1"));
    assertNotNull(mixin);
}
Also used : Mixins(com.enonic.xp.schema.mixin.Mixins) InlineMixin(com.enonic.xp.form.InlineMixin) Mixin(com.enonic.xp.schema.mixin.Mixin) Test(org.junit.jupiter.api.Test) AbstractSchemaTest(com.enonic.xp.core.impl.schema.AbstractSchemaTest)

Example 7 with Mixin

use of com.enonic.xp.schema.mixin.Mixin in project xp by enonic.

the class XmlMixinParserTest method assertResult.

private void assertResult() throws Exception {
    final Mixin result = this.builder.build();
    assertEquals("myapplication:mymixin", result.getName().toString());
    assertEquals("display name", result.getDisplayName());
    assertEquals("key.display-name", result.getDisplayNameI18nKey());
    assertEquals("description", result.getDescription());
    assertEquals("key.description", result.getDescriptionI18nKey());
    assertEquals(1, result.getForm().size());
}
Also used : Mixin(com.enonic.xp.schema.mixin.Mixin)

Aggregations

Mixin (com.enonic.xp.schema.mixin.Mixin)7 InlineMixin (com.enonic.xp.form.InlineMixin)4 Mixins (com.enonic.xp.schema.mixin.Mixins)3 Test (org.junit.jupiter.api.Test)3 AbstractSchemaTest (com.enonic.xp.core.impl.schema.AbstractSchemaTest)2 MixinName (com.enonic.xp.schema.mixin.MixinName)2 Application (com.enonic.xp.app.Application)1 Content (com.enonic.xp.content.Content)1 CreateContentParams (com.enonic.xp.content.CreateContentParams)1 ExtraData (com.enonic.xp.content.ExtraData)1 ExtraDatas (com.enonic.xp.content.ExtraDatas)1 UpdateContentParams (com.enonic.xp.content.UpdateContentParams)1 PropertyTree (com.enonic.xp.data.PropertyTree)1 FieldSet (com.enonic.xp.form.FieldSet)1 Form (com.enonic.xp.form.Form)1 FormItem (com.enonic.xp.form.FormItem)1 FormItemSet (com.enonic.xp.form.FormItemSet)1 FormOptionSet (com.enonic.xp.form.FormOptionSet)1 FormOptionSetOption (com.enonic.xp.form.FormOptionSetOption)1 Instant (java.time.Instant)1