-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OLGH20804: Update, fixes for persistence service for JPA 3.1, adding …
…JPA 3.1 to persistence service fat. Signed-off-by: Joe Grassel <jgrassel@us.ibm.com>
- Loading branch information
Showing
7 changed files
with
135 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
dev/com.ibm.ws.persistence_fat/fat/src/com/ibm/ws/persistence/fat/ConsumerTest_JPA31.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
|
||
package com.ibm.ws.persistence.fat; | ||
|
||
import java.io.File; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
|
||
import org.junit.AfterClass; | ||
import org.junit.Assert; | ||
import org.junit.BeforeClass; | ||
import org.junit.runner.RunWith; | ||
|
||
import com.ibm.websphere.simplicity.ShrinkHelper; | ||
|
||
//import componenttest.custom.junit.runner.OnlyRunInJava7Rule; | ||
import componenttest.annotation.Server; | ||
import componenttest.annotation.TestServlet; | ||
import componenttest.custom.junit.runner.FATRunner; | ||
import componenttest.rules.repeater.JakartaEE9Action; | ||
import componenttest.topology.impl.LibertyServer; | ||
import componenttest.topology.utils.FATServletClient; | ||
import persistence_fat.consumer.web.ConsumerServlet; | ||
|
||
@RunWith(FATRunner.class) | ||
public class ConsumerTest_JPA31 extends FATServletClient { | ||
private static final String APP_NAME = "consumer"; | ||
|
||
private static final String FEATURE_NAME = "com.ibm.ws.persistence.consumer.jakarta-1.0"; | ||
private static final String BUNDLE_NAME = "com.ibm.ws.persistence.consumer.jakarta_1.0.0"; | ||
|
||
@Server("com.ibm.ws.persistence.consumer.jpa31") | ||
@TestServlet(servlet = ConsumerServlet.class, path = APP_NAME) | ||
public static LibertyServer server; | ||
|
||
@BeforeClass | ||
public static void beforeClass() throws Exception { | ||
server.installSystemFeature(FEATURE_NAME); | ||
server.copyFileToLibertyInstallRoot("lib/", "bundles/com.ibm.ws.persistence.consumer.jar"); | ||
Assert.assertTrue(server.fileExistsInLibertyInstallRoot("lib/com.ibm.ws.persistence.consumer.jar")); | ||
|
||
Path someArchive = Paths.get(server.getInstallRoot() + File.separatorChar + "lib" + File.separatorChar + "com.ibm.ws.persistence.consumer.jar"); | ||
JakartaEE9Action.transformApp(someArchive); | ||
|
||
ShrinkHelper.defaultDropinApp(server, APP_NAME, "persistence_fat.consumer.ejb", "persistence_fat.consumer.model", | ||
"persistence_fat.consumer.web"); | ||
|
||
Path warArchive = Paths.get(server.getServerRoot() + File.separatorChar + "dropins" + File.separatorChar + APP_NAME + ".war"); | ||
JakartaEE9Action.transformApp(warArchive); | ||
|
||
server.startServer(); | ||
} | ||
|
||
@AfterClass | ||
public static void afterClass() throws Exception { | ||
server.stopServer("WTRN0074E"); | ||
server.deleteFileFromLibertyInstallRoot("lib/com.ibm.ws.persistence.consumer.jar"); | ||
server.uninstallSystemFeature(FEATURE_NAME); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...ersistence_fat/publish/servers/com.ibm.ws.persistence.consumer.jpa31/bootstrap.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
bootstrap.include=../testports.properties | ||
|
||
com.ibm.ws.logging.trace.specification=persistenceService=all | ||
websphere.java.security.exempt=true |
9 changes: 9 additions & 0 deletions
9
...bm.ws.persistence_fat/publish/servers/com.ibm.ws.persistence.consumer.jpa31/inmem-orm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd" | ||
version="2.0"> | ||
|
||
<entity class="persistence_fat.consumer.internal.model.Person"> | ||
<table name="PERSON_ORM"/> | ||
</entity> | ||
</entity-mappings> |
35 changes: 35 additions & 0 deletions
35
...m.ibm.ws.persistence_fat/publish/servers/com.ibm.ws.persistence.consumer.jpa31/server.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<server> | ||
<include location="../fatTestPorts.xml" /> | ||
|
||
<featureManager> | ||
<feature>servlet-6.0</feature> | ||
<feature>persistence-3.1</feature> | ||
<feature>enterpriseBeansLite-4.0</feature> | ||
<feature>consumer.jakarta-1.0</feature> | ||
<feature>componenttest-2.0</feature> | ||
</featureManager> | ||
|
||
|
||
<jpa defaultJtaDataSourceJndiName="consumerdsNonTxDs" | ||
defaultNonJtaDataSourceJndiName="consumerdsNonTxDs" /> | ||
|
||
<jdbcDriver id="derby"> | ||
<library> | ||
<fileset dir="${shared.resource.dir}/derby" includes="derby.jar" /> | ||
</library> | ||
</jdbcDriver> | ||
|
||
<javaPermission codebase="${shared.resource.dir}/derby/derby.jar" className="java.security.AllPermission"/> | ||
|
||
<dataSource id="consumerJtaDs" jndiName="consumerJtaDs" jdbcDriverRef="derby"> | ||
<properties databaseName="memory:consumer" createDatabase="create" /> | ||
</dataSource> | ||
<dataSource id="consumerdsNonTxDs" jndiName="consumerdsNonTxDs" jdbcDriverRef="derby" transactional="false"> | ||
<properties databaseName="memory:consumer" createDatabase="create" /> | ||
</dataSource> | ||
<dataSource id="privDs" jndiName="privDs" jdbcDriverRef="derby" transactional="false"> | ||
<properties databaseName="memory:consumer" createDatabase="create" /> | ||
</dataSource> | ||
|
||
<consumer inmemMappingFile="inmem-orm.xml" staticMappingFile="static-orm.xml" createTables="true"/> | ||
</server> |
16 changes: 16 additions & 0 deletions
16
...m.ws.persistence_fat/publish/servers/com.ibm.ws.persistence.consumer.jpa31/static-orm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd" | ||
version="2.0"> | ||
|
||
<entity class="persistence_fat.consumer.internal.model.Person"> | ||
<attributes> | ||
<basic name="firstName"> | ||
<column name="FIRST_NAME" /> | ||
</basic> | ||
<basic name="lastName"> | ||
<column name="LAST_NAME" /> | ||
</basic> | ||
</attributes> | ||
</entity> | ||
</entity-mappings> |