kgyrtkirk commented on a change in pull request #970: Hive 23100
URL: https://github.com/apache/hive/pull/970#discussion_r408706367
##########
File path:
ql/src/test/org/apache/hadoop/hive/ql/parse/type/TestTypeCheckProcFactory.java
##########
@@ -78,63 +79,63 @@ public void init() {
testSubject = ExprNodeTypeCheck.getExprNodeDefaultExprProcessor();
}
- public void testOneCase(Object constValue) {
+ public void testOneCase(Object constValue) throws SemanticException {
Mockito.when(nodeDesc.getValue()).thenReturn(constValue);
Mockito.when(typeInfo.getPrimitiveTypeEntry()).thenReturn(constType);
- ExprNodeConstantDesc result = (ExprNodeConstantDesc)
testSubject.interpretNodeAs(typeInfo, nodeDesc);
+ ExprNodeConstantDesc result = (ExprNodeConstantDesc)
testSubject.interpretNodeAsConstant(typeInfo, nodeDesc);
Assert.assertNotNull(result);
Assert.assertEquals(expectedValue, result.getValue());
}
- public void testNullCase(Object constValue) {
+ public void testNullCase(Object constValue) throws SemanticException {
Mockito.when(nodeDesc.getValue()).thenReturn(constValue);
Mockito.when(typeInfo.getPrimitiveTypeEntry()).thenReturn(constType);
- ExprNodeConstantDesc result = (ExprNodeConstantDesc)
testSubject.interpretNodeAs(typeInfo, nodeDesc);
+ ExprNodeConstantDesc result = (ExprNodeConstantDesc)
testSubject.interpretNodeAsConstant(typeInfo, nodeDesc);
Assert.assertNull(result);
}
@Test
- public void testWithSring() {
+ public void testWithSring() throws SemanticException {
testOneCase(maxValue.toString());
}
@Test
- public void testWithLSuffix() {
+ public void testWithLSuffix() throws SemanticException {
if (intType) {
testOneCase(maxValue.toString() + "L");
}
}
@Test
- public void testWithZeroFraction() {
+ public void testWithZeroFraction() throws SemanticException {
if (intType) {
testOneCase(maxValue.toString() + ".0");
}
}
@Test
- public void testWithFSuffix() {
+ public void testWithFSuffix() throws SemanticException {
testOneCase(maxValue.toString() + "f");
}
@Test
- public void testWithDSuffix() {
+ public void testWithDSuffix() throws SemanticException {
testOneCase(maxValue.toString() + "D");
}
@Test
- public void testOverflow() {
+ public void testOverflow() throws SemanticException {
if (intType) {
testNullCase(maxValue.add(BigDecimal.valueOf(1L)).toString());
}
}
@Test
- public void testWithNonZeroFraction() {
+ public void testWithNonZeroFraction() throws SemanticException {
Review comment:
nit: in case throwing an exception from a testcase: it's better to throw
plain Exception - then we never have to go back there
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]