Search in sources :

Example 1 with ParameterizedTypeImpl

use of org.glassfish.hk2.utilities.reflection.ParameterizedTypeImpl in project jersey by jersey.

the class FeedEntriesAtomBodyWriterTest method testIsWriteableSuccess.

@Test
public void testIsWriteableSuccess() {
    boolean writeable = testedClass.isWriteable(List.class, new ParameterizedTypeImpl(FeedEntry.class, FeedEntry.class), null, MediaType.APPLICATION_ATOM_XML_TYPE);
    assertTrue(writeable);
}
Also used : FeedEntry(org.glassfish.jersey.examples.feedcombiner.model.FeedEntry) ParameterizedTypeImpl(org.glassfish.hk2.utilities.reflection.ParameterizedTypeImpl) Test(org.junit.Test)

Example 2 with ParameterizedTypeImpl

use of org.glassfish.hk2.utilities.reflection.ParameterizedTypeImpl in project jersey by jersey.

the class FeedEntriesAtomBodyWriterTest method testIsWriteableWrongClass.

@Test
public void testIsWriteableWrongClass() {
    boolean writeable = testedClass.isWriteable(String.class, new ParameterizedTypeImpl(FeedEntry.class, FeedEntry.class), null, MediaType.APPLICATION_ATOM_XML_TYPE);
    assertFalse(writeable);
}
Also used : FeedEntry(org.glassfish.jersey.examples.feedcombiner.model.FeedEntry) ParameterizedTypeImpl(org.glassfish.hk2.utilities.reflection.ParameterizedTypeImpl) Test(org.junit.Test)

Example 3 with ParameterizedTypeImpl

use of org.glassfish.hk2.utilities.reflection.ParameterizedTypeImpl in project jersey by jersey.

the class FeedEntriesAtomBodyWriterTest method testIsWriteableWrongMediaType.

@Test
public void testIsWriteableWrongMediaType() {
    boolean writeable = testedClass.isWriteable(List.class, new ParameterizedTypeImpl(FeedEntry.class, FeedEntry.class), null, MediaType.APPLICATION_JSON_TYPE);
    assertFalse(writeable);
}
Also used : FeedEntry(org.glassfish.jersey.examples.feedcombiner.model.FeedEntry) ParameterizedTypeImpl(org.glassfish.hk2.utilities.reflection.ParameterizedTypeImpl) Test(org.junit.Test)

Example 4 with ParameterizedTypeImpl

use of org.glassfish.hk2.utilities.reflection.ParameterizedTypeImpl in project jersey by jersey.

the class FeedEntriesAtomBodyWriterTest method testIsWriteableWrongGeneric.

@Test
public void testIsWriteableWrongGeneric() {
    boolean writeable = testedClass.isWriteable(List.class, new ParameterizedTypeImpl(String.class, String.class), null, MediaType.APPLICATION_ATOM_XML_TYPE);
    assertFalse(writeable);
}
Also used : ParameterizedTypeImpl(org.glassfish.hk2.utilities.reflection.ParameterizedTypeImpl) Test(org.junit.Test)

Aggregations

ParameterizedTypeImpl (org.glassfish.hk2.utilities.reflection.ParameterizedTypeImpl)4 Test (org.junit.Test)4 FeedEntry (org.glassfish.jersey.examples.feedcombiner.model.FeedEntry)3