function dataChangeHandler() {
			oBinding.detachChange(dataChangeHandler);

			// retrieve the data and check it
			var aContexts = oBinding.getContexts(1, 10);

			// check return value of getContexts call
			assert.equal(aContexts[0].getProperty("HierarchyNode"), "000003", "Node 1 is 000003");
			assert.equal(aContexts[0].getProperty("FinancialStatementItemText"), "Ausstehende Kapital-Einlagen",
				"Node 1 is 'Ausstehende Kapital-Einlagen'");
			assert.equal(aContexts[0].getProperty("FinStatementHierarchyLevelVal"), 3, "Node 1 is a 1st level node");

			assert.equal(aContexts[7].getProperty("HierarchyNode"), "000362", "Node 8 is 'P A S S I V A'");
			assert.equal(aContexts[7].getProperty("FinancialStatementItemText"), "P A S S I V A", "Node 8 is 'P A S S I V A'");
			assert.equal(aContexts[7].getProperty("FinStatementHierarchyLevelVal"), 2, "Node 8 is a top-level node");

			// check internal tree state
			var oN000002 = oBinding.findNode(0);
			var oN000003 = oBinding.findNode(1);

			assert.equal(oN000002.groupID, "/000002/", "Correct node for index 0 found.");
			assert.equal(oN000003.groupID, "/000002/000003/", "Correct node for index 1 found.");

			var oN000002_test2 = oBinding.getNodeByIndex(0);
			var oN000003_test2 = oBinding.getNodeByIndex(1);

			assert.deepEqual(oN000002, oN000002_test2, "Correct node for index 0 found via getNodeByIndex.");
			assert.deepEqual(oN000003, oN000003_test2, "Correct node for index 1 found via getNodeByIndex.");

			// check if contexts are correctly returned via getContextByIndex vs getContexts
			// Beware: Indices are shifted by 1, as the context array starts with 0
			var oContext000003 = oBinding.getContextByIndex(1);
			var oContext000008 = oBinding.getContextByIndex(2);

			assert.equal(oContext000003.getProperty("HierarchyNode"), aContexts[0].getProperty("HierarchyNode"),
				"Context 000003 via different API calls is identical.");
			assert.equal(oContext000008.getProperty("HierarchyNode"), aContexts[1].getProperty("HierarchyNode"),
				"Context 000008 via different API calls is identical.");

			done();
		}
// change handler called after the data returned
change handler called after the data returned
change handler called after the data returned
function dataChangeHandler() {
			oBinding.detachChange(dataChangeHandler);
			var aContexts = oBinding.getContexts(1, 10);
			assert.equal(aContexts[0].getProperty("HierarchyNode"), "000003", "Node 1 is 000003");
			assert.equal(aContexts[0].getProperty("FinancialStatementItemText"), "Ausstehende Kapital-Einlagen",
				"Node 1 is 'Ausstehende Kapital-Einlagen'");
			assert.equal(aContexts[0].getProperty("FinStatementHierarchyLevelVal"), 3, "Node 1 is a 1st level node");
			assert.equal(aContexts[7].getProperty("HierarchyNode"), "000362", "Node 8 is 'P A S S I V A'");
			assert.equal(aContexts[7].getProperty("FinancialStatementItemText"), "P A S S I V A", "Node 8 is 'P A S S I V A'");
			assert.equal(aContexts[7].getProperty("FinStatementHierarchyLevelVal"), 2, "Node 8 is a top-level node");
			var oN000002 = oBinding.findNode(0);
			var oN000003 = oBinding.findNode(1);
			assert.equal(oN000002.groupID, "/000002/", "Correct node for index 0 found.");
			assert.equal(oN000003.groupID, "/000002/000003/", "Correct node for index 1 found.");
			var oN000002_test2 = oBinding.getNodeByIndex(0);
			var oN000003_test2 = oBinding.getNodeByIndex(1);
			assert.deepEqual(oN000002, oN000002_test2, "Correct node for index 0 found via getNodeByIndex.");
			assert.deepEqual(oN000003, oN000003_test2, "Correct node for index 1 found via getNodeByIndex.");
			var oContext000003 = oBinding.getContextByIndex(1);
			var oContext000008 = oBinding.getContextByIndex(2);
			assert.equal(oContext000003.getProperty("HierarchyNode"), aContexts[0].getProperty("HierarchyNode"),
				"Context 000003 via different API calls is identical.");
			assert.equal(oContext000008.getProperty("HierarchyNode"), aContexts[1].getProperty("HierarchyNode"),
				"Context 000008 via different API calls is identical.");
			done();
		}
function dataChangeHandler ( ) { oBinding . detachChange ( dataChangeHandler ) ; var aContexts = oBinding . getContexts ( 1 , 10 ) ; assert . equal ( aContexts [ 0 ] . getProperty ( "HierarchyNode" ) , "000003" , "Node 1 is 000003" ) ; assert . equal ( aContexts [ 0 ] . getProperty ( "FinancialStatementItemText" ) , "Ausstehende Kapital-Einlagen" , "Node 1 is 'Ausstehende Kapital-Einlagen'" ) ; assert . equal ( aContexts [ 0 ] . getProperty ( "FinStatementHierarchyLevelVal" ) , 3 , "Node 1 is a 1st level node" ) ; assert . equal ( aContexts [ 7 ] . getProperty ( "HierarchyNode" ) , "000362" , "Node 8 is 'P A S S I V A'" ) ; assert . equal ( aContexts [ 7 ] . getProperty ( "FinancialStatementItemText" ) , "P A S S I V A" , "Node 8 is 'P A S S I V A'" ) ; assert . equal ( aContexts [ 7 ] . getProperty ( "FinStatementHierarchyLevelVal" ) , 2 , "Node 8 is a top-level node" ) ; var oN000002 = oBinding . findNode ( 0 ) ; var oN000003 = oBinding . findNode ( 1 ) ; assert . equal ( oN000002 . groupID , "/000002/" , "Correct node for index 0 found." ) ; assert . equal ( oN000003 . groupID , "/000002/000003/" , "Correct node for index 1 found." ) ; var oN000002_test2 = oBinding . getNodeByIndex ( 0 ) ; var oN000003_test2 = oBinding . getNodeByIndex ( 1 ) ; assert . deepEqual ( oN000002 , oN000002_test2 , "Correct node for index 0 found via getNodeByIndex." ) ; assert . deepEqual ( oN000003 , oN000003_test2 , "Correct node for index 1 found via getNodeByIndex." ) ; var oContext000003 = oBinding . getContextByIndex ( 1 ) ; var oContext000008 = oBinding . getContextByIndex ( 2 ) ; assert . equal ( oContext000003 . getProperty ( "HierarchyNode" ) , aContexts [ 0 ] . getProperty ( "HierarchyNode" ) , "Context 000003 via different API calls is identical." ) ; assert . equal ( oContext000008 . getProperty ( "HierarchyNode" ) , aContexts [ 1 ] . getProperty ( "HierarchyNode" ) , "Context 000008 via different API calls is identical." ) ; done ( ) ; }
change handler called after the data returned
change handler called after the data returned
// retrieve the data and check it // check return value of getContexts call // check internal tree state // check if contexts are correctly returned via getContextByIndex vs getContexts // Beware: Indices are shifted by 1, as the context array starts with 0