From cac9d5b8294cd975ed3139bbee1330df7d91d9c6 Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Wed, 30 Nov 2022 16:55:18 +0100 Subject: Change package --- .../commons/page/PageAdapterUnitTest.java | 62 ---------------------- .../util/page/PageAdapterUnitTest.java | 62 ++++++++++++++++++++++ 2 files changed, 62 insertions(+), 62 deletions(-) delete mode 100644 src/test/java/it/alessandroiezzi/commons/page/PageAdapterUnitTest.java create mode 100644 src/test/java/it/alessandroiezzi/util/page/PageAdapterUnitTest.java diff --git a/src/test/java/it/alessandroiezzi/commons/page/PageAdapterUnitTest.java b/src/test/java/it/alessandroiezzi/commons/page/PageAdapterUnitTest.java deleted file mode 100644 index fced04a..0000000 --- a/src/test/java/it/alessandroiezzi/commons/page/PageAdapterUnitTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2022 Alessandro Iezzi - * - * This file is part of commons-page. - * - * commons-page is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * commons-page is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with commons-page. If not, see . - */ - -package it.alessandroiezzi.commons.page; - -import it.alessandroiezzi.util.page.*; -import org.junit.*; - -import java.util.*; - -import static org.junit.Assert.*; - -public class PageAdapterUnitTest { - @Test - public void test() { - int max = 48; - List integers = new ArrayList<>(); - for (int i = 1; i < max; i++) { - integers.add(i); - } - Pages pages = new PageAdapter<>(integers); - assertEquals(4, pages.getTotalPages()); - - int i = 0; - for (Integer integer : pages.firstPage().getContent()) { - assertEquals(++i, (int) integer); - } - assertEquals(i, 15); - - for (Integer integer : pages.lastPage().getContent()) { -// System.out.println(integer); - } - - for (int j = max; j < max + 13; j++) { - pages.addElement(j); - } - pages.removeElementIf((e) -> e > 0 && e < 58); - for (Integer integer : pages.lastPage().getContent()) { - System.out.println(integer); - } - System.out.println(); - for (Integer integer : pages.firstPage().getContent()) { - System.out.println(integer); - } - } -} \ No newline at end of file diff --git a/src/test/java/it/alessandroiezzi/util/page/PageAdapterUnitTest.java b/src/test/java/it/alessandroiezzi/util/page/PageAdapterUnitTest.java new file mode 100644 index 0000000..33f185a --- /dev/null +++ b/src/test/java/it/alessandroiezzi/util/page/PageAdapterUnitTest.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2022 Alessandro Iezzi + * + * This file is part of commons-page. + * + * commons-page is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * commons-page is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with commons-page. If not, see . + */ + +package it.alessandroiezzi.util.page; + +import it.alessandroiezzi.util.page.*; +import org.junit.*; + +import java.util.*; + +import static org.junit.Assert.*; + +public class PageAdapterUnitTest { + @Test + public void test() { + int max = 48; + List integers = new ArrayList<>(); + for (int i = 1; i < max; i++) { + integers.add(i); + } + Pages pages = new PageAdapter<>(integers); + assertEquals(4, pages.getTotalPages()); + + int i = 0; + for (Integer integer : pages.firstPage().getContent()) { + assertEquals(++i, (int) integer); + } + assertEquals(i, 15); + + for (Integer integer : pages.lastPage().getContent()) { +// System.out.println(integer); + } + + for (int j = max; j < max + 13; j++) { + pages.addElement(j); + } + pages.removeElementIf((e) -> e > 0 && e < 58); + for (Integer integer : pages.lastPage().getContent()) { + System.out.println(integer); + } + System.out.println(); + for (Integer integer : pages.firstPage().getContent()) { + System.out.println(integer); + } + } +} \ No newline at end of file -- cgit v1.2.3