NegativeBoundHiveDecimal extends BoundaryDecimal<NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag> { public List<Map<String, String>> pipelinePossibleStates(NegativeBoundHiveDecimalTag action, List<Map<String, String>> possibleStateList) { return returnStates(action, possibleStateList, setParameters(action, false)); }  Class<NegativeBoundHiveDecimalTag> getTagActionClass(); String getTagName(); String getTagNameSpace(); List<Map<String, String>> pipelinePossibleStates(NegativeBoundHiveDecimalTag action,
                                                            List<Map<String, String>> possibleStateList);  }
@Test public void nullTest2() { Map<String, String> variableDomains = new HashMap<>(); NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag neg = new NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag(); NegativeBoundHiveDecimal test = new NegativeBoundHiveDecimal(); List<Map<String, String>> listOfMaps = new LinkedList<>(); variableDomains.put("decimal", ""); listOfMaps.add(variableDomains); neg.setLength("18,8"); neg.setName("decimal"); neg.setNullable("true"); List<Map<String, String>> list = test.pipelinePossibleStates(neg, listOfMaps); Assert.assertEquals(list.size(), 2); neg.setNullable("false"); list = test.pipelinePossibleStates(neg, listOfMaps); Assert.assertEquals(list.size(), 3); }
@Test public void minMaxTest() { Map<String, String> variableDomains = new HashMap<>(); List<Map<String, String>> listOfMaps = new LinkedList<>(); listOfMaps.add(variableDomains); NegativeBoundHiveDecimal minMaxTest = new NegativeBoundHiveDecimal(); NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag tag = new NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag(); tag.setName("Name"); tag.setMin("10"); tag.setMax("20"); Assert.assertEquals(tag.getMin(), "10"); Assert.assertEquals(tag.getMax(), "20"); tag.setMin("100"); tag.setMax("200"); Assert.assertEquals(tag.getMin(), "100"); Assert.assertEquals(tag.getMax(), "200"); List<Map<String, String>> newList = minMaxTest.pipelinePossibleStates(tag, listOfMaps); Assert.assertEquals(newList.get(0).get("Name"), "99"); Assert.assertEquals(newList.get(1).get("Name"), "201"); }
@Test public void minLenTest() { Map<String, String> variableDomains = new HashMap<>(); List<Map<String, String>> listOfMaps = new LinkedList<>(); listOfMaps.add(variableDomains); NegativeBoundHiveDecimal minLenTest = new NegativeBoundHiveDecimal(); NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag tag = new NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag(); tag.setName("name"); tag.setMinLen("10"); Assert.assertEquals(tag.getMinLen(), "10"); tag.setMinLen("100"); Assert.assertEquals(tag.getMinLen(), "100"); List<Map<String, String>> newList = minLenTest.pipelinePossibleStates(tag, listOfMaps); Assert.assertEquals(newList.get(0).get("name").length(), 9); Assert.assertEquals(newList.get(1).get("name").length(), 11); }
@Test public void maxLenTest() { Map<String, String> variableDomains = new HashMap<>(); List<Map<String, String>> listOfMaps = new LinkedList<>(); listOfMaps.add(variableDomains); NegativeBoundHiveDecimal maxLenTest = new NegativeBoundHiveDecimal(); NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag tag = new NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag(); tag.setName("name"); tag.setMinLen("100"); Assert.assertEquals(tag.getMinLen(), "100"); List<Map<String, String>> newList = maxLenTest.pipelinePossibleStates(tag, listOfMaps); Assert.assertEquals(newList.get(0).get("name").length(), 9); Assert.assertEquals(newList.get(1).get("name").length(), 11); }
@Test public void minLenAndmaxLenTest() { Map<String, String> variableDomains = new HashMap<>(); List<Map<String, String>> listOfMaps = new LinkedList<>(); listOfMaps.add(variableDomains); NegativeBoundHiveDecimal maxLenTest = new NegativeBoundHiveDecimal(); NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag tag = new NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag(); tag.setName("name"); tag.setMinLen("5"); tag.setMaxLen("9"); List<Map<String, String>> newList = maxLenTest.pipelinePossibleStates(tag, listOfMaps); Assert.assertEquals(newList.get(0).get("name").length(), 4); Assert.assertEquals(newList.get(1).get("name").length(), 10); }
@Test public void defaultBehaviorTest() { Map<String, String> variableDomains = new HashMap<>(); List<Map<String, String>> listOfMaps = new LinkedList<>(); listOfMaps.add(variableDomains); NegativeBoundHiveDecimal setTest = new NegativeBoundHiveDecimal(); NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag tag = new NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag(); tag.setName("Name"); List<Map<String, String>> newList = setTest.pipelinePossibleStates(tag, listOfMaps); Assert.assertEquals(newList.get(0).get("Name").length(), 11); Assert.assertEquals(newList.get(1).get("Name").length(), 11); }
@Test public void minLenAndMaxTest() { Map<String, String> variableDomains = new HashMap<>(); List<Map<String, String>> listOfMaps = new LinkedList<>(); listOfMaps.add(variableDomains); NegativeBoundHiveDecimal defaultBehavior = new NegativeBoundHiveDecimal(); NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag tag = new NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag(); tag.setName("name"); tag.setMinLen("10"); tag.setMax("1000"); List<Map<String, String>> newList = defaultBehavior.pipelinePossibleStates(tag, listOfMaps); Assert.assertEquals(newList.get(0).get("name"), "-100000000"); Assert.assertEquals(newList.get(1).get("name"), "1001"); }
@Test public void minAndMaxLenTest() { Map<String, String> variableDomains = new HashMap<>(); List<Map<String, String>> listOfMaps = new LinkedList<>(); listOfMaps.add(variableDomains); NegativeBoundHiveDecimal defaultBehavior = new NegativeBoundHiveDecimal(); NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag tag = new NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag(); tag.setName("name"); tag.setMin("10"); tag.setMaxLen("12"); List<Map<String, String>> newList = defaultBehavior.pipelinePossibleStates(tag, listOfMaps); Assert.assertEquals(newList.get(0).get("name"), "9"); Assert.assertEquals(newList.get(1).get("name").length(), 11); }
@Test public void setTest() { Map<String, String> variableDomains = new HashMap<>(); List<Map<String, String>> listOfMaps = new LinkedList<>(); variableDomains.put("A", "1"); variableDomains.put("B", "2"); variableDomains.put("C", "3"); listOfMaps.add(variableDomains); NegativeBoundHiveDecimal setTest = new NegativeBoundHiveDecimal(); NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag tag = new NegativeBoundHiveDecimal.NegativeBoundHiveDecimalTag(); tag.setNullable("true"); tag.setLength("38,18"); tag.setName("Name"); List<Map<String, String>> newList = setTest.pipelinePossibleStates(tag, listOfMaps); Assert.assertEquals(newList.get(0).get("A"), "1"); Assert.assertEquals(newList.get(0).get("B"), "2"); Assert.assertEquals(newList.get(0).get("C"), "3"); Assert.assertEquals(newList.get(1).get("A"), "1"); Assert.assertEquals(newList.get(1).get("B"), "2"); Assert.assertEquals(newList.get(1).get("C"), "3"); Assert.assertEquals(newList.size(), 2); }