diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f067238..18c4d59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,20 +26,6 @@ jobs: run: | cd code mvn --batch-mode install - - name: Test Demo - run: | - cd demo - mvn --batch-mode test - services: - mariadb: - image: mariadb - ports: - - 3307:3306 - env: - MARIADB_DATABASE: jacuzzi - MARIADB_USER: jacuzzi - MARIADB_PASSWORD: jacuzzi - MARIADB_RANDOM_ROOT_PASSWORD: true deploy: if: github.ref == 'refs/heads/master' && github.repository_owner == 'Codeforces' needs: test @@ -56,4 +42,4 @@ jobs: - name: Deploy run: | cd code - mvn --batch-mode deploy -DskipTests + mvn --batch-mode deploy diff --git a/code/pom.xml b/code/pom.xml index 354bb78..01c36ad 100644 --- a/code/pom.xml +++ b/code/pom.xml @@ -1,31 +1,31 @@ - - - Jacuzzi works around java.sql.Connection and it is all you need to provide. - Jacuzzi don't use any configuration files and uses just a few annotations. - It doesn't take care about abstract cross-database query language, use native - SQL to write queries. It provides you easy way to write specific DAOs. - - 2009 - 4.0.0 - jacuzzi - jacuzzi - 0.1.0-SNAPSHOT - jar - jacuzzi - https://github.com/Codeforces/jacuzzi - - - MikeMirzayanov - Mike Mirzayanov - mirzayanovmr@gmail.com - - owner, author - - +3 - - - + + + Jacuzzi works around java.sql.Connection and it is all you need to provide. + Jacuzzi don't use any configuration files and uses just a few annotations. + It doesn't take care about abstract cross-database query language, use native + SQL to write queries. It provides you easy way to write specific DAOs. + + 2009 + 4.0.0 + jacuzzi + jacuzzi + 0.1.0-SNAPSHOT + jar + jacuzzi + https://github.com/Codeforces/jacuzzi + + + MikeMirzayanov + Mike Mirzayanov + mirzayanovmr@gmail.com + + owner, author + + +3 + + + github @@ -33,166 +33,165 @@ https://maven.pkg.github.com/Codeforces/jacuzzi - - GitHub Issues - https://github.com/Codeforces/jacuzzi/issues - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - https://github.com/Codeforces/jacuzzi - scm:git:git://github.com/Codeforces/jacuzzi.git - scm:git:git@github.com:Codeforces/jacuzzi.git - - - UTF-8 - - - - - org.apache.maven.plugins - maven-repository-plugin - 2.4 - - - org.codehaus.plexus - plexus-archiver - 4.2.5 - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 1.8 - 1.8 - UTF-8 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.3.1 - - -Xdoclint:none - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.2 - - -Dfile.encoding=UTF-8 - -Xmx1200M - - - - - - org.basepom.maven - duplicate-finder-maven-plugin - 1.5.0 - - - default - verify - - check - - - - - false - false - true - true - true - false - false - false - false - true - - - false - sun.boot.class.path - - - - - false - - - - - - - - log4j - log4j - 1.2.17 - - - org.apache.commons - commons-lang3 - 3.12.0 - - - cglib - cglib - 3.3.0 - - - org.ow2.asm - asm - 9.2 - - - org.ow2.asm - asm-tree - 9.2 - - - org.ow2.asm - asm-analysis - 9.2 - - - org.ow2.asm - asm-util - 9.2 - - - junit - junit - 4.13.2 - test - - - org.hsqldb - hsqldb - 2.5.2 - test - - - com.mchange - c3p0 - 0.9.5.5 - - - com.google.code.findbugs - annotations - 3.0.1u2 - compile - - - + + GitHub Issues + https://github.com/Codeforces/jacuzzi/issues + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + https://github.com/Codeforces/jacuzzi + scm:git:git://github.com/Codeforces/jacuzzi.git + scm:git:git@github.com:Codeforces/jacuzzi.git + + + UTF-8 + + + + + org.apache.maven.plugins + maven-repository-plugin + 2.4 + + + org.codehaus.plexus + plexus-archiver + 4.2.5 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.3.1 + + -Xdoclint:none + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + -Dfile.encoding=UTF-8 + -Xmx1200M + + + + + + org.basepom.maven + duplicate-finder-maven-plugin + 1.5.0 + + + default + verify + + check + + + + + false + false + true + true + true + false + false + false + false + true + + + false + sun.boot.class.path + + + + + false + + + + + + + + log4j + log4j + 1.2.17 + + + org.apache.commons + commons-lang3 + 3.12.0 + + + cglib + cglib + 3.3.0 + + + org.ow2.asm + asm + 9.2 + + + org.ow2.asm + asm-tree + 9.2 + + + org.ow2.asm + asm-analysis + 9.2 + + + org.ow2.asm + asm-util + 9.2 + + + junit + junit + 4.13.2 + test + + + org.hsqldb + hsqldb + 2.5.2 + test + + + com.mchange + c3p0 + 0.9.5.5 + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + diff --git a/demo/pom.xml b/demo/pom.xml deleted file mode 100644 index 9fe4690..0000000 --- a/demo/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - 4.0.0 - jacuzzi - jacuzzi-demo - jar - 0.0.28-SNAPSHOT - jacuzzi-demo - http://code.google.com/p/jacuzzi - - - The GNU General Public License, Version 2 - http://www.gnu.org/licenses/gpl.txt - repo - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.0.2 - - 1.8 - 1.8 - - - - - - - jacuzzi - jacuzzi - 0.1.0-SNAPSHOT - test - - - junit - junit - 3.8.1 - test - - - mysql - mysql-connector-java - 5.1.27 - - - diff --git a/demo/src/test/java/com/jacuzzi/test/JacuzziTest.java b/demo/src/test/java/com/jacuzzi/test/JacuzziTest.java deleted file mode 100644 index d153535..0000000 --- a/demo/src/test/java/com/jacuzzi/test/JacuzziTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright by Mike Mirzayanov. */ - -package com.jacuzzi.test; - -import junit.framework.TestCase; -import com.jacuzzi.test.dao.UserDao; -import com.jacuzzi.test.model.User; - -/** @author Mike Mirzayanov */ -public class JacuzziTest extends TestCase { - private UserDao userDao; - private static final int ITERATION_COUNT = 20; - - protected void setUp() { - userDao = new UserDao(); - userDao.createStorage(); - } - - protected void tearDown() { - userDao.deleteStorage(); - } - - public void testInitialization() { - // No operations. - } - - public void testInsertAndFind() { - User user = new User(); - user.setLogin("jacuzzi"); - userDao.insert(user); - assertEquals(1, userDao.findBy("login=?", "jacuzzi").size()); - } - - public void testManyInsertsAndFinds() { - for (int i = 0; i < ITERATION_COUNT; i++) { - User user = new User(); - user.setLogin("jacuzzi" + i); - userDao.insert(user); - assertEquals(1, userDao.findBy("login=?", "jacuzzi" + i).size()); - } - for (int i = 0; i < ITERATION_COUNT; i++) { - User user = new User(); - user.setLogin("jacuzzi"); - userDao.insert(user); - assertEquals(i + 1, userDao.findBy("login=?", "jacuzzi").size()); - } - } - - public void testTransaction() { - userDao.returnJacuzzi().beginTransaction(); - - for (int i = 0; i < ITERATION_COUNT; i++) { - User user = new User(); - user.setLogin("jacuzzi"); - userDao.insert(user); - } - - userDao.returnJacuzzi().commit(); - assertEquals(ITERATION_COUNT, userDao.findBy("login=?", "jacuzzi").size()); - - userDao.returnJacuzzi().beginTransaction(); - - for (int i = 0; i < ITERATION_COUNT; i++) { - User user = new User(); - user.setLogin("jacuzzi"); - userDao.insert(user); - } - - userDao.returnJacuzzi().rollback(); - assertEquals(ITERATION_COUNT, userDao.findBy("login=?", "jacuzzi").size()); - } -} diff --git a/demo/src/test/java/com/jacuzzi/test/dao/UserDao.java b/demo/src/test/java/com/jacuzzi/test/dao/UserDao.java deleted file mode 100644 index 26898e1..0000000 --- a/demo/src/test/java/com/jacuzzi/test/dao/UserDao.java +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright by Mike Mirzayanov. */ - -package com.jacuzzi.test.dao; - -import org.jacuzzi.core.GenericDaoImpl; -import org.jacuzzi.core.Jacuzzi; - -import javax.sql.DataSource; - -import com.jacuzzi.test.model.User; -import com.mysql.jdbc.jdbc2.optional.MysqlDataSource; - -/** @author Mike Mirzayanov */ -public class UserDao extends GenericDaoImpl { - public static final String CREATE_USER_TABLE_SQL = "CREATE TABLE User (" + - "id BIGINT NOT NULL AUTO_INCREMENT, " + - "login VARCHAR( 255 ) NOT NULL, " + - "PRIMARY KEY (id)" + - ") ENGINE = InnoDB CHARACTER SET = utf8"; - - private static final String DELETE_USER_TABLE_SQL = "DROP TABLE User"; - - public UserDao() { - super(newDataSource()); - } - - private static DataSource newDataSource() { - MysqlDataSource dataSource = new MysqlDataSource(); - dataSource.setURL("jdbc:mysql://localhost:3307/jacuzzi?useUnicode=true&characterSetResults=UTF-8&characterEncoding=UTF-8"); - dataSource.setUser("jacuzzi"); - dataSource.setPassword("jacuzzi"); - return dataSource; - } - - public void createStorage() { - getJacuzzi().execute(CREATE_USER_TABLE_SQL); - } - - public void deleteStorage() { - getJacuzzi().execute(DELETE_USER_TABLE_SQL); - } - - public Jacuzzi returnJacuzzi() { - return getJacuzzi(); - } - - static { - try { - Class.forName("com.mysql.jdbc.Driver"); - } catch (ClassNotFoundException e) { - throw new RuntimeException(e); - } - } -} diff --git a/demo/src/test/java/com/jacuzzi/test/model/User.java b/demo/src/test/java/com/jacuzzi/test/model/User.java deleted file mode 100644 index 53aa732..0000000 --- a/demo/src/test/java/com/jacuzzi/test/model/User.java +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright by Mike Mirzayanov. */ - -package com.jacuzzi.test.model; - -import org.jacuzzi.mapping.Id; - -/** @author Mike Mirzayanov */ -public class User { - @Id - private long id; - private String login; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getLogin() { - return login; - } - - public void setLogin(String login) { - this.login = login; - } -}