How to convert Hibernate POJO Classes to XML for JUnit Testing -
How to convert Hibernate POJO Classes to XML for JUnit Testing -
i have work on project seek write junit tests service layer. have check whether same info writing database (with same scenario , inputs) or not.
first planned create info user interface manually convert hibernate pojo classes xml , save sample result value. while testing junit, planned compare sample xml results. if junit result info same manually created sample info can understand junit test successful.
my question is: how can convert hibernate annotations , pojo classes xml? researched jaxb couldn't find way convert xml.
my model class this.
class="lang-java prettyprint-override">@entity @table(name="userss") public class user { @id @generatedvalue(strategy = generationtype.auto, generator = "seq_gen") @sequencegenerator(name = "seq_gen", sequencename = "s_") @basic(optional = false) @column(name="id", unique = true, nullable = false) private int id; @column(name="name", unique = true, nullable = false) private string name; @column(name="surname", unique = true, nullable = false) private string surname; @column(name="mail", unique = true, nullable = false) private string mail; @column(name="password", unique = true, nullable = false) private string password; //private userroles userroles; public user() { // todo auto-generated constructor stub } public user(int id, string name, string surname, string mail, string password) { this.id = id; this.name = name; this.surname = surname; this.mail = mail; this.password = password; } public int getid() { homecoming id; } //@column(name="name", unique = true, nullable = false) public void setid(int id) { this.id = id; } public string getname() { homecoming name; } public void setname(string htmlinputtext) { this.name = htmlinputtext; } public string getsurname() { homecoming surname; } public void setsurname(string htmlinputtext) { this.surname = htmlinputtext; } public string getmail() { homecoming mail; } public string getpassword() { homecoming password; } public void setmail(string htmlinputtext) { this.mail = htmlinputtext; } public void setpassword(string password) { this.password = password; } }
xml hibernate junit jaxb pojo
Comments
Post a Comment