| 1 |
package com.fasterxml.jackson.module.jaxb.misc; |
| 2 |
|
| 3 |
import javax.xml.bind.annotation.XmlEnum; |
| 4 |
|
| 5 |
import com.fasterxml.jackson.databind.ObjectMapper; |
| 6 |
import com.fasterxml.jackson.module.jaxb.BaseJaxbTest; |
| 7 |
|
| 8 |
public class TestEnums extends BaseJaxbTest |
| 9 |
{ |
| 10 |
enum Plain { A, B; } |
| 11 |
|
| 12 |
@XmlEnum(Integer.class) |
| 13 |
enum Numeric { A, B; } |
| 14 |
|
| 15 |
/* |
| 16 |
/********************************************************** |
| 17 |
/* Unit tests |
| 18 |
/********************************************************** |
| 19 |
*/ |
| 20 |
|
| 21 |
// [JACKSON-436] |
| 22 |
public void testWrapperWithCollection() throws Exception |
| 23 |
{ |
| 24 |
ObjectMapper mapper = getJaxbMapper(); |
| 25 |
assertEquals("\"B\"", mapper.writeValueAsString(Plain.B)); |
| 26 |
assertEquals("1", mapper.writeValueAsString(Numeric.B)); |
| 27 |
} |
| 28 |
} |