@Test public void testGetInt2() throws Throwable { int result = new SimpleConfiguration(new Properties()).getInt("testSimpleConfigurationName"); assertEquals("result", 0, result); }
@Test public void testGetInt() throws Throwable { int result = new SimpleConfiguration(new Properties()).getInt("testSimpleConfigurationName", 100); assertEquals("result", 100, result); }
@Test public void testGetInt1() throws Throwable { int result = new SimpleConfiguration(new Properties()).getInt("testSimpleConfigurationName", 0); assertEquals("result", 0, result); }
@Test public void testGetIntThrowsNumberFormatException1() throws Throwable { Properties props = new Properties(); props.put("YnFqoMm>b^[gMH*a^qc\f\n#\nUXhdWK\\^G", "testString"); try { new SimpleConfiguration(props).getInt("YnFqoMm>b^[gMH*a^qc\f\n#\nUXhdWK\\^G"); fail("Expected NumberFormatException to be thrown"); } catch (NumberFormatException ex) { assertEquals("ex.getMessage()", "For input string: \"testString\"", ex.getMessage()); } }
@Test public void testGetIntThrowsNumberFormatException() throws Throwable { SimpleConfiguration simpleConfiguration = new SimpleConfiguration(new Properties()); simpleConfiguration.put("testString", ""); try { simpleConfiguration.getInt("testString", 100); fail("Expected NumberFormatException to be thrown"); } catch (NumberFormatException ex) { assertEquals("ex.getMessage()", "For input string: \"\"", ex.getMessage()); } }
@Test public void testGetIntThrowsNullPointerException1() throws Throwable { try { new SimpleConfiguration((Properties) null).getInt("testSimpleConfigurationName"); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { assertNull("ex.getMessage()", ex.getMessage()); } }
@Test public void testGetIntThrowsNullPointerException() throws Throwable { try { new SimpleConfiguration((Properties) null).getInt("testSimpleConfigurationName", 100); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { assertNull("ex.getMessage()", ex.getMessage()); } }