Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【书籍勘误】assertNotSame #63

Open
abel533 opened this issue Nov 17, 2018 · 0 comments
Open

【书籍勘误】assertNotSame #63

abel533 opened this issue Nov 17, 2018 · 0 comments

Comments

@abel533
Copy link
Contributor

abel533 commented Nov 17, 2018

[email protected] 通过邮件指出本书的一处错误:

186页:

//这里的role2和前一个session查询的结果是两个不同的实例
Assert.assertNotEquals(role1,role2);
//……
Assert.assertNotEquals(role2,role3);

上面role1和role2不是同一个实例,role2和role3不是同一个实例,均没有问题,但 assertNotEquals该函数是比较内容是否相等,而不是比较的引用是否相等。在这里role1和role2内容是相等的,role2和role3也是相等的。
修改为:

Assert.assertNotSame(role1,role2);
//……
Assert.assertNotSame(role2,role3);

希望更正。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant