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 6255969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:27:50+00:00 2026-05-24T14:27:50+00:00

private Long itemId; private String longName; private String shortName; private String itemUrl; private Integer

  • 0
    private Long itemId;

    private String longName;

    private String shortName;

    private String itemUrl;

    private Integer itemCount;

    private Long parentCategory;

    private Long childCategory;

    private Integer shopType;

    private Integer payPostage;

    private Long originalPrice;

    private String picUrl;

    private Long activityPrice;

    private String city;

    private String itemDesc;

    private Integer itemStatus;

    private String itemGuarantee;

    private Double discount;

    private String checkComment;

    private Long platformId;

    private Long sellerId;

    private String sellerNick;

    private Integer sellerCredit;

    private Long categoryId;

    private Long operatorId;

    private String operatorNick;

    private String sellerEmail;

    private String sellerPhone;

    private String sellerAddress;

    private String sellerShopUrl;

    private String sellerRealName;

    private String picUrlFromIC;

    private Integer itemType;

    private Integer tgType;

    private String attributes;

    private Integer isAuth = 0;

    private String[] itemCities;

    private Integer isBlack = 0;

    private double lowestPirce;

    private transient int pollNum;

    private Integer limitNum;

That is the object i have.
When i test a select operation(select the object from mysql).

should i verify each property of this object??

what is the best way to test such data access operations(I am using dbunit currently)

  • 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-24T14:27:51+00:00Added an answer on May 24, 2026 at 2:27 pm

    Should i verify each property of this object?

    Yes, you should. Otherwise, you would partially verify the state of the object, potentially resulting in unspecified data for the the unverified properties.

    What is the best way to test such data access operations(I am using dbunit currently)

    Assert for equality of the actual dataset/table contents and the pre-determined dataset/table contents. This is covered in the how-to guide of DbUnit. This would make sense for mutating operations involving INSERT, DELETE or an UPDATE.

    For SELECT operations, you can assert the values in the actual object and an expected object, or read the properties of the object into a Map, and compare it against the expected Map. If you’ve implemented equals() (and hashcode()) to consider all object properties, assertEquals() should be sufficient for verifying objects for equality. If you haven’t implemented equals() to consider all the object’s properties for equality, you can use the assertThat() method instead, with a custom matcher to verify if the object properties are equal.

    Additionally, if you have multiple such tests that have a known set of inputs for an DAO operation and expected dataset/table contents after the DAO operation, you can consider parameterizing the tests, so that the test sequence is defined only once, but the test is executed multiple times with different inputs, and the system is asserted with different expected outputs.

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

Sidebar

Related Questions

I have a class Item and Category Class Item { private long ItemId; private
public class Student implements java.io.Serializable { private long studentId; private String studentName; private Set<Course>
MainTable.java extends Common.java private Long id ; private Long version ; private String name
private void activateRecords(long[] stuff) { ... api.activateRecords(Arrays.asList(specIdsToActivate)); } Shouldn't this call to Arrays.asList return
private string? typeOfContract { get { return (string?)ViewState[typeOfContract]; } set { ViewState[typeOfContract] = value;
private IEnumerable<string> Tables { get { yield return Foo; yield return Bar; } }
I have the following object : class Repeat{ private long startIndex; private long endIndex;
I have the ViewValue class defined as follows: class ViewValue { private Long id;
There's an abstract class: public abstract class AbstractAny { private long period; public void
my primary key entity look like below @GeneratedValue(strategy= GenerationType.TABLE) private Long id; when i

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.