Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Testing Interviews:Analyst TestingAutomationDatabase TestingJSUnitJUnitLocalization TestingManual TestingMobile TestingNetwork TestingQA ConceptsQA TestingQTPQUnitRadar TesterRational TestSuiteSoftware QASoftware TestingTest CasesTest Documents ReportingWebsites Stress TestingWinRunnerWireless Testing
Copyright © 2018. All Rights Reserved
JUnit Interview Question:
Why Does Poeple Import org.junit.Assert Statically?
Submitted by: AdministratorPoeple use the static import statement on org.junit.Assert to save coding time on calling its assetion methods. With a normal import statement, assertion method names must qualified with the class name like this:
import org.junit.Assert;
...
Assert.assertEquals(12, message.length());
With a static import statement, assertion method names can be used directly like this:
import static org.junit.Assert.*;
...
assertEquals(12, message.length());
Submitted by: Administrator
import org.junit.Assert;
...
Assert.assertEquals(12, message.length());
With a static import statement, assertion method names can be used directly like this:
import static org.junit.Assert.*;
...
assertEquals(12, message.length());
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.