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
|
/*******************************************************************************
* 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.test.type;
import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.type.OseeEnumType;
import org.junit.Ignore;
import org.junit.Test;
/**
* @author Roberto E. Escobar
*/
public class OseeEnumTypeTest {
@Test(expected = OseeArgumentException.class)
public void enumNamesWithSpaces() throws OseeCoreException {
OseeEnumType oseeEnum = new OseeEnumType("ABC", "Test");
oseeEnum.valueOf(new String(" apple "));
}
@Test(expected = OseeArgumentException.class)
public void enumNamesWithGarbageData() throws OseeCoreException {
OseeEnumType oseeEnum = new OseeEnumType("ABC", "Test");
oseeEnum.valueOf(new String("#@Gbotkob!11233%20"));
}
@Test(expected = OseeArgumentException.class)
public void enumNamesWithNull() throws OseeCoreException {
OseeEnumType oseeEnum = new OseeEnumType("ABC", "Test");
oseeEnum.valueOf(null);
}
@Ignore
@Test
public void test() {
}
// @Override
// public void testDirty() throws OseeCoreException {
// }
//
// @org.junit.Test
// public void testAddOseeEnumEntry() throws OseeCoreException {
// OseeEnumType enum1 =
// OseeTypesUtil.createEnumType(cache, factory, "Test 1", "Test 1", "OneEntry", 0, "TwoEntry", 1);
// OseeTypesUtil.checkOseeEnumEntries(enum1.values(), "OneEntry", 0, "TwoEntry", 1);
//
// OseeEnumEntry entry = factory.createEnumEntry(cache, "C", "AddedEntry", 4);
// enum1.addEntry(entry);
//
// OseeTypesUtil.checkOseeEnumEntries(enum1.values(), "OneEntry", 0, "TwoEntry", 1, "AddedEntry", 4);
//
// enum1.removeEntry(entry);
// OseeTypesUtil.checkOseeEnumEntries(enum1.values(), "OneEntry", 0, "TwoEntry", 1);
//
// enum1.removeEntry(enum1.values()[0]);
// OseeTypesUtil.checkOseeEnumEntries(enum1.values(), "TwoEntry", 1);
// }
//
}
|