Skip to content

Update RaindropConverterTest.java - #1303

Merged
sjwarner-bp merged 2 commits into
exercism:masterfrom
Kyle-Pu:patch-3
Feb 12, 2018
Merged

sjwarner-bp merged 2 commits into
exercism:masterfrom
Kyle-Pu:patch-3

Conversation

@Kyle-Pu

@Kyle-Pu Kyle-Pu commented Feb 11, 2018 •

Copy link
Copy Markdown
Contributor

Changed from parametrized tests to individual tests to allow TDD so tests can be ignored.

Methods to test sounds for prime numbers or numbers with their only factor as that prime number (other than 1 and itself) were grouped together in one method. For example, 3 and numbers which factor out to only 3's such as 9 and 27 were grouped together into one method named soundFor3OrNumberWithOnlyDistinctFactorOf3.

Some formatting may be off, but hopefully, this finishes the job for the raindrops class!

Closes part of #1293 (the raindrops test suite).


Reviewer Resources:

Track Policies

Changed from parametrized tests to individual tests to allow TDD so tests can be ignored.
@Kyle-Pu

Kyle-Pu commented Feb 11, 2018 •

Copy link
Copy Markdown
Contributor Author

How can I check why the build failed? Can't seem to find it in the Travis CI job log. Thanks!

@sjwarner-bp sjwarner-bp left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @Kyle-P

Looks like the build is failing because two of the tests no longer pass:

/home/travis/build/exercism/java/exercises/raindrops/.meta/src/reference/java/RaindropConverter.java)
:raindrops:processResources NO-SOURCE
:raindrops:classes
:raindrops:copyTestsFilteringIgnores
:raindrops:compileTestJava
  (source = /home/travis/build/exercism/java/exercises/raindrops/build/gen/test/java/RaindropConverterTest.java)
:raindrops:processTestResources NO-SOURCE
:raindrops:testClasses
:raindrops:testPicked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
RaindropConverterTest > soundFor35IsPlangPong FAILED
    org.junit.ComparisonFailure: expected:<PlangP[]ong> but was:<PlangP[l]ong>
        at org.junit.Assert.assertEquals(Assert.java:115)
        at org.junit.Assert.assertEquals(Assert.java:144)
        at RaindropConverterTest.soundFor35IsPlangPong(RaindropConverterTest.java:58)
RaindropConverterTest > soundFor21IsPlingPlong PASSED
RaindropConverterTest > soundFor7OrNumberWithOnlyDistinctFactorOf7IsPlong PASSED
RaindropConverterTest > noSoundFor2Cubed PASSED
RaindropConverterTest > soundFor5OrNumberWithOnlyDistinctFactorOf5IsPlang PASSED
RaindropConverterTest > soundFor1Is1 PASSED
RaindropConverterTest > noSoundFor52 PASSED
RaindropConverterTest > soundFor105IsPlingPlangPlong FAILED
    org.junit.ComparisonFailure: expected:<PlingPlangP[]ong> but was:<PlingPlangP[l]ong>
        at org.junit.Assert.assertEquals(Assert.java:115)
        at org.junit.Assert.assertEquals(Assert.java:144)
        at RaindropConverterTest.soundFor105IsPlingPlangPlong(RaindropConverterTest.java:68)
RaindropConverterTest > soundFor15IsPlingPlang PASSED
RaindropConverterTest > soundFor3OrNumberWithOnlyDistinctFactorOf3 PASSED
10 tests completed, 2 failed
:raindrops:test FAILED

@Ignore("Remove to run test")
@Test
public void soundFor35IsPlangPong() {
assertEquals("PlangPong", raindropConverter.convert(35));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just looks like a typo here pong should be plong 🙂

@Ignore("Remove to run test")
@Test
public void soundFor105IsPlingPlangPlong() {
assertEquals("PlingPlangPong", raindropConverter.convert(105));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here, just a typo pong -> plong 🙂

@Kyle-Pu

Kyle-Pu commented Feb 11, 2018

Copy link
Copy Markdown
Contributor Author

Alright, thanks @sjwarner-bp!

@sjwarner-bp

Copy link
Copy Markdown
Contributor

Looks like the build timed out - I'll kick it off again and then I think this should be good 🙂

@Kyle-Pu

Kyle-Pu commented Feb 12, 2018 •

Copy link
Copy Markdown
Contributor Author

Great! Thanks @sjwarner-bp! Looks like everything should be good now.

@sjwarner-bp
sjwarner-bp merged commit a8a720d into exercism:master Feb 12, 2018
@sjwarner-bp

Copy link
Copy Markdown
Contributor

Thanks @Kyle-P 🎆

@Kyle-Pu
Kyle-Pu deleted the patch-3 branch February 13, 2018 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants