question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DataSetProvider incompatible data types on extected data set

See original GitHub issue
public class UserDataSetProvider implements DataSetProvider {

        @Override
        public IDataSet provide() throws DataSetException {
            DataSetBuilder builder = new DataSetBuilder();
            IDataSet dataSet = builder
                    .table("user") 
                        .columns("id", "name")
                        .values(1,"@realpestano")
                    .build();
            return dataSet;
        }
    }
@DBRider
@DBUnit(caseSensitiveTableNames = true)
class UserTest {

    @Test
    @DataSet(provider = UserDataSetProvider.class, cleanBefore = true)
    @ExpectedDataSet(provider = UserDataSetProvider::class)
    public void shouldSeedDatabaseProgrammatically() {
        List<User> users = EntityManagerProvider.em().createQuery("select u from User u ").getResultList();
        assertThat(users).
                isNotNull().
                isNotEmpty().hasSize(3).
                extracting("name").
                contains("@dbunit", "@dbrider", "@new row");
    }
}

We get an error

junit.framework.ComparisonFailure: Incompatible data types: (table=user, col=id) 
Expected :NUMERIC
Actual   :BIGINT

PostgreSQL 11 database.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
raderiocommented, Sep 3, 2019
0reactions
rmpestanocommented, Sep 3, 2019

Maybe it is the docker version, let me check my env which is working now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

incompatible data types in combination" Error when Loading ...
"java.sql.SQLSyntaxErrorException: incompatible data types in combination" Error when Loading Data from XML to Oracle Database (Doc ID 2901081.1).
Read more >
Incompatible data types(hypersql) - java - Stack Overflow
SQLSyntaxErrorException : incompatible data type in operation: ; in LIMIT, OFFSET or FETCH in statement [ select * from( select l.
Read more >
KB38458: "Incompatible datatypes in expression :"
KB38458: "Incompatible datatypes in expression :" error thrown when performing a SUM() on a column in a Text File Database in MicroStrategy ...
Read more >
How to Handle the Incompatible Types Error in Java - Rollbar
The Java incompatible types error happens when a value assigned to a variable or returned by a method is incompatible with the one...
Read more >
Datasnap.Provider.TDataSetProvider - Embarcadero DocWiki
Description. TDataSetProvider provides data from a dataset and resolves updates to that dataset or its database server. Use TDataSetProvider to provide data ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found