Exemplo n.º 1
0
            [result, e] = testHelper.testrangepartition(MyAssignment, RATINGS_TABLE, 5, conn, 0, ACTUAL_ROWS_IN_INPUT_FILE)
            if result :
                print("rangepartition function pass!")

            # ALERT:: Use only one at a time i.e. uncomment only one line at a time and run the script
            [result, e] = testHelper.testrangeinsert(MyAssignment, RATINGS_TABLE, 100, 2, 3, conn, '2')
            # [result, e] = testHelper.testrangeinsert(MyAssignment, RATINGS_TABLE, 100, 2, 0, conn, '0')
            if result:
                print("rangeinsert function pass!")

            testHelper.deleteAllPublicTables(conn)
            MyAssignment.loadRatings(RATINGS_TABLE, INPUT_FILE_PATH, conn)

            [result, e] = testHelper.testroundrobinpartition(MyAssignment, RATINGS_TABLE, 5, conn, 0, ACTUAL_ROWS_IN_INPUT_FILE)
            if result :
                print("roundrobinpartition function pass!")

            [result, e] = testHelper.testroundrobininsert(MyAssignment, RATINGS_TABLE, 100, 1, 3, conn, '0')
            # [result, e] = testHelper.testroundrobininsert(MyAssignment, RATINGS_TABLE, 100, 1, 3, conn, '1')
            # [result, e] = testHelper.testroundrobininsert(MyAssignment, RATINGS_TABLE, 100, 1, 3, conn, '2')
            if result:
                print("roundrobininsert function pass!")

            choice = input("Press enter to Delete all tables? ")
            if choice == '':
                testHelper.deleteAllPublicTables(conn)

    except Exception as detail:
        traceback.print_exc()
            #[result, e] = testHelper.testrangeinsert(MyAssignment, RATINGS_TABLE, 0, 2, 0.5, conn, '0')
            if result:
                print("rangeinsert function pass!")

            testHelper.deleteAllPublicTables(conn)
            MyAssignment.loadRatings(RATINGS_TABLE, INPUT_FILE_PATH, conn)

            [result, e
             ] = testHelper.testroundrobinpartition(MyAssignment,
                                                    RATINGS_TABLE, 5, conn, 0,
                                                    ACTUAL_ROWS_IN_INPUT_FILE)
            if result:
                print("roundrobinpartition function pass!")

            [result,
             e] = testHelper.testroundrobininsert(MyAssignment, RATINGS_TABLE,
                                                  100, 1, 3, conn, '0')
            [result,
             e] = testHelper.testroundrobininsert(MyAssignment, RATINGS_TABLE,
                                                  200, 1, 3, conn, '1')
            [result,
             e] = testHelper.testroundrobininsert(MyAssignment, RATINGS_TABLE,
                                                  100, 1, 3, conn, '2')
            [result,
             e] = testHelper.testroundrobininsert(MyAssignment, RATINGS_TABLE,
                                                  100, 1, 3, conn, '3')
            if result:
                print("roundrobininsert function pass!")

            choice = input("Press enter to Delete all tables? ")
            if choice == '':
                testHelper.deleteAllPublicTables(conn)