use of com.google.example.library.v1.Book in project wicket by apache.
the class WicketTesterTest method bookmarkableLink.
/**
* @throws Exception
*/
@Test
void bookmarkableLink() throws Exception {
// for WebPage without default constructor, I define a TestPageSource to
// let the page be instatiated lately.
Book mockBook = new Book("xxId", "xxName");
tester.startPage(new ViewBook(mockBook));
// assertion
tester.assertRenderedPage(ViewBook.class);
tester.clickLink("link");
tester.assertRenderedPage(CreateBook.class);
}
use of com.google.example.library.v1.Book in project wicket by apache.
the class FormTesterTest method before.
/**
*/
@BeforeEach
void before() {
books = new Book[] { new Book("1", "book1"), new Book("2", "book2"), new Book("3", "book3"), new Book("4", "book4") };
choicePage = tester.startPage(new ChoicePage(Arrays.asList(books)));
formTester = tester.newFormTester("choiceForm");
}
use of com.google.example.library.v1.Book in project java_1_sunday_january_2022_online by javagurulv.
the class ArrayOutOfBoundExceptionException method m3.
public static void m3() {
Book book = new Book();
System.out.println("M3");
// ArrayOutOfBoundExceptionExceptionV2.m3();
}
use of com.google.example.library.v1.Book in project java_1_sunday_january_2022_online by javagurulv.
the class ListExample method main.
public static void main(String[] args) {
int[] objects = new int[10];
// List<int>
// int, long, double, float, boolean
Integer numberI = Integer.parseInt("3");
Long nuberL = Long.parseLong("3");
List<Integer> numbers = new ArrayList<>();
List<Integer> numbersv2 = new LinkedList<>();
System.out.println("List length = " + numbers.size());
System.out.println("List isEmpty = " + numbers.isEmpty());
numbers.add(Integer.parseInt("4"));
numbers.add(3);
numbers.add(4);
// -> numbers.add(new Integer(5))
numbers.add(5);
numbers.add(6);
numbers.add(0, 777);
// /numbers.add(3L);
System.out.println("List length = " + numbers.size());
System.out.println("List isEmpty = " + numbers.isEmpty());
numbers.add(777);
numbers.add(777);
numbers.add(777);
for (int i = 0; i < numbers.size(); i++) {
Integer number = numbers.get(i);
System.out.println("Index = " + i + " Element = " + number);
}
for (Integer number : numbers) {
System.out.println("Element for each = " + number);
}
numbers.forEach(System.out::println);
numbers.remove(0);
numbers.remove(Integer.parseInt("5"));
List<Integer> numbersToRemove = new ArrayList<>();
numbersToRemove.add(Integer.parseInt("777"));
numbers.removeAll(numbersToRemove);
System.out.println("After remove:");
numbers.forEach(System.out::println);
List<String> words = new LinkedList<>();
boolean contains3 = numbers.contains(3);
System.out.println("Contains 3 = " + contains3);
List<Book> books = new ArrayList<>();
Book book1 = new Book();
Book book2 = new Book();
Book book3 = new Book();
books.add(book1);
books.add(book2);
books.add(book3);
}
use of com.google.example.library.v1.Book in project java_1_wednesday_2022 by AlexJavaGuru.
the class FindByAuthorUIAction method execute.
@Override
public void execute() {
Scanner scanner = new Scanner(System.in);
System.out.println("Author's name: ");
String authorName = scanner.nextLine();
List<Book> books = bookDatabase.findByAuthor(authorName);
System.out.println(books);
}
Aggregations