Class Tester


  • public class Tester
    extends java.lang.Object
    This class tests the following methods: - PersonPageData's constructor by scraping public PersonPageData(WebDriver webDriver, PersonNameUrl personNameUrl, String dynastyPageUrl) {[...]} (through PersonPageDataTester) - Dynasty's constructor by scraping public Dynasty(String dynastyPageUrl, String dynastyName, WebDriver webDriver, boolean makeDynastyTree) {[...]} (through DynastyTester) - Dynasty's getDynasties method (through DynastiesTester)
    Author:
    Matteo Collica, Sara Lazzaroni, Radu Ionut Barbalata
    • Constructor Summary

      Constructors 
      Constructor Description
      Tester()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int computeResults​(int numberOfSinglePassedTests, int numberOfSingleTests)
      Compare the number of single passed tests with the total amount of single tests and print out the outcome
      static void main​(java.lang.String[] args)
      The main method executes and keeps count of the single passed tests and test groups (PersonPageDataTester, DynastyTester and DynastiesTester) passed over the total amount
      static void printValues​(java.util.ArrayList<java.lang.String> fields, java.util.HashMap<java.lang.String,​java.lang.String> expectedScrapedValues)
      Given an ArrayList of fields and their expected and scraped value, print them all
      • Methods inherited from class java.lang.Object

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

      • Tester

        public Tester()
    • Method Detail

      • printValues

        public static void printValues​(java.util.ArrayList<java.lang.String> fields,
                                       java.util.HashMap<java.lang.String,​java.lang.String> expectedScrapedValues)
        Given an ArrayList of fields and their expected and scraped value, print them all
        Parameters:
        fields - an ArrayList of the fields we have to print expected values and scraped values of
        expectedScrapedValues - the expected value : scraped value entries to be printed
      • computeResults

        public static int computeResults​(int numberOfSinglePassedTests,
                                         int numberOfSingleTests)
        Compare the number of single passed tests with the total amount of single tests and print out the outcome
        Parameters:
        numberOfSinglePassedTests - the number of single passed tests
        numberOfSingleTests - the total amount of single tests
        Returns:
        1 if the number of single passed tests is the same as the total amount of tests, 0 otherwise