Skip to main content
summaryrefslogtreecommitdiffstats
blob: a3650771d40be89890405ae506f8fa5462fc150f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*******************************************************************************
 * Copyright (c) 2010 Boeing.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.ote.message.test.recordMap;

import org.eclipse.osee.ote.message.test.mock.TestMessage;
import org.junit.Assert;
import org.junit.Test;

/**
 * @author Roberto E. Escobar
 */
public class RecordMapTest {

   @Test
   public void testGetInt() {
      TestMessage msg = new TestMessage();

      // Testing below the boundary.
      try {
         msg.RECORD_MAP_1.get(1);
         Assert.assertTrue(true);
      } catch (IllegalArgumentException ex) {
         Assert.fail("We shouldn't get an exception for this get!");
      }

      // Testing on the boundary.
      try {
         msg.RECORD_MAP_1.get(2);
         Assert.fail("We should get an exception for this get on the boundary!");
      } catch (IllegalArgumentException ex) {
         Assert.assertTrue("We should get an exception for this index", true);
      }
      // Testing above the boundary.
      try {
         msg.RECORD_MAP_1.get(3);
         Assert.fail("We should get an exception for this get above the boundary!");
      } catch (IllegalArgumentException ex) {
         Assert.assertTrue("We should get an exception for this index", true);
      }

   }
}

Back to the top