Package org.agoncal.book.javaee7.chapter15

Examples of org.agoncal.book.javaee7.chapter15.Book


    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Book b = new Book("Lolity", "james callog", 1998);
        ExtBook eb = new ExtBook("title", "author", 1020, "publisher");
    }
View Full Code Here


      return null;
    }

    public List<Book> findBooks() {
      List<Book> bookList = new ArrayList<>();
      bookList.add(new Book("The Hitchhiker's Guide to the Galaxy", 23.99f, "Science fiction comedy book", 352, Boolean.TRUE));
      bookList.add(new Book("Harry Potter and the Goblet of Fire", 19.79f, "Kids best seller (Book 4)", 734, Boolean.TRUE));
//      bookList.add(new Book("The Elements of Style", 6.64f, "A masterpiece in the art of clear and concise writing.", 105, Boolean.FALSE));
//      bookList.add(new Book("Harry Potter And The Order Of The Phoenix", 9.35f, "Science fiction (Book 1)", 870, Boolean.TRUE));
//      bookList.add(new Book("The Difference Between God and Larry Ellison", 11.99f, "God Doesn't Think He's Larry Ellison", 420, Boolean.FALSE));
//      bookList.add(new Book("The Children of Hurin", 17.16f, "The first complete book by J.R.R. Tolkien in three decades", 313, Boolean.TRUE));
//      bookList.add(new Book("The Da Vinci Code", 17.79f, "Thriller", 454, Boolean.FALSE));
//      bookList.add(new Book("La carte et le territoire", 24.99f, "Prix Goncourt 2010", 428, Boolean.FALSE));
//      bookList.add(new Book("Une forme de vie", 18.99f, "Amelie Nothomb", 168, Boolean.FALSE));
//      bookList.add(new Book("To Kill a Mockingbird", 5.99f, "American classic", 281, Boolean.FALSE));
//      bookList.add(new Book("Fahrenheit 451", 7.99f, "Science fiction", 208, Boolean.FALSE));
//      bookList.add(new Book("Lolita", 14.99f, "Nabovok masterpiece", 368, Boolean.TRUE));
//      bookList.add(new Book("A Midsummer Night's Dream", 14.99f, "Shakespeare masterpiece", 288, Boolean.TRUE));
//      bookList.add(new Book("I bastioni del coraggio", 18.99f, "Anno domini 1548. Una grande storia d'amore, ...", 457, Boolean.FALSE));
//      bookList.add(new Book("Harjunpaa ja pahan pappi", 32.49f, "Finns read crime novels", 300, Boolean.FALSE));
//      bookList.add(new Book("El ingenioso hidalgo don Quijote de la Mancha", 13.99f, "Classical Don Quijote", 108, Boolean.TRUE));
//      bookList.add(new Book("The Lord of the Rings", 50.4f, "Science fiction comedy book", 1216, Boolean.TRUE));
      bookList.add(new Book("Java EE 6 with GlassFish 3", 31.49f, "Just amazing", 458, Boolean.TRUE));
//      bookList.add(new Book("Heidis Lehr- und Wanderjahre", 68f, "Inhalt: Die Heidi-Bucher erzahlen...", 160, Boolean.TRUE));
//      bookList.add(new Book("l Nome della Rosa", 34.99f, "Science fiction comedy book", 354, Boolean.FALSE));
      return bookList;
    }
