alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Axis 2 example source code file (ParameterDescriptionImplTests.java)

This example Axis 2 source code file (ParameterDescriptionImplTests.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Axis 2 tags/keywords

method, method, parameterdescription, parameterdescription, parameterdescriptionimpl, parameterdescriptionimpl, parameterdescriptionimpltests, reflection, string, string, testcase, testinterface, util, xml

The Axis 2 ParameterDescriptionImplTests.java source code

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.axis2.jaxws.description.impl;

import junit.framework.TestCase;
import org.apache.axis2.jaxws.description.ParameterDescription;

import javax.xml.ws.Holder;
import java.lang.reflect.Method;
import java.util.List;

/**
 * 
 */
public class ParameterDescriptionImplTests extends TestCase {

    /*
    * This is a TEMPORARY test.  It is testing the construction of a
    * ParameterDesc using a class (instead of a DBC).  Using a class should
    * be deprecated and only a DBC should be used in construction
    */
    public void test1() {
        Method[] methods = TestInterface.class.getMethods();
        Method method1 = methods[0];
        ParameterDescription pdc1 = new ParameterDescriptionImpl(0, method1.getParameterTypes()[0],
                                                                 method1.getGenericParameterTypes()[0],
                                                                 method1.getAnnotations(), null);
        assertNotNull(pdc1);
        assertEquals(List[].class, pdc1.getParameterActualType());

    }

    public void test2() {
        Method[] methods = TestInterface.class.getMethods();
        Method method2 = methods[1];
        ParameterDescription pdc2 = new ParameterDescriptionImpl(0, method2.getParameterTypes()[0],
                                                                 method2.getGenericParameterTypes()[0],
                                                                 method2.getAnnotations(), null);
        assertNotNull(pdc2);
        assertEquals(String[].class, pdc2.getParameterActualType());
    }

    public void test3() {
        Method[] methods = TestInterface.class.getMethods();
        Method method3 = methods[2];
        ParameterDescription pdc3 = new ParameterDescriptionImpl(0, method3.getParameterTypes()[0],
                                                                 method3.getGenericParameterTypes()[0],
                                                                 method3.getAnnotations(), null);
        assertNotNull(pdc3);
        assertEquals(List[].class, pdc3.getParameterActualType());
    }

    public void test4() {
        Method[] methods = TestInterface.class.getMethods();
        Method method4 = methods[3];
        ParameterDescription pdc4 = new ParameterDescriptionImpl(0, method4.getParameterTypes()[0],
                                                                 method4.getGenericParameterTypes()[0],
                                                                 method4.getAnnotations(), null);
        assertNotNull(pdc4);
        assertEquals(String[].class, pdc4.getParameterActualType());
    }

    public void test5() {
        Method[] methods = TestInterface.class.getMethods();
        Method method5 = methods[4];
        ParameterDescription pdc = new ParameterDescriptionImpl(0, method5.getParameterTypes()[0],
                                                                method5.getGenericParameterTypes()[0],
                                                                method5.getAnnotations(), null);
        assertNotNull(pdc);
        assertEquals(List[].class, pdc.getParameterActualType());
    }
}

interface TestInterface {
    String method1(Holder<List foo);

    String method2(Holder<String[]> foo);

    String method3(Holder<List foo);

    String method4(String[] foo);

    String method5(List<String>[] foo);
}

Other Axis 2 examples (source code examples)

Here is a short list of links related to this Axis 2 ParameterDescriptionImplTests.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.