ossj.common.tck.tests
Class TestMev

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by ossj.common.tck.JVTTestBase
              extended by ossj.common.tck.tests.TestMev
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
TestCbeBasics, TestEventValue, TestManagedEntityValueSingle, TestQueryValueSingle, TestUpvSingle

public class TestMev
extends JVTTestBase

Test case for ManagedEntityValues

Version:

Field Summary
 
Fields inherited from class ossj.common.tck.JVTTestBase
debug, done, EVENT_TIMEOUT, howmany_key, howmany_value, JMS_FACTORY, JNDI_FACT_CLASS_NAME, JNDI_URL, jvtSessionList, LOG_FILE, namingContext, QUOTECHAR, result, return_failed_only, runonce, TESTFILES_HOME, TOPIC_NAME, util
 
Method Summary
protected  void setUp()
          sets up the TestCase
 void test_ClassNameAndTypeAndValueKeyPair(javax.oss.AttributeAccess mev)
          Test Value and Value type and key pattern
test if VALUE_TYPE field is declared
test it VALUE_TYPE field is public final static String
test if the declared type exist (call forName)
test if the class is of the declared type (decalreType.isAssignableFrom)
test if the VALUE_TYPE ends with "Value"
test if the VALUE_TYPE corresponding key interface exists
test if the get/set/make methods exist and use/return the correct key type
test if set(make) don't throw exceptions
 void test_GetAttributeNames_ContainsKEY(javax.oss.AttributeAccess ac)
          this method tries to check weather the getattributes return KEY as attribute or not
 void test_GetAttributeNames_NamesStartWithLowerCase(javax.oss.AttributeAccess mev)
          tests that attributes names have length > 0 and start with lowercase letter

- call getAttributeNames check if return array length>0 and != null
- Fall all attribute names check name length >0 name following bean convention
bean spec: However to support the occasional use of all upper-case names, we check if the first two characters of the name are both upper case and if so leave it alone.
 void test_GetOptionalAttributeNames_InAllAttributes(javax.oss.AttributeAccess mev)
          tests same as test_GetAttributeNames_NamesStartWithLowerCase for optional attributes
 void test_GetSettableAttributeNames_NotContainsKEY(javax.oss.AttributeAccess ac)
          The KEY attribute is usually set on the server side, so this test just looks at the absence of the "KEY" attribute from the settables attribute list
 void test_GetSettableAttributeNames_SubsetOfGetAttributeNames(javax.oss.AttributeAccess ac)
          tests that getSettableAttributesNames is a subset of getAttributeNames<
Get the settable attribute list and check that all attribute names are also present in the list returned by getAttributeNames
 void test_Negative_GetAttributeValue_AttributeNameIllegalValue(javax.oss.AttributeAccess mev)
          tests failure of getAttributeValue(invalid_argument)
 void test_Negative_GetAttributeValue_AttributeNameNullValue(javax.oss.AttributeAccess mev)
          tests failure of getAttributeValue(null) Suceesed if java.lang.IllegalArgumentException is thrown
 void test_Negative_IsPopulated_AttributeNameIllegalValue(javax.oss.AttributeAccess mev)
          tests failure of isPopulated(a) for String a not in getAttributeNames()
Successed if java.lang.IllegalArgumentException or javax.oss.OssUnsupportedAttributeException is thrown
 void test_Negative_IsPopulated_AttributeNameNullValue(javax.oss.AttributeAccess mev)
          tests failure of isPopulated(null)
Successed if java.lang.IllegalArgumentException is thrown
 void test_Negative_SetAttributeValue_AttributeNameIllegalValue(javax.oss.AttributeAccess mev)
          tests failure of setAttributeValue(invalid_argument, value) Suceesed if java.lang.IllegalArgumentException is thrown
 void test_Negative_SetAttributeValue_AttributeNameNullValue(javax.oss.AttributeAccess mev)
          tests failure of setAttributeValue(null, value)
Suceesed if java.lang.IllegalArgumentException is thrown
 void test_Negative_SetAttributeValue_IllegalObject(javax.oss.AttributeAccess mev)
          DOMAINTEST tests failure of setAttributeValue(a) for an illegal object()
 void test_Negative_SetAttributeValue_PrimitiveNullValue(javax.oss.AttributeAccess mev)
          DOCUMENT ME!
 void test_Negative_UnpopulateAttribute_AttributeNameIllegalValue(javax.oss.AttributeAccess mev)
          tests failure of unpopulatedAttribute(a) for an argument not in getAttributeNames
