Revision 4dbcb616
Added by Andreas Müller about 3 years ago
cdmlib-model/src/test/java/eu/etaxonomy/cdm/hibernate/ShiftUsertTypeTest.java | ||
---|---|---|
1 | 1 |
/** |
2 |
* |
|
3 |
*/ |
|
2 |
* Copyright (C) 2016 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
4 | 9 |
package eu.etaxonomy.cdm.hibernate; |
5 | 10 |
|
6 | 11 |
import java.io.Serializable; |
12 |
import java.sql.Types; |
|
7 | 13 |
|
8 | 14 |
import org.junit.Assert; |
9 | 15 |
import org.junit.Before; |
... | ... | |
13 | 19 |
|
14 | 20 |
/** |
15 | 21 |
* @author a.mueller |
16 |
* |
|
17 | 22 |
*/ |
18 | 23 |
public class ShiftUsertTypeTest { |
19 | 24 |
|
20 | 25 |
private ShiftUserType shiftUserType; |
21 |
|
|
22 |
/** |
|
23 |
* @throws java.lang.Exception |
|
24 |
*/ |
|
26 |
|
|
25 | 27 |
@Before |
26 | 28 |
public void setUp() throws Exception { |
27 | 29 |
shiftUserType = new ShiftUserType(); |
28 | 30 |
} |
29 | 31 |
|
30 |
/** |
|
31 |
* Test method for {@link eu.etaxonomy.cdm.hibernate.ShiftUserType#deepCopy(java.lang.Object)}. |
|
32 |
*/ |
|
33 | 32 |
@Test |
34 | 33 |
public void testDeepCopyObject() { |
35 | 34 |
//TODO |
36 | 35 |
} |
37 | 36 |
|
38 |
/** |
|
39 |
* Test method for {@link eu.etaxonomy.cdm.hibernate.ShiftUserType#disassemble(java.lang.Object)}. |
|
40 |
*/ |
|
41 | 37 |
@Test |
42 | 38 |
public void testDisassembleObject() { |
43 | 39 |
Serializable nullValue = this.shiftUserType.disassemble(null); |
... | ... | |
50 | 46 |
Assert.assertEquals("2,3;3,-1", twoValues); |
51 | 47 |
} |
52 | 48 |
|
53 |
/** |
|
54 |
* Test method for {@link eu.etaxonomy.cdm.hibernate.ShiftUserType#nullSafeGet(java.sql.ResultSet, java.lang.String[], org.hibernate.engine.spi.SessionImplementor, java.lang.Object)}. |
|
55 |
*/ |
|
56 | 49 |
@Test |
57 | 50 |
public void testNullSafeGetString() { |
58 | 51 |
Shift[] emptyResult = shiftUserType.nullSafeGet(""); |
... | ... | |
61 | 54 |
Assert.assertEquals(1, singleResult.length); |
62 | 55 |
} |
63 | 56 |
|
64 |
/** |
|
65 |
* Test method for {@link eu.etaxonomy.cdm.hibernate.ShiftUserType#nullSafeSet(java.sql.PreparedStatement, java.lang.Object, int, org.hibernate.engine.spi.SessionImplementor)}. |
|
66 |
*/ |
|
67 | 57 |
@Test |
68 | 58 |
public void testNullSafeSet() { |
69 | 59 |
//TODO |
70 | 60 |
} |
71 | 61 |
|
72 |
/** |
|
73 |
* Test method for {@link eu.etaxonomy.cdm.hibernate.ShiftUserType#returnedClass()}. |
|
74 |
*/ |
|
75 | 62 |
@Test |
76 | 63 |
public void testReturnedClass() { |
77 | 64 |
Class<?> returnedClass = new ShiftUserType().returnedClass(); |
78 | 65 |
Assert.assertEquals(Shift[].class, returnedClass); |
79 | 66 |
} |
80 | 67 |
|
81 |
/** |
|
82 |
* Test method for {@link eu.etaxonomy.cdm.hibernate.ShiftUserType#sqlTypes()}. |
|
83 |
*/ |
|
84 | 68 |
@Test |
85 | 69 |
public void testSqlTypes() { |
86 | 70 |
int[] sqlTypes = new ShiftUserType().sqlTypes(); |
87 |
// Assert.assertEquals(new int[]{ Types.CLOB }, sqlTypes);
|
|
71 |
Assert.assertArrayEquals(new int[]{Types.CLOB}, sqlTypes);
|
|
88 | 72 |
} |
89 |
|
|
90 |
} |
|
73 |
} |
Also available in: Unified diff
cleanup and use TermTestBase for model tests