From: David ‘Bombe’ Roden Date: Fri, 25 Oct 2013 04:40:14 +0000 (+0200) Subject: Verify that a missing section does not cause an error. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4de51d1f23c4b8013faec911b00cc5b7fc1d90f0;p=Sone.git Verify that a missing section does not cause an error. --- diff --git a/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java b/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java index 1799ac7..f0fca12 100644 --- a/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java +++ b/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java @@ -151,6 +151,11 @@ public class SoneParserTest { } @Test + public void verifyThatMissingAlbumsSectionDoNotCauseAnError() { + soneParser.parseSone(database, originalSone, getXml("missing-albums")); + } + + @Test public void verifyThatAnEmptyProfileIsParsedWithoutError() { Sone sone = soneParser.parseSone(database, originalSone, getXml("empty-profile")); assertThat(sone.getProfile().getFirstName(), nullValue()); diff --git a/src/test/resources/sone-parser/missing-albums.xml b/src/test/resources/sone-parser/missing-albums.xml new file mode 100644 index 0000000..2b30fe7 --- /dev/null +++ b/src/test/resources/sone-parser/missing-albums.xml @@ -0,0 +1,72 @@ + + + + + 0 + + + Sone + 0.8.7 + + + + First + M. + Last + 22 + 10 + 2013 + 96431abe-3add-11e3-8a46-67047503bf6d + + + Field1 + Value1 + + + Field2 + Value2 + + + + + + + bbb7ebf0-3adb-11e3-8a0b-630cd8f21cf3 + + + Hello, World! + + + d8c9586e-3adb-11e3-bb31-171fc040e645 + 0rpD4gL8mszav2trndhIdKIxvKUCNAe2kjA3dLV8CVU + + Hello, User! + + + + + + f09fa448-3adb-11e3-a783-ab54a11aacc4 + bbb7ebf0-3adb-11e3-8a0b-630cd8f21cf3 + + Talking to myself. + + + 0a376440-3adc-11e3-8f45-c7cc157436a5 + 11ebe86e-3adc-11e3-b7b9-7f2c88018a33 + + Talking to somebody I can't see. + + + + + bbb7ebf0-3adb-11e3-8a0b-630cd8f21cf3 + 305d85e6-3adc-11e3-be45-8b53dd91f0af + + + + f09fa448-3adb-11e3-a783-ab54a11aacc4 + 3ba28960-3adc-11e3-93c7-6713d170f44c + + +