Search in sources :

Example 1 with ResolvedPrimitiveType

use of com.github.javaparser.resolution.types.ResolvedPrimitiveType in project javaparser by javaparser.

the class PrimitiveTypeTest method testIsAssignableByAnythingElse.

@Test
public void testIsAssignableByAnythingElse() {
    for (ResolvedPrimitiveType ptu : ResolvedPrimitiveType.values()) {
        assertEquals(false, ptu.isAssignableBy(OBJECT));
        assertEquals(false, ptu.isAssignableBy(STRING));
        assertEquals(false, ptu.isAssignableBy(NullType.INSTANCE));
        assertEquals(false, ptu.isAssignableBy(ResolvedVoidType.INSTANCE));
        assertEquals(false, ptu.isAssignableBy(arrayOfBooleans));
        assertEquals(false, ptu.isAssignableBy(arrayOfListOfA));
    }
}
Also used : ResolvedPrimitiveType(com.github.javaparser.resolution.types.ResolvedPrimitiveType) Test(org.junit.Test)

Example 2 with ResolvedPrimitiveType

use of com.github.javaparser.resolution.types.ResolvedPrimitiveType in project javaparser by javaparser.

the class PrimitiveTypeTest method testAsReferenceTypeUsage.

@Test
public void testAsReferenceTypeUsage() {
    for (ResolvedPrimitiveType ptu : ResolvedPrimitiveType.values()) {
        try {
            ptu.asReferenceType();
            fail();
        } catch (UnsupportedOperationException e) {
        }
    }
}
Also used : ResolvedPrimitiveType(com.github.javaparser.resolution.types.ResolvedPrimitiveType) Test(org.junit.Test)

Example 3 with ResolvedPrimitiveType

use of com.github.javaparser.resolution.types.ResolvedPrimitiveType in project javaparser by javaparser.

the class PrimitiveTypeTest method testAsTypeParameter.

@Test
public void testAsTypeParameter() {
    for (ResolvedPrimitiveType ptu : ResolvedPrimitiveType.values()) {
        try {
            ptu.asTypeParameter();
            fail();
        } catch (UnsupportedOperationException e) {
        }
    }
}
Also used : ResolvedPrimitiveType(com.github.javaparser.resolution.types.ResolvedPrimitiveType) Test(org.junit.Test)

Example 4 with ResolvedPrimitiveType

use of com.github.javaparser.resolution.types.ResolvedPrimitiveType in project javaparser by javaparser.

the class PrimitiveTypeTest method testAsArrayTypeUsage.

@Test
public void testAsArrayTypeUsage() {
    for (ResolvedPrimitiveType ptu : ResolvedPrimitiveType.values()) {
        try {
            ptu.asArrayType();
            fail();
        } catch (UnsupportedOperationException e) {
        }
    }
}
Also used : ResolvedPrimitiveType(com.github.javaparser.resolution.types.ResolvedPrimitiveType) Test(org.junit.Test)

Aggregations

ResolvedPrimitiveType (com.github.javaparser.resolution.types.ResolvedPrimitiveType)4 Test (org.junit.Test)4