Successed if java.lang.IllegalArgumentException is thrown
 void test_Negative_UnpopulateAttribute_AttributeNameNullValue(javax.oss.AttributeAccess mev)
          tests failure of unpopulatedAttribute(null)
Successed if java.lang.IllegalArgumentException is thrown
 void test_Positive_IsPopulated_AttributeNameAllDomainValues(javax.oss.AttributeAccess mev)
          tests isPopulated for all attributes in getAttributeNames()
call ispopulated for all attributes fails if an exception is thrown
 void test_Positive_ManagedEntityKey_IllegalKey(javax.oss.AttributeAccess ac)
           
 void test_Positive_SetAttributeValue_DomainValue(javax.oss.AttributeAccess mev)
           
 void test_Positive_SetAttributeValue_PrimitiveMINMAXValues(javax.oss.AttributeAccess mev)
          tests setAttributeValue(min/max) for primitive attributes that are not enums
 void test_Positive_SetAttributeValueKEY_IllegalKey(javax.oss.AttributeAccess ac)
          tests a illegal key
 void test_Positive_SetManagedEntityKey_DomainValue(javax.oss.AttributeAccess ac)
          tests based key management
Call setManagedEntityKey(mev.makeManagedEntityKey());
 void test_Positive_SetManagedEntityKey_IllegalKey(javax.oss.AttributeAccess ac)
          tests illegal keys
Illegal keys are: type="" type=invalid_prefix+getType() promary key = new object() primaryKey-newObject + invalid type
 void test_Positive_testCloneEqualsImplementation(javax.oss.AttributeAccess mev)
          Test clone and equals methods CBE implementations
Expected Result:
a = b.clone()
a.equals(a) == true
b.equals(b) == true
a.equals(b) == true
b.equals(a) == true
 void test_Positive_testCloneEqualsImplementation(Object mev)
          Test clone and equals methods CBE implementations
Expected Result:
 void test_Positive_UnpopulateAttribute_AttributeNameAllDomainValues(javax.oss.AttributeAccess mev)
          tests succesful invocation of unpopulateAttribute(a) for all a in getAttributeNames()
 void test_Query_Type(javax.oss.AttributeAccess mev)
          Test QUERY_TYPE

test if QUERY_TYPE field is declared
test it QUERY_TYPE field is public final static String
test if the declared type exist (call forName)
test if the class is of the declared type (decalreType.isAssignableFrom)
test if the QUERY_TYPE corresponding interface exists
 void test_SetAttributeValue_GetPopulatedAttributesNamesContainsAttributeName(javax.oss.AttributeAccess mev)
          tests that setAttributeValue(a) => a in getPopulatedAttributes()
 void test_SetAttributeValue_IsPopulated(javax.oss.AttributeAccess mev)
          tests that setAttributeValue(a) => isPopulated(a)
 void test_SetManagedEntityKey_GetPopulatedAttributeNamesContainsKEY(javax.oss.AttributeAccess ac)
          tests that succesful setManagedEntityKey(val) implies KEY in getPopulatedAttributeNames()
 void test_SetManagedEntityKey_IsPopulatedKEY(javax.oss.AttributeAccess ac)
          tests that succesful setManagedEntityKey(val) implies isPopulated(KEY)
 void test_UnpopulateAllAttributes_GetAttributeValueFailsForAll(javax.oss.AttributeAccess mev)
          tests that unpopulateAlAttributes implies failure of getAttributeValue(a) for all a in getAttributeNames
 void test_UnpopulateAllAttributes_GetPopulatedAttributesNamesIsEmpty(javax.oss.AttributeAccess mev)
          tests that unpopulateAlAttributes implies getPopulatedAttributesNamesIsEmpty() is empty
 void test_UnpopulateAllAttributes_IsPopulatedFalseForAll(javax.oss.AttributeAccess mev)
          tests that unpopulateAlAttributes implies !isPopulated(a) for all a in getAttributeNames()
 void test_upv_Type(javax.oss.AttributeAccess mev)
          Test UPDATE_TYPE

