use of com.enonic.xp.schema.mixin.Mixins in project xp by enonic.
the class MixinServiceImpl method getAll.
@Override
public Mixins getAll() {
final Set<Mixin> list = new LinkedHashSet<>();
for (final Application application : this.applicationService.getInstalledApplications()) {
final Mixins types = getByApplication(application.getKey());
list.addAll(types.getList());
}
return Mixins.from(list);
}
use of com.enonic.xp.schema.mixin.Mixins in project xp by enonic.
the class MixinServiceImplTest method testEmpty.
@Test
public void testEmpty() {
final Mixins types1 = this.service.getAll();
assertNotNull(types1);
assertEquals(0, types1.getSize());
final Mixins types2 = this.service.getByApplication(ApplicationKey.from("other"));
assertNotNull(types2);
assertEquals(0, types2.getSize());
final Mixin mixin = service.getByName(MixinName.from("other:mytype"));
assertEquals(null, mixin);
}
use of com.enonic.xp.schema.mixin.Mixins 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);
}
Aggregations