forked from jakartaee/platform-tck
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix test failures, update tck bundle with pom. (jakartaee#1249)
Signed-off-by: Gurunandan Rao <[email protected]>
- Loading branch information
Showing
13 changed files
with
386 additions
and
123 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
** JDOM 1.1.3 | ||
** dbprocedures | ||
|
||
** Apache Commons HTTP Client 3.1 | ||
** persistence-tck-common | ||
|
||
** Apache Commons Logging 1.1.3 | ||
** persistence-tck-spec-tests | ||
|
||
** Apache Commons Codec 1.9 |
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
101 changes: 101 additions & 0 deletions
101
jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/se/entityManagerFactory/Client1.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,101 @@ | ||
/* | ||
* Copyright (c) 2007, 2023 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package ee.jakarta.tck.persistence.se.entityManagerFactory; | ||
|
||
import java.lang.System.Logger; | ||
import java.util.Properties; | ||
|
||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import ee.jakarta.tck.persistence.common.PMClientBase; | ||
|
||
import jakarta.persistence.EntityManager; | ||
import jakarta.persistence.EntityManagerFactory; | ||
import jakarta.persistence.Persistence; | ||
import jakarta.persistence.PersistenceException; | ||
|
||
public class Client1 extends PMClientBase { | ||
|
||
private static final Logger logger = (Logger) System.getLogger(Client1.class.getName()); | ||
|
||
Properties props = null; | ||
|
||
public Client1() { | ||
} | ||
|
||
public JavaArchive createDeployment() throws Exception { | ||
|
||
String pkgNameWithoutSuffix = Client1.class.getPackageName(); | ||
String pkgName = pkgNameWithoutSuffix + "."; | ||
String[] classes = { pkgName + "Member", pkgName + "Member_", pkgName + "Order", pkgName + "Order_" }; | ||
return createDeploymentJar("jpa_se_entityManagerFactory.jar", pkgNameWithoutSuffix, (String[]) classes); | ||
|
||
} | ||
|
||
@BeforeEach | ||
public void setupNoData() throws Exception { | ||
logger.log(Logger.Level.TRACE, "setupNoData"); | ||
try { | ||
super.setup(); | ||
createDeployment(); | ||
} catch (Exception e) { | ||
logger.log(Logger.Level.ERROR, "Exception: ", e); | ||
throw new Exception("Setup failed:", e); | ||
} | ||
} | ||
|
||
@AfterEach | ||
public void cleanupNoData() throws Exception { | ||
try { | ||
super.cleanup(); | ||
} finally { | ||
removeTestJarFromCP(); | ||
} | ||
} | ||
|
||
/* | ||
* @testName: getMetamodelIllegalStateExceptionTest | ||
* | ||
* @assertion_ids: PERSISTENCE:JAVADOC:536; | ||
* | ||
* @test_Strategy: Close the EntityManagerFactory, then call emf.getMetaModel() | ||
*/ | ||
@Test | ||
public void getMetamodelIllegalStateExceptionTest() throws Exception { | ||
boolean pass = false; | ||
try { | ||
EntityManagerFactory emf = getEntityManager().getEntityManagerFactory(); | ||
emf.close(); | ||
try { | ||
emf.getMetamodel(); | ||
logger.log(Logger.Level.ERROR, "IllegalStateException not thrown"); | ||
} catch (IllegalStateException ise) { | ||
logger.log(Logger.Level.TRACE, "Received expected IllegalStateException"); | ||
pass = true; | ||
} | ||
|
||
} catch (Exception e) { | ||
logger.log(Logger.Level.ERROR, "Unexpected exception occurred", e); | ||
} | ||
if (!pass) { | ||
throw new Exception("getMetamodelIllegalStateExceptionTest failed"); | ||
} | ||
} | ||
} |
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
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
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
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,58 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License v. 2.0, which is available at | ||
# http://www.eclipse.org/legal/epl-2.0. | ||
# | ||
# This Source Code may also be made available under the following Secondary | ||
# Licenses when the conditions for such availability set forth in the | ||
# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
# version 2 with the GNU Classpath Exception, which is available at | ||
# https://www.gnu.org/software/classpath/license.html. | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
# | ||
|
||
##script to install the artifact directory contents into a local maven repository | ||
|
||
if [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then | ||
VERSION="$1" | ||
else | ||
VERSION="3.2.0" | ||
fi | ||
|
||
JAKARTAEE_VERSION="11.0.0-SNAPSHOT" | ||
|
||
|
||
# dbprocedures jar | ||
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file \ | ||
-Dfile=dbprocedures-$VERSION.jar -DgroupId=jakarta.tck -DartifactId=dbprocedures \ | ||
-Dversion=$VERSION -Dpackaging=jar | ||
|
||
# persistence-tck pom | ||
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file \ | ||
-Dfile=persistence-tck-$VERSION.pom -DgroupId=jakarta.tck -DartifactId=persistence-tck \ | ||
-Dversion=$VERSION -Dpackaging=pom | ||
|
||
# persistence-tck-common jar | ||
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file \ | ||
-Dfile=persistence-tck-common-$VERSION.jar -DgroupId=jakarta.tck -DartifactId=persistence-tck-common \ | ||
-Dversion=$VERSION -Dpackaging=jar | ||
|
||
# persistence-tck-common pom | ||
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file \ | ||
-Dfile=persistence-tck-common-$VERSION.pom -DgroupId=jakarta.tck -DartifactId=persistence-tck-common \ | ||
-Dversion=$VERSION -Dpackaging=pom | ||
|
||
|
||
# persistence-tck-spec-tests jar | ||
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file \ | ||
-Dfile=persistence-tck-spec-tests-$VERSION.jar -DgroupId=jakarta.tck -DartifactId=persistence-tck-spec-tests \ | ||
-Dversion=$VERSION -Dpackaging=jar | ||
|
||
# persistence-tck-spec-tests pom | ||
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file \ | ||
-Dfile=persistence-tck-spec-tests-$VERSION.pom -DgroupId=jakarta.tck -DartifactId=persistence-tck-spec-tests \ | ||
-Dversion=$VERSION -Dpackaging=pom |
Oops, something went wrong.