View Full Code Here

      return null;
    }

    public List<Book> findBooks() {
      List<Book> bookList = new ArrayList<>();
      bookList.add(new Book("The Hitchhiker's Guide to the Galaxy", 23.99f, "Science fiction comedy book", 352, Boolean.TRUE));
      bookList.add(new Book("Harry Potter and the Goblet of Fire", 19.79f, "Kids best seller (Book 4)", 734, Boolean.TRUE));
//      bookList.add(new Book("The Elements of Style", 6.64f, "A masterpiece in the art of clear and concise writing.", 105, Boolean.FALSE));
//      bookList.add(new Book("Harry Potter And The Order Of The Phoenix", 9.35f, "Science fiction (Book 1)", 870, Boolean.TRUE));
//      bookList.add(new Book("The Difference Between God and Larry Ellison", 11.99f, "God Doesn't Think He's Larry Ellison", 420, Boolean.FALSE));
//      bookList.add(new Book("The Children of Hurin", 17.16f, "The first complete book by J.R.R. Tolkien in three decades", 313, Boolean.TRUE));
//      bookList.add(new Book("The Da Vinci Code", 17.79f, "Thriller", 454, Boolean.FALSE));
//      bookList.add(new Book("La carte et le territoire", 24.99f, "Prix Goncourt 2010", 428, Boolean.FALSE));
//      bookList.add(new Book("Une forme de vie", 18.99f, "Amelie Nothomb", 168, Boolean.FALSE));
//      bookList.add(new Book("To Kill a Mockingbird", 5.99f, "American classic", 281, Boolean.FALSE));
//      bookList.add(new Book("Fahrenheit 451", 7.99f, "Science fiction", 208, Boolean.FALSE));
//      bookList.add(new Book("Lolita", 14.99f, "Nabovok masterpiece", 368, Boolean.TRUE));
//      bookList.add(new Book("A Midsummer Night's Dream", 14.99f, "Shakespeare masterpiece", 288, Boolean.TRUE));
//      bookList.add(new Book("I bastioni del coraggio", 18.99f, "Anno domini 1548. Una grande storia d'amore, ...", 457, Boolean.FALSE));
//      bookList.add(new Book("Harjunpaa ja pahan pappi", 32.49f, "Finns read crime novels", 300, Boolean.FALSE));
//      bookList.add(new Book("El ingenioso hidalgo don Quijote de la Mancha", 13.99f, "Classical Don Quijote", 108, Boolean.TRUE));
//      bookList.add(new Book("The Lord of the Rings", 50.4f, "Science fiction comedy book", 1216, Boolean.TRUE));
      bookList.add(new Book("Java EE 6 with GlassFish 3", 31.49f, "Just amazing", 458, Boolean.TRUE));
//      bookList.add(new Book("Heidis Lehr- und Wanderjahre", 68f, "Inhalt: Die Heidi-Bucher erzahlen...", 160, Boolean.TRUE));
//      bookList.add(new Book("l Nome della Rosa", 34.99f, "Science fiction comedy book", 354, Boolean.FALSE));
      return bookList;
    }
View Full Code Here

  // =          Lifecycle methods         =
  // ======================================

  @PostConstruct
  private void init() {
    defaultBook = new Book("default title", 0F, "default descritpion", "0000-000", 100, true);
  }
View Full Code Here

      return null;
    }

    public List<Book> findBooks() {
      List<Book> bookList = new ArrayList<>();
      bookList.add(new Book("The Hitchhiker's Guide to the Galaxy", 23.99f, "Science fiction comedy book", 352, Boolean.TRUE));
      bookList.add(new Book("Harry Potter and the Goblet of Fire", 19.79f, "Kids best seller (Book 4)", 734, Boolean.TRUE));
//      bookList.add(new Book("The Elements of Style", 6.64f, "A masterpiece in the art of clear and concise writing.", 105, Boolean.FALSE));
//      bookList.add(new Book("Harry Potter And The Order Of The Phoenix", 9.35f, "Science fiction (Book 1)", 870, Boolean.TRUE));
//      bookList.add(new Book("The Difference Between God and Larry Ellison", 11.99f, "God Doesn't Think He's Larry Ellison", 420, Boolean.FALSE));
//      bookList.add(new Book("The Children of Hurin", 17.16f, "The first complete book by J.R.R. Tolkien in three decades", 313, Boolean.TRUE));
//      bookList.add(new Book("The Da Vinci Code", 17.79f, "Thriller", 454, Boolean.FALSE));
//      bookList.add(new Book("La carte et le territoire", 24.99f, "Prix Goncourt 2010", 428, Boolean.FALSE));
//      bookList.add(new Book("Une forme de vie", 18.99f, "Amelie Nothomb", 168, Boolean.FALSE));
//      bookList.add(new Book("To Kill a Mockingbird", 5.99f, "American classic", 281, Boolean.FALSE));
//      bookList.add(new Book("Fahrenheit 451", 7.99f, "Science fiction", 208, Boolean.FALSE));
//      bookList.add(new Book("Lolita", 14.99f, "Nabovok masterpiece", 368, Boolean.TRUE));
//      bookList.add(new Book("A Midsummer Night's Dream", 14.99f, "Shakespeare masterpiece", 288, Boolean.TRUE));
//      bookList.add(new Book("I bastioni del coraggio", 18.99f, "Anno domini 1548. Una grande storia d'amore, ...", 457, Boolean.FALSE));
//      bookList.add(new Book("Harjunpaa ja pahan pappi", 32.49f, "Finns read crime novels", 300, Boolean.FALSE));
//      bookList.add(new Book("El ingenioso hidalgo don Quijote de la Mancha", 13.99f, "Classical Don Quijote", 108, Boolean.TRUE));
//      bookList.add(new Book("The Lord of the Rings", 50.4f, "Science fiction comedy book", 1216, Boolean.TRUE));
      bookList.add(new Book("Java EE 6 with GlassFish 3", 31.49f, "Just amazing", 458, Boolean.TRUE));
//      bookList.add(new Book("Heidis Lehr- und Wanderjahre", 68f, "Inhalt: Die Heidi-Bucher erzahlen...", 160, Boolean.TRUE));
//      bookList.add(new Book("l Nome della Rosa", 34.99f, "Science fiction comedy book", 354, Boolean.FALSE));
      return bookList;
    }
