Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7660659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:29:45+00:00 2026-05-31T13:29:45+00:00

I am attempting to perform integration testing on services that I have developed. Part

  • 0

I am attempting to perform integration testing on services that I have developed. Part of the service involves using daos. At this point what I need to do is in my setup create some sort of connection to the persistent unit and then I can test my service.

I basically copy the persistence.xml and put it in src/test/resources and am trying

@Before
public void beginTransaction() {
  emf = Persistence.createEntityManagerFactory(dao-test");
  em = emf.createEntityManager();
}

@Test
public void testAccountDonation(){

    AccountResult result = AccountService.getDonationAmount();
    Assert.assertEquals("Success", result.getResultCode());


}

A connection could not be obtained for driver class “oracle.jdbc.driver.OracleDriver” and URL “jdbc:oracle:thin:@data-arctichome.arcww2.com:1521:orclgdb1”. You may have specified an invalid URL.

Here is my persistence unit.

<persistence-unit name="dao-test"
    transaction-type="RESOURCE_LOCAL">

    <properties>
        <property name="openjpa.ConnectionDriverName"
            value="oracle.jdbc.driver.OracleDriver" />


        <property name="openjpa.ConnectionURL"
            value="jdbc:oracle:thin:@xxxxxxxxx:orclgdb1" />
        <property name="openjpa.ConnectionUserName" value="xxxxxx" />
        <property name="openjpa.ConnectionPassword"
            value="xxxxxx" />
    </properties>
</persistence-unit>

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:29:46+00:00Added an answer on May 31, 2026 at 1:29 pm

    Spring offers a lot of help for unit- and integration-testing, for example management of application contexts and transactions in integration tests, so rather than trying to create all the persistence- etc. stuff yourself for the tests in code, I’d suggest you read through the testing chapter (and maybe look for some examples in the ‘net) and use the functionality provided by Spring. It’s going to save you a ton of time and hair-pulling in the long run.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to perform a Storyboard segue from a UIbutton that is a
I'm attempting to perform dynamic sorting of data that I'm putting into grids into
I have a web page that connects to a SQL Server 2008 instance, attempting
I'm attempting to perform a link of previously generated .obj files (using the latest
I'm attempting to perform a full outer join on two tables that are not
I am attempting to perform an inner join on two tables so that I
I am attempting to build a system that allows users to perform certain actions,
Ok, I am attempting to use this custom extension to perform an entity update.
I have been attempting to perform multiple (different) string replacement with recursion and I
I am using mongoid on rails3. I am attempting to perform a very simple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.