Skip to content

Commit 69dd371

Browse files
committed
Fixes #36.
1 parent c3fb9ad commit 69dd371

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

tests/issues/src/main/resources/binding.xjb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@
5454
<annox:annotate annox:class="java.lang.Deprecated" />
5555
</annox:annotate>
5656
</jaxb:bindings>
57-
<jaxb:bindings node="xsd:complexType[@name='gh36Type']">
57+
<jaxb:bindings node="xsd:complexType[@name='gh36Type']/xsd:simpleContent/xsd:extension/xsd:attribute[@name='attr']">
5858
<annox:annotate>@com.fasterxml.jackson.annotation.JsonView(java.lang.Object.class)</annox:annotate>
5959
</jaxb:bindings>
60+
6061
</jaxb:bindings>
6162
</jaxb:bindings>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package org.jvnet.jaxb2_commons.tests.issues;
2+
3+
import static org.hamcrest.CoreMatchers.equalTo;
4+
import static org.hamcrest.CoreMatchers.is;
5+
import static org.hamcrest.CoreMatchers.notNullValue;
6+
import static org.junit.Assert.assertThat;
7+
8+
import java.lang.reflect.Method;
9+
10+
import org.junit.Test;
11+
12+
import com.fasterxml.jackson.annotation.JsonView;
13+
14+
public class Gh36Test {
15+
16+
@Test
17+
public void getAttrMethodIsCorrectlyAnnotated() throws Exception {
18+
19+
Method getAttrMethod = Gh36Type.class.getDeclaredMethod("getAttr");
20+
JsonView actualAnnotation = getAttrMethod.getAnnotation(JsonView.class);
21+
22+
assertThat(actualAnnotation, is(notNullValue()));
23+
assertThat(actualAnnotation.value(), is(equalTo(new Class[]{Object.class})));
24+
}
25+
}

0 commit comments

Comments
 (0)