test if UPDATE_TYPE field is declared
test it UPDATE_TYPE field is public final static String
test if the declared type exist (call forName)
test if the class is of the declared type (decalreType.isAssignableFrom)
test if the UPDATE_TYPE corresponding interface exists
 
Methods inherited from class ossj.common.tck.JVTTestBase
assertTrue, assertTrue, assertTrueMsg, fail, fail, getEnvironment, getInstanceOf, init, log, log, run, run
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

setUp

protected void setUp()
              throws Exception
sets up the TestCase

Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

test_ClassNameAndTypeAndValueKeyPair

public void test_ClassNameAndTypeAndValueKeyPair(javax.oss.AttributeAccess mev)
                                          throws Exception
Test Value and Value type and key pattern
test if VALUE_TYPE field is declared
test it VALUE_TYPE field is public final static String
test if the declared type exist (call forName)
test if the class is of the declared type (decalreType.isAssignableFrom)
test if the VALUE_TYPE ends with "Value"
test if the VALUE_TYPE corresponding key interface exists
test if the get/set/make methods exist and use/return the correct key type
test if set(make) don't throw exceptions

Throws:
Exception

test_Query_Type

public void test_Query_Type(javax.oss.AttributeAccess mev)
                     throws Exception
Test QUERY_TYPE

test if QUERY_TYPE field is declared
test it QUERY_TYPE field is public final static String
test if the declared type exist (call forName)
test if the class is of the declared type (decalreType.isAssignableFrom)
test if the QUERY_TYPE corresponding interface exists

Throws:
Exception

test_upv_Type

public void test_upv_Type(javax.oss.AttributeAccess mev)
                   throws Exception
Test UPDATE_TYPE

test if UPDATE_TYPE field is declared
test it UPDATE_TYPE field is public final static String
test if the declared type exist (call forName)
test if the class is of the declared type (decalreType.isAssignableFrom)
test if the UPDATE_TYPE corresponding interface exists

Throws:
Exception

test_GetAttributeNames_NamesStartWithLowerCase

public void test_GetAttributeNames_NamesStartWithLowerCase(javax.oss.AttributeAccess mev)
                                                    throws Exception
tests that attributes names have length > 0 and start with lowercase letter

- call getAttributeNames check if return array length>0 and != null
- Fall all attribute names check name length >0 name following bean convention
bean spec: However to support the occasional use of all upper-case names, we check if the first two characters of the name are both upper case and if so leave it alone.

Throws:
Exception

test_GetOptionalAttributeNames_InAllAttributes

public void test_GetOptionalAttributeNames_InAllAttributes(javax.oss.AttributeAccess mev)
                                                    throws Exception
tests same as test_GetAttributeNames_NamesStartWithLowerCase for optional attributes

Throws:
Exception
See Also:
test_GetAttributeNames_NamesStartWithLowerCase(javax.oss.AttributeAccess)

test_Positive_IsPopulated_AttributeNameAllDomainValues

public void test_Positive_IsPopulated_AttributeNameAllDomainValues(javax.oss.AttributeAccess mev)
                                                            throws Exception
tests isPopulated for all attributes in getAttributeNames()
call ispopulated for all attributes fails if an exception is thrown

Throws:
Exception

test_Negative_IsPopulated_AttributeNameNullValue

public void test_Negative_IsPopulated_AttributeNameNullValue(javax.oss.AttributeAccess mev)
                                                      throws Exception
tests failure of isPopulated(null)
Successed if java.lang.IllegalArgumentException is thrown

Throws:
Exception

test_Negative_IsPopulated_AttributeNameIllegalValue

public void test_Negative_IsPopulated_AttributeNameIllegalValue(javax.oss.AttributeAccess mev)
                                                         throws Exception
tests failure of isPopulated(a) for String a not in getAttributeNames()
Successed if java.lang.IllegalArgumentException or javax.oss.OssUnsupportedAttributeException is thrown

Throws:
Exception

test_GetSettableAttributeNames_SubsetOfGetAttributeNames

public void test_GetSettableAttributeNames_SubsetOfGetAttributeNames(javax.oss.AttributeAccess ac)
                                                              throws Exception
tests that getSettableAttributesNames is a subset of getAttributeNames<
Get the settable attribute list and check that all attribute names are also present in the list returned by getAttributeNames

