Package gov.nysenate.openleg.model

Examples of gov.nysenate.openleg.model.Bill


 

  @Test
  public void verifyBill2013S2230() throws IOException
  {
    Bill theBill;
   
      ArrayList<File> file = (ArrayList<File>) TestHelper.getFilesByNameCollection(sobiDirectory, "SOBI.D130114.T213149.TXT",
        "SOBI.D130114.T212649.TXT","SOBI.D130115.T124054.TXT", "SOBI.D130115.T093046.TXT", "SOBI.D130114.T225652.TXT",
        "SOBI.D130114.T233653.TXT","SOBI.D130115.T162604.TXT", "SOBI.D130114.T232653.TXT""SOBI.D130116.T115728.TXT",
        "SOBI.D130115.T162104.TXT", "SOBI.D130115.T094047.TXT" );
     
     // Tests for SOBI.D130114.T213149.TXT
      TestHelper.processFileC(env ,file.get(0));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      assertEquals(theBill.getSameAs(),"A2388");
   
     
     // Tests for SOBI.D130114.T212649.TXT  
     TestHelper.processFileC(env ,file.get(1));
     theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
     ArrayList<Person> list=(ArrayList<Person>)theBill.getCoSponsors();
     assertEquals(theBill.getSponsor().getFullname(),"KLEIN");
     assertEquals(list.get(0).toString(),"SMITH");
   
   
      // Tests for the SOBI.D130114.T225652.TXT
      TestHelper.processFileC(env ,file.get(4));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      assertNotNull("The title should not be null",theBill.getTitle());
      assertEquals(theBill.getSponsor().getFullname(),"KLEIN");
   
     // Tests for the SOBI.D130114.T232653.TXT
      TestHelper.processFileC(env ,file.get(7));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      assertNotNull("The title should not be null",theBill.getTitle());
      assertEquals(theBill.getSponsor().getFullname(),"KLEIN");
 
      // Tests for the SOBI.D130114.T233653.TXT
      TestHelper.processFileC(env ,file.get(5));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      Vote vote=processExpectedVote();
      boolean var=VoteTests.voteCheck(theBill,vote);
      assertEquals(var,true);
     
     
   // Tests for the SOBI.D130115.T93046.TXT
      TestHelper.processFileC(env ,file.get(3));
       theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
       assertEquals(theBill.getLawSection().equalsIgnoreCase("Criminal Procedure Law"),true);
    
      
     /*  Nothing to test in SOBI.D130115.T093547.TXT,SOBI.D130115.T095048.TXT,SOBI.D130115.T101048.TXT,
       SOBI.D130115.T124554.TXT, SOBI.D130115.T132056.TXT,SOBI.D130116.T120230.TXT(Memo), SOBI.D130114.T223651.TXT(Memo)
       SOBI.D130116.T122729.TXT */
      
     //Tests for the SOBI.D130115.T094047.TXT,SOBI.D130115.T124054.TXT,SOBI.D130115.T162104.TXT,SOBI.D130116.T115728.TXT
        TestHelper.processFileC(env ,file.get(10));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      assertNotNull("The title should not be null",theBill.getTitle());
      assertEquals(theBill.getSponsor().getFullname(),"KLEIN");
     
      TestHelper.processFileC(env ,file.get(2));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      assertNotNull("The title should not be null",theBill.getTitle());
      assertEquals(theBill.getSponsor().getFullname(),"KLEIN");
     
      TestHelper.processFileC(env ,file.get(9));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      assertNotNull("The title should not be null",theBill.getTitle());
      assertEquals(theBill.getSponsor().getFullname(),"KLEIN");
     
      TestHelper.processFileC(env ,file.get(8));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      assertNotNull("The title should not be null",theBill.getTitle());
      assertEquals(theBill.getSponsor().getFullname(),"KLEIN");
     
      }
View Full Code Here



    @Test
     public void verifyWholeBill2011S1462() throws IOException
    {
    Bill theBill;
    TestSetup.initalSetup();
      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

    }

  @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.D120130.T202912.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.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");
      // NO test for SOBI.D110210.T102843.TXT ,SOBI.D110210.T221519.TXT (Memo),SOBI.D110209.T171647.TXT


        // Test for SOBI.D110209.T105617.TXT
     TestHelper.processFileC(env ,file.get(8));
     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(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.D110215.T151615.TXT
        TestHelper.processFileC(env ,file.get(7));
        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(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.T170214.TXT,
        TestHelper.processFileC(env ,file.get(17));
        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(15));
        theBill=(Bill)storage.get("2011/bill/S1462A-2011", Bill.class);
       //assertEquals(theBill.getSameAs(),"A1415A");  ?? Have to check why its failing? Not written in json file ..why?

        // Test for SOBI.D110614.T195743.TXT
        TestHelper.processFileC(env ,file.get(5));
        theBill=(Bill)storage.get("2011/bill/S1462A-2011", Bill.class);
        String[] voteDate=(theBill.getVotes().get(0).getOid()).split("-");
      String date=voteDate[2];
        // Checking vote Date
      assertEquals(date.equals("2011/06/14"),true);
        Vote vote=processExpectedVote2011S1462A();
      boolean flag=VoteTests.voteCheck(theBill,vote);
        assertEquals(flag,true);

     // Test for SOBI.D110614.T185240.TXT
        TestHelper.processFileC(env ,file.get(13));
        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.T192241.TXT
        TestHelper.processFileC(env ,file.get(2));
        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.D120104.T223233.TXT
        TestHelper.processFileC(env ,file.get(6));
        theBill=(Bill)storage.get("2011/bill/S1462A-2011", Bill.class);
        assertEquals(theBill.getSponsor().getFullname(),"LAVALLE");
        assertNotNull("The title should not be null",theBill.getTitle());
       // assertEquals(theBill.getSameAs(),"A1415A");   ( In json file we dont have sameAs in amendment A??



     // Tests for SOBI.D120125.T130337.TXT
        TestHelper.processFileC(env ,file.get(14));
        theBill=(Bill)storage.get("2011/bill/S1462A-2011", Bill.class);
        assertEquals(theBill.getSponsor().getFullname(),"LAVALLE");
        ArrayList<Person> list=(ArrayList<Person>)theBill.getCoSponsors();
        assertEquals(list.get(0).toString(),"DUANE");


        // Tests for SOBI.D120126.T103841.TXT
        TestHelper.processFileC(env ,file.get(4));
        theBill=(Bill)storage.get("2011/bill/S1462A-2011", Bill.class);
        assertEquals(theBill.getSponsor().getFullname(),"LAVALLE");
        ArrayList<Person> list1=(ArrayList<Person>)theBill.getCoSponsors();
        assertEquals(list1.get(0).toString(),"DUANE");
        assertEquals(list1.get(1).toString(),"MONTGOMERY");

    }
View Full Code Here

    }

  @Test
     public void verifyWholeBill2011S1462B() throws IOException  // Testing Amendment B of the bill 2011S1462
    {
    Bill theBill;
    ArrayList<File> file = (ArrayList<File>) TestHelper.getFilesByNameCollection(sobiDirectory,"SOBI.D120130.T151358.TXT",
      "SOBI.D120130.T152900.TXT","SOBI.D120130.T160900.TXT");

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

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

      // Test for SOBI.D120130.T160900.TXT
      TestHelper.processFileC(env ,file.get(2));
      theBill=(Bill)storage.get("2011/bill/S1462B-2011", Bill.class);
      assertEquals(theBill.getSameAs(),"A1415B");

    }
View Full Code Here

    }

  @Test
     public void verifyWholeBill2011S1462C() throws IOException  // Testing Amendment C of the bill 2011S1462
    {
    Bill theBill;
    ArrayList<File> file = (ArrayList<File>) TestHelper.getFilesByNameCollection(sobiDirectory,"SOBI.D120217.T150812.TXT",
          "SOBI.D120217.T145311.TXT","SOBI.D120217.T153313.TXT");

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

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

      // Test for SOBI.D120217.T153313.TXT
      TestHelper.processFileC(env ,file.get(2));
      theBill=(Bill)storage.get("2011/bill/S1462C-2011", Bill.class);
      //assertEquals(theBill.getSameAs(),"A1415C");  No entry in json file
View Full Code Here

    }

  @Test
     public void verifyWholeBill2011S1462D() throws IOException  // Testing Amendment D of the bill 2011S1462
    {
    Bill theBill;
    ArrayList<File> file = (ArrayList<File>) TestHelper.getFilesByNameCollection(sobiDirectory,"SOBI.D120416.T133347.TXT",
           "SOBI.D120416.T150351.TXT","SOBI.D120416.T151351.TXT","SOBI.D120523.T100051.TXT","SOBI.D120530.T161430.TXT",
           "SOBI.D120531.T112447.TXT", "SOBI.D120611.T165600.TXT", "SOBI.D120611.T162600.TXT","SOBI.D120620.T100719.TXT",
           "SOBI.D120706.T151155.TXT","SOBI.D120727.T100847.TXT","SOBI.D120724.T140552.TXT");

      // All the above SOBI files have to be tested for sponsor name and title
      for( File f:file)
      {
          TestHelper.processFileC(env ,f);
            theBill=(Bill)storage.get("2011/bill/S1462D-2011", Bill.class);
            assertEquals(theBill.getSponsor().getFullname(),"LAVALLE");
          assertNotNull("The title should not be null",theBill.getTitle());

      }

      ArrayList<File> vfile = (ArrayList<File>) TestHelper.getFilesByNameCollection(sobiDirectory,"SOBI.D120612.T090338.TXT");
      TestHelper.processFileC(env ,vfile.get(0));
      theBill=(Bill)storage.get("2011/bill/S1462D-2011", Bill.class);

      String[] voteDate=(theBill.getVotes().get(0).getOid()).split("-");
    String date=voteDate[2];
        // Checking vote Date
    assertEquals(date.equals("2012/06/11"),true);
    Vote vote=processExpectedVote2011S1462D();
    boolean flag=VoteTests.voteCheck(theBill,vote);
View Full Code Here

      Storage storage = new Storage(env.getStorageDirectory());
    File[] initialCommit = TestHelper.getFilesByName(sobiDirectory, "SOBI.D120311.T202049.TXT");
      TestHelper.processFile(env, initialCommit);
      File[] finalCommit = TestHelper.getFilesByName(sobiDirectory, "SOBI.D120311.T202549.TXT");
      TestHelper.processFile(env, finalCommit);
      Bill theBill = (Bill)storage.get("2011/bill/S6696-2011", Bill.class);
      assertThat(theBill,nullValue());


  }
View Full Code Here

  }
  @Test
  public void verifyBill2013S2230() 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.D130114.T213149.TXT",
      "SOBI.D130115.T124554.TXT", "SOBI.D130114.T212649.TXT", "SOBI.D130115.T095048.TXT", "SOBI.D130115.T124054.TXT",
      "SOBI.D130115.T093046.TXT", "SOBI.D130116.T122729.TXT", "SOBI.D130114.T225652.TXT", "SOBI.D130114.T233653.TXT",
      "SOBI.D130115.T093547.TXT", "SOBI.D130116.T120230.TXT", "SOBI.D130115.T162604.TXT", "SOBI.D130114.T232653.TXT",
      "SOBI.D130116.T115728.TXT", "SOBI.D130114.T223651.TXT", "SOBI.D130115.T162104.TXT", "SOBI.D130115.T132056.TXT",
      "SOBI.D130115.T094047.TXT", "SOBI.D130115.T101048.TXT");


     // Tests for SOBI.D130114.T213149.TXT
      TestHelper.processFileC(env ,file.get(0));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      assertEquals(theBill.getSameAs(),"A2388");


     // Tests for SOBI.D130114.T212649.TXT
     TestHelper.processFileC(env ,file.get(2));
     theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
     ArrayList<Person> list=(ArrayList<Person>)theBill.getCoSponsors();
     assertEquals(theBill.getSponsor().getFullname(),"KLEIN");
     assertEquals(list.get(0).toString(),"SMITH");

      // Tests for the SOBI.D130114.T223651.TXT
      TestHelper.processFileC(env ,file.get(14));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      //Should have a title:It is left empty (Memo) Dont Care
      //assertNull("The title should not be null",theBill.getTitle());

      // Tests for the SOBI.D130114.T225652.TXT
      TestHelper.processFileC(env ,file.get(7));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      assertNotNull("The title should not be null",theBill.getTitle());
      assertEquals(theBill.getSponsor().getFullname(),"KLEIN");



      // Tests for the SOBI.D130114.T232653.TXT
      TestHelper.processFileC(env ,file.get(12));

      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      assertNotNull("The title should not be null",theBill.getTitle());
      assertEquals(theBill.getSponsor().getFullname(),"KLEIN");

      // Tests for the SOBI.D130114.T233653.TXT
      TestHelper.processFileC(env ,file.get(8));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      boolean var=voteList2013S2230(theBill);
      assertEquals(var,true);


   // Tests for the SOBI.D130115.T93046.TXT
      TestHelper.processFileC(env ,file.get(5));
       theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
       assertEquals(theBill.getLawSection().equalsIgnoreCase("Criminal Procedure Law"),true);


     /*  Nothing to test in SOBI.D130115.T093547.TXT,SOBI.D130115.T095048.TXT,SOBI.D130115.T101048.TXT,
       SOBI.D130115.T124554.TXT, SOBI.D130115.T132056.TXT,SOBI.D130116.T120230.TXT(Memo), SOBI.D130116.T122729.TXT */

     //Tests for the SOBI.D130115.T094047.TXT,SOBI.D130115.T124054.TXT,SOBI.D130115.T162104.TXT,SOBI.D130116.T115728.TXT
        TestHelper.processFileC(env ,file.get(17));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      assertNotNull("The title should not be null",theBill.getTitle());
      assertEquals(theBill.getSponsor().getFullname(),"KLEIN");
      TestHelper.processFileC(env ,file.get(4));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      assertNotNull("The title should not be null",theBill.getTitle());
      assertEquals(theBill.getSponsor().getFullname(),"KLEIN");
      TestHelper.processFileC(env ,file.get(15));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      assertNotNull("The title should not be null",theBill.getTitle());
      assertEquals(theBill.getSponsor().getFullname(),"KLEIN");
      TestHelper.processFileC(env ,file.get(13));
      theBill=(Bill)storage.get("2013/bill/S2230-2013", Bill.class);
      assertNotNull("The title should not be null",theBill.getTitle());
      assertEquals(theBill.getSponsor().getFullname(),"KLEIN");

      }
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.