Author: gk
Date: Thu Apr 4 14:00:55 2024
New Revision: 1916801
URL: http://svn.apache.org/viewvc?rev=1916801&view=rev
Log:
- remove deprecated (in Java 11) number constructors
- replace deprecated maven.compiler.release in compiler plugin with
compilerVersion
- disable loggin.log4j.api version in transparent dependencies in fulcrum
-yaafi dependency, which does not align
- update docker-maven-plugin version to 0.44.0, update postgresl to 15.2 in
DOCKERFILE
- update testcontainers to 1.19.7, postgres.jdbc version to 42.6.
Modified:
db/torque/trunk/pom.xml
db/torque/trunk/torque-test/README.md
db/torque/trunk/torque-test/pom.xml
db/torque/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BitTest.java
db/torque/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BooleanIntCharTest.java
db/torque/trunk/torque-test/src/test/java/org/apache/torque/datatypes/ByteTypeTest.java
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/dataobject/ForeignKeyAdderTest.java
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/dataobject/SaveTest.java
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/BaseOptimisticLockingTest.java
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromDatabaseTest.java
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DoInsertTest.java
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DoUpdateTest.java
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/SelectFunctionTest.java
db/torque/trunk/torque-test/src/test/java/org/apache/torque/om/OMByNameMethodsTest.java
db/torque/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerCallbackPostgreSQLExtension.java
db/torque/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerDatabaseAbstractExtension.java
db/torque/trunk/torque-test/src/test/profile/postgresql/docker-resources/db/Dockerfile
db/torque/trunk/torque-test/src/test/profile/postgresql/docker-resources/testcontainers.properties
Modified: db/torque/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/db/torque/trunk/pom.xml?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
--- db/torque/trunk/pom.xml (original)
+++ db/torque/trunk/pom.xml Thu Apr 4 14:00:55 2024
@@ -601,9 +601,8 @@
<target>${maven.compiler.target}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<fork>${torque.compiler.fork}</fork>
- <!--
compilerVersion>${torque.compiler.compilerVersion}</compilerVersion-->
+
<compilerVersion>${torque.compiler.compilerVersion}</compilerVersion>
<executable>${torque.compiler.javac}</executable>
-
<maven.compiler.release>${torque.compiler.compilerVersion}</maven.compiler.release>
</configuration>
</plugin>
<plugin>
Modified: db/torque/trunk/torque-test/README.md
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/README.md?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
--- db/torque/trunk/torque-test/README.md (original)
+++ db/torque/trunk/torque-test/README.md Thu Apr 4 14:00:55 2024
@@ -102,7 +102,9 @@ or instead of mysql replace with postgre
Maven 3.3.9 might need to be upgraded to newest version (tested version 3.6.3).
-- Docker environment
+- Container (Docker) environment
+
+Podman (Windows) currently not supported by Testcontainers.
A successfull connection will result in a message like this
Modified: db/torque/trunk/torque-test/pom.xml
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/pom.xml?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
--- db/torque/trunk/torque-test/pom.xml (original)
+++ db/torque/trunk/torque-test/pom.xml Thu Apr 4 14:00:55 2024
@@ -56,9 +56,9 @@
<torque.test.mssql.version>1.2.7</torque.test.mssql.version>
<torque.test.mysql.version>8.0.33</torque.test.mysql.version><!--
5.1.48 -->
<torque.test.oracle.version>10.2.0.4.0</torque.test.oracle.version>
-
<torque.test.postgres.jdbc.version>42.2.14</torque.test.postgres.jdbc.version><!--
9.1-901.jdbc4, -->
- <torque.test.postgres.version>13.1</torque.test.postgres.version>
-
<torque.test.testcontainer.version>1.18.3</torque.test.testcontainer.version>
+
<torque.test.postgres.jdbc.version>42.6.0</torque.test.postgres.jdbc.version><!--
9.1-901.jdbc4, -->
+ <torque.test.postgres.version>15.2</torque.test.postgres.version>
+
<torque.test.testcontainer.version>1.19.7</torque.test.testcontainer.version>
<!-- -->
<torque.test.idmethod>native</torque.test.idmethod>
</properties>
@@ -118,6 +118,12 @@
<groupId>org.apache.fulcrum</groupId>
<artifactId>fulcrum-yaafi</artifactId>
<scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
@@ -1381,11 +1387,12 @@
Build image:
requires a started docker host - starts database for
sql-maven-plugin.
caution: Cancelling the maven process before life cycle
process-classes is reached, requires the docker to be stopped manually with
docker stop <id>.
+ add -Ddocker.skip=true if image already downloaded and
up-to-date to skip all plugin goals.
-->
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
- <version>0.33.0</version>
+ <version>0.44.0</version>
<configuration>
<filter>${docker.image.name}:${docker.image.version}</filter>
</configuration>
Modified:
db/torque/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BitTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BitTest.java?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
---
db/torque/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BitTest.java
(original)
+++
db/torque/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BitTest.java
Thu Apr 4 14:00:55 2024
@@ -189,7 +189,7 @@ public class BitTest extends BaseDatabas
// query data
Criteria criteria = new Criteria()
- .where(BitTypePeer.BIT_VALUE, new Boolean(true));
+ .where(BitTypePeer.BIT_VALUE, Boolean.valueOf(true));
List<BitType> bitTypeList = BitTypePeer.doSelect(criteria);
assertEquals(1, bitTypeList.size());
BitType bitType = bitTypeList.get(0);
@@ -215,7 +215,7 @@ public class BitTest extends BaseDatabas
fillTables();
Criteria criteria = new Criteria().where(
- BitTypePeer.BIT_VALUE, new Boolean(false));
+ BitTypePeer.BIT_VALUE, Boolean.valueOf(false));
List<BitType> bitTypeList = BitTypePeer.doSelect(criteria);
assertTrue("Should have read 1 dataset "
+ "but read " + bitTypeList.size(),
Modified:
db/torque/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BooleanIntCharTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BooleanIntCharTest.java?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
---
db/torque/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BooleanIntCharTest.java
(original)
+++
db/torque/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BooleanIntCharTest.java
Thu Apr 4 14:00:55 2024
@@ -261,10 +261,10 @@ public class BooleanIntCharTest extends
public void testBooleanTrueSelect() throws Exception
{
Criteria criteria = new Criteria()
- .where(BintBcharTypePeer.BCHAR_VALUE, new Boolean(true))
- .and(BintBcharTypePeer.BINT_VALUE, new Boolean(true))
- .and(BintBcharTypePeer.BCHAR_OBJECT_VALUE, new Boolean(true))
- .and(BintBcharTypePeer.BINT_OBJECT_VALUE, new Boolean(true));
+ .where(BintBcharTypePeer.BCHAR_VALUE, Boolean.valueOf(true))
+ .and(BintBcharTypePeer.BINT_VALUE, Boolean.valueOf(true))
+ .and(BintBcharTypePeer.BCHAR_OBJECT_VALUE,
Boolean.valueOf(true))
+ .and(BintBcharTypePeer.BINT_OBJECT_VALUE,
Boolean.valueOf(true));
List<BintBcharType> selectedList
= BintBcharTypePeer.doSelect(criteria);
assertEquals(1, selectedList.size());
@@ -282,10 +282,10 @@ public class BooleanIntCharTest extends
public void testBooleanFalseSelect() throws Exception
{
Criteria criteria = new Criteria()
- .where(BintBcharTypePeer.BCHAR_VALUE, new Boolean(false))
- .and(BintBcharTypePeer.BINT_VALUE, new Boolean(false))
- .and(BintBcharTypePeer.BCHAR_OBJECT_VALUE, new Boolean(false))
- .and(BintBcharTypePeer.BINT_OBJECT_VALUE, new Boolean(false));
+ .where(BintBcharTypePeer.BCHAR_VALUE, Boolean.valueOf(false))
+ .and(BintBcharTypePeer.BINT_VALUE, Boolean.valueOf(false))
+ .and(BintBcharTypePeer.BCHAR_OBJECT_VALUE,
Boolean.valueOf(false))
+ .and(BintBcharTypePeer.BINT_OBJECT_VALUE,
Boolean.valueOf(false));
List<BintBcharType> selectedList
= BintBcharTypePeer.doSelect(criteria);
assertEquals(1, selectedList.size());
@@ -346,10 +346,10 @@ public class BooleanIntCharTest extends
criteria.addJoin(
BintBcharTypePeer.ID,
new ColumnImpl("bc.id"));
- criteria.where(new ColumnImpl("bc.BINT_VALUE"), new Boolean(false))
- .and(new ColumnImpl("bc.BCHAR_VALUE"), new Boolean(false))
- .and(new ColumnImpl("bc.BINT_OBJECT_VALUE"), new Boolean(false))
- .and(new ColumnImpl("bc.BCHAR_OBJECT_VALUE"), new Boolean(false));
+ criteria.where(new ColumnImpl("bc.BINT_VALUE"), Boolean.valueOf(false))
+ .and(new ColumnImpl("bc.BCHAR_VALUE"), Boolean.valueOf(false))
+ .and(new ColumnImpl("bc.BINT_OBJECT_VALUE"), Boolean.valueOf(false))
+ .and(new ColumnImpl("bc.BCHAR_OBJECT_VALUE"), Boolean.valueOf(false));
List<BintBcharType> selectedList
= BintBcharTypePeer.doSelect(criteria);
assertTrue("Should have read 1 dataset with both values false "
Modified:
db/torque/trunk/torque-test/src/test/java/org/apache/torque/datatypes/ByteTypeTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/src/test/java/org/apache/torque/datatypes/ByteTypeTest.java?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
---
db/torque/trunk/torque-test/src/test/java/org/apache/torque/datatypes/ByteTypeTest.java
(original)
+++
db/torque/trunk/torque-test/src/test/java/org/apache/torque/datatypes/ByteTypeTest.java
Thu Apr 4 14:00:55 2024
@@ -178,7 +178,7 @@ public abstract class ByteTypeTest<T ext
byte[] bytes = new byte[size];
for (int i = 0; i < size; ++i)
{
- bytes[i] = new Integer(i % 256).byteValue();
+ bytes[i] = Integer.valueOf(i % 256).byteValue();
}
return bytes;
}
Modified:
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/dataobject/ForeignKeyAdderTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/dataobject/ForeignKeyAdderTest.java?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
---
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/dataobject/ForeignKeyAdderTest.java
(original)
+++
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/dataobject/ForeignKeyAdderTest.java
Thu Apr 4 14:00:55 2024
@@ -112,7 +112,7 @@ public class ForeignKeyAdderTest extends
oIntegerFkToPPk,
pIntegerPk.getOIntegerFkToPPks().get(0));
- assertEquals(new Integer(0), oIntegerFkToPPk.getFk());
+ assertEquals(Integer.valueOf(0), oIntegerFkToPPk.getFk());
assertSame(pIntegerPk, oIntegerFkToPPk.getPIntegerPk());
}
@@ -140,7 +140,7 @@ public class ForeignKeyAdderTest extends
oIntegerFkToPPk,
pIntegerPk.getOIntegerFkToPPks().get(0));
- assertEquals(new Integer(4), oIntegerFkToPPk.getFk());
+ assertEquals(Integer.valueOf(4), oIntegerFkToPPk.getFk());
assertSame(pIntegerPk, oIntegerFkToPPk.getPIntegerPk());
}
@@ -191,7 +191,7 @@ public class ForeignKeyAdderTest extends
nullableOIntegerFk,
oIntegerPk.getNullableOIntegerFks().get(0));
- assertEquals(new Integer(0), nullableOIntegerFk.getFk());
+ assertEquals(Integer.valueOf(0), nullableOIntegerFk.getFk());
assertSame(oIntegerPk, nullableOIntegerFk.getOIntegerPk());
}
@@ -218,7 +218,7 @@ public class ForeignKeyAdderTest extends
nullableOIntegerFk,
oIntegerPk.getNullableOIntegerFks().get(0));
- assertEquals(new Integer(13), nullableOIntegerFk.getFk());
+ assertEquals(Integer.valueOf(13), nullableOIntegerFk.getFk());
assertSame(oIntegerPk, nullableOIntegerFk.getOIntegerPk());
}
Modified:
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/dataobject/SaveTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/dataobject/SaveTest.java?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
---
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/dataobject/SaveTest.java
(original)
+++
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/dataobject/SaveTest.java
Thu Apr 4 14:00:55 2024
@@ -103,7 +103,7 @@ public class SaveTest extends BaseDataba
oIntegerPk.save();
// verify
- assertEquals(new Integer(3001), oIntegerPk.getId());
+ assertEquals(Integer.valueOf(3001), oIntegerPk.getId());
Criteria criteria = new Criteria().where(OIntegerPkPeer.ID, 3001);
List<OIntegerPk> integerObjectPkList
Modified:
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/BaseOptimisticLockingTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/BaseOptimisticLockingTest.java?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
---
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/BaseOptimisticLockingTest.java
(original)
+++
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/BaseOptimisticLockingTest.java
Thu Apr 4 14:00:55 2024
@@ -63,7 +63,7 @@ public abstract class BaseOptimisticLock
List<T> objectList = fillDatabase();
T toUpdate = objectList.get(1);
- assertEquals(new Integer(0), toUpdate.getVersion());
+ assertEquals(Integer.valueOf(0), toUpdate.getVersion());
toUpdate.setName("2a");
@@ -71,7 +71,7 @@ public abstract class BaseOptimisticLock
toUpdate.save();
// verify
- assertEquals(new Integer(1), toUpdate.getVersion());
+ assertEquals(Integer.valueOf(1), toUpdate.getVersion());
assertEquals("2a", toUpdate.getName());
assertDatabase(objectList);
}
@@ -89,7 +89,7 @@ public abstract class BaseOptimisticLock
List<T> objectList = fillDatabase();
T toUpdate = objectList.get(1);
- assertEquals(new Integer(0), toUpdate.getVersion());
+ assertEquals(Integer.valueOf(0), toUpdate.getVersion());
toUpdate.setName("2a");
Connection connection = Torque.getConnection();
@@ -101,7 +101,7 @@ public abstract class BaseOptimisticLock
connection.close();
// verify
- assertEquals(new Integer(1), toUpdate.getVersion());
+ assertEquals(Integer.valueOf(1), toUpdate.getVersion());
assertEquals("2a", toUpdate.getName());
assertDatabase(objectList);
}
@@ -118,7 +118,7 @@ public abstract class BaseOptimisticLock
List<T> objectList = fillDatabase();
T toUpdate = objectList.get(1);
- assertEquals(new Integer(0), toUpdate.getVersion());
+ assertEquals(Integer.valueOf(0), toUpdate.getVersion());
toUpdate.setName("2a");
@@ -126,7 +126,7 @@ public abstract class BaseOptimisticLock
peer.doUpdate(toUpdate);
// verify
- assertEquals(new Integer(1), toUpdate.getVersion());
+ assertEquals(Integer.valueOf(1), toUpdate.getVersion());
assertEquals("2a", toUpdate.getName());
assertDatabase(objectList);
}
@@ -144,7 +144,7 @@ public abstract class BaseOptimisticLock
List<T> objectList = fillDatabase();
T toUpdate = objectList.get(1);
- assertEquals(new Integer(0), toUpdate.getVersion());
+ assertEquals(Integer.valueOf(0), toUpdate.getVersion());
toUpdate.setName("2a");
Connection connection = Torque.getConnection();
@@ -156,7 +156,7 @@ public abstract class BaseOptimisticLock
connection.close();
// verify
- assertEquals(new Integer(1), toUpdate.getVersion());
+ assertEquals(Integer.valueOf(1), toUpdate.getVersion());
assertEquals("2a", toUpdate.getName());
assertDatabase(objectList);
}
@@ -173,11 +173,11 @@ public abstract class BaseOptimisticLock
List<T> objectList = fillDatabase();
T toUpdate = objectList.get(1);
- assertEquals(new Integer(0), toUpdate.getVersion());
+ assertEquals(Integer.valueOf(0), toUpdate.getVersion());
toUpdate.setName("2a");
toUpdate.save();
- assertEquals(new Integer(1), toUpdate.getVersion());
+ assertEquals(Integer.valueOf(1), toUpdate.getVersion());
toUpdate.setName("2b");
@@ -185,7 +185,7 @@ public abstract class BaseOptimisticLock
toUpdate.save();
// verify
- assertEquals(new Integer(2), toUpdate.getVersion());
+ assertEquals(Integer.valueOf(2), toUpdate.getVersion());
assertEquals("2b", toUpdate.getName());
assertDatabase(objectList);
}
@@ -222,7 +222,7 @@ public abstract class BaseOptimisticLock
}
// verify
- assertEquals(new Integer(0), toUpdate.getVersion());
+ assertEquals(Integer.valueOf(0), toUpdate.getVersion());
assertEquals("2b", toUpdate.getName());
assertTrue(toUpdate.isModified());
assertDatabase(objectList);
@@ -259,7 +259,7 @@ public abstract class BaseOptimisticLock
}
// verify
- assertEquals(new Integer(0), toUpdate.getVersion());
+ assertEquals(Integer.valueOf(0), toUpdate.getVersion());
assertEquals("2b", toUpdate.getName());
assertTrue(toUpdate.isModified());
assertDatabase(objectList);
Modified:
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromDatabaseTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromDatabaseTest.java?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
---
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromDatabaseTest.java
(original)
+++
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DefaultValuesFromDatabaseTest.java
Thu Apr 4 14:00:55 2024
@@ -142,7 +142,7 @@ public class DefaultValuesFromDatabaseTe
DatabaseDefaultValues databaseDefaultValuesSaved
= databaseDefaultValuesList.get(0);
assertEquals(
- new Integer(2),
+ Integer.valueOf(2),
databaseDefaultValuesSaved.getOInteger());
assertEquals(4, databaseDefaultValuesSaved.getPInt());
assertEquals("Default!", databaseDefaultValuesSaved.getVarcharField());
@@ -204,7 +204,7 @@ public class DefaultValuesFromDatabaseTe
DatabaseDefaultValues databaseDefaultValuesSaved
= defaultValuesList.get(0);
assertEquals(
- new Integer(1),
+ Integer.valueOf(1),
databaseDefaultValuesSaved.getOInteger());
assertEquals(3, databaseDefaultValuesSaved.getPInt());
assertEquals("Changed!", databaseDefaultValuesSaved.getVarcharField());
@@ -266,7 +266,7 @@ public class DefaultValuesFromDatabaseTe
DatabaseDefaultValues databaseDefaultValuesSaved
= databaseDefaultValuesList.get(0);
assertEquals(
- new Integer(2),
+ Integer.valueOf(2),
databaseDefaultValuesSaved.getOInteger());
assertEquals(4, databaseDefaultValuesSaved.getPInt());
assertEquals("Default!", databaseDefaultValuesSaved.getVarcharField());
Modified:
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DoInsertTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DoInsertTest.java?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
---
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DoInsertTest.java
(original)
+++
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DoInsertTest.java
Thu Apr 4 14:00:55 2024
@@ -149,7 +149,7 @@ public class DoInsertTest extends BaseDa
new Criteria().addDescendingOrderByColumn(IntegerTypePeer.ID));
assertEquals(2, allIntegerTypes.size());
assertEquals(5, allIntegerTypes.get(0).getIntegerValue());
- assertEquals(new Integer(3),
allIntegerTypes.get(0).getIntegerObjectValue());
+ assertEquals(Integer.valueOf(3),
allIntegerTypes.get(0).getIntegerObjectValue());
assertEquals(
((BigDecimal) objectKey.getValue()).intValue(),
allIntegerTypes.get(0).getId());
Modified:
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DoUpdateTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DoUpdateTest.java?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
---
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DoUpdateTest.java
(original)
+++
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DoUpdateTest.java
Thu Apr 4 14:00:55 2024
@@ -197,6 +197,6 @@ public class DoUpdateTest extends BaseDa
new Criteria().addDescendingOrderByColumn(IntegerTypePeer.ID));
assertEquals(2, allIntegerTypes.size());
assertEquals(5, allIntegerTypes.get(0).getIntegerValue());
- assertEquals(new Integer(3),
allIntegerTypes.get(0).getIntegerObjectValue());
+ assertEquals(Integer.valueOf(3),
allIntegerTypes.get(0).getIntegerObjectValue());
}
}
Modified:
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/SelectFunctionTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/SelectFunctionTest.java?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
---
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/SelectFunctionTest.java
(original)
+++
db/torque/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/SelectFunctionTest.java
Thu Apr 4 14:00:55 2024
@@ -83,7 +83,7 @@ public class SelectFunctionTest extends
Integer avg = peer.doSelectSingleRecord(criteria);
- assertEquals(new Integer(2), avg);
+ assertEquals(Integer.valueOf(2), avg);
}
/**
@@ -98,7 +98,7 @@ public class SelectFunctionTest extends
Integer avg = peer.doSelectSingleRecord(criteria);
- assertEquals(new Integer(3), avg);
+ assertEquals(Integer.valueOf(3), avg);
}
/**
@@ -112,7 +112,7 @@ public class SelectFunctionTest extends
Integer count = peer.doSelectSingleRecord(criteria);
- assertEquals(new Integer(4), count);
+ assertEquals(Integer.valueOf(4), count);
}
/**
@@ -127,7 +127,7 @@ public class SelectFunctionTest extends
Integer count = peer.doSelectSingleRecord(criteria);
- assertEquals(new Integer(2), count);
+ assertEquals(Integer.valueOf(2), count);
}
/**
@@ -142,7 +142,7 @@ public class SelectFunctionTest extends
Integer min = peer.doSelectSingleRecord(criteria);
- assertEquals(new Integer(1), min);
+ assertEquals(Integer.valueOf(1), min);
}
/**
@@ -157,7 +157,7 @@ public class SelectFunctionTest extends
Integer max = peer.doSelectSingleRecord(criteria);
- assertEquals(new Integer(5), max);
+ assertEquals(Integer.valueOf(5), max);
}
/**
@@ -172,7 +172,7 @@ public class SelectFunctionTest extends
Integer sum = peer.doSelectSingleRecord(criteria);
- assertEquals(new Integer(8), sum);
+ assertEquals(Integer.valueOf(8), sum);
}
/**
@@ -187,6 +187,6 @@ public class SelectFunctionTest extends
Integer sum = peer.doSelectSingleRecord(criteria);
- assertEquals(new Integer(6), sum);
+ assertEquals(Integer.valueOf(6), sum);
}
}
Modified:
db/torque/trunk/torque-test/src/test/java/org/apache/torque/om/OMByNameMethodsTest.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/src/test/java/org/apache/torque/om/OMByNameMethodsTest.java?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
---
db/torque/trunk/torque-test/src/test/java/org/apache/torque/om/OMByNameMethodsTest.java
(original)
+++
db/torque/trunk/torque-test/src/test/java/org/apache/torque/om/OMByNameMethodsTest.java
Thu Apr 4 14:00:55 2024
@@ -73,12 +73,12 @@ public class OMByNameMethodsTest extends
public static final Object[] OBJECT_TEST_VALUES =
{
- new Boolean(true), // "OBit",
- new Byte((byte) 1), // "OTinyint",
- new Short((short) 1), // "OSmallint",
- new Long((long) 1.0), // "OBigint",
- new Double(1.0), // "OFloat",
- new Float(1.0), // "OReal",
+ Boolean.valueOf( true), // "OBit",
+ Byte.valueOf( (byte) 1), // "OTinyint",
+ Short.valueOf( (short) 1), // "OSmallint",
+ Long.valueOf( (long) 1.0), // "OBigint",
+ Double.valueOf( (double)1.0), // "OFloat",
+ Float.valueOf( (float) 1.0), // "OReal",
new BigDecimal(1.0), // "ONumeric",
new BigDecimal(1.0), // "ODecimal",
"OChar_TEST_VALUE", // "OChar",
@@ -86,29 +86,28 @@ public class OMByNameMethodsTest extends
"OLongvarchar_TEST_VALUE", // "OLongvarchar",
new Date(1000000000l), // "ODate",
new Date(1000000000l), // "OTime",
- new Integer(1), // "OInteger",
+ Integer.valueOf(1), // "OInteger",
new Date(1000000000l), // "OTimestamp",
new byte[]
{
1, 1, 1
}, // "OBinary",
- new byte[]
- {
- 1, 1, 1
- }, // "OVarbinary",
- new byte[]
- {
- 1, 1, 1
- }, // "OLongvarbinary",
- new byte[]
- {
- 1, 1, 1
- }, // "OBlob",
- "OClob_TEST_VALUE", // "OClob",
- new Boolean(true), //
"OBooleanint",
- new Boolean(true), //
"OBooleanchar",
- new Double(1.0)
- // "ODouble"
+ new byte[]
+ {
+ 1, 1, 1
+ }, // "OVarbinary",
+ new byte[]
+ {
+ 1, 1, 1
+ }, // "OLongvarbinary",
+ new byte[]
+ {
+ 1, 1, 1
+ }, // "OBlob",
+ "OClob_TEST_VALUE", // "OClob",
+ Boolean.valueOf(true), // "OBooleanint",
+ Boolean.valueOf(true), // "OBooleanchar",
+ Double.valueOf( (double)1.0) // "ODouble"
};
public static final String[] OBJECT_COLUMN_NAMES =
@@ -149,12 +148,12 @@ public class OMByNameMethodsTest extends
public static final Object[] PRIMITIVE_TEST_VALUES =
{
- new Boolean(true), // "PBit",
- new Byte((byte) 1), // "PTinyint",
- new Short((short) 1), // "PSmallint",
- new Long((long) 1.0), // "PBigint",
- new Double(1.0), // "PFloat",
- new Float(1.0), // "PReal",
+ Boolean.valueOf(true), // "PBit",
+ Byte.valueOf((byte) 1), // "PTinyint",
+ Short.valueOf((short) 1), // "PSmallint",
+ Long.valueOf((long) 1.0), // "PBigint",
+ Double.valueOf( (double)1.0), // "PFloat",
+ Float.valueOf( (float)1.0), // "PReal",
new BigDecimal(1.0), // "PNumeric",
new BigDecimal(1.0), // "PDecimal",
"OChar_TEST_VALUE", // "PChar",
@@ -162,28 +161,28 @@ public class OMByNameMethodsTest extends
"OLongvarchar_TEST_VALUE", // "PLongvarchar",
new Date(1000000000l), // "PDate",
new Date(1000000000l), // "PTime",
- new Integer(1), // "PInteger",
+ Integer.valueOf(1), // "PInteger",
new Date(1000000000l), // "PTimestamp",
new byte[]
{
1, 1, 1
}, // "PBinary",
- new byte[]
- {
- 1, 1, 1
- }, // "PVarbinary",
- new byte[]
- {
- 1, 1, 1
- }, // "PLongvarbinary",
- new byte[]
- {
- 1, 1, 1
- }, // "PBlob",
- "OClob_TEST_VALUE", // "PClob",
- new Boolean(true), //
"PBooleanint",
- new Boolean(true), //
"PBooleanchar",
- new Double(1.0) //" PDouble"
+ new byte[]
+ {
+ 1, 1, 1
+ }, // "PVarbinary",
+ new byte[]
+ {
+ 1, 1, 1
+ }, // "PLongvarbinary",
+ new byte[]
+ {
+ 1, 1, 1
+ }, // "PBlob",
+ "OClob_TEST_VALUE", // "PClob",
+ Boolean.valueOf(true), // "PBooleanint",
+ Boolean.valueOf(true), // "PBooleanchar",
+ Double.valueOf(1.0) //" PDouble"
};
public static final Column[] OBJECT_PEER_NAMES =
@@ -698,7 +697,7 @@ public class OMByNameMethodsTest extends
boolean error = false;
try
{
- objectTypes.setByName("OBit", new Integer(1));
+ objectTypes.setByName("OBit", Integer.valueOf(1));
}
catch (IllegalArgumentException e)
{
@@ -711,7 +710,7 @@ public class OMByNameMethodsTest extends
error = false;
try
{
- primitiveTypes.setByName("PBit", new Integer(99));
+ primitiveTypes.setByName("PBit", Integer.valueOf(99));
}
catch (IllegalArgumentException e)
{
@@ -730,15 +729,15 @@ public class OMByNameMethodsTest extends
{
ColumnAccessByName objectTypes = new TypesObject();
// Test that false status is returned for invalid column names.
- boolean status = objectTypes.setByName("xxxOBit", new Integer(1));
+ boolean status = objectTypes.setByName("xxxOBit", Integer.valueOf(1));
assertFalse("Did not get a false status from setByName with "
+ "invalid column name!", status);
- status = objectTypes.setByPeerName("xxxOBit", new Integer(1));
+ status = objectTypes.setByPeerName("xxxOBit", Integer.valueOf(1));
assertFalse("Did not get a false status from setByPeerName with "
+ "invalid column name!", status);
- status = objectTypes.setByPosition(1000, new Integer(1));
+ status = objectTypes.setByPosition(1000, Integer.valueOf(1));
assertFalse("Did not get a false status from setByPosition with "
+ "invalid position!", status);
}
Modified:
db/torque/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerCallbackPostgreSQLExtension.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerCallbackPostgreSQLExtension.java?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
---
db/torque/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerCallbackPostgreSQLExtension.java
(original)
+++
db/torque/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerCallbackPostgreSQLExtension.java
Thu Apr 4 14:00:55 2024
@@ -35,6 +35,7 @@ import org.testcontainers.containers.out
import org.testcontainers.images.builder.ImageFromDockerfile;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
+import org.testcontainers.utility.DockerImageName;
/**
* Testcontainer configuration for database Postgres
@@ -45,73 +46,97 @@ import org.testcontainers.junit.jupiter.
*
*/
@Testcontainers
-public class DockerCallbackPostgreSQLExtension extends
DockerDatabaseAbstractExtension implements BeforeAllCallback,
BeforeTestExecutionCallback, ExecutionCondition {
+public class DockerCallbackPostgreSQLExtension extends
DockerDatabaseAbstractExtension
+ implements BeforeAllCallback, BeforeTestExecutionCallback,
ExecutionCondition
+{
- private static org.slf4j.Logger log =
LoggerFactory.getLogger(DockerCallbackPostgreSQLExtension.class);
+ private static org.slf4j.Logger log = LoggerFactory.getLogger(
DockerCallbackPostgreSQLExtension.class );
private static int SERVICE_PORT = 5432;
private static final ConditionEvaluationResult ENABLED_BY_DEFAULT =
enabled(
- "DockerCallbackExtension is enabled by default - checking internal
state only");
+ "DockerCallbackExtension is enabled by default - checking internal
state only" );
+ /**
+ * podman issue:
https://github.com/testcontainers/testcontainers-java/issues/5998
+ */
@Container
public static GenericContainer DATABASE_CONTAINER = new GenericContainer<>(
new ImageFromDockerfile().withDockerfile(new
File(DOCKERFILE).toPath())).withExposedPorts(SERVICE_PORT)
.withEnv("POSTGRES_DB",
DATABASE_NAME).withEnv("POSTGRES_USER", "torque")
.withEnv("POSTGRES_PASSWORD",
"torque").withLogConsumer(new Slf4jLogConsumer(log));
-
- public DockerCallbackPostgreSQLExtension() {
- setDbContainer(DATABASE_CONTAINER);
- setServicePort(SERVICE_PORT);
+
+ public DockerCallbackPostgreSQLExtension()
+ {
+ log.warn( "DATABASE_CONTAINER: {}", DATABASE_CONTAINER );
+ if (DATABASE_CONTAINER == null)
+ {
+ DockerImageName fqdImage = DockerImageName.parse( "postgres:15.2"
);
+ log.warn( "hard coded init container not from Testcontainers
Container annotation {}" );
+ DATABASE_CONTAINER = new GenericContainer<>( fqdImage );
+ DATABASE_CONTAINER.withExposedPorts( SERVICE_PORT ).withEnv(
"POSTGRES_DB", DATABASE_NAME )
+ .withEnv( "POSTGRES_USER", "torque" ).withEnv(
"POSTGRES_PASSWORD", "torque" )
+ .withLogConsumer( new Slf4jLogConsumer( log ) );
+ }
+ setDbContainer( DATABASE_CONTAINER );
+ log.warn( "DATABASE_CONTAINER: {}", DATABASE_CONTAINER );
+ setServicePort( SERVICE_PORT );
}
-
+
@Override
- public ConditionEvaluationResult
evaluateExecutionCondition(ExtensionContext context) {
- String actual = System.getProperty("torque.callback");
- if (actual == null) {
- actual = System.getenv("torque.callback");
+ public ConditionEvaluationResult
evaluateExecutionCondition(ExtensionContext context)
+ {
+ String actual = System.getProperty( "torque.callback" );
+ if (actual == null)
+ {
+ actual = System.getenv( "torque.callback" );
}
- if (actual != null && actual.matches("docker")) {
+ if (actual != null && actual.matches( "docker" ))
+ {
}
return ENABLED_BY_DEFAULT;
}
-
@Override
- public void beforeAll(ExtensionContext context) throws Exception {
+ public void beforeAll(ExtensionContext context) throws Exception
+ {
// log.info("starting call context "+ context);
Class<?> clazz = context.getRequiredTestClass();
- log.warn("found and get annotation : {}", (Object[]
)context.getRequiredTestClass().getAnnotations());
- DockerPostGresCallback dockerCallback =
clazz.getAnnotation(DockerPostGresCallback.class);
- if (dockerCallback != null) {
- log.warn("using annotation: {}",dockerCallback);
- setSkipConfigurationCheck(dockerCallback.skipConfigurationCheck());
- setCustomUrlKey(dockerCallback.customUrlKey());
- setTargetConfigName(dockerCallback.targetConfigName());
- setTargetFileName(dockerCallback.targetFileName());
- setAdapterProfileFallback(dockerCallback.adapterProfileFallback());
- } else {
- super.beforeAll(context);
+ log.warn( "found and get annotation : {}", (Object[])
context.getRequiredTestClass().getAnnotations() );
+ DockerPostGresCallback dockerCallback = clazz.getAnnotation(
DockerPostGresCallback.class );
+ if (dockerCallback != null)
+ {
+ log.warn( "using annotation: {}", dockerCallback );
+ setSkipConfigurationCheck( dockerCallback.skipConfigurationCheck()
);
+ setCustomUrlKey( dockerCallback.customUrlKey() );
+ setTargetConfigName( dockerCallback.targetConfigName() );
+ setTargetFileName( dockerCallback.targetFileName() );
+ setAdapterProfileFallback( dockerCallback.adapterProfileFallback()
);
+ } else
+ {
+ super.beforeAll( context );
}
- try {
- dbInit(context);
- } catch (Exception e) {
+ try
+ {
+ dbInit( context );
+ } catch (Exception e)
+ {
final String logs = DATABASE_CONTAINER.getLogs();
- log.info("fetched container logs: {} ", logs);
+ log.info( "fetched container logs: {} ", logs );
throw e;
}
- String jdbcConnectionString = generateJdbcUrl("");
- context.getStore(Namespace.GLOBAL).put("jdbcConnectionString",
jdbcConnectionString);
- context.getStore(Namespace.GLOBAL).put("container",
DATABASE_CONTAINER);
- context.getStore(Namespace.GLOBAL).put("annotatedClass",
dockerCallback);
-
- torqueInit(context);
+ String jdbcConnectionString = generateJdbcUrl( "" );
+ context.getStore( Namespace.GLOBAL ).put( "jdbcConnectionString",
jdbcConnectionString );
+ context.getStore( Namespace.GLOBAL ).put( "container",
DATABASE_CONTAINER );
+ context.getStore( Namespace.GLOBAL ).put( "annotatedClass",
dockerCallback );
+
+ torqueInit( context );
}
@Override
- public void beforeTestExecution(ExtensionContext context) throws Exception
{
+ public void beforeTestExecution(ExtensionContext context) throws Exception
+ {
// log.info("starting call test context "+ context);
}
-
}
Modified:
db/torque/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerDatabaseAbstractExtension.java
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerDatabaseAbstractExtension.java?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
---
db/torque/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerDatabaseAbstractExtension.java
(original)
+++
db/torque/trunk/torque-test/src/test/java/org/apache/torque/testcontainer/junit5/extension/DockerDatabaseAbstractExtension.java
Thu Apr 4 14:00:55 2024
@@ -57,6 +57,7 @@ public abstract class DockerDatabaseAbst
* If it is still not running throw RuntimeException
*/
private void startDatabaseContainer() {
+ log.info("DbContainer: {}", getDbContainer());
if (!getDbContainer().isRunning()) {
log.info("Waiting for running/ listening port..., binds: {}",
getDbContainer().getBinds());
getDbContainer().waitingFor(Wait.forListeningPort());
@@ -85,7 +86,7 @@ public abstract class DockerDatabaseAbst
throw new RuntimeException("Could not find RUNNING database
container");
}
// MY_SQL_CONTAINER.withCreateContainerCmdModifier(modifier) //
- String serviceHost = getDbContainer().getContainerIpAddress();
+ String serviceHost = getDbContainer().getHost();
Integer mappedPort =
getDbContainer().getMappedPort(getServicePort());// e.g. 32811
log.info("generate jdbc url from {}, mapped Port: {}, bounded port:
{}", serviceHost, mappedPort,
getDbContainer().getBoundPortNumbers());
@@ -101,10 +102,15 @@ public abstract class DockerDatabaseAbst
protected void dbInit(ExtensionContext context)
throws TorqueException, UnsupportedOperationException,
IOException, InterruptedException {
- log.info("Starting from dockerfile: {} with image name: {}",
DOCKERFILE , getDbContainer().getDockerImageName() );
- // before torque init
- getDbContainer().setStartupAttempts(3);
- startDatabaseContainer();
+ if (getDbContainer() != null)
+ {
+ log.info("Starting from dockerfile: {} with image name: {}",
DOCKERFILE , getDbContainer().getDockerImageName() );
+ // before torque init
+ getDbContainer().setStartupAttempts(3);
+ startDatabaseContainer();
+ } else {
+ log.warn("No container found: {}", DOCKERFILE , getDbContainer() );
+ }
}
public DockerDatabaseAbstractExtension(String adapterProfileFallback) {
Modified:
db/torque/trunk/torque-test/src/test/profile/postgresql/docker-resources/db/Dockerfile
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/src/test/profile/postgresql/docker-resources/db/Dockerfile?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
---
db/torque/trunk/torque-test/src/test/profile/postgresql/docker-resources/db/Dockerfile
(original)
+++
db/torque/trunk/torque-test/src/test/profile/postgresql/docker-resources/db/Dockerfile
Thu Apr 4 14:00:55 2024
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-FROM postgres:13.1
+FROM postgres:15.2
COPY ./generated-sql-init /tmp-sql
# dependent sql should be name sorted after id-table-schema.sql
Modified:
db/torque/trunk/torque-test/src/test/profile/postgresql/docker-resources/testcontainers.properties
URL:
http://svn.apache.org/viewvc/db/torque/trunk/torque-test/src/test/profile/postgresql/docker-resources/testcontainers.properties?rev=1916801&r1=1916800&r2=1916801&view=diff
==============================================================================
---
db/torque/trunk/torque-test/src/test/profile/postgresql/docker-resources/testcontainers.properties
(original)
+++
db/torque/trunk/torque-test/src/test/profile/postgresql/docker-resources/testcontainers.properties
Thu Apr 4 14:00:55 2024
@@ -16,4 +16,8 @@
# under the License.
# windows workaround, should have more than 2GB free disk space
-#checks.disable = true
\ No newline at end of file
+#checks.disable = true
+
+# since 1.19.0 not required podman machine set --rootful
+# deprecated: ryuk.container.privileged = true
+#TESTCONTAINERS_RYUK_DISABLED=true
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]