private void remove(Planet planet) { if(parentPlanet == planet) { parentPlanet = null; throw new IllegalFormatCodePointException(1); } }
/** * @tests java.util.IllegalFormatCodePointException.getCodePoint() */ public void test_getCodePoint() { int codePoint = 12345; IllegalFormatCodePointException illegalFormatCodePointException = new IllegalFormatCodePointException( codePoint); assertEquals(codePoint, illegalFormatCodePointException.getCodePoint()); }
/** * @tests java.util.IllegalFormatCodePointException.getMessage() */ public void test_getMessage() { int codePoint = 12345; IllegalFormatCodePointException illegalFormatCodePointException = new IllegalFormatCodePointException( codePoint); assertTrue(null != illegalFormatCodePointException.getMessage()); }
public void assertDeserialized(Serializable initial, Serializable deserialized) { SerializationTest.THROWABLE_COMPARATOR.assertDeserialized(initial, deserialized); IllegalFormatCodePointException initEx = (IllegalFormatCodePointException) initial; IllegalFormatCodePointException desrEx = (IllegalFormatCodePointException) deserialized; assertEquals("CodePoint", initEx.getCodePoint(), desrEx .getCodePoint()); }
@Override public IBAN get() { try { fillCountryCode(); fillAccountNumber(); fillBankCode(); fillBranchCode(); nationalCheckDigit = nationalCheckDigit(nationalCheckDigit); Iban iban = new Iban.Builder() .countryCode(countryCode) .bankCode(bankCode) .branchCode(branchCode) .nationalCheckDigit(nationalCheckDigit) .accountNumber(accountNumber) .build(); String identificationNumber = iban.getIdentificationNumber(); String checkDigit = iban.getCheckDigit(); String accountType = iban.getAccountType(); String bban = iban.getBban(); String ownerAccountType = iban.getOwnerAccountType(); String ibanNumber = iban.toString(); return new IBAN(accountNumber, identificationNumber, branchCode, checkDigit, accountType, bankCode, bban, countryCode.getName(), nationalCheckDigit, ownerAccountType, ibanNumber); } catch (IllegalFormatCodePointException e) { throw new IllegalArgumentException("Invalid iban " + e.getMessage(), e); } }
/** * @tests java.util.IllegalFormatCodePointException.IllegalFormatCodePointException(int) */ public void test_illegalFormatCodePointException() { IllegalFormatCodePointException illegalFormatCodePointException = new IllegalFormatCodePointException( -1); assertTrue(null != illegalFormatCodePointException); }
/** * @tests serialization/deserialization. */ public void testSerializationSelf() throws Exception { SerializationTest.verifySelf( new IllegalFormatCodePointException(12345), exComparator); }
/** * @tests serialization/deserialization compatibility with RI. */ public void testSerializationCompatibility() throws Exception { SerializationTest.verifyGolden(this, new IllegalFormatCodePointException(12345), exComparator); }