Package gov.nysenate.openleg.model

Examples of gov.nysenate.openleg.model.Bill


        List<String> sobiCommits = Arrays.asList(billSobis);
        for(String commit: sobiCommits){
            commitFile = TestHelper.getFilesByName(sobiDirectory, commit);
            TestHelper.processFile(env, commitFile);
        }
        Bill initialBill = TestHelper.getBill(storage, billKey);
        // Now process the incorrect status line sobi and get its bill.
        File[] emptyCommit = TestHelper.getFilesByName(sobiDirectory, nullStatusSobi);
        TestHelper.processFile(env, emptyCommit);
        Bill nullSponsorBill = TestHelper.getBill(storage, billKey);
        assertThat(nullSponsorBill.getSponsor().getFullname(), is(initialBill.getSponsor().getFullname()));
        // Test if anything else got changed.
        assertThat(initialBill.equals(nullSponsorBill), is(true)); // TODO do these both reference the same object?
    }
View Full Code Here


    public static void testLawSection(Environment env, File sobiDirectory,
            Storage storage, String billKey, String sobi, String expectedLawSection)
    {
        File[] initialSobi = TestHelper.getFilesByName(sobiDirectory, sobi);
        TestHelper.processFile(env, initialSobi);
        Bill bill = TestHelper.getBill(storage, billKey);
        assertThat(bill.getLawSection(), is(expectedLawSection));
    }
View Full Code Here

            Storage storage, String billKey, String sobi, ArrayList<String[]> actionString, Bill bill)
    {
        List<Action> expectedActions = TestHelper.convertIntoActions(actionString, bill);
        File[] initialSobi = TestHelper.getFilesByName(sobiDirectory, sobi);
        TestHelper.processFile(env, initialSobi);
        Bill storageBill = TestHelper.getBill(storage, billKey);
        List<Action> actions = storageBill.getActions();
        for(int i = 0; i < actions.size(); i++) {
            // Test status action text
            assertThat(actions.get(i).getText(), is(expectedActions.get(i).getText()));
            // Test status action date. Tests accuracy up to the day since that is what is provided by the SOBI.
            Date actionDate = DateUtils.round(actions.get(i).getDate(), Calendar.DAY_OF_MONTH);
View Full Code Here

    public static void testBillLaw(Environment env, File sobiDirectory,
            Storage storage, String billKey, String sobi, String expectedLaw)
    {
        File[] initialSobi = TestHelper.getFilesByName(sobiDirectory, sobi);
        TestHelper.processFile(env, initialSobi);
        Bill bill = TestHelper.getBill(storage, billKey);
        assertThat(bill.getLaw(), is(expectedLaw));
    }
View Full Code Here

    public static void testSameAs(Environment env, File sobiDirectory,
            Storage storage, String billKey, String sobi, String expectedSameAs)
    {
        File[] initialSobi = TestHelper.getFilesByName(sobiDirectory, sobi);
        TestHelper.processFile(env, initialSobi);
        Bill bill = TestHelper.getBill(storage, billKey);
        // If the same as sobi text = "No same as", leave the sameAs value empty in json.
        if(expectedSameAs.equals("No same as")){
            assertThat(bill.getSameAs(), is(""));
        }
        else{
            assertThat(bill.getSameAs(), is(expectedSameAs));
        }
    }
View Full Code Here

    public static void testActToClause(Environment env, File sobiDirectory,
            Storage storage, String billKey, String sobi, String expectedClause)
    {
        File[] initialSobi = TestHelper.getFilesByName(sobiDirectory, sobi);
        TestHelper.processFile(env, initialSobi);
        Bill bill = TestHelper.getBill(storage, billKey);
        assertThat(bill.getActClause(), is(expectedClause));
    }
View Full Code Here

    public static void testBillSummary(Environment env, File sobiDirectory,
            Storage storage, String billKey, String sobi, String expectedSummary)
    {
        File[] initialSobi = TestHelper.getFilesByName(sobiDirectory, sobi);
        TestHelper.processFile(env, initialSobi);
        Bill bill = TestHelper.getBill(storage, billKey);
        assertThat(bill.getSummary(), is(expectedSummary));
    }
View Full Code Here

    public static void testSponsorMemo(Environment env, File sobiDirectory,
            Storage storage, String billKey, String sobi, String expectedMemo)
    {
        File[] initialSobi = TestHelper.getFilesByName(sobiDirectory, sobi);
        TestHelper.processFile(env, initialSobi);
        Bill bill = TestHelper.getBill(storage, billKey);
        assertThat(bill.getMemo(), is(expectedMemo));
    }
View Full Code Here

    return getFilesByName(directory, Arrays.asList(names));
  }

  public static Bill getBill(Storage storage, String billKey)
  {
    Bill bill = (Bill)storage.get(billKey, Bill.class);
    return bill;
  }
View Full Code Here

    return meeting;
  }

  public static Bill getBillByName(List<Bill> bills, String billName)
  {
    Bill bill = null;
    for(Bill eachBill: bills){
      if(eachBill.getBillId().equalsIgnoreCase(billName)){
        bill = eachBill;
      }
    }
View Full Code Here

TOP

Related Classes of gov.nysenate.openleg.model.Bill

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.