Skip to main content
summaryrefslogtreecommitdiffstats
blob: 91c5cb4057c92b9d757df844ece89815250b58b6 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*******************************************************************************
 * 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.core.model.type;

import org.junit.Ignore;
import org.junit.Test;

/**
 * @author Roberto E. Escobar
 */
public class RelationTypeTest {
   @Ignore
   @Test
   public void test() {

   }
   //   @org.junit.Test
   //   public void testRelationTypeSides() throws OseeCoreException {
   //      OseeTypesUtil.checkRelationTypeInheritance(cache, artCache, "1A", RelationSide.SIDE_A, 1, "111");
   //      OseeTypesUtil.checkRelationTypeInheritance(cache, artCache, "1A", RelationSide.SIDE_B, 1, "444", "555");
   //
   //      OseeTypesUtil.checkRelationTypeInheritance(cache, artCache, "2B", RelationSide.SIDE_A, 1, "555");
   //      OseeTypesUtil.checkRelationTypeInheritance(cache, artCache, "2B", RelationSide.SIDE_B, Integer.MAX_VALUE, "000",
   //            "111", "222", "333", "444", "555", "666");
   //
   //      OseeTypesUtil.checkRelationTypeInheritance(cache, artCache, "3C", RelationSide.SIDE_A, Integer.MAX_VALUE, "222",
   //            "333", "444", "555", "666");
   //      OseeTypesUtil.checkRelationTypeInheritance(cache, artCache, "3C", RelationSide.SIDE_B, 1, "333", "444", "555",
   //            "666");
   //
   //      OseeTypesUtil.checkRelationTypeInheritance(cache, artCache, "4D", RelationSide.SIDE_A, Integer.MAX_VALUE, "666");
   //      OseeTypesUtil.checkRelationTypeInheritance(cache, artCache, "4D", RelationSide.SIDE_B, Integer.MAX_VALUE, "666");
   //   }
   //
   //   @Override
   //   public void testDirty() throws OseeCoreException {
   //   }
   //
   //   private final static class ArtifactDataAccessor extends MockOseeDataAccessor<ArtifactType> {
   //      private final List<ArtifactType> artifactTypes;
   //
   //      public ArtifactDataAccessor(List<ArtifactType> artifactTypes) {
   //         super();
   //         this.artifactTypes = artifactTypes;
   //      }
   //
   //      @Override
   //      public void load(AbstractOseeCache<ArtifactType> cache) throws OseeCoreException {
   //         super.load(cache);
   //         artifactTypes.add(factory.createArtifactType(cache, "000", true, "BaseArtifactType"));
   //         artifactTypes.add(factory.createArtifactType(cache, "111", true, "ArtifactType1"));
   //         artifactTypes.add(factory.createArtifactType(cache, "222", false, "ArtifactType2"));
   //         artifactTypes.add(factory.createArtifactType(cache, "333", true, "ArtifactType3"));
   //         artifactTypes.add(factory.createArtifactType(cache, "444", false, "ArtifactType4"));
   //         artifactTypes.add(factory.createArtifactType(cache, "555", true, "ArtifactType5"));
   //         artifactTypes.add(factory.createArtifactType(cache, "666", false, "ArtifactType6"));
   //         int typeId = 100;
   //         for (ArtifactType type : artifactTypes) {
   //            type.setId(typeId++);
   //            cache.cache(type);
   //         }
   //         ArtifactTypeCache artCache = (ArtifactTypeCache) cache;
   //         setUpArtifactTypeInheritance(artCache);
   //      }
   //
   //      private void setUpArtifactTypeInheritance(ArtifactTypeCache cache) throws OseeCoreException {
   //         ArtifactType baseType = cache.getUniqueByName("BaseArtifactType");
   //
   //         Set<ArtifactType> baseSuperType = new HashSet<ArtifactType>();
   //         baseSuperType.add(baseType);
   //         // 0<-1
   //         cache.cacheArtifactSuperType(cache.getByGuid("111"), baseSuperType);
   //         // 0<-2
   //         cache.cacheArtifactSuperType(cache.getByGuid("222"), baseSuperType);
   //         // 2<-3
   //         cache.cacheArtifactSuperType(cache.getByGuid("333"), Arrays.asList(cache.getByGuid("222")));
   //         // 2,3<-4
   //         cache.cacheArtifactSuperType(cache.getByGuid("444"), Arrays.asList(cache.getByGuid("222"),
   //               cache.getByGuid("333"), baseType));
   //         // 4<-5
   //         cache.cacheArtifactSuperType(cache.getByGuid("555"), Arrays.asList(cache.getByGuid("444"), baseType));
   //         // 3<-6
   //         cache.cacheArtifactSuperType(cache.getByGuid("666"), Arrays.asList(cache.getByGuid("333"), baseType));
   //      }
   //   }
   //
   //   private final static class RelationDataAccessor extends MockOseeDataAccessor<RelationType> {
   //      private final List<RelationType> relationTypes;
   //      private final AbstractOseeCache<ArtifactType> artCache;
   //
   //      public RelationDataAccessor(AbstractOseeCache<ArtifactType> artCache, List<RelationType> relationTypes) {
   //         super();
   //         this.artCache = artCache;
   //         this.relationTypes = relationTypes;
   //      }
   //
   //      @Override
   //      public void load(AbstractOseeCache<RelationType> cache) throws OseeCoreException {
   //         artCache.ensurePopulated();
   //         super.load(cache);
   //         relationTypes.add(OseeTypesUtil.createRelationType(cache, artCache, factory, "1A", "REL_1", "111", "444",
   //               RelationTypeMultiplicity.ONE_TO_ONE));
   //         relationTypes.add(OseeTypesUtil.createRelationType(cache, artCache, factory, "2B", "REL_2", "555", "000",
   //               RelationTypeMultiplicity.ONE_TO_MANY));
   //         relationTypes.add(OseeTypesUtil.createRelationType(cache, artCache, factory, "3C", "REL_3", "222", "333",
   //               RelationTypeMultiplicity.MANY_TO_ONE));
   //         relationTypes.add(OseeTypesUtil.createRelationType(cache, artCache, factory, "4D", "REL_4", "666", "666",
   //               RelationTypeMultiplicity.MANY_TO_MANY));
   //         int typeId = 300;
   //         for (RelationType type : relationTypes) {
   //            type.setId(typeId++);
   //            cache.cache(type);
   //         }
   //      }
   //   }
}

Back to the top