protected void assertNodeName ( Node pNode , String ... pExpected ) { for ( String expected : pExpected ) { if ( pNode . getNodeName ( ) . equals ( expected ) ) { return ; } } StringBuilder buffer = new StringBuilder ( ) ; for ( int i = 0 ; i < pExpected . length ; i ++ ) { buffer . append ( pExpected [ i ] ) ; if ( i < pExpected . length - 1 ) { buffer . append ( "," ) ; } } throw new SecurityException ( "Expected element " + buffer . toString ( ) + " but got " + pNode . getNodeName ( ) ) ; }
Verify that a given node has one of a set of expected node names