Skip to content

Commit

Permalink
Oracle AQ API upgrade to com.oracle.database.messaging/aqapi-jakarta@…
Browse files Browse the repository at this point in the history
…23.2.0.0 (#1882)

* Oracle AQ API upgrade

Signed-off-by: Radek Felcman <radek.felcman@oracle.com>
  • Loading branch information
rfelcman committed Jun 6, 2023
1 parent 90eb04b commit 0767bf4
Show file tree
Hide file tree
Showing 22 changed files with 113 additions and 109 deletions.
7 changes: 3 additions & 4 deletions foundation/org.eclipse.persistence.oracle.nosql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</dependency>
<dependency>
<groupId>com.oracle.database.messaging</groupId>
<artifactId>aqapi</artifactId>
<artifactId>aqapi-jakarta</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
Expand Down Expand Up @@ -282,9 +282,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.jms</groupId>
<artifactId>javax.jms-api</artifactId>
<version>2.0.1</version>
<groupId>jakarta.jms</groupId>
<artifactId>jakarta.jms-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
Expand Down Expand Up @@ -120,7 +120,7 @@ public void testInvalidUsername() throws Exception {
session.login();
session.logout();
} catch (Exception ex) {
if (ex.getMessage().indexOf("invalid username/password") == -1) {
if (ex.getMessage().indexOf("invalid credential or not authorized; logon denied") == -1) {
throw ex;
}
failure = true;
Expand All @@ -144,7 +144,7 @@ public void testInvalidPassword() throws Exception {
session.login();
session.logout();
} catch (Exception ex) {
if (ex.getMessage().indexOf("invalid username/password") == -1) {
if (ex.getMessage().indexOf("invalid credential or not authorized; logon denied") == -1) {
throw ex;
}
failure = true;
Expand All @@ -168,7 +168,7 @@ public void testInvalidUsernameDBSession() throws Exception {
session.login();
session.logout();
} catch (Exception ex) {
if (ex.getMessage().indexOf("invalid username/password") == -1) {
if (ex.getMessage().indexOf("invalid credential or not authorized; logon denied") == -1) {
throw ex;
}
failure = true;
Expand All @@ -192,7 +192,7 @@ public void testInvalidPasswordDBSession() throws Exception {
session.login();
session.logout();
} catch (Exception ex) {
if (ex.getMessage().indexOf("invalid username/password") == -1) {
if (ex.getMessage().indexOf("invalid credential or not authorized; logon denied") == -1) {
throw ex;
}
failure = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
Expand All @@ -16,21 +16,21 @@
// - 490677: Database connection properties made configurable in test.properties
package org.eclipse.persistence.testing.tests.eis.aq;

import javax.jms.JMSException;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
import javax.jms.TopicSession;
import jakarta.jms.JMSException;
import jakarta.jms.QueueConnection;
import jakarta.jms.QueueConnectionFactory;
import jakarta.jms.QueueSession;
import jakarta.jms.Session;
import jakarta.jms.TopicConnection;
import jakarta.jms.TopicConnectionFactory;
import jakarta.jms.TopicSession;

import org.eclipse.persistence.testing.framework.junit.LogTestExecution;
import org.eclipse.persistence.testing.tests.nosql.NoSQLProperties;
import org.junit.Rule;
import org.junit.Test;

import oracle.jms.AQjmsFactory;
import oracle.jakarta.jms.AQjmsFactory;

/**
* Test connecting directly through the AQ JMS driver. Requires AQ installed on this database.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
Expand All @@ -16,18 +16,18 @@
// - 490677: Database connection properties made configurable in test.properties
package org.eclipse.persistence.testing.tests.eis.aq;

import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueReceiver;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.jms.TopicConnection;
import javax.jms.TopicPublisher;
import javax.jms.TopicSession;
import javax.jms.TopicSubscriber;
import jakarta.jms.Queue;
import jakarta.jms.QueueConnection;
import jakarta.jms.QueueReceiver;
import jakarta.jms.QueueSender;
import jakarta.jms.QueueSession;
import jakarta.jms.Session;
import jakarta.jms.TextMessage;
import jakarta.jms.Topic;
import jakarta.jms.TopicConnection;
import jakarta.jms.TopicPublisher;
import jakarta.jms.TopicSession;
import jakarta.jms.TopicSubscriber;

import org.eclipse.persistence.logging.AbstractSessionLog;
import org.eclipse.persistence.logging.SessionLog;
Expand All @@ -42,7 +42,7 @@
import org.junit.Rule;
import org.junit.Test;

import oracle.jms.AQjmsSession;
import oracle.jakarta.jms.AQjmsSession;

/**
* Test direct interactions through the AQ JMS driver. Requires AQ installed on this database.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
Expand Down Expand Up @@ -32,13 +32,13 @@
import org.junit.Rule;
import org.junit.Test;

import oracle.AQ.AQDequeueOption;
import oracle.AQ.AQDriverManager;
import oracle.AQ.AQEnqueueOption;
import oracle.AQ.AQMessage;
import oracle.AQ.AQQueue;
import oracle.AQ.AQRawPayload;
import oracle.AQ.AQSession;
import oracle.jakarta.AQ.AQDequeueOption;
import oracle.jakarta.AQ.AQDriverManager;
import oracle.jakarta.AQ.AQEnqueueOption;
import oracle.jakarta.AQ.AQMessage;
import oracle.jakarta.AQ.AQQueue;
import oracle.jakarta.AQ.AQRawPayload;
import oracle.jakarta.AQ.AQSession;

/**
* Test direct interactions through the AQ Java driver. Requires AQ installed on this database.
Expand Down Expand Up @@ -75,8 +75,8 @@ public void testDirectConnect() throws Exception {
Connection connection = null;
AQSession session = null;
try {
final Class<?> driver = Class.forName("oracle.AQ.AQOracleDriver");
assertNotNull("Driver class oracle.AQ.AQOracleDriver was not found", driver);
final Class<?> driver = Class.forName("oracle.jakarta.AQ.AQOracleDriver");
assertNotNull("Driver class oracle.jakarta.AQ.AQOracleDriver was not found", driver);
connection = getConnection();
connection.setAutoCommit(false);
session = AQDriverManager.createAQSession(connection);
Expand Down Expand Up @@ -104,7 +104,7 @@ public void testDirectInteraction() throws Exception {
try {
connection = getConnection();
connection.setAutoCommit(false);
Class.forName("oracle.AQ.AQOracleDriver");
Class.forName("oracle.jakarta.AQ.AQOracleDriver");
session = AQDriverManager.createAQSession(connection);
AQQueue queue = session.getQueue(NoSQLProperties.getDBUserName(), "raw_order_queue");
LOG.log(SessionLog.FINEST, queue.toString());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 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
Expand Down Expand Up @@ -40,7 +40,7 @@
import org.junit.Rule;
import org.junit.Test;

import oracle.AQ.AQDequeueOption;
import oracle.jakarta.AQ.AQDequeueOption;

/**
* Tests based on {@link Order} and {@link Address} entities and {@code raw_order_queue} model.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version = '1.0' encoding = 'UTF-8'?>
<!--
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 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
Expand Down Expand Up @@ -172,7 +172,7 @@
</attribute-mappings>
<descriptor-type>independent</descriptor-type>
<amendment>
<amendment-class>org.eclipse.persistence.testing.models.order.eis.aq.OrderAmendments</amendment-class>
<amendment-class>org.eclipse.persistence.testing.models.eis.aq.OrderAmendments</amendment-class>
<amendment-method>addToOrderDescriptor</amendment-method>
</amendment>
<instantiation/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version = '1.0' encoding = 'UTF-8'?>
<!--
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 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
Expand Down Expand Up @@ -172,7 +172,7 @@
</attribute-mappings>
<descriptor-type>independent</descriptor-type>
<amendment>
<amendment-class>org.eclipse.persistence.testing.models.order.eis.aq.OrderAmendments</amendment-class>
<amendment-class>org.eclipse.persistence.testing.models.eis.aq.OrderAmendments</amendment-class>
<amendment-method>addToOrderDescriptor</amendment-method>
</amendment>
<instantiation/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
Expand All @@ -21,7 +21,8 @@
import org.eclipse.persistence.eis.interactions.*;
import org.eclipse.persistence.internal.eis.adapters.aq.*;
import org.eclipse.persistence.internal.sessions.AbstractRecord;
import oracle.AQ.*;
import oracle.jakarta.AQ.AQDequeueOption;
import oracle.jakarta.AQ.AQEnqueueOption;

/**
* Platform for Oracle AQ JCA adapter.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
Expand All @@ -16,7 +16,7 @@

import jakarta.resource.*;
import jakarta.resource.cci.*;
import oracle.AQ.*;
import oracle.jakarta.AQ.AQSession;
import org.eclipse.persistence.exceptions.ValidationException;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
Expand All @@ -20,7 +20,8 @@
import javax.naming.*;
import jakarta.resource.*;
import jakarta.resource.cci.*;
import oracle.AQ.*;
import oracle.jakarta.AQ.AQSession;
import oracle.jakarta.AQ.AQDriverManager;
import org.eclipse.persistence.internal.security.PrivilegedAccessHelper;
import org.eclipse.persistence.internal.security.PrivilegedClassForName;

Expand Down Expand Up @@ -58,9 +59,9 @@ public Connection getConnection(ConnectionSpec spec) throws ResourceException {
connection.setAutoCommit(false);
}
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
AccessController.doPrivileged(new PrivilegedClassForName<>("oracle.AQ.AQOracleDriver", true, this.getClass().getClassLoader()));
AccessController.doPrivileged(new PrivilegedClassForName<>("oracle.jakarta.AQ.AQOracleDriver", true, this.getClass().getClassLoader()));
}else{
PrivilegedAccessHelper.getClassForName("oracle.AQ.AQOracleDriver", true, this.getClass().getClassLoader());
PrivilegedAccessHelper.getClassForName("oracle.jakarta.AQ.AQOracleDriver", true, this.getClass().getClassLoader());
}
session = AQDriverManager.createAQSession(connection);
} catch (Exception exception) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
Expand All @@ -14,7 +14,7 @@
// Oracle - initial API and implementation from Oracle TopLink
package org.eclipse.persistence.internal.eis.adapters.aq;

import oracle.AQ.*;
import oracle.jakarta.AQ.AQDequeueOption;

/**
* Interaction spec for AQ JCA adapter.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
Expand All @@ -14,7 +14,7 @@
// Oracle - initial API and implementation from Oracle TopLink
package org.eclipse.persistence.internal.eis.adapters.aq;

import oracle.AQ.*;
import oracle.jakarta.AQ.AQEnqueueOption;

/**
* Interaction spec for AQ JCA adapter.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
Expand All @@ -16,7 +16,11 @@

import jakarta.resource.*;
import jakarta.resource.cci.*;
import oracle.AQ.*;
import oracle.jakarta.AQ.AQDequeueOption;
import oracle.jakarta.AQ.AQEnqueueOption;
import oracle.jakarta.AQ.AQMessage;
import oracle.jakarta.AQ.AQQueue;
import oracle.jakarta.AQ.AQRawPayload;
import org.eclipse.persistence.eis.EISException;

/**
Expand Down
9 changes: 4 additions & 5 deletions foundation/org.eclipse.persistence.oracle.test/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019, 2022 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2019, 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
Expand Down Expand Up @@ -98,15 +98,14 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.jms</groupId>
<artifactId>javax.jms-api</artifactId>
<version>2.0.1</version>
<groupId>jakarta.jms</groupId>
<artifactId>jakarta.jms-api</artifactId>
<scope>test</scope>
</dependency>
<!--Oracle proprietary dependencies-->
<dependency>
<groupId>com.oracle.database.messaging</groupId>
<artifactId>aqapi</artifactId>
<artifactId>aqapi-jakarta</artifactId>
<scope>test</scope>
</dependency>
<!--Other modules-->
Expand Down

0 comments on commit 0767bf4

Please sign in to comment.