Search in sources :

Example 26 with Book

use of com.google.example.library.v1.Book in project java_1_wednesday_2022 by AlexJavaGuru.

the class FindByTitleUIAction method execute.

@Override
public void execute() {
    Scanner scanner = new Scanner(System.in);
    System.out.println("Book's title: ");
    String title = scanner.nextLine();
    scanner.close();
    List<Book> books = bookDatabase.findByTitle(title);
    System.out.println(books);
}
Also used : Scanner(java.util.Scanner) Book(student_arturs_melnikovs.lesson_10.level_02.Book)

Example 27 with Book

use of com.google.example.library.v1.Book in project java_1_wednesday_2022 by AlexJavaGuru.

the class SearchCriteriaTest method testAuthorCriteria2.

private void testAuthorCriteria2() {
    SearchCriteria searchCriteria = new AuthorSearchCriteria("1");
    Book book = new Book("2", "1");
    checkResult(!searchCriteria.test(book));
}
Also used : Book(student_arturs_melnikovs.lesson_10.level_02.Book)

Example 28 with Book

use of com.google.example.library.v1.Book in project java_1_wednesday_2022 by AlexJavaGuru.

the class SearchCriteriaTest method testTitleCriteria1.

private void testTitleCriteria1() {
    SearchCriteria searchCriteria = new TitleSearchCriteria("1");
    Book book = new Book("1", "1");
    checkResult(searchCriteria.test(book));
}
Also used : Book(student_arturs_melnikovs.lesson_10.level_02.Book)

Example 29 with Book

use of com.google.example.library.v1.Book in project java_1_wednesday_2022 by AlexJavaGuru.

the class SearchCriteriaTest method testYearCriteria1.

private void testYearCriteria1() {
    SearchCriteria searchCriteria = new YearOfIssueSearchCriteria("2000");
    Book book = new Book("1", "1", "2000");
    checkResult(searchCriteria.test(book));
}
Also used : Book(student_arturs_melnikovs.lesson_10.level_02.Book)

Example 30 with Book

use of com.google.example.library.v1.Book in project java_1_wednesday_2022 by AlexJavaGuru.

the class SearchCriteriaTest method testTitleCriteria2.

private void testTitleCriteria2() {
    SearchCriteria searchCriteria = new TitleSearchCriteria("1");
    Book book = new Book("1", "2");
    checkResult(!searchCriteria.test(book));
}
Also used : Book(student_arturs_melnikovs.lesson_10.level_02.Book)

Aggregations

Book (com.google.example.library.v1.Book)33 Test (org.junit.Test)25 LibraryServiceClient (com.google.cloud.example.library.v1.LibraryServiceClient)22 Book (student_arturs_melnikovs.lesson_10.level_02.Book)16 BookName (com.google.example.library.v1.BookName)12 AbstractMessage (com.google.protobuf.AbstractMessage)12 ShelfName (com.google.example.library.v1.ShelfName)9 InvalidArgumentException (com.google.api.gax.rpc.InvalidArgumentException)7 StatusRuntimeException (io.grpc.StatusRuntimeException)7 MoveBookRequest (com.google.example.library.v1.MoveBookRequest)6 DeleteBookRequest (com.google.example.library.v1.DeleteBookRequest)5 Scanner (java.util.Scanner)5 CreateBookRequest (com.google.example.library.v1.CreateBookRequest)4 GetBookRequest (com.google.example.library.v1.GetBookRequest)4 Page (org.apache.wicket.Page)4 Book (org.apache.wicket.core.util.tester.apps_1.Book)4 WebPage (org.apache.wicket.markup.html.WebPage)4 AccessDeniedPage (org.apache.wicket.markup.html.pages.AccessDeniedPage)4 DummyPage (org.apache.wicket.resource.DummyPage)4 Book (org.apache.wicket.util.tester.apps_1.Book)4