/** * @param indexedColumn * @param f * @return TODO: Make this method accept n number of parameters elegantly */ private static PropertyIndex populatePropertyIndex(String indexName, String indexType, Integer max, Integer min, Field f) { PropertyIndex pi = new PropertyIndex(f, indexName, indexType); pi.setMax(max); pi.setMin(min); return pi; }
@Test public void testPropertyIndex() { try { PropertyIndex pi = new PropertyIndex(Employe.class.getDeclaredField("empName"), "EMP_NAME", "ASC"); pi.setBoost(1.2f); Assert.assertEquals(1.2f, pi.getBoost()); Assert.assertEquals("ASC", pi.getIndexType()); } catch (SecurityException e) { Assert.fail(e.getMessage()); } catch (NoSuchFieldException e) { Assert.fail(e.getMessage()); } }