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

Unit tests for AttributeUpdates #79

Merged
merged 3 commits into from
Sep 5, 2016
Merged

Unit tests for AttributeUpdates #79

merged 3 commits into from
Sep 5, 2016

Conversation

amihaiemil
Copy link
Member

@amihaiemil amihaiemil commented Aug 24, 2016

PR for #55 .

Wrote unit tests for the methods in class AttributeUpdates .

Unit test AttributeUpdatesTest.containsValue() looks weird. Normally it should work with only attr.containsValue(value), but it does not. I reported this issue for it.
I could have written the correct text (without the "hack") and Ignore it, but I didn't want to create dependencies between tasks... If the bug I reported will be accepted, then the test will be "fixed" with it - and if for any reason it won't be accepted, then this task is free, there won't be a need to create other issue just to unIgnore the test.

@dmarkov
Copy link

dmarkov commented Aug 25, 2016

@amihaiemil Thanks, let me find someone who can review this pull request

@dmarkov
Copy link

dmarkov commented Aug 25, 2016

@mkordas please review this PR

@mkordas
Copy link

mkordas commented Aug 25, 2016

@amihaiemil I'll check it soon

@mkordas
Copy link

mkordas commented Aug 25, 2016

@amihaiemil

If the bug I reported will be accepted, then the test will be "fixed" with it - and if for any reason it won't be accepted, then this task is free, there won't be a need to create other issue just to unIgnore the test.

Right, makes sense, good catch.

/**
* AttributesUpdates.put(...) throws exception when called.
*/
@Test(expected = UnsupportedOperationException.class)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amihaiemil please see: yegor256/qulice#668 - no big harm here, but future version of Qulice would prohibit such code

@mkordas
Copy link

mkordas commented Aug 25, 2016

@amihaiemil see my review above

@mkordas
Copy link

mkordas commented Aug 26, 2016

@amihaiemil will you have time for this one today or tomorrow? Should I keep pinging you?

@amihaiemil
Copy link
Member Author

@mkordas tomorrow evening or on sunday morning :D

@mkordas
Copy link

mkordas commented Aug 27, 2016

@amihaiemil any success today? :)

@amihaiemil
Copy link
Member Author

@mkordas done. Can you merge pls?

new AttributeUpdates().clear();
Assert.fail("#clear should not be supported.");
} catch (final UnsupportedOperationException ex) {
MatcherAssert.assertThat("test passed", Matchers.notNullValue());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkordas These always-true asserts are done since catch block cannot be empty and also a boolean flag and an if() statement afterwards cannot be done because every variable has to be final.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amihaiemil I'm not aware of rule demanding that all variables must be final

@mkordas
Copy link

mkordas commented Aug 28, 2016

@amihaiemil I'll check it in an hour

@amihaiemil
Copy link
Member Author

@mkordas sure, thanks

@mkordas
Copy link

mkordas commented Aug 28, 2016

@amihaiemil I'm ready here :)

new AttributeUpdates().putAll(new AttributeUpdates());
Assert.fail("#putAll should not be supported.");
} catch (final UnsupportedOperationException ex) {
MatcherAssert.assertThat("test ok", Matchers.notNullValue());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amihaiemil that assertion is a bit awkward for me. Personally I'd go with // expected comment or if comment violates Qulice as well I'd make asssertion on ex.getMessage - whatever it is

@mkordas
Copy link

mkordas commented Aug 28, 2016

@amihaiemil I have one minor comment open, please take a look when you can, but in the meantime I can trigger merge

@mkordas
Copy link

mkordas commented Aug 28, 2016

@rultor merge

@rultor
Copy link
Contributor

rultor commented Aug 28, 2016

@rultor merge

@mkordas Thanks for your request. @yegor256 Please confirm this.

@amihaiemil
Copy link
Member Author

@mkordas thank you. I added the boolean and if() statement. I could have sworn all variables had to be final... strange

@amihaiemil
Copy link
Member Author

@yegor256 ping

@mkordas
Copy link

mkordas commented Aug 29, 2016

@amihaiemil thanks for the fix in 75e8167, looks good

@amihaiemil
Copy link
Member Author

@yegor256 ping

@mkordas
Copy link

mkordas commented Aug 31, 2016

@yegor256 please review this one

@mkordas
Copy link

mkordas commented Sep 1, 2016

@yegor256 this is waiting as well

@mkordas
Copy link

mkordas commented Sep 2, 2016

@yegor256 ping

@mkordas
Copy link

mkordas commented Sep 4, 2016

@yegor256 ping again

@yegor256
Copy link
Member

yegor256 commented Sep 5, 2016

@rultor try to merge

@rultor
Copy link
Contributor

rultor commented Sep 5, 2016

@rultor try to merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit 75e8167 into jcabi:master Sep 5, 2016
@rultor
Copy link
Contributor

rultor commented Sep 5, 2016

@rultor try to merge

@yegor256 Done! FYI, the full log is here (took me 4min)

@dmarkov
Copy link

dmarkov commented Sep 7, 2016

@mkordas thanks, paid, 34 mins to your account, payment ID is 57cfdadcea7ef81beb1686c0, task took 288 hours and 44 mins to complete; you're getting extra minutes here (c=19); added +34 to your rating, now it is equal to +4127

@dmarkov
Copy link

dmarkov commented Sep 7, 2016

@rultor please deploy

@rultor
Copy link
Contributor

rultor commented Sep 7, 2016

@rultor please deploy

@dmarkov OK, I'll try to deploy now. You can check the progress here

@rultor
Copy link
Contributor

rultor commented Sep 7, 2016

@rultor please deploy

@dmarkov Done! FYI, the full log is here (took me 7min)

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

Successfully merging this pull request may close these issues.

5 participants