use of com.enonic.xp.schema.relationship.RelationshipType in project xp by enonic.
the class RelationshipTypeServiceImplTest method testEmpty.
@Test
public void testEmpty() {
final RelationshipTypes types1 = this.service.getAll();
assertNotNull(types1);
assertEquals(2, types1.getSize());
final RelationshipTypes types2 = this.service.getByApplication(ApplicationKey.from("other"));
assertNotNull(types2);
assertEquals(0, types2.getSize());
final RelationshipType mixin = service.getByName(RelationshipTypeName.from("other:mytype"));
assertEquals(null, mixin);
}
use of com.enonic.xp.schema.relationship.RelationshipType in project xp by enonic.
the class RelationshipTypeServiceImplTest method testApplications.
@Test
public void testApplications() {
initializeApps();
final RelationshipTypes types1 = this.service.getAll();
assertNotNull(types1);
assertEquals(3, types1.getSize());
final RelationshipTypes types2 = this.service.getByApplication(ApplicationKey.from("myapp1"));
assertNotNull(types2);
assertEquals(0, types2.getSize());
final RelationshipTypes types3 = this.service.getByApplication(ApplicationKey.from("myapp2"));
assertNotNull(types3);
assertEquals(1, types3.getSize());
final RelationshipType type = service.getByName(RelationshipTypeName.from("myapp2:member"));
assertNotNull(type);
}
Aggregations