Everything is fine, except for the stopping condition:
for (i = 0; i < 50; i++) {
Since your array is 50 in size and indexes start at 0, the last index is 49.
i, ( ) camelCase:
int[] testArray = new int[50];
for (int i = 0; i < testArray.length; i++) {
testArray[i]=i;
}