blob: fff5070fb21d44feb11dd6b3599bac2a850d02c3 (
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
|
/*******************************************************************************
* Copyright (c) 2015 Oracle. 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:
* Oracle - initial API and implementation
******************************************************************************/
package org.eclipse.jpt.common.utility.tests.internal.reference;
import org.eclipse.jpt.common.utility.internal.reference.TrueBooleanReference;
import org.eclipse.jpt.common.utility.reference.BooleanReference;
import org.eclipse.jpt.common.utility.tests.internal.TestTools;
import junit.framework.TestCase;
@SuppressWarnings("nls")
public class TrueBooleanReferenceTests
extends TestCase
{
public TrueBooleanReferenceTests(String name) {
super(name);
}
public void testGetValue() {
BooleanReference ref = TrueBooleanReference.instance();
assertTrue(ref.getValue());
}
public void testIs() {
BooleanReference ref = TrueBooleanReference.instance();
assertTrue(ref.is(true));
assertFalse(ref.is(false));
}
public void testIsNot() {
BooleanReference ref = TrueBooleanReference.instance();
assertFalse(ref.isNot(true));
assertTrue(ref.isNot(false));
}
public void testIsTrue() {
BooleanReference ref = TrueBooleanReference.instance();
assertTrue(ref.isTrue());
}
public void testIsFalse() {
BooleanReference ref = TrueBooleanReference.instance();
assertFalse(ref.isFalse());
}
public void testToString() {
BooleanReference ref = TrueBooleanReference.instance();
assertEquals("[true]", ref.toString());
}
public void testSerialization() throws Exception {
BooleanReference ref = TrueBooleanReference.instance();
assertSame(ref, TestTools.serialize(ref));
}
}
|