Throws:
Exception

test_Positive_UnpopulateAttribute_AttributeNameAllDomainValues

public void test_Positive_UnpopulateAttribute_AttributeNameAllDomainValues(javax.oss.AttributeAccess mev)
                                                                    throws Exception
tests succesful invocation of unpopulateAttribute(a) for all a in getAttributeNames()

Throws:
Exception

test_Negative_UnpopulateAttribute_AttributeNameNullValue

public void test_Negative_UnpopulateAttribute_AttributeNameNullValue(javax.oss.AttributeAccess mev)
                                                              throws Exception
tests failure of unpopulatedAttribute(null)
Successed if java.lang.IllegalArgumentException is thrown

Throws:
Exception

test_Negative_UnpopulateAttribute_AttributeNameIllegalValue

public void test_Negative_UnpopulateAttribute_AttributeNameIllegalValue(javax.oss.AttributeAccess mev)
                                                                 throws Exception
tests failure of unpopulatedAttribute(a) for an argument not in getAttributeNames
Successed if java.lang.IllegalArgumentException is thrown

Throws:
Exception

test_UnpopulateAllAttributes_IsPopulatedFalseForAll

public void test_UnpopulateAllAttributes_IsPopulatedFalseForAll(javax.oss.AttributeAccess mev)
                                                         throws Exception
tests that unpopulateAlAttributes implies !isPopulated(a) for all a in getAttributeNames()

Throws:
Exception

test_UnpopulateAllAttributes_GetPopulatedAttributesNamesIsEmpty

public void test_UnpopulateAllAttributes_GetPopulatedAttributesNamesIsEmpty(javax.oss.AttributeAccess mev)
                                                                     throws Exception
tests that unpopulateAlAttributes implies getPopulatedAttributesNamesIsEmpty() is empty

Throws:
Exception

test_UnpopulateAllAttributes_GetAttributeValueFailsForAll

public void test_UnpopulateAllAttributes_GetAttributeValueFailsForAll(javax.oss.AttributeAccess mev)
                                                               throws Exception
tests that unpopulateAlAttributes implies failure of getAttributeValue(a) for all a in getAttributeNames

Throws:
Exception

test_Negative_SetAttributeValue_AttributeNameNullValue

public void test_Negative_SetAttributeValue_AttributeNameNullValue(javax.oss.AttributeAccess mev)
                                                            throws Exception
tests failure of setAttributeValue(null, value)
Suceesed if java.lang.IllegalArgumentException is thrown

Throws:
Exception

test_Negative_SetAttributeValue_AttributeNameIllegalValue

public void test_Negative_SetAttributeValue_AttributeNameIllegalValue(javax.oss.AttributeAccess mev)
                                                               throws Exception
tests failure of setAttributeValue(invalid_argument, value) Suceesed if java.lang.IllegalArgumentException is thrown

Throws:
Exception

test_Negative_GetAttributeValue_AttributeNameNullValue

public void test_Negative_GetAttributeValue_AttributeNameNullValue(javax.oss.AttributeAccess mev)
                                                            throws Exception
tests failure of getAttributeValue(null) Suceesed if java.lang.IllegalArgumentException is thrown

Throws:
Exception

test_Negative_GetAttributeValue_AttributeNameIllegalValue

public void test_Negative_GetAttributeValue_AttributeNameIllegalValue(javax.oss.AttributeAccess mev)
                                                               throws Exception
tests failure of getAttributeValue(invalid_argument)

Throws:
Exception

test_Positive_SetManagedEntityKey_DomainValue

public void test_Positive_SetManagedEntityKey_DomainValue(javax.oss.AttributeAccess ac)
                                                   throws Exception
tests based key management
Call setManagedEntityKey(mev.makeManagedEntityKey());

Throws:
Exception

test_Positive_SetManagedEntityKey_IllegalKey

public void test_Positive_SetManagedEntityKey_IllegalKey(javax.oss.AttributeAccess ac)
                                                  throws Exception
tests illegal keys
Illegal keys are:

Throws:
Exception

test_Positive_SetAttributeValueKEY_IllegalKey

public void test_Positive_SetAttributeValueKEY_IllegalKey(javax.oss.AttributeAccess ac)
                                                   throws Exception
tests a illegal key

Throws:
Exception

test_SetManagedEntityKey_GetPopulatedAttributeNamesContainsKEY

public void test_SetManagedEntityKey_GetPopulatedAttributeNamesContainsKEY(javax.oss.AttributeAccess ac)
                                                                    throws Exception
tests that succesful setManagedEntityKey(val) implies KEY in getPopulatedAttributeNames()

Throws:
Exception

test_SetManagedEntityKey_IsPopulatedKEY

public void test_SetManagedEntityKey_IsPopulatedKEY(javax.oss.AttributeAccess ac)
                                             throws Exception
tests that succesful setManagedEntityKey(val) implies isPopulated(KEY)

Throws:
Exception

test_GetAttributeNames_ContainsKEY

public void test_GetAttributeNames_ContainsKEY(javax.oss.AttributeAccess ac)
                                        throws Exception
this method tries to check weather the getattributes return KEY as attribute or not

Throws:
Exception

test_GetSettableAttributeNames_NotContainsKEY

public void test_GetSettableAttributeNames_NotContainsKEY(javax.oss.AttributeAccess ac)
                                                   throws Exception
The KEY attribute is usually set on the server side, so this test just looks at the absence of the "KEY" attribute from the settables attribute list

Throws:
Exception

test_Positive_ManagedEntityKey_IllegalKey

public void test_Positive_ManagedEntityKey_IllegalKey(javax.oss.AttributeAccess ac)
                                               throws Exception
Throws:
Exception

test_Positive_SetAttributeValue_PrimitiveMINMAXValues

public void test_Positive_SetAttributeValue_PrimitiveMINMAXValues(javax.oss.AttributeAccess mev)
                                                           throws Exception
tests setAttributeValue(min/max) for primitive attributes that are not enums

Throws:
Exception

test_Negative_SetAttributeValue_PrimitiveNullValue

public void test_Negative_SetAttributeValue_PrimitiveNullValue(javax.oss.AttributeAccess mev)
                                                        throws Exception
DOCUMENT ME!

Parameters:
mev - DOCUMENT ME!
Throws:
Exception - DOCUMENT ME!
TCKException - DOCUMENT ME!

test_Positive_SetAttributeValue_DomainValue

public void test_Positive_SetAttributeValue_DomainValue(javax.oss.AttributeAccess mev)
                                                 throws Exception
Throws:
Exception

test_SetAttributeValue_GetPopulatedAttributesNamesContainsAttributeName

public void test_SetAttributeValue_GetPopulatedAttributesNamesContainsAttributeName(javax.oss.AttributeAccess mev)
                                                                             throws Exception
tests that setAttributeValue(a) => a in getPopulatedAttributes()

Throws:
Exception

test_SetAttributeValue_IsPopulated

public void test_SetAttributeValue_IsPopulated(javax.oss.AttributeAccess mev)
                                        throws Exception
tests that setAttributeValue(a) => isPopulated(a)

Throws:
Exception

test_Negative_SetAttributeValue_IllegalObject

public void test_Negative_SetAttributeValue_IllegalObject(javax.oss.AttributeAccess mev)
                                                   throws Exception
DOMAINTEST tests failure of setAttributeValue(a) for an illegal object()

Throws:
Exception

test_Positive_testCloneEqualsImplementation

public void test_Positive_testCloneEqualsImplementation(javax.oss.AttributeAccess mev)
                                                 throws Exception
Test clone and equals methods CBE implementations
Expected Result:
a = b.clone()
a.equals(a) == true
b.equals(b) == true
a.equals(b) == true
b.equals(a) == true

Throws:
Exception

test_Positive_testCloneEqualsImplementation

public void test_Positive_testCloneEqualsImplementation(Object mev)
                                                 throws Exception
Test clone and equals methods CBE implementations
Expected Result:
  new a;
  a = b.clone()
  a.equals(a) == true
  b.equals(b) == true
  a.equals(b) == true
  b.equals(a) == true

 set random attribute in a
  a = b.clone()
  a.equals(a) == true
  b.equals(b) == true
  a.equals(b) == true
  b.equals(a) == true
 

Throws:
Exception - DOCUMENT ME!
TCKException - DOCUMENT ME!


Copyright 2002-2006 The Members of the OSS through Java(TM) Initiative. All rights reserved. Use is subject to license terms.