/** * Handles a simple label with an embedded ampersand and plus * * @throws FeathercoinURIParseException If something goes wrong * @throws UnsupportedEncodingException */ @Test public void testGood_LabelWithAmpersandAndPlus() throws FeathercoinURIParseException, UnsupportedEncodingException { String testString = "Hello Earth & Mars + Venus"; String encodedLabel = FeathercoinURI.encodeURLString(testString); testObject = new FeathercoinURI( NetworkParameters.prodNet(), FeathercoinURI.LITECOIN_SCHEME + ":" + PRODNET_GOOD_ADDRESS + "?label=" + encodedLabel); assertEquals(testString, testObject.getLabel()); }
/** * Handles a Russian label (Unicode test) * * @throws FeathercoinURIParseException If something goes wrong * @throws UnsupportedEncodingException */ @Test public void testGood_LabelWithRussian() throws FeathercoinURIParseException, UnsupportedEncodingException { // Moscow in Russian in Cyrillic String moscowString = "\u041c\u043e\u0441\u043a\u0432\u0430"; String encodedLabel = FeathercoinURI.encodeURLString(moscowString); testObject = new FeathercoinURI( NetworkParameters.prodNet(), FeathercoinURI.LITECOIN_SCHEME + ":" + PRODNET_GOOD_ADDRESS + "?label=" + encodedLabel); assertEquals(moscowString, testObject.getLabel()); }