/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 5000980
* @summary Check NullPointerException for cipherSpi.engineUpdate(x, null)
*/
public class ByteBuffersNull {
CipherSpiImpl c = new CipherSpiImpl();
int failureCount = 0;
try {
throw new Exception("No Exception?!");
} catch (NullPointerException npe) {
// Expected behaviour - pass
}
}
}
// Creates a ByteBuffer with a desired properties
boolean limitAt0) {
if (limitAt0)
return bb;
}
int caseNum = 4;
// ByteBuffer with capacity 0
// ByteBuffer with some space but limit = 0
"ByteBuffer with some capacity but limit == 0",
// ByteBuffer with some remaining data (limit = capacity)
// ByteBuffer with some data but position is at the limit
"ByteBuffer with data but position at the limit",
return buffers;
}
test.testCase010();
}
class BufferDescr {
descr = d;
buf = b;
}
}
public CipherSpiImpl() {
super();
}
throws NoSuchAlgorithmException { }
throws NoSuchPaddingException { }
public int engineGetBlockSize() {
return 0;
}
return 0;
}
public byte[] engineGetIV() {
return null;
}
return null;
}
throws InvalidKeyException { }
return null;
}
byte[] output, int outputOffset)
throws ShortBufferException {
return 0;
}
throws IllegalBlockSizeException, BadPaddingException {
return null;
}
byte[] output, int outputOffset)
return 0;
}
throws IllegalBlockSizeException, InvalidKeyException {
return super.engineWrap(key);
}
int wKeyType) throws InvalidKeyException,
}
return super.engineGetKeySize(key);
}
}
throws ShortBufferException {
}
}
}