Skip to main content
summaryrefslogtreecommitdiffstats
blob: 36001dc8b6fc231caaac86de146c4ef541fda5c4 (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
/*******************************************************************************
 * Copyright (c) 2004, 2007 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.framework.access.test.internal;

import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.model.AccessData;
import org.eclipse.osee.framework.core.model.DefaultBasicArtifact;
import org.eclipse.osee.framework.core.model.IBasicArtifact;
import org.junit.Assert;
import org.junit.Test;

/**
 * Test Case for {@link AccessData}
 * 
 * @author Jeff C. Phillips
 */
public class AccessDataTest {

   @Test
   public void testObjectBase() {
      AccessData accessData = new AccessData();
      Assert.assertFalse(accessData.matches(PermissionEnum.READ));

      IBasicArtifact<?> basicArtifact = new DefaultBasicArtifact(1, "1", "Name");
      accessData.add(basicArtifact, PermissionEnum.READ);
      IBasicArtifact<?> basicArtifact2 = new DefaultBasicArtifact(2, "2", "Name2");
      accessData.add(basicArtifact2, PermissionEnum.WRITE);

      Assert.assertTrue(accessData.matches(PermissionEnum.READ));
      Assert.assertFalse(accessData.matches(PermissionEnum.WRITE));
   }
}

Back to the top