Closed scottmarlow closed 1 month ago
I took another look at ^ and I don't think this issue is correct about the cause, so will look again.
The test pattern that seems to work is where the appclient archive has the same name as the ear except with _client
added on:
// the jar with the correct archive name
- JavaArchive jpa_core_EntityGraph_appmanaged_vehicle_client = ShrinkWrap.create(JavaArchive.class, "jpa_core_EntityGraph_appmanaged_vehicle_client.jar");
+ JavaArchive jpa_core_EntityGraph_appmanaged_vehicle_client = ShrinkWrap.create(JavaArchive.class, "jpa_core_EntityGraph_appmanaged_vehicles_client.jar");
.
.
.
EnterpriseArchive jpa_core_EntityGraph_vehicles_ear = ShrinkWrap.create(EnterpriseArchive.class, "jpa_core_EntityGraph_appmanaged_vehicles.ear");
So we might need to update the jpa tests to only update the client jar name to match the ear.
Trying the following to update 900 JPA tests:
set -x
function update_tests ()
{
name=$1
for updatefile in `find -name "*$name*"`; do
# echo "do something with file $updatefile"
EAR_CLASS="$(grep "EnterpriseArchive.class" $updatefile | cut -d \" -f2 | cut -d'.' -f1)"
# echo "class is $EAR_CLASS"
# class is jpa_jpa22_repeatable_namedentitygraph_vehicles.ear
# update line with JavaArchive jpa_core_annotations_access_field_appmanagedNoTx_vehicle_client = ShrinkWrap.create(JavaArchive.class, "jpa_core_annotations_access_field_appmanagedNoTx_vehicle_client.jar");
# search pattern will be something like "JavaArchive.class.*_client.jar"
# ^ will be updated to "$EAR_CLASS_client.jar"
sed "s%JavaArchive.class.*_client.jar%JavaArchive.class, \"${EAR_CLASS}_client.jar%" -i $updatefile
done
}
# covers both AppmanagedTest + Appmanagednotx
update_tests "*Appmanaged*.java"
update_tests "*Stateful3Test*.java"
update_tests "*Stateless3Test*.java"
set +x
Closing as handled via ^
The Arquillian TsTestPropsBuilder.vehicleArchiveName() is returning names like
jpa_core_EntityGraph_vehicles
since deployment.getDescription().getArchive().getName() is returningjpa_core_EntityGraph_vehicles.ear
^ seems to because of the JPA test ear names in use such as https://github.com/jakartaee/platform-tck/commit/817632426d143ce00516fd2c4a4208f8dbd0e6c3#diff-d7378e1899f757a7c97b65acc9dc8dc4d7b727f6019e43b895fe7bfcc8aeb779R157:
^ leads to failures like:
The workaround is :
As far as I understand it, this is only a jpa test issue. Perhaps we can workaround it differently.