Search in sources :

Example 26 with Type

use of org.jboss.jandex.Type in project wildfly-swarm by wildfly-swarm.

the class ExpectationTests method testGenericsWithBounds.

@Test
public void testGenericsWithBounds() throws IOException, JSONException {
    String name = GenericTypeTestContainer.class.getName();
    Type pType = getFieldFromKlazz(name, "genericWithBounds").type();
    OpenApiDataObjectScanner scanner = new OpenApiDataObjectScanner(index, pType);
    Schema result = scanner.process();
    printToConsole(name, result);
    assertJsonEquals(name, "generic.withBounds.expected.json", result);
}
Also used : Type(org.jboss.jandex.Type) ClassType(org.jboss.jandex.ClassType) Schema(org.eclipse.microprofile.openapi.models.media.Schema) Test(org.junit.Test)

Example 27 with Type

use of org.jboss.jandex.Type in project wildfly-swarm by wildfly-swarm.

the class SpecialCaseTests method testCollection_SimpleTerminalType.

@Test
public void testCollection_SimpleTerminalType() throws IOException, JSONException {
    String name = SpecialCaseTestContainer.class.getName();
    Type pType = getFieldFromKlazz(name, "listOfString").type();
    OpenApiDataObjectScanner scanner = new OpenApiDataObjectScanner(index, pType);
    Schema result = scanner.process();
    printToConsole(name, result);
    assertJsonEquals(name, "special.simple.expected.json", result);
}
Also used : Type(org.jboss.jandex.Type) Schema(org.eclipse.microprofile.openapi.models.media.Schema) Test(org.junit.Test)

Example 28 with Type

use of org.jboss.jandex.Type in project wildfly-swarm by wildfly-swarm.

the class SpecialCaseTests method testCollection_WildcardWithExtendBound.

@Test
public void testCollection_WildcardWithExtendBound() throws IOException, JSONException {
    String name = SpecialCaseTestContainer.class.getName();
    Type pType = getFieldFromKlazz(name, "listExtendsFoo").type();
    OpenApiDataObjectScanner scanner = new OpenApiDataObjectScanner(index, pType);
    Schema result = scanner.process();
    printToConsole(name, result);
    assertJsonEquals(name, "special.wildcardWithExtendBound.expected.json", result);
}
Also used : Type(org.jboss.jandex.Type) Schema(org.eclipse.microprofile.openapi.models.media.Schema) Test(org.junit.Test)

Aggregations

Type (org.jboss.jandex.Type)28 Schema (org.eclipse.microprofile.openapi.models.media.Schema)15 Test (org.junit.Test)11 ClassType (org.jboss.jandex.ClassType)10 ClassInfo (org.jboss.jandex.ClassInfo)9 ParameterizedType (org.jboss.jandex.ParameterizedType)7 PrimitiveType (org.jboss.jandex.PrimitiveType)6 ArrayType (org.jboss.jandex.ArrayType)5 MethodInfo (org.jboss.jandex.MethodInfo)4 TypeUtil (org.wildfly.swarm.microprofile.openapi.runtime.util.TypeUtil)4 ArrayList (java.util.ArrayList)3 LinkedHashMap (java.util.LinkedHashMap)3 MediaType (org.eclipse.microprofile.openapi.models.media.MediaType)3 EEModuleClassDescription (org.jboss.as.ee.component.EEModuleClassDescription)3 InterceptorClassDescription (org.jboss.as.ee.component.interceptors.InterceptorClassDescription)3 MethodIdentifier (org.jboss.invocation.proxy.MethodIdentifier)3 FieldInfo (org.jboss.jandex.FieldInfo)3 RefType (org.wildfly.swarm.microprofile.openapi.runtime.util.JandexUtil.RefType)3 HashMap (java.util.HashMap)2 Map (java.util.Map)2