/** * Storage attribute: 1234 Default value: null Assert return default value */ @Test public void testGetStorageAttributeIntegerValueByNameWithDefault_4() { String attributeName = "test"; String attributeValue = "1234"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); Integer defaultValue = null; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, defaultValue); assertEquals(new Integer(attributeValue), value); }
/** * Storage attribute: 1234 Attribute required: false Attribute required if exists: true Assert result = 1234 */ @Test public void testGetStorageAttributeIntegerValueByName_1() { String attributeName = "test"; String attributeValue = "1234"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = false; boolean attributeValueRequiredIfExists = true; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); assertEquals(new Integer(attributeValue), value); }
/** * Storage attribute: 1234 Default value: 2345 Assert return default value */ @Test public void testGetStorageAttributeIntegerValueByNameWithDefault_3() { String attributeName = "test"; String attributeValue = "1234"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); Integer defaultValue = 2345; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, defaultValue); assertEquals(new Integer(attributeValue), value); }
/** * Storage attribute: 1234 Attribute required: false Attribute required if exists: false Assert result = 1234 */ @Test public void testGetStorageAttributeIntegerValueByName_3() { String attributeName = "test"; String attributeValue = "1234"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = false; boolean attributeValueRequiredIfExists = false; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); assertEquals(new Integer(attributeValue), value); }
/** * Storage attribute: 1234 Attribute required: true Attribute required if exists: false Assert result = 1234 */ @Test public void testGetStorageAttributeIntegerValueByName_2() { String attributeName = "test"; String attributeValue = "1234"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = true; boolean attributeValueRequiredIfExists = false; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); assertEquals(new Integer(attributeValue), value); }
/** * Storage attribute: null Attribute required: true Attribute required if exists: false Assert throw */ @Test public void testGetStorageAttributeIntegerValueByName_12() { String attributeName = "test"; String attributeValue = null; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = true; boolean attributeValueRequiredIfExists = false; Integer value = storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); assertEquals(attributeValue, value); }
/** * Storage attribute: null Attribute required: false Attribute required if exists: false Assert return null */ @Test public void testGetStorageAttributeIntegerValueByName_13() { String attributeName = "test"; String attributeValue = null; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = true; boolean attributeValueRequiredIfExists = false; assertEquals(attributeValue, storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists)); }
/** * Storage attribute: abcd Default value: 2345 Assert throw */ @Test public void testGetStorageAttributeIntegerValueByNameWithDefault_5() { String attributeName = "test"; String attributeValue = "abcd"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); Integer defaultValue = 2345; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, defaultValue); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Storage attribute \"" + attributeName + "\" must be a valid integer. Actual value is \"" + attributeValue + "\"", e.getMessage()); } }
/** * Storage attribute: blank Attribute required: true Attribute required if exists: false Assert throw */ @Test public void testGetStorageAttributeIntegerValueByName_6() { String attributeName = "test"; String attributeValue = BLANK_TEXT; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = true; boolean attributeValueRequiredIfExists = false; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Storage attribute \"" + attributeName + "\" must be a valid integer. Actual value is \"" + attributeValue + "\"", e.getMessage()); } }
/** * Storage attribute: blank Attribute required: false Attribute required if exists: false Assert throw */ @Test public void testGetStorageAttributeIntegerValueByName_7() { String attributeName = "test"; String attributeValue = BLANK_TEXT; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = false; boolean attributeValueRequiredIfExists = false; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Storage attribute \"" + attributeName + "\" must be a valid integer. Actual value is \"" + attributeValue + "\"", e.getMessage()); } }
/** * Storage attribute: abcd Default value: null Assert throw */ @Test public void testGetStorageAttributeIntegerValueByNameWithDefault_6() { String attributeName = "test"; String attributeValue = "abcd"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); Integer defaultValue = null; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, defaultValue); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Storage attribute \"" + attributeName + "\" must be a valid integer. Actual value is \"" + attributeValue + "\"", e.getMessage()); } }
/** * Storage attribute: blank Default value: 2345 Assert throw */ @Test public void testGetStorageAttributeIntegerValueByNameWithDefault_7() { String attributeName = "test"; String attributeValue = BLANK_TEXT; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); Integer defaultValue = 2345; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, defaultValue); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Storage attribute \"" + attributeName + "\" must be a valid integer. Actual value is \"" + attributeValue + "\"", e.getMessage()); } }
/** * Storage attribute: abcd Attribute required: false Attribute required if exists: false Assert throw */ @Test public void testGetStorageAttributeIntegerValueByName_4() { String attributeName = "test"; String attributeValue = "abcd"; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = false; boolean attributeValueRequiredIfExists = false; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Storage attribute \"" + attributeName + "\" must be a valid integer. Actual value is \"" + attributeValue + "\"", e.getMessage()); } }
/** * Storage attribute: blank Default value: null Assert throw */ @Test public void testGetStorageAttributeIntegerValueByNameWithDefault_8() { String attributeName = "test"; String attributeValue = BLANK_TEXT; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); Integer defaultValue = null; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, defaultValue); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Storage attribute \"" + attributeName + "\" must be a valid integer. Actual value is \"" + attributeValue + "\"", e.getMessage()); } } }
/** * Storage attribute: null Attribute required: false Attribute required if exists: true Assert return null */ @Test public void testGetStorageAttributeIntegerValueByName_11() { String attributeName = "test"; String attributeValue = null; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = false; boolean attributeValueRequiredIfExists = true; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Attribute \"" + attributeName + "\" for \"" + storageEntity.getName() + "\" storage must have a value that is not blank.", e.getMessage()); } }
/** * Storage attribute: blank Attribute required: false Attribute required if exists: true Assert throw */ @Test public void testGetStorageAttributeIntegerValueByName_5() { String attributeName = "test"; String attributeValue = BLANK_TEXT; StorageEntity storageEntity = storageDaoTestHelper.createStorageEntityWithAttributes(attributeName, attributeValue); boolean attributeRequired = false; boolean attributeValueRequiredIfExists = true; try { storageHelper.getStorageAttributeIntegerValueByName(attributeName, storageEntity, attributeRequired, attributeValueRequiredIfExists); fail(); } catch (Exception e) { assertEquals(IllegalStateException.class, e.getClass()); assertEquals("Attribute \"" + attributeName + "\" for \"" + storageEntity.getName() + "\" storage must have a value that is not blank.", e.getMessage()); } }