@Override public void check(TestCase testCase) { Pair<TestType, Object> result = _executor.executeQuery(testCase.getFunctionCall()); Assert.assertEquals(result.getLeft(), _typeFactory.createType(TypeSignature.parse(testCase.getExpectedOutputType()), _boundVariables)); Assert.assertEquals(result.getRight(), testCase.getExpectedOutput()); } }
/** * Verifies that the output and output type of the function call matches the provided expected values * * @param functionCall A {@link FunctionCall} with function name and a list of input arguments. * @param expectedOutput The expected output data * @param expectedOutputTypeSignature The type signature string for the data type of the expected output */ default void check(FunctionCall functionCall, Object expectedOutput, String expectedOutputTypeSignature) { check(new TestCase(functionCall, expectedOutput, expectedOutputTypeSignature)); } }
default void check(TestCase testCase) { assertFunctionCall(getSqlFunctionCallGenerator().getSqlFunctionCallString(testCase.getFunctionCall()), getToPlatformTestOutputConverter().convertToTestOutput(testCase.getExpectedOutput(), testCase.getInferredOutputType()), getPlatformType(testCase.getExpectedOutputType())); }
default void check(TestCase testCase) { assertFunctionCall(getSqlFunctionCallGenerator().getSqlFunctionCallString(testCase.getFunctionCall()), getToPlatformTestOutputConverter().convertToTestOutput(testCase.getExpectedOutput(), testCase.getInferredOutputType()), getPlatformType(testCase.getExpectedOutputType())); }
/** * Verifies that the output and output type of the function call matches the provided expected values * * @param functionCall A {@link FunctionCall} with function name and a list of input arguments. * @param expectedOutput The expected output data * @param expectedOutputTypeSignature The type signature string for the data type of the expected output */ default void check(FunctionCall functionCall, Object expectedOutput, String expectedOutputTypeSignature) { check(new TestCase(functionCall, expectedOutput, expectedOutputTypeSignature)); } }