OSimpleKeyIndexDefinition extends ODocumentWrapperNoClass implements OIndexDefinition { public Comparable<?> createValue(final List<?> params) { return createValue(params != null ? params.toArray() : null); } OSimpleKeyIndexDefinition(final OType... keyTypes);  OSimpleKeyIndexDefinition(); List<String> getFields(); List<String> getFieldsToIndex(); String getClassName(); Comparable<?> createValue(final List<?> params); Comparable<?> createValue(final Object... params); int getParamCount(); OType[] getTypes(); @Override ODocument toStream(); Object getDocumentValueToIndex(final ODocument iDocument); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); String toCreateIndexDDL(final String indexName, final String indexType);  }
@Test public void testCreateValueSimpleKey() { final OSimpleKeyIndexDefinition keyIndexDefinition = new OSimpleKeyIndexDefinition(OType.INTEGER); final Object result = keyIndexDefinition.createValue("2"); Assert.assertEquals(result, 2); }
@Test public void testCreateValueCompositeKeyListParam() { final Object result = simpleKeyIndexDefinition.createValue(Arrays.asList("2", "3")); final OCompositeKey compositeKey = new OCompositeKey(Arrays.asList(2, "3")); Assert.assertEquals(result, compositeKey); }
@Test public void testCreateValueCompositeKeyNullListParam() { final Object result = simpleKeyIndexDefinition.createValue(Arrays.asList((Object) null)); Assert.assertNull(result); }
@Test public void testNullParamListItem() { final Object result = simpleKeyIndexDefinition.createValue(Arrays.asList("2", null)); Assert.assertNull(result); }
@Test public void testWrongParamTypeListItem() { final Object result = simpleKeyIndexDefinition.createValue(Arrays.asList("a", "3")); Assert.assertNull(result); }
@Test public void testCreateValueCompositeKey() { final Object result = simpleKeyIndexDefinition.createValue("2", "3"); final OCompositeKey compositeKey = new OCompositeKey(Arrays.asList(2, "3")); Assert.assertEquals(result, compositeKey); }
@Test public void testCreateValueCompositeKeyNullParamList() { final Object result = simpleKeyIndexDefinition.createValue((List<?>) null); Assert.assertNull(result); }
@Test public void testCreateValueCompositeKeyNullParam() { final Object result = simpleKeyIndexDefinition.createValue((Object) null); Assert.assertNull(result); }
@Test public void testCreateValueCompositeKeyEmptyList() { final Object result = simpleKeyIndexDefinition.createValue(Collections.<Object> emptyList()); Assert.assertNull(result); }
@Test public void testNullParamItem() { final Object result = simpleKeyIndexDefinition.createValue("2", null); Assert.assertNull(result); }
@Test public void testWrongParamType() { final Object result = simpleKeyIndexDefinition.createValue("a", "3"); Assert.assertNull(result); }