Ejemplo n.º 1
0
 @Test(expected = SidoClosedItemException.class)
 public void addType_closed() {
   SidoContext context = mock(SidoContext.class);
   DefaultSidoSchema schema = new DefaultSidoSchema(context, UID);
   schema.close();
   schema.addType(mock(SidoType.class));
 }
Ejemplo n.º 2
0
 @Test
 public void getType_not_required() {
   SidoContext context = mock(SidoContext.class);
   DefaultSidoSchema schema = new DefaultSidoSchema(context, UID);
   SidoType type = schema.getType("Person", false);
   assertNull(type);
 }
Ejemplo n.º 3
0
 @Test
 public void addType() {
   SidoContext context = mock(SidoContext.class);
   DefaultSidoSchema schema = new DefaultSidoSchema(context, UID);
   SidoType type = mock(SidoType.class);
   when(type.getName()).thenReturn("Person");
   schema.addType(type);
   assertSame(type, schema.getType("Person", true));
 }
Ejemplo n.º 4
0
 @Test
 public void constructor() {
   SidoContext context = mock(SidoContext.class);
   DefaultSidoSchema schema = new DefaultSidoSchema(context, UID);
   assertSame(context, schema.getContext());
   assertEquals(UID, schema.getUid());
   assertEquals(UID, schema.toString());
   Collection<SidoType> types = schema.getTypes();
   assertNotNull(types);
   assertTrue(types.isEmpty());
 }
Ejemplo n.º 5
0
 @Test(expected = SidoTypeNotFoundInSchemaException.class)
 public void getType_required() {
   SidoContext context = mock(SidoContext.class);
   DefaultSidoSchema schema = new DefaultSidoSchema(context, UID);
   schema.getType("Person", true);
 }