Monday, January 21, 2013

Difference Between JUnit And TestNG Annotations



Difference Between JUnit And TestNG Annotations

Features JUnit Annotations TestNG Annotations
Test annotation. @Test @Test
Run before all test in this suite have run. -- @BeforeSuite
Run after all test in this suite have run. -- @AfterSuite
Run before the test. -- @BeforeTest
Run after the test. -- @AfterTest
Run before the first test method that belongs to any of these group is invoked. -- @BeforeGroup
Run after the last test method that belongs to any of these group is invoked. -- @AfterGroup
Run before the first test method in the current class is invoked. @BeforeClass @BeforeClass
Run after all the test method in the current class have been run. @AfterClass @AfterClass
Run before each test method. @Before @BeforeMethod
Run after each test method. @After @AfterMethod
IgnoreTest @ignore @Test(enable=false)
Expected Exception @Test(Expected=ArithmeticException.Class) @Test(ExpectedExceptions=ArithmeticException.Class)
TimeOut @Test(timeout=1000) @Test(timeout=1000)
Thanks From Prashant Chauhan

5 Questions You Should Never Ask in a Job Interview


Could these words be costing you your dream job?

By Catherine Conlan, Monster Contributing Writer

Hiring managers and HR pros will often close out a job interview by asking an applicant if he or she has any questions themselves. This is a great opportunity to find out more about the job and the company's expectations, but you can't forget that the interviewer hasn't stopped judging YOU. Here are 5 questions that can make a bad impression on your interviewer, scuttling your chances for getting the job.

1. When will I be promoted ?


This is one of the most common questions that applicants come up with, and it should be avoided, says Rebecca Woods, Vice President of Human Resources at Doherty Employer Services in Minneapolis. "It's inappropriate because it puts the cart before the horse."  Instead of asking when the promotion will occur, Woods says a better approach is to ask what you would need to do to get a promotion.

2. What's the salary for this position ?


Asking about salary and benefits in the first interview "always turns me off," says Norma Beasant, founder of Talento Human Resources Consulting and an HR consultant at the University of Minnesota. "I'm always disappointed when they ask this, especially in the first interview." Beasant says the first interview is more about selling yourself to the interviewer, and that questions about salary and benefits should really wait until a later interview.

3. When can I expect a raise ?


Talking about compensation can be difficult, but asking about raises is not the way to go about it, Woods says. So many companies have frozen salaries and raises that it makes more sense to ask about the process to follow or what can be done to work up to higher compensation level. Talking about "expecting" a raise, Woods says, "shows a person is out of touch with reality."

4. What sort of flextime options do you have ?


This kind of question can make it sound like you're interested in getting out of the office as much as possible. "When I hear this question, I'm wondering, are you interested in the job?" Beasant says. Many companies have many options for scheduling, but asking about it in the first interview is "not appropriate," Beasant says.

5. Any question that shows you haven't been listening. 


Woods said she interviewed an applicant for a position that was 60 miles from the person's home. Woods told the applicant that the company was flexible about many things, but it did not offer telecommuting. "At the end of the interview, she asked if she would be able to work from home," Woods says. "Was she even listening? So some 'bad questions' can be more situational to the interview itself."

With the economy the way it is, employers are much more choosy and picky, Beasant says. Knowing the questions to avoid in an interview can help you stand out -- in a good way.


Thursday, January 10, 2013

The Difference Between Cookies and Sessions.

The main difference between cookies and sessions is that cookies are stored in the user's browser, and sessions are not. This difference determines what each is best used for.

A cookie can keep information in the user's browser until deleted. If a person has a login and password, this can be set as a cookie in their browser so they do not have to re-login to your website every time they visit. You can store almost anything in a browser cookie. The trouble is that a user can block cookies or delete them at any time. If, for example, your website's shopping cart utilized cookies, and a person had their browser set to block them, then they could not shop at your website.

Sessions are not reliant on the user allowing a cookie. They work instead like a token allowing access and passing information while the user has their browser open. The problem with sessions is that when you close your browser you also lose the session. So, if you had a site requiring a login, this couldn't be saved as a session like it could as a cookie, and the user would be forced to re-login every time they visit.

You can of course get the best of both worlds! Once you know what each does, you can use a combination of cookies and sessions to make your site work exactly the way you want it to.