PositiveBoundHiveBigInt extends BoundaryInteger<PositiveBoundHiveBigInt.PositiveBoundHiveBigIntTag> { public List<Map<String, String>> pipelinePossibleStates(PositiveBoundHiveBigIntTag action, List<Map<String, String>> possibleStateList) { final String minVALUE = Long.toString(Long.MIN_VALUE); final String maxVALUE = Long.toString(Long.MAX_VALUE); return returnStates(action, possibleStateList, buildNumericData(action, minVALUE, maxVALUE, true)); }  Class<PositiveBoundHiveBigIntTag> getTagActionClass(); String getTagName(); String getTagNameSpace(); List<Map<String, String>> pipelinePossibleStates(PositiveBoundHiveBigIntTag action,
                                                            List<Map<String, String>> possibleStateList);  }
@Test public void nullTest2() { Map<String, String> variableDomains = new HashMap<>(); PositiveBoundHiveBigInt.PositiveBoundHiveBigIntTag pos = new PositiveBoundHiveBigInt.PositiveBoundHiveBigIntTag(); PositiveBoundHiveBigInt test = new PositiveBoundHiveBigInt(); List<Map<String, String>> listOfMaps = new LinkedList<>(); variableDomains.put("test", ""); listOfMaps.add(variableDomains); pos.setMin("10"); pos.setMax("100"); pos.setName("test"); pos.setNullable("true"); List<Map<String, String>> list = test.pipelinePossibleStates(pos, listOfMaps); Assert.assertEquals(list.size(), 6); pos.setNullable("false"); list = test.pipelinePossibleStates(pos, listOfMaps); Assert.assertEquals(list.size(), 5); }
@Test public void minTest2() { Map<String, String> variableDomains = new HashMap<>(); PositiveBoundHiveBigInt.PositiveBoundHiveBigIntTag pos = new PositiveBoundHiveBigInt.PositiveBoundHiveBigIntTag(); PositiveBoundHiveBigInt test = new PositiveBoundHiveBigInt(); List<Map<String, String>> listOfMaps = new LinkedList<>(); ArrayList<String> al = new ArrayList<>(); variableDomains.put("test", ""); listOfMaps.add(variableDomains); pos.setMin("10"); pos.setMax("100"); pos.setNullable("true"); pos.setName("test"); List<Map<String, String>> list = test.pipelinePossibleStates(pos, listOfMaps); for (Map<String, String> map : list) { for (String key : map.keySet()) { al.add(map.get(key)); } } Assert.assertTrue(al.contains("10")); Assert.assertTrue(al.contains("11")); }
@Test public void minTest3() { Map<String, String> variableDomains = new HashMap<>(); PositiveBoundHiveBigInt.PositiveBoundHiveBigIntTag pos = new PositiveBoundHiveBigInt.PositiveBoundHiveBigIntTag(); PositiveBoundHiveBigInt test = new PositiveBoundHiveBigInt(); List<Map<String, String>> listOfMaps = new LinkedList<>(); ArrayList<String> al = new ArrayList<>(); variableDomains.put("test", ""); listOfMaps.add(variableDomains); pos.setMin("1232132132234234234234234231321321213"); pos.setMax("-9994234234234234234234234223423"); pos.setNullable("true"); pos.setName("test"); List<Map<String, String>> list = test.pipelinePossibleStates(pos, listOfMaps); for (Map<String, String> map : list) { for (String key : map.keySet()) { al.add(map.get(key)); } } Assert.assertTrue(al.contains(Long.toString(Long.MIN_VALUE))); Assert.assertTrue(al.contains(Long.toString(Long.MIN_VALUE + 1))); }
@Test public void maxTest2() { Map<String, String> variableDomains = new HashMap<>(); PositiveBoundHiveBigInt.PositiveBoundHiveBigIntTag pos = new PositiveBoundHiveBigInt.PositiveBoundHiveBigIntTag(); PositiveBoundHiveBigInt test = new PositiveBoundHiveBigInt(); List<Map<String, String>> listOfMaps = new LinkedList<>(); ArrayList<String> al = new ArrayList<>(); variableDomains.put("test", ""); listOfMaps.add(variableDomains); pos.setMin("10"); pos.setMax("100"); pos.setNullable("true"); pos.setName("test"); List<Map<String, String>> list = test.pipelinePossibleStates(pos, listOfMaps); for (Map<String, String> map : list) { for (String key : map.keySet()) { al.add(map.get(key)); } } Assert.assertTrue(al.contains("100")); Assert.assertTrue(al.contains("99")); }
@Test public void zeroTest() { Map<String, String> variableDomains = new HashMap<>(); PositiveBoundHiveBigInt.PositiveBoundHiveBigIntTag pos = new PositiveBoundHiveBigInt.PositiveBoundHiveBigIntTag(); PositiveBoundHiveBigInt test = new PositiveBoundHiveBigInt(); List<Map<String, String>> listOfMaps = new LinkedList<>(); variableDomains.put("test", ""); listOfMaps.add(variableDomains); pos.setMin("-1"); pos.setMax("100"); pos.setName("test"); pos.setNullable("true"); List<Map<String, String>> list = test.pipelinePossibleStates(pos, listOfMaps); Assert.assertEquals(list.size(), 7); pos.setNullable("false"); list = test.pipelinePossibleStates(pos, listOfMaps); Assert.assertEquals(list.size(), 6); }