javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/impl/storage/TestStorageAttribute.java
branchRCL_3
changeset 66 2455ef1f5bbc
parent 65 ae942d28ec0e
child 71 d5e927d5853b
equal deleted inserted replaced
65:ae942d28ec0e 66:2455ef1f5bbc
   134     /**
   134     /**
   135      * Test constructor with name and value.
   135      * Test constructor with name and value.
   136      * 2. Test with Name and Value.
   136      * 2. Test with Name and Value.
   137      * 3. Test Name null throws StorageException
   137      * 3. Test Name null throws StorageException
   138      * 4. Test Name "" throws StorageException
   138      * 4. Test Name "" throws StorageException
   139      * 5. Test value null. It is allowed value.
   139      * 5. Test value null. Type is not set SE thrown.
   140      * 6. Test value "".
   140      * 6. Test value "".
   141      * 7. Test one len name and value.
   141      * 7. Test one len name and value.
   142      * 8. Test value null, type STRING is allowed.
   142      * 8. Test value null, type STRING throws StorageException.
   143      */
   143      */
   144     public void testNameValueConstructor()
   144     public void testNameValueConstructor()
   145     {
   145     {
   146         StorageAttribute sa = new StorageAttribute("N/A", "N/A");
   146         StorageAttribute sa = new StorageAttribute("N/A", "N/A");
   147         // 2. Test with Name and Value
   147         // 2. Test with Name and Value
   193         try
   193         try
   194         {
   194         {
   195             String name = "AttrName";
   195             String name = "AttrName";
   196             String value = null;
   196             String value = null;
   197             sa = new StorageAttribute(name, value);
   197             sa = new StorageAttribute(name, value);
   198         }
   198             assertTrue("No exp when value Null", false);
   199         catch (StorageException se)
   199         }
   200         {
   200         catch (StorageException se)
   201             assertTrue("SE thrown when null value: " + se.toString(), false);
   201         {
       
   202             // PASSED
   202         }
   203         }
   203         catch (Throwable t)
   204         catch (Throwable t)
   204         {
   205         {
   205             assertTrue("Wrong exp thrown: " + t.toString(), false);
   206             assertTrue("Wrong exp thrown: " + t.toString(), false);
   206 
   207 
   243         try
   244         try
   244         {
   245         {
   245             String name = "A";
   246             String name = "A";
   246             String value = null;
   247             String value = null;
   247             sa = new StorageAttribute(name, value);
   248             sa = new StorageAttribute(name, value);
   248         }
   249             assertTrue("No exp thrown when null value, string type", false);
   249         catch (StorageException se)
   250         }
   250         {
   251         catch (StorageException se)
   251             assertTrue("SE thrown when null value: " + se.toString(), false);
   252         {
       
   253             // PASSED
   252         }
   254         }
   253         catch (Throwable t)
   255         catch (Throwable t)
   254         {
   256         {
   255             assertTrue("Wrong exception thrown: " + t.toString(), false);
   257             assertTrue("Wrong exception thrown: " + t.toString(), false);
   256         }
   258         }