Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RESTEASY-1432] - Interface with generic type does not work with clie…
…nt proxy (#1968)
- Loading branch information
Showing
10 changed files
with
174 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...c/test/java/org/jboss/resteasy/test/client/proxy/resource/GenericEntities/BaseEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.jboss.resteasy.test.client.proxy.resource.GenericEntities; | ||
|
||
public class BaseEntity { | ||
private String name; | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
.../jboss/resteasy/test/client/proxy/resource/GenericEntities/EntityExtendingBaseEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.jboss.resteasy.test.client.proxy.resource.GenericEntities; | ||
|
||
public class EntityExtendingBaseEntity extends BaseEntity { | ||
private String lastName; | ||
|
||
public EntityExtendingBaseEntity() {} | ||
|
||
public EntityExtendingBaseEntity(final String name, final String lastName) { | ||
super.setName(name); | ||
this.lastName = lastName; | ||
} | ||
|
||
public String getLastName() { | ||
return lastName; | ||
} | ||
|
||
public void setLastName(String lastName) { | ||
this.lastName = lastName; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...resteasy/test/client/proxy/resource/GenericEntities/GenericEntityExtendingBaseEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.jboss.resteasy.test.client.proxy.resource.GenericEntities; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
import java.util.List; | ||
|
||
@Path("/") | ||
public interface GenericEntityExtendingBaseEntity<T extends BaseEntity> { | ||
|
||
@GET | ||
@Path("one") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
T findOne(); | ||
|
||
@GET | ||
@Path("all") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
List<T> findAll(); | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
...asy/test/client/proxy/resource/GenericEntities/GenericEntityExtendingBaseEntityProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.jboss.resteasy.test.client.proxy.resource.GenericEntities; | ||
|
||
public interface GenericEntityExtendingBaseEntityProxy extends GenericEntityExtendingBaseEntity<EntityExtendingBaseEntity> { | ||
|
||
} | ||
|
28 changes: 28 additions & 0 deletions
28
.../test/client/proxy/resource/GenericEntities/GenericEntityExtendingBaseEntityResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.jboss.resteasy.test.client.proxy.resource.GenericEntities; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class GenericEntityExtendingBaseEntityResource implements GenericEntityExtendingBaseEntity<EntityExtendingBaseEntity> { | ||
public static final String FIRST_NAME = "FirstName"; | ||
public static final String LAST_NAME = "LastName"; | ||
|
||
public static List<EntityExtendingBaseEntity> generateEntities(int count) { | ||
List<EntityExtendingBaseEntity> entityExtendingBaseEntities = new ArrayList<>(); | ||
for(int i = 0; i < count; i++) { | ||
entityExtendingBaseEntities.add(new EntityExtendingBaseEntity(FIRST_NAME, LAST_NAME)); | ||
} | ||
return entityExtendingBaseEntities; | ||
} | ||
|
||
@Override | ||
public List<EntityExtendingBaseEntity> findAll() { | ||
return generateEntities(2); | ||
} | ||
|
||
@Override | ||
public EntityExtendingBaseEntity findOne() { | ||
return new EntityExtendingBaseEntity(FIRST_NAME, LAST_NAME); | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
...rg/jboss/resteasy/test/client/proxy/resource/GenericEntities/MultipleGenericEntities.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.jboss.resteasy.test.client.proxy.resource.GenericEntities; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
import java.util.HashMap; | ||
|
||
@Path("") | ||
public interface MultipleGenericEntities<K, V> { | ||
|
||
@GET | ||
@Path("hashMap") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
HashMap<K,V> findHashMap(); | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
...oss/resteasy/test/client/proxy/resource/GenericEntities/MultipleGenericEntitiesProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.jboss.resteasy.test.client.proxy.resource.GenericEntities; | ||
|
||
public interface MultipleGenericEntitiesProxy extends MultipleGenericEntities<String, EntityExtendingBaseEntity> { | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
.../resteasy/test/client/proxy/resource/GenericEntities/MultipleGenericEntitiesResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.jboss.resteasy.test.client.proxy.resource.GenericEntities; | ||
|
||
import java.util.HashMap; | ||
|
||
import static org.jboss.resteasy.test.client.proxy.resource.GenericEntities.GenericEntityExtendingBaseEntityResource.FIRST_NAME; | ||
import static org.jboss.resteasy.test.client.proxy.resource.GenericEntities.GenericEntityExtendingBaseEntityResource.LAST_NAME; | ||
|
||
public class MultipleGenericEntitiesResource implements MultipleGenericEntities<String, EntityExtendingBaseEntity> { | ||
|
||
@Override | ||
public HashMap<String, EntityExtendingBaseEntity> findHashMap() { | ||
HashMap<String, EntityExtendingBaseEntity> res = new HashMap<>(); | ||
res.put(FIRST_NAME, new EntityExtendingBaseEntity(FIRST_NAME, LAST_NAME)); | ||
return res; | ||
} | ||
} |