NegativeBoundHiveVarchar extends BoundaryVarchar<NegativeBoundHiveVarchar.NegativeBoundHiveVarcharTag> { public List<Map<String, String>> pipelinePossibleStates(NegativeBoundHiveVarcharTag action, List<Map<String, String>> possibleStateList) { return returnStates(action, possibleStateList, buildVarcharData(action, false)); }  Class<NegativeBoundHiveVarcharTag> getTagActionClass(); String getTagName(); String getTagNameSpace(); List<Map<String, String>> pipelinePossibleStates(NegativeBoundHiveVarcharTag action,
                                            List<Map<String, String>> possibleStateList);  }
@Test public void minLenTest() { Map<String, String> variableDomains = new HashMap<>(); List<Map<String, String>> listOfMaps = new LinkedList<>(); listOfMaps.add(variableDomains); NegativeBoundHiveVarchar maxLenTest = new NegativeBoundHiveVarchar(); NegativeBoundHiveVarchar.NegativeBoundHiveVarcharTag neg = new NegativeBoundHiveVarchar.NegativeBoundHiveVarcharTag(); neg.setName("name"); neg.setLength("18"); neg.setMinLen("10"); Assert.assertEquals(neg.getMinLen(), "10"); List<Map<String, String>> newList = maxLenTest.pipelinePossibleStates(neg, listOfMaps); Assert.assertEquals(newList.get(0).get("name").length(), 9); Assert.assertEquals(newList.get(1).get("name").length(), 19); }
@Test public void allCapsTest() { Map<String, String> variableDomains = new HashMap<>(); List<Map<String, String>> listOfMaps = new LinkedList<>(); listOfMaps.add(variableDomains); NegativeBoundHiveVarchar maxLenTest = new NegativeBoundHiveVarchar(); NegativeBoundHiveVarchar.NegativeBoundHiveVarcharTag neg = new NegativeBoundHiveVarchar.NegativeBoundHiveVarcharTag(); neg.setName("name"); neg.setAllCaps("true"); List<Map<String, String>> newList = maxLenTest.pipelinePossibleStates(neg, listOfMaps); Assert.assertEquals(newList.get(0).get("name"), newList.get(0).get("name").toUpperCase()); Assert.assertEquals(newList.get(1).get("name"), newList.get(1).get("name").toUpperCase()); }
@Test public void maxLenTest() { Map<String, String> variableDomains = new HashMap<>(); List<Map<String, String>> listOfMaps = new LinkedList<>(); listOfMaps.add(variableDomains); NegativeBoundHiveVarchar maxLenTest = new NegativeBoundHiveVarchar(); NegativeBoundHiveVarchar.NegativeBoundHiveVarcharTag neg = new NegativeBoundHiveVarchar.NegativeBoundHiveVarcharTag(); neg.setName("name"); neg.setLength("18"); neg.setMaxLen("10"); Assert.assertEquals(neg.getMaxLen(), "10"); List<Map<String, String>> newList = maxLenTest.pipelinePossibleStates(neg, listOfMaps); neg.setMaxLen("100"); Assert.assertEquals(newList.get(0).get("name").length(), 1); Assert.assertEquals(newList.get(1).get("name").length(), 11); }