Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .0pdd.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# Copyright (c) 2012-2025, jcabi.com
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met: 1) Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer. 2) Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution. 3) Neither the name of the jcabi.com nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
# NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
---
errors:
- [email protected]
# alerts:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mvn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ jobs:
${{ runner.os }}-jdk-${{ matrix.java }}-maven-
- run: java -version
- run: mvn -version
- run: sudo apt-get install --yes libnuma1 libaio1
- run: sudo apt-get install --yes libnuma1 libaio1 || true
if: matrix.os == 'ubuntu-24.04'
- run: mvn --errors --batch-mode clean install -Pqulice
29 changes: 29 additions & 0 deletions .rultor.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# Copyright (c) 2012-2025, jcabi.com
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met: 1) Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer. 2) Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution. 3) Neither the name of the jcabi.com nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
# NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
---
docker:
image: yegor256/rultor-image:1.20.0
assets:
Expand All @@ -12,6 +40,7 @@ merge:
mvn clean install -Pqulice --errors --batch-mode
release:
pre: false
# yamllint disable rule:line-length
script: |-
[[ "${tag}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit -1
mvn versions:set "-DnewVersion=${tag}" --batch-mode
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
<plugin>
<groupId>com.qulice</groupId>
<artifactId>qulice-maven-plugin</artifactId>
<version>0.22.0</version>
<version>0.23.0</version>
<configuration>
<excludes>
<exclude>findbugs:.*</exclude>
Expand Down
27 changes: 27 additions & 0 deletions src/it/basic-usage/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
# Copyright (c) 2012-2025, jcabi.com
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met: 1) Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer. 2) Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution. 3) Neither the name of the jcabi.com nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
# NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
invoker.goals = install
27 changes: 27 additions & 0 deletions src/it/parallel/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
# Copyright (c) 2012-2025, jcabi.com
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met: 1) Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer. 2) Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution. 3) Neither the name of the jcabi.com nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
# NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
invoker.goals = install
27 changes: 27 additions & 0 deletions src/it/skip/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
# Copyright (c) 2012-2025, jcabi.com
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met: 1) Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer. 2) Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution. 3) Neither the name of the jcabi.com nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
# NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
invoker.goals = install
27 changes: 27 additions & 0 deletions src/it/with-options/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
# Copyright (c) 2012-2025, jcabi.com
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met: 1) Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer. 2) Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution. 3) Neither the name of the jcabi.com nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
# NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
invoker.goals = install
50 changes: 25 additions & 25 deletions src/main/java/com/jcabi/mysql/maven/plugin/Instances.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
* Running instances of MySQL.
*
* <p>The class is thread-safe.
* @since 0.1
* @checkstyle ClassDataAbstractionCoupling (500 lines)
* @checkstyle MultipleStringLiterals (500 lines)
* @since 0.1
*/
@ToString
@EqualsAndHashCode(of = "processes")
Expand Down Expand Up @@ -391,35 +391,35 @@ private void configure(@NotNull final Config config,
String.format("--password=%s", Instances.DEFAULT_PASSWORD),
String.format("--socket=%s", socket)
).start();
final PrintWriter writer = new PrintWriter(
try (PrintWriter writer = new PrintWriter(
new OutputStreamWriter(
process.getOutputStream(),
StandardCharsets.UTF_8
)
);
writer.print("CREATE DATABASE ");
writer.print(config.dbname());
writer.println(";");
if (!Instances.DEFAULT_USER.equals(config.user())) {
writer.println(
String.format(
"CREATE USER '%s'@'%s' IDENTIFIED BY '%s';",
config.user(),
Instances.DEFAULT_HOST,
config.password()
)
);
writer.println(
String.format(
"GRANT ALL ON %s.* TO '%s'@'%s';",
config.dbname(),
config.user(),
Instances.DEFAULT_HOST
)
);
writer.println("SHOW DATABASES;");
)) {
writer.print("CREATE DATABASE ");
writer.print(config.dbname());
writer.println(";");
if (!Instances.DEFAULT_USER.equals(config.user())) {
writer.println(
String.format(
"CREATE USER '%s'@'%s' IDENTIFIED BY '%s';",
config.user(),
Instances.DEFAULT_HOST,
config.password()
)
);
writer.println(
String.format(
"GRANT ALL ON %s.* TO '%s'@'%s';",
config.dbname(),
config.user(),
Instances.DEFAULT_HOST
)
);
writer.println("SHOW DATABASES;");
}
}
writer.close();
new VerboseProcess(process).stdout();
Logger.info(
this,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ void detectsCurrentPlatform() throws Exception {
mojo.setClassifier(name);
mojo.execute();
MatcherAssert.assertThat(
"should be true",
props.getProperty(name).matches("[a-z]+-[a-z0-9_]+"),
Matchers.is(true)
);
Expand Down
12 changes: 8 additions & 4 deletions src/test/java/com/jcabi/mysql/maven/plugin/InstancesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@
import java.util.concurrent.TimeUnit;
import javax.sql.DataSource;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

/**
* Test case for {@link Instances}.
* @since 0.6
* @checkstyle ClassDataAbstractionCoupling (500 lines)
* @checkstyle MultipleStringLiterals (500 lines)
* @since 0.6
*/
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
final class InstancesTest {
Expand Down Expand Up @@ -347,7 +348,8 @@ void willCreateDatabaseEvenWithoutClear() throws Exception {
);
MatcherAssert.assertThat(
"Instance reusedExistingDatabase should be false.",
!instances.reusedExistingDatabase()
!instances.reusedExistingDatabase(),
Matchers.is(true)
);
final DataSource source = new UrlSource(
String.format(
Expand Down Expand Up @@ -399,7 +401,8 @@ void canReuseExistingDatabse() throws Exception {
);
MatcherAssert.assertThat(
"Instance reusedExistingDatabase should be false.",
!instances.reusedExistingDatabase()
!instances.reusedExistingDatabase(),
Matchers.is(true)
);
final DataSource source = new UrlSource(
String.format(
Expand Down Expand Up @@ -456,7 +459,8 @@ private void checkExistingDatabase(final File target) throws Exception {
);
MatcherAssert.assertThat(
"Instance reusedExistingDatabase should be true.",
instances.reusedExistingDatabase()
instances.reusedExistingDatabase(),
Matchers.is(true)
);
do {
TimeUnit.SECONDS.sleep(InstancesTest.SLEEP_SECONDS);
Expand Down
Loading