Package org.apache.commons.lang3.builder

Examples of org.apache.commons.lang3.builder.MultilineRecursiveToStringStyleTest$Customer


     * @see <a href="http://www.w3.org/International/questions/qa-escapes">Using character escapes in markup and CSS</a>
     * @see <a href="https://issues.apache.org/jira/browse/LANG-728">LANG-728</a>
     */
    @Test
    public void testEscapeXmlSupplementaryCharacters() {
        CharSequenceTranslator escapeXml =
            StringEscapeUtils.ESCAPE_XML.with( NumericEntityEscaper.between(0x7f, Integer.MAX_VALUE) );

        assertEquals("Supplementary character must be represented using a single escape", "&#144308;",
                escapeXml.translate("\uD84C\uDFB4"));
    }
View Full Code Here


        String sql = "SELECT v.proposal_id as proposalId, avg(v.note) as moy, count(v.proposal_id) as nbVote, t.title as proposalTitle FROM vote v, proposal t where (v.proposal_id=t.id) group by v.proposal_id order by moy desc";
        List<SqlRow> rows = Ebean.createSqlQuery(sql).findList();
       
        Map<Long, Pair<Double, Integer>> moyennes = new HashMap<Long, Pair<Double, Integer>>();
        for (SqlRow row : rows) {
            Pair<Double, Integer> moyProposal = new ImmutablePair(row.getDouble("moy"), row.getInteger("nbVote"));
            moyennes.put(row.getLong("proposalId"), moyProposal);
        }
       
        return moyennes;
    }
View Full Code Here

  protected void tearDown() throws Exception {
    super.tearDown();
  }

  public void testCustomer() {
    Customer c = new Customer("David");
    assertNotNull(c)
  }
View Full Code Here

    Customer c = new Customer("David");
    assertNotNull(c)
  }

  public void testAddRental() {
    Customer customer2 = new Customer("Sallie");
    Movie movie1 = new Movie("Gone with the Wind", Movie.REGULAR);
    Rental rental1 = new Rental(movie1, 3); // 3 day rental
    customer2.addRental(rental1);
  }
View Full Code Here

    Rental rental1 = new Rental(movie1, 3); // 3 day rental
    customer2.addRental(rental1);
  }

  public void testGetName() {
    Customer c = new Customer("David");
    assertEquals("David", c.getName());
  }
View Full Code Here

    Customer c = new Customer("David");
    assertEquals("David", c.getName());
  }

  public void testStatementForRegularMovie() {
    Customer customer2 = new Customer("Sallie");
    Movie movie1 = new Movie("Gone with the Wind", Movie.REGULAR);
    Rental rental1 = new Rental(movie1, 3); // 3 day rental
    customer2.addRental(rental1);
    String expected = "Rental Record for Sallie\n" +
              "\tGone with the Wind\t3.5\n" +
              "Amount owed is 3.5\n" +
              "You earned 1 frequent renter points";
    String statement = customer2.statement();
    assertEquals(expected, statement);
  }
View Full Code Here

    String statement = customer2.statement();
    assertEquals(expected, statement);
  }
 
  public void testStatementForNewReleaseMovie() {
    Customer customer2 = new Customer("Sallie");
    Movie movie1 = new Movie("Star Wars", Movie.NEW_RELEASE);
    Rental rental1 = new Rental(movie1, 3); // 3 day rental
    customer2.addRental(rental1);
    String expected = "Rental Record for Sallie\n" +
              "\tStar Wars\t9.0\n" +
              "Amount owed is 9.0\n" +
              "You earned 2 frequent renter points";
    String statement = customer2.statement();
    assertEquals(expected, statement);
  }
View Full Code Here

    String statement = customer2.statement();
    assertEquals(expected, statement);
  }
 
  public void testStatementForChildrensMovie() {
    Customer customer2 = new Customer("Sallie");
    Movie movie1 = new Movie("Madagascar", Movie.CHILDRENS);
    Rental rental1 = new Rental(movie1, 3); // 3 day rental
    customer2.addRental(rental1);
    String expected = "Rental Record for Sallie\n" +
              "\tMadagascar\t1.5\n" +
              "Amount owed is 1.5\n" +
              "You earned 1 frequent renter points";
    String statement = customer2.statement();
    assertEquals(expected, statement);
  }
View Full Code Here

    String statement = customer2.statement();
    assertEquals(expected, statement);
  }
 
  public void testStatementForManyMovies() {
    Customer customer1 = new Customer("David");
    Movie movie1 = new Movie("Madagascar", Movie.CHILDRENS);
    Rental rental1 = new Rental(movie1, 6); // 6 day rental
    Movie movie2 = new Movie("Star Wars", Movie.NEW_RELEASE);
    Rental rental2 = new Rental(movie2, 2); // 2 day rental
    Movie movie3 = new Movie("Gone with the Wind", Movie.REGULAR);
    Rental rental3 = new Rental(movie3, 8); // 8 day rental
    customer1.addRental(rental1);
    customer1.addRental(rental2);
    customer1.addRental(rental3);
    String expected = "Rental Record for David\n" +
              "\tMadagascar\t6.0\n" +
              "\tStar Wars\t6.0\n" +
              "\tGone with the Wind\t11.0\n" +
              "Amount owed is 23.0\n" +
              "You earned 4 frequent renter points";
    String statement = customer1.statement();
    assertEquals(expected, statement);
  }
View Full Code Here

    assertEquals(expected, statement);
  }
  public void testPriceBreak(){
    String name = "Serg";
    String titleMovie = "Terminator";
    Customer customerSerg = new Customer("Serg");
    try{
      Movie movieWithWrongType = new Movie("Terminator", -1);
    }catch (IllegalArgumentException e) {
      assertTrue(true);
   
View Full Code Here

TOP

Related Classes of org.apache.commons.lang3.builder.MultilineRecursiveToStringStyleTest$Customer

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.