View Full Code Here

      return null;
    }

    public List<Book> findBooks() {
      List<Book> bookList = new ArrayList<>();
      bookList.add(new Book("The Hitchhiker's Guide to the Galaxy", 23.99f, "Science fiction comedy book", 352, Boolean.TRUE));
      bookList.add(new Book("Harry Potter and the Goblet of Fire", 19.79f, "Kids best seller (Book 4)", 734, Boolean.TRUE));
//      bookList.add(new Book("The Elements of Style", 6.64f, "A masterpiece in the art of clear and concise writing.", 105, Boolean.FALSE));
//      bookList.add(new Book("Harry Potter And The Order Of The Phoenix", 9.35f, "Science fiction (Book 1)", 870, Boolean.TRUE));
//      bookList.add(new Book("The Difference Between God and Larry Ellison", 11.99f, "God Doesn't Think He's Larry Ellison", 420, Boolean.FALSE));
//      bookList.add(new Book("The Children of Hurin", 17.16f, "The first complete book by J.R.R. Tolkien in three decades", 313, Boolean.TRUE));
//      bookList.add(new Book("The Da Vinci Code", 17.79f, "Thriller", 454, Boolean.FALSE));
//      bookList.add(new Book("La carte et le territoire", 24.99f, "Prix Goncourt 2010", 428, Boolean.FALSE));
//      bookList.add(new Book("Une forme de vie", 18.99f, "Amelie Nothomb", 168, Boolean.FALSE));
//      bookList.add(new Book("To Kill a Mockingbird", 5.99f, "American classic", 281, Boolean.FALSE));
//      bookList.add(new Book("Fahrenheit 451", 7.99f, "Science fiction", 208, Boolean.FALSE));
//      bookList.add(new Book("Lolita", 14.99f, "Nabovok masterpiece", 368, Boolean.TRUE));
//      bookList.add(new Book("A Midsummer Night's Dream", 14.99f, "Shakespeare masterpiece", 288, Boolean.TRUE));
//      bookList.add(new Book("I bastioni del coraggio", 18.99f, "Anno domini 1548. Una grande storia d'amore, ...", 457, Boolean.FALSE));
//      bookList.add(new Book("Harjunpaa ja pahan pappi", 32.49f, "Finns read crime novels", 300, Boolean.FALSE));
//      bookList.add(new Book("El ingenioso hidalgo don Quijote de la Mancha", 13.99f, "Classical Don Quijote", 108, Boolean.TRUE));
//      bookList.add(new Book("The Lord of the Rings", 50.4f, "Science fiction comedy book", 1216, Boolean.TRUE));
      bookList.add(new Book("Java EE 6 with GlassFish 3", 31.49f, "Just amazing", 458, Boolean.TRUE));
//      bookList.add(new Book("Heidis Lehr- und Wanderjahre", 68f, "Inhalt: Die Heidi-Bucher erzahlen...", 160, Boolean.TRUE));
//      bookList.add(new Book("l Nome della Rosa", 34.99f, "Science fiction comedy book", 354, Boolean.FALSE));
      return bookList;
    }
View Full Code Here

  // =           Public Methods           =
  // ======================================

  @GET
  public String getAsPlainText() {
    return new Customer11("John", "Smith", "jsmith@gmail.com", "1234565").toString();
  }
View Full Code Here

  // =              Unit tests            =
  // ======================================

  @Test
  public void shouldMarshallACustomer() throws JAXBException {
    Customer13 customer = new Customer13("John", "Smith", "jsmith@gmail.com", "1334565");
    StringWriter writer = new StringWriter();
    JAXBContext context = JAXBContext.newInstance(Customer13.class);
    Marshaller m = context.createMarshaller();
    m.marshal(customer, writer);
  }
View Full Code Here

  }

  @Test
  public void shouldMarshallAListOfCustomers() throws JAXBException {
    Customers13 customers = new Customers13();
    customers.add(new Customer13("John", "Smith", "jsmith@gmail.com", "1334565"));
    customers.add(new Customer13("John", "Smith", "jsmith@gmail.com", "1334565"));
    StringWriter writer = new StringWriter();
    JAXBContext context = JAXBContext.newInstance(Customers13.class);
    Marshaller m = context.createMarshaller();
    m.marshal(customers, writer);
  }
View Full Code Here

    assertEquals(404, response.getStatus());
  }

  @Test
  public void shouldCreateACustomerWithURIBuilderFromUri() {
    Response response = client.target("http://localhost:8282/13/customer/fromUri").request().post(Entity.entity(new Customer13("John", "Smith", "jsmith@gmail.com", "1334565"), MediaType.APPLICATION_XML));
    assertEquals(201, response.getStatus());
    assertEquals("http://localhost:8282/13/customer/1334", response.getLocation().toString());
  }
View Full Code Here

TOP

Related Classes of org.agoncal.book.javaee7.chapter15.Book

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.