+ @Test
+ public void testMdsal589() throws Exception {
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("mdsal589");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("mdsal589");
+ generateTestSources("/compilation/mdsal589", sourcesOutputDir);
+ CompilationTestUtils.testCompilation(sourcesOutputDir, compiledOutputDir);
+ CompilationTestUtils.cleanUp(sourcesOutputDir, compiledOutputDir);
+ }
+
+ private static void testReturnTypeIdentityref(final Class<?> clazz, final String methodName,
+ final String returnTypeStr) throws NoSuchMethodException {
+ Method method = clazz.getMethod(methodName);
+ assertEquals(java.lang.Class.class, method.getReturnType());
+ java.lang.reflect.Type returnType = method.getGenericReturnType();
+ assertTrue(returnType instanceof ParameterizedType);
+ final ParameterizedType pt = (ParameterizedType) returnType;
+ final java.lang.reflect.Type[] parameters = pt.getActualTypeArguments();
+ assertEquals(1, parameters.length);
+ final java.lang.reflect.Type parameter = parameters[0];
+ assertTrue(parameter instanceof WildcardType);
+ final WildcardType wildcardType = (WildcardType) parameter;
+ assertEquals("? extends " + returnTypeStr, wildcardType.toString());
+ }
+
+ private static void testReturnTypeInstanceIdentitifer(final ClassLoader loader, final Class<?> clazz,
+ final String methodName) throws ClassNotFoundException, NoSuchMethodException, SecurityException {
+ final Method method = clazz.getMethod(methodName);
+ final Class<?> rawReturnType = Class.forName("org.opendaylight.yangtools.yang.binding.InstanceIdentifier", true,
+ loader);
+ assertEquals(rawReturnType, method.getReturnType());
+ final java.lang.reflect.Type returnType = method.getGenericReturnType();
+ assertTrue(returnType instanceof ParameterizedType);
+ final ParameterizedType pt = (ParameterizedType) returnType;
+ final java.lang.reflect.Type[] parameters = pt.getActualTypeArguments();
+ assertEquals(1, parameters.length);
+ final java.lang.reflect.Type parameter = parameters[0];
+ assertTrue(parameter instanceof WildcardType);
+ final WildcardType wildcardType = (WildcardType) parameter;
+ assertEquals("?", wildcardType.toString());
+ }