Examples of Bill


Examples of gov.nysenate.openleg.model.Bill

                        else {
                            if(isPrimitive(obj)) {
                                root.addProperty(f.getName(), obj.toString());
                            }
                            else if(type.equals("Bill")) {
                                Bill bill = (Bill)obj;

                                if(!cachedSimpleBills.containsKey(bill.getBillId())) {
                                    cachedSimpleBills.put(bill.getBillId(), converter(obj,internal_bill_exclude()));
                                }

                                root.add(f.getName(), cachedSimpleBills.get(bill.getBillId()));
                            }
                            else if(type.equals("Date")) {
                                Date d = (Date)obj;
                                root.addProperty(f.getName(), (d != null) ? d.getTime() + "":"");
                            }
View Full Code Here

Examples of gov.nysenate.openleg.model.Bill

                resultNode.setAttribute("sponsor", vote.getBill().getSponsor().getFullname());
            }
            else if (result.getOtype().equals("bill")) {
                root.setName("docket");
                resultNode.setName("bill");
                Bill bill = (Bill)result.getObject();
                resultNode.setAttribute("billId", bill.getBillId());
                resultNode.setAttribute("senateId", bill.getBillId());
                resultNode.setAttribute("year", String.valueOf(bill.getYear()));
                resultNode.setAttribute("law", bill.getLaw());
                resultNode.setAttribute("lawSection", bill.getLawSection());
                resultNode.setAttribute("sponsor", bill.getSponsor().getFullname());
                resultNode.setAttribute("assemblySameAs", bill.getSameAs());
                resultNode.setAttribute("sameAs", bill.getSameAs());

                Element cosponsorsNode = new Element("cosponsors");
                for (Person cosponsor : bill.getCoSponsors()) {
                    Element cosponsorNode = new Element("cosponsor");
                    cosponsorNode.addContent(cosponsor.getFullname());
                }
                resultNode.addContent(cosponsorsNode);

                Element summaryNode = new Element("summary");
                summaryNode.addContent(bill.getSummary());
                resultNode.addContent(summaryNode);

                Element committeeNode = new Element("committee");
                committeeNode.addContent(bill.getCurrentCommittee());
                resultNode.addContent(committeeNode);
            }
            else if (result.getOtype().equals("meeting")) {
                Meeting meeting = (Meeting)result.getObject();
                resultNode.setAttribute("committee", meeting.getCommitteeName());
View Full Code Here

Examples of gov.nysenate.openleg.model.Bill

    public static void write(IBaseObject object, OutputStream out) throws IOException, COSVisitorException, AbstractApiRequest.ApiRequestException {
        if (!(object instanceof Bill)) {
            throw new AbstractApiRequest.ApiRequestException("Unable to convert " + object.getOtype() + "s to pdf.");
        }

        Bill bill = (Bill) object;
        PDDocument doc = new PDDocument();
        PDFont font = PDType1Font.COURIER;

        Float margin = billMargin;
        if (bill.isResolution()) {
            margin = resolutionMargin;
        }

        List<List<String>> pages = TextFormatter.pdfPrintablePages(bill);
        for (List<String> page : pages) {
View Full Code Here

Examples of gov.nysenate.openleg.model.Bill

      }

  @Test
     public void verifyWholeBill2011S1462() throws IOException
    {
    Bill theBill;
    File sobiDirectory = new File("/home/shweta/test/processed/2013/bills/");
      Storage storage = new Storage(env.getStorageDirectory());
      ArrayList<File> file = (ArrayList<File>) TestHelper.getFilesByNameCollection(sobiDirectory,"SOBI.D110110.T142112.TXT",
     "SOBI.D110107.T144910.TXT",   "SOBI.D110112.T175532.TXT", "SOBI.D110107.T150914.TXT", "SOBI.D110107.T141407.TXT");

      // Test for SOBI.D110107.T141407.TXT
      TestHelper.processFileC(env ,file.get(4));
      theBill=(Bill)storage.get("2011/bill/S1462-2011", Bill.class);
      assertNotNull("The title should not be null",theBill.getTitle());
    assertEquals(theBill.getSponsor().getFullname(),"LAVALLE");

    //Test for SOBI.D110107.T144910.TXT
     TestHelper.processFileC(env ,file.get(1));
     theBill=(Bill)storage.get("2011/bill/S1462-2011", Bill.class);
     assertEquals(theBill.getSameAs(),"A1415");

    // No Test for SOBI.D110107.T150914.TXT,SOBI.D110110.T142112.TXT,SOBI.D110112.T175532.TXT(Memo)
    }
View Full Code Here

Examples of gov.nysenate.openleg.model.Bill

    }

  @Test
     public void verifyWholeBill2011S1462A() throws IOException  // Testing Amendment A of the bill 2011S1462
    {
    Bill theBill;
    File sobiDirectory = new File("/home/shweta/test/processed/2013/bills/");
      Storage storage = new Storage(env.getStorageDirectory());
      ArrayList<File> file = (ArrayList<File>) TestHelper.getFilesByNameCollection(sobiDirectory,"SOBI.D110110.T142112.TXT",
          "SOBI.D110613.T222123.TXT", "SOBI.D110614.T192241.TXT", "SOBI.D110210.T221519.TXT", "SOBI.D120130.T202912.TXT",
          "SOBI.D110209.T171647.TXT", "SOBI.D120126.T103841.TXT", "SOBI.D110614.T195743.TXT", "SOBI.D120104.T223233.TXT",
          "SOBI.D110215.T151615.TXT", "SOBI.D110209.T105617.TXT", "SOBI.D110209.T110618.TXT", "SOBI.D110614.T152729.TXT",
          "SOBI.D110210.T102843.TXT", "SOBI.D110112.T175532.TXT", "SOBI.D110107.T144910.TXT", "SOBI.D110614.T185240.TXT",
          "SOBI.D120125.T130337.TXT", "SOBI.D110209.T171147.TXT", "SOBI.D110107.T150914.TXT", "SOBI.D110209.T170214.TXT",
          "SOBI.D110107.T141407.TXT");



        // Test for SOBI.D110209.T105617.TXT
     TestHelper.processFileC(env ,file.get(10));
     theBill=(Bill)storage.get("2011/bill/S1462A-2011", Bill.class);
     assertEquals(theBill.getSponsor().getFullname(),"LAVALLE");
     assertNotNull("The title should not be null",theBill.getTitle());

      // Test for SOBI.D110209.T110618.TXT
      TestHelper.processFileC(env ,file.get(11));
        theBill=(Bill)storage.get("2011/bill/S1462A-2011", Bill.class);
        assertEquals(theBill.getSponsor().getFullname(),"LAVALLE");
        assertNotNull("The title should not be null",theBill.getTitle());

        // Test for SOBI.D110215.T151615.TXT
        TestHelper.processFileC(env ,file.get(9));
        theBill=(Bill)storage.get("2011/bill/S1462A-2011", Bill.class);
        assertEquals(theBill.getSponsor().getFullname(),"LAVALLE");
        assertNotNull("The title should not be null",theBill.getTitle());

        // Test for SOBI.D110613.T222123.TXT
        TestHelper.processFileC(env ,file.get(1));
        theBill=(Bill)storage.get("2011/bill/S1462A-2011", Bill.class);
        assertEquals(theBill.getSponsor().getFullname(),"LAVALLE");
        assertNotNull("The title should not be null",theBill.getTitle());

        // Test for SOBI.D110614.T152729.TXT
        TestHelper.processFileC(env ,file.get(12));
        theBill=(Bill)storage.get("2011/bill/S1462A-2011", Bill.class);
        assertEquals(theBill.getSponsor().getFullname(),"LAVALLE");
        assertNotNull("The title should not be null",theBill.getTitle());

        // Test for SOBI.D110209.T170214.TXT,
        TestHelper.processFileC(env ,file.get(20));
        theBill=(Bill)storage.get("2011/bill/S1462A-2011", Bill.class);
        assertEquals(theBill.getSponsor().getFullname(),"LAVALLE");
        assertNotNull("The title should not be null",theBill.getTitle());

        // Test for SOBI.D110209.T171147.TXT
        TestHelper.processFileC(env ,file.get(18));
        theBill=(Bill)storage.get("2011/bill/S1462A-2011", Bill.class);
        assertEquals(theBill.getSameAs(),"A1415A");

        // NO test for SOBI.D110210.T102843.TXT ,SOBI.D110210.T221519.TXT (Memo)


View Full Code Here

Examples of gov.nysenate.openleg.model.Bill

        actionStrings.add(new String[]{"01/23/12", "ADVANCED TO THIRD READING"});
        actionStrings.add(new String[]{"01/30/12", "PASSED SENATE"});
        actionStrings.add(new String[]{"01/30/12", "DELIVERED TO ASSEMBLY"});
        actionStrings.add(new String[]{"01/30/12", "referred to codes"});
        // TODO: Passed assembly??
        BillTests.testBillStatusActions(env, sobiDirectory, storage, billKey, initialSenateSobi, actionStrings, new Bill("S1618-2011", 2011));
    }
View Full Code Here

Examples of gov.nysenate.openleg.model.Bill

  public static void testVoteDate(Environment env, File sobiDirectory,
      Storage storage, String billKey, String voteSobi, String expectedVoteDate)
  {
    File[] voteSobiFile = TestHelper.getFilesByName(sobiDirectory, voteSobi);
    TestHelper.processFile(env, voteSobiFile);
    Bill bill = TestHelper.getBill(storage, billKey);
    Vote vote = bill.getVotes().get(0);
    Date voteDate = vote.getVoteDate();
    DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);
    // Format the Date into a string and test.
    assertThat(dateFormat.format(voteDate), is(expectedVoteDate));
  }
View Full Code Here

Examples of gov.nysenate.openleg.model.Bill

  public static void testSenateVotes(Environment env, File sobiDirectory,
      Storage storage, String billKey, String voteSobi, Vote expected)
  {
    File[] voteSobiFile = TestHelper.getFilesByName(sobiDirectory, voteSobi);
    TestHelper.processFile(env, voteSobiFile);
    Bill bill = TestHelper.getBill(storage, billKey);
    Vote testVote = bill.getVotes().get(0);
    // Look into ListAssert.assertEquals if we don't care about the order of the lists.
    assertThat(testVote.getAyes(), is(expected.getAyes()));
    assertThat(testVote.getAyeswr(), is(expected.getAyeswr()));
    assertThat(testVote.getAbsent(), is(expected.getAbsent()));
    assertThat(testVote.getAbstains(), is(expected.getAbstains()));
View Full Code Here

Examples of gov.nysenate.openleg.model.Bill

  {
    File[] voteSobiFile = TestHelper.getFilesByName(sobiDirectory, committeeVoteSobi);
    TestHelper.processFile(env, voteSobiFile);
    Meeting meeting = TestHelper.getMeeting(storage, meetingKey);
    List<Bill> bills = meeting.getBills();
    Bill bill = TestHelper.getBillByName(bills, billName);
    Vote testVote = bill.getVotes().get(0);
    assertThat(testVote.getAyes(), is(expected.getAyes()));
    assertThat(testVote.getAyeswr(), is(expected.getAyeswr()));
    assertThat(testVote.getAbsent(), is(expected.getAbsent()));
    assertThat(testVote.getAbstains(), is(expected.getAbstains()));
    assertThat(testVote.getExcused(), is(expected.getExcused()));
View Full Code Here

Examples of gov.nysenate.openleg.model.Bill

        actionStrings.add(new String[]{"06/24/11", "PASSED SENATE"});
        actionStrings.add(new String[]{"06/24/11", "RETURNED TO ASSEMBLY"});
        actionStrings.add(new String[]{"06/24/11", "delivered to governor"});
        actionStrings.add(new String[]{"06/24/11", "signed chap.95"});

        BillTests.testBillStatusActions(env, sobiDirectory, storage, billKey, actionsSobi, actionStrings, new Bill(billNumber, 2011));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.