Class MongoAssertions


  • public class MongoAssertions
    extends java.lang.Object
    Util class which needs to be in the same package as CalciteAssert due to package-private visibility.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private MongoAssertions()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void assumeRealMongoInstance()
      Used to skip tests if current instance is not mongo.
      static java.util.function.Consumer<java.sql.ResultSet> checkResultUnordered​(java.lang.String... lines)
      Similar to CalciteAssert.checkResultUnordered(java.lang.String...), but filters strings before comparing them.
      static boolean useFake()
      Checks wherever tests should use Embedded Fake Mongo instead of connecting to real mongodb instance.
      static boolean useMongo()
      Whether to run Mongo integration tests.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MongoAssertions

        private MongoAssertions()
    • Method Detail

      • checkResultUnordered

        public static java.util.function.Consumer<java.sql.ResultSet> checkResultUnordered​(java.lang.String... lines)
        Similar to CalciteAssert.checkResultUnordered(java.lang.String...), but filters strings before comparing them.
        Parameters:
        lines - Expected expressions
        Returns:
        validation function
      • useMongo

        public static boolean useMongo()
        Whether to run Mongo integration tests. Enabled by default, however test is only included if "it" profile is activated (-Pit). To disable, specify -Dcalcite.test.mongodb=false on the Java command line.
        Returns:
        Whether current tests should use an external mongo instance
      • useFake

        public static boolean useFake()
        Checks wherever tests should use Embedded Fake Mongo instead of connecting to real mongodb instance. Opposite of useMongo().
        Returns:
        Whether current tests should use embedded Mongo Java Server instance
      • assumeRealMongoInstance

        public static void assumeRealMongoInstance()
        Used to skip tests if current instance is not mongo. Some functionalities are not available in fongo.
        See Also:
        Aggregation with $cond (172)