Questions tagged [database-testing]

84 questions
0
votes
2 answers

How to test @Transactional method, where two table are getting updated

I am trying to write a unit test for a method which uses: @Transactional. There are two methods are being called, each is running an update query on two table, if one fails other should not run or rollback. I need to write a unit test to check if…
0
votes
2 answers

Unit testing a function that depends on database

I am running tests on some functions. I have a function that uses database queries. So, I have gone through the blogs and docs that say we have to make an in memory or test database to use such functions. Below is my function, def…
0
votes
1 answer

How to prevent application (using hibernate + c3po) from hanging if Mysql port is blocked?

I've been trying to make my Java application db fail proof, so that they are no unexpected lags if the DB is not available. I've successfully handled the easy case when the database is totally down. I am stuck on a case when the mysql is port is…
lazyloader
  • 157
  • 2
  • 10
0
votes
1 answer

Mockito - Mock ReultSet

Here is my method under test as well as test code. My method under test depends on the result set produced by runExecuteQueryStatement. If the resultSet is null and resultSet.next is false it is going to return 0 else when the resultSet.next returns…
Muthaiah PL
  • 1,048
  • 3
  • 15
  • 26
0
votes
1 answer

How would you unit test a method whose only purpose to make a database call?

I have method something like this: func (alert *Alert) CreateAlert(db *mgo.Database) error { return db.C("alerts").Insert(&alert) } How should I unit test this? If I just call this method for uni test, then I will have to create test DB to…
Ankit Sahu
  • 387
  • 1
  • 3
  • 11
0
votes
1 answer

How to validate elastic search data with sql data after migration from sql to elastic search

Anyone who have worked on elastic search. need input as mentioned in subject. I have one requirement in which sql data is migrated to elastic Search now there is ton of data so I can not check each and every field manually. So what is best way to…
anky
  • 91
  • 1
  • 5
0
votes
0 answers

I am getting error Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

package GoldenGate; import java.sql.Connection; import java.sql.Statement; import java.sql.ResultSet; import java.sql.DriverManager; import java.sql.SQLException; public class SQLConnector { public…
0
votes
1 answer

Can tsqlt be used with parallel data warehouse?

Saw that CLR functions needed to be enabled to use tsqlt. Can I actually use it in PDW ? Or any other ways or tools to perform unit testing on PDW ? Thanks,
0
votes
2 answers

JMockIt Mocked Method not Mocking

[10/7/06 4:00 Edited example code] I'm trying to test some code (using JMockIt with TestNG) without touching the database, but it appears a mocked method is still actually called. Here's the simplified setup: class DBRow { public DBRow() { } …
Didjit
  • 785
  • 2
  • 8
  • 26
0
votes
1 answer

Changing datasets for each PHPUnit Test

i'm kinda noobie in PHPUnit Testing and I need to cover multiple scenarios of a method. The method takes the rows of a table and make decisions based on it, so if I have 0 rows matching my query, it will execute some action, else, it will execute…
gfviegas
  • 58
  • 4
0
votes
1 answer

What is worth testing in an ActiveRecord model/entity?

I've just started with unit testing and I'm getting a bit confused and a bit overwhelmed when the subject is testing the models. I currently have some ActiveRecord models with setters and getters. Most of them are simply to encapsulate data, only a…
lbrandao
  • 4,144
  • 4
  • 35
  • 43
0
votes
1 answer

Accessing same instance of an object in @Before and @After in a JUnit4 test

I'm using JUnit 4 for testing a database-application. Since each test requires a special preset of the database before it runs, I'm using the @Before method to load the data first and the @After method to delete all data from the database. For some…
0
votes
2 answers

How to test database calls with testng in spring boot

I have created small web application in spring boot.I am new for TestNG. I am trying to test my services with testng which calls dao for database operations. I am trying to do it using inmemory database HSQL. Following is my…
Prashant Shilimkar
  • 8,402
  • 13
  • 54
  • 89
0
votes
2 answers

Data Warehouse Testing Approach

I am working on testing space on Data Warehousing. In the scope I got newly created and dimensions and facts which should be validated. As per my knowledge and information got via browsing I would decide to cover for following Schema validation of…
Shabar
  • 2,617
  • 11
  • 57
  • 98
0
votes
3 answers

What is the best way to do testing database (MYSQL spesific)

Right now i'm on testing something in a database. It's a wordpress database. i have to write and delete and do other operation on it. As you know it, it has indexing mechanism that will always make every new post inherit the next highest possible…
justjoe
  • 5,454
  • 9
  • 44
  • 64