/*
 * jlib - Open Source Java Library
 *
 *     www.jlib.org
 *
 *
 *     Copyright 2005-2013 Igor Akkerman
 *
 *     Licensed under the Apache License, Version 2.0 (the "License");
 *     you may not use this file except in compliance with the License.
 *     You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *     Unless required by applicable law or agreed to in writing, software
 *     distributed under the License is distributed on an "AS IS" BASIS,
 *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *     See the License for the specific language governing permissions and
 *     limitations under the License.
 */

package org.jlib.core.array;

import org.jlib.core.storage.InvalidIndexException;
import org.jlib.core.storage.LinearIndexStorage;
import org.junit.Test;

public class ArrayStorageTest {

    @Test(expected = InvalidIndexException.class)
    public void zeroCapacityReadAccessTest()
    throws Exception {
        LinearIndexStorage<Integer> storage = new ArrayStorage<>(0);
        storage.getItem(0);
    }

    @Test
    public void testEnsureCapacityAndShiftItems()
    throws Exception {

    }

    @Test
    public void testGetItem()
    throws Exception {

    }

    @Test
    public void testReplaceItem()
    throws Exception {

    }

    @Test
    public void testShiftItems()
    throws Exception {

    }

    @Test
    public void testCopyItems()
    throws Exception {

    }

    @Test
    public void testGetCapacity()
    throws Exception {

    }
}

@@ -762,29 +762,32 @@
 rage.Invalid
-Index
+Capacity
 Exception;%0Ai
@@ -814,34 +814,37 @@
 storage.
-LinearIndexStorage
+InvalidIndexException
 ;%0Aimport
@@ -982,20 +982,16 @@
 adAccess
-Test
 ()%0A    t
@@ -1020,19 +1020,17 @@
     
-LinearIndex
+new Array
 Stor
@@ -1045,67 +1045,345 @@
 ger%3E
- storage = new ArrayStorage%3C%3E(0
+(0).getItem(0);%0A    %7D%0A%0A    @Test(expected = InvalidIndexException.class)%0A    public void negativeIndexAccess()%0A    throws Exception %7B%0A        new ArrayStorage%3CInteger%3E(5).getItem(-1
 );%0A    
+%7D%0A%0A
     
-storage.getItem(0
+@Test(expected = InvalidCapacityException.class)%0A    public void negativeCapacity()%0A    throws Exception %7B%0A        new ArrayStorage%3CObject%3E(-1
 );%0A 

test methods added