Skip to content

Commit

Permalink
Merge pull request #13748 from geoand/rr-test-output
Browse files Browse the repository at this point in the history
Convert test logging level to debug
  • Loading branch information
geoand authored Dec 8, 2020
2 parents baf4466 + ea27e5c commit 94ea17a
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
@DisplayName("Default Media Type Test")
public class DefaultMediaTypeTest {

protected final Logger logger = Logger.getLogger(DefaultMediaTypeResource.class.getName());
private final Logger LOG = Logger.getLogger(DefaultMediaTypeResource.class.getName());

static Client client;

Expand Down Expand Up @@ -81,7 +81,7 @@ public void postDateProduce() throws Exception {
Response response = target.request().post(Entity.entity(baos.toByteArray(), MediaType.APPLICATION_OCTET_STREAM));
Assertions.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
String responseContent = response.readEntity(String.class);
logger.info(String.format("Response: %s", responseContent));
LOG.debug(String.format("Response: %s", responseContent));
}

/**
Expand All @@ -102,7 +102,7 @@ public void postDate() throws Exception {
Assertions.assertEquals(Response.Status.OK.getStatusCode(),
response.getStatus());
String responseContent = response.readEntity(String.class);
logger.info(String.format("Response: %s", responseContent));
LOG.debug(String.format("Response: %s", responseContent));
}

/**
Expand All @@ -120,7 +120,7 @@ public void postFooProduce() throws Exception {
Response response = target.request().post(Entity.entity(baos.toByteArray(), MediaType.APPLICATION_OCTET_STREAM));
Assertions.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
String responseContent = response.readEntity(String.class);
logger.info(String.format("Response: %s", responseContent));
LOG.debug(String.format("Response: %s", responseContent));
}

/**
Expand All @@ -141,7 +141,7 @@ public void postFoo() throws Exception {
Assertions.assertEquals(Response.Status.OK.getStatusCode(),
response.getStatus());
String responseContent = response.readEntity(String.class);
logger.info(String.format("Response: %s", responseContent));
LOG.debug(String.format("Response: %s", responseContent));
}

/**
Expand All @@ -159,7 +159,7 @@ public void postIntProduce() throws Exception {
Response response = target.request().post(Entity.entity(baos.toByteArray(), MediaType.APPLICATION_OCTET_STREAM));
Assertions.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
String responseContent = response.readEntity(String.class);
logger.info(String.format("Response: %s", responseContent));
LOG.debug(String.format("Response: %s", responseContent));
}

/**
Expand All @@ -178,7 +178,7 @@ public void postInt() throws Exception {
Assertions.assertEquals(Response.Status.OK.getStatusCode(),
response.getStatus());
String responseContent = response.readEntity(String.class);
logger.info(String.format("Response: %s", responseContent));
LOG.debug(String.format("Response: %s", responseContent));
}

/**
Expand All @@ -196,7 +196,7 @@ public void postIntegerProduce() throws Exception {
Response response = target.request().post(Entity.entity(baos.toByteArray(), MediaType.APPLICATION_OCTET_STREAM));
Assertions.assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
String responseContent = response.readEntity(String.class);
logger.info(String.format("Response: %s", responseContent));
LOG.debug(String.format("Response: %s", responseContent));
}

/**
Expand All @@ -215,6 +215,6 @@ public void postInteger() throws Exception {
Assertions.assertEquals(Response.Status.OK.getStatusCode(),
response.getStatus());
String responseContent = response.readEntity(String.class);
logger.info(String.format("Response: %s", responseContent));
LOG.debug(String.format("Response: %s", responseContent));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.resteasy.reactive.server.test.resource.basic.resource.ReponseInfoResource;
import io.quarkus.resteasy.reactive.server.test.resource.basic.resource.ResponseInfoResource;
import io.quarkus.resteasy.reactive.server.test.simple.PortProviderUtil;
import io.quarkus.test.QuarkusUnitTest;

Expand Down Expand Up @@ -48,7 +48,7 @@ public JavaArchive get() {
JavaArchive war = ShrinkWrap.create(JavaArchive.class);
war.addClasses(PortProviderUtil.class, ReponseInfoTest.class);
// Use of PortProviderUtil in the deployment
war.addClasses(ReponseInfoResource.class);
war.addClasses(ResponseInfoResource.class);
return war;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@
@Produces("*/*")
public class GenericEntityDoubleWriter implements MessageBodyWriter<List<Double>> {

private static Logger logger = Logger.getLogger(GenericEntityDoubleWriter.class);
private static final Logger LOG = Logger.getLogger(GenericEntityDoubleWriter.class);

public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
logger.info("DoubleWriter type: " + type.getName());
LOG.debug("DoubleWriter type: " + type.getName());
if (!List.class.isAssignableFrom(type)) {
return false;
}
logger.info("DoubleWriter: " + genericType);
LOG.debug("DoubleWriter: " + genericType);
if (!(genericType instanceof ParameterizedType)) {
return false;
}
logger.info("DoubleWriter");
LOG.debug("DoubleWriter");
ParameterizedType pt = (ParameterizedType) genericType;
boolean result = pt.getActualTypeArguments()[0].equals(Double.class);
logger.info("Doublewriter result!!!: " + result);
LOG.debug("Doublewriter result!!!: " + result);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@Produces("*/*")
public class GenericEntitytFloatWriter implements MessageBodyWriter<List<Float>> {

private static Logger logger = Logger.getLogger(GenericEntitytFloatWriter.class);
private static final Logger LOG = Logger.getLogger(GenericEntitytFloatWriter.class);

public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
if (!List.class.isAssignableFrom(type)) {
Expand All @@ -31,7 +31,7 @@ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotat
}
ParameterizedType pt = (ParameterizedType) genericType;
boolean result = pt.getActualTypeArguments()[0].equals(Float.class);
logger.info("FloatWriter result!!!: " + result);
LOG.debug("FloatWriter result!!!: " + result);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.jboss.logging.Logger;

public class ParameterSubResSubImpl<T extends Number> implements ParameterSubResSub, ParameterSubResInternalInterface<T> {
private static Logger logger = Logger.getLogger(ParameterSubResSubImpl.class);
private static Logger LOG = Logger.getLogger(ParameterSubResSubImpl.class);

private final String path;

Expand All @@ -18,7 +18,7 @@ public String get() {

@Override
public void foo(T value) {
logger.info("foo: " + value);
LOG.debug("foo: " + value);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ public class ResourceLocatorBaseResource {

@Path("base/{param}/resources")
public Object getSubresource(@PathParam("param") String param, @Context UriInfo uri) {
LOG.info("Here in BaseResource");
LOG.debug("Here in BaseResource");
Assertions.assertEquals("1", param);
List<String> matchedURIs = uri.getMatchedURIs();
Assertions.assertEquals(2, matchedURIs.size());
Assertions.assertEquals("base/1/resources", matchedURIs.get(0));
Assertions.assertEquals("", matchedURIs.get(1));
for (String ancestor : matchedURIs)
LOG.info(" " + ancestor);
LOG.debug(" " + ancestor);

LOG.info("Uri Ancesstors Object for Subresource.doGet():");
LOG.debug("Uri Ancestors Object for Subresource.doGet():");
Assertions.assertEquals(1, uri.getMatchedResources().size());
Assertions.assertEquals(ResourceLocatorBaseResource.class, uri.getMatchedResources().get(0).getClass());
return new ResourceLocatorSubresource();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,34 @@ public String doGet(@Context UriInfo uri) {
Assertions.assertEquals("base/1/resources", matchedURIs.get(0));
Assertions.assertEquals("", matchedURIs.get(1));
for (String ancestor : matchedURIs)
LOG.info(" " + ancestor);
LOG.debug(" " + ancestor);

LOG.info("Uri Ancesstors Object for Subresource.doGet():");
LOG.info("Uri Ancestors Object for Subresource.doGet():");
Assertions.assertEquals(2, uri.getMatchedResources().size());
Assertions.assertEquals(ResourceLocatorSubresource.class, uri.getMatchedResources().get(0).getClass());
Assertions.assertEquals(ResourceLocatorBaseResource.class, uri.getMatchedResources().get(1).getClass());
for (Object ancestor : uri.getMatchedResources())
LOG.infov(" {0}", ancestor.getClass().getName());
LOG.debugv(" {0}", ancestor.getClass().getName());
return this.getClass().getName();
}

@Path("/subresource2")
public Object getSubresource2(@Context UriInfo uri) {
LOG.info("Uri Ancesstors for Subresource.getSubresource2():");
LOG.info("Uri Ancestors for Subresource.getSubresource2():");
List<String> matchedURIs = uri.getMatchedURIs();
Assertions.assertEquals(3, matchedURIs.size());
Assertions.assertEquals("base/1/resources/subresource2", matchedURIs.get(0));
Assertions.assertEquals("base/1/resources", matchedURIs.get(1));
Assertions.assertEquals("", matchedURIs.get(2));
for (String ancestor : matchedURIs)
LOG.info(" " + ancestor);
LOG.debug(" " + ancestor);

LOG.info("Uri Ancesstors Object for Subresource.getSubresource2():");
LOG.info("Uri Ancestors Object for Subresource.getSubresource2():");
Assertions.assertEquals(2, uri.getMatchedResources().size());
Assertions.assertEquals(ResourceLocatorSubresource.class, uri.getMatchedResources().get(0).getClass());
Assertions.assertEquals(ResourceLocatorBaseResource.class, uri.getMatchedResources().get(1).getClass());
for (Object ancestor : uri.getMatchedResources())
LOG.infov(" {0}", ancestor.getClass().getName());
LOG.debugv(" {0}", ancestor.getClass().getName());
return new ResourceLocatorSubresource2();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ public class ResourceLocatorSubresource2 {
@GET
@Path("stuff/{param}/bar")
public String doGet(@PathParam("param") String param, @Context UriInfo uri) {
LOG.info("Uri Ancesstors for Subresource2.doGet():");
LOG.debug("Uri Ancestors for Subresource2.doGet():");
Assertions.assertEquals(4, uri.getMatchedURIs().size());
Assertions.assertEquals("base/1/resources/subresource2/stuff/2/bar", uri.getMatchedURIs().get(0));
Assertions.assertEquals("base/1/resources/subresource2", uri.getMatchedURIs().get(1));
Assertions.assertEquals("base/1/resources", uri.getMatchedURIs().get(2));
Assertions.assertEquals("", uri.getMatchedURIs().get(3));
for (String ancestor : uri.getMatchedURIs())
LOG.infov(" {0}", ancestor);
LOG.debugv(" {0}", ancestor);

LOG.info("Uri Ancesstors Object for Subresource2.doGet():");
LOG.debug("Uri Ancestors Object for Subresource2.doGet():");
Assertions.assertEquals(3, uri.getMatchedResources().size());
Assertions.assertEquals(ResourceLocatorSubresource2.class, uri.getMatchedResources().get(0).getClass());
Assertions.assertEquals(ResourceLocatorSubresource.class, uri.getMatchedResources().get(1).getClass());
Assertions.assertEquals(ResourceLocatorBaseResource.class, uri.getMatchedResources().get(2).getClass());
for (Object ancestor : uri.getMatchedResources())
LOG.infov(" {0}", ancestor.getClass().getName());
LOG.debugv(" {0}", ancestor.getClass().getName());
Assertions.assertEquals("2", param);
return this.getClass().getName() + "-" + param;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
import io.quarkus.resteasy.reactive.server.test.simple.PortProviderUtil;

@Path("/")
public class ReponseInfoResource {
private static Logger logger = Logger.getLogger(ReponseInfoResource.class);
public class ResponseInfoResource {
private static Logger LOG = Logger.getLogger(ResponseInfoResource.class);

@Path("/simple")
@GET
public String get(@QueryParam("abs") String abs) {
logger.info("abs query: " + abs);
LOG.debug("abs query: " + abs);
URI base;
if (abs == null) {
base = PortProviderUtil.createURI("/new/one");
Expand All @@ -29,7 +29,7 @@ public String get(@QueryParam("abs") String abs) {
}
Response response = Response.temporaryRedirect(URI.create("new/one")).build();
URI uri = (URI) response.getMetadata().getFirst(HttpHeaders.LOCATION);
logger.info("Location uri: " + uri);
LOG.debug("Location uri: " + uri);
Assertions.assertEquals(base.getPath(), uri.getPath());
return "CONTENT";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@Path("/{api:(?i:api)}")
public class SpecialResourceApiResource {
private static Logger logger = Logger.getLogger(SpecialResourceApiResource.class);
private static Logger LOG = Logger.getLogger(SpecialResourceApiResource.class);

@Path("/{func:(?i:func)}")
@GET
Expand All @@ -23,7 +23,7 @@ public String func() {

@PUT
public void put(@Context HttpHeaders headers, String val) {
logger.info(headers.getMediaType());
LOG.debug(headers.getMediaType());
Assertions.assertEquals("Wrong request content", val, "hello");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@

@Path("/UriInfoSimpleResource")
public class UriInfoSimpleResource {
private static Logger logger = Logger.getLogger(UriInfoSimpleResource.class);
private static Logger LOG = Logger.getLogger(UriInfoSimpleResource.class);
@Context
UriInfo myInfo;

@Path("/simple")
@GET
public String get(@Context UriInfo info, @QueryParam("abs") String abs) {
logger.info("abs query: " + abs);
LOG.debug("abs query: " + abs);
URI base = null;
if (abs == null) {
base = PortProviderUtil.createURI("/");
} else {
base = PortProviderUtil.createURI("/" + abs + "/");
}

logger.info("BASE URI: " + info.getBaseUri());
logger.info("Request URI: " + info.getRequestUri());
logger.info("Absolute URI: " + info.getAbsolutePath());
LOG.debug("BASE URI: " + info.getBaseUri());
LOG.debug("Request URI: " + info.getRequestUri());
LOG.debug("Absolute URI: " + info.getAbsolutePath());
Assertions.assertEquals(base.getPath(), info.getBaseUri().getPath());
Assertions.assertEquals("/UriInfoSimpleResource/simple", info.getPath());
return "CONTENT";
Expand All @@ -41,16 +41,16 @@ public String get(@Context UriInfo info, @QueryParam("abs") String abs) {
@Path("/simple/fromField")
@GET
public String getField(@QueryParam("abs") String abs) {
logger.info("abs query: " + abs);
LOG.debug("abs query: " + abs);
URI base = null;
if (abs == null) {
base = PortProviderUtil.createURI("/");
} else {
base = PortProviderUtil.createURI("/" + abs + "/");
}

logger.info("BASE URI: " + myInfo.getBaseUri());
logger.info("Request URI: " + myInfo.getRequestUri());
LOG.debug("BASE URI: " + myInfo.getBaseUri());
LOG.debug("Request URI: " + myInfo.getRequestUri());
Assertions.assertEquals(base.getPath(), myInfo.getBaseUri().getPath());
Assertions.assertEquals("/UriInfoSimpleResource/simple/fromField", myInfo.getPath());
return "CONTENT";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@

@Path("UriInfoSimpleSingletonResource")
public class UriInfoSimpleSingletonResource {
private static Logger logger = Logger.getLogger(UriInfoSimpleSingletonResource.class);
private static Logger LOG = Logger.getLogger(UriInfoSimpleSingletonResource.class);

@Context
UriInfo myInfo;

@Path("/simple")
@GET
public String get(@Context UriInfo info, @QueryParam("abs") String abs) {
logger.info("abs query: " + abs);
LOG.debug("abs query: " + abs);
URI base = null;
if (abs == null) {
base = PortProviderUtil.createURI("/");
} else {
base = PortProviderUtil.createURI("/" + abs + "/");
}

logger.info("BASE URI: " + info.getBaseUri());
logger.info("Request URI: " + info.getRequestUri());
LOG.debug("BASE URI: " + info.getBaseUri());
LOG.debug("Request URI: " + info.getRequestUri());
Assertions.assertEquals(base.getPath(), info.getBaseUri().getPath());
Assertions.assertEquals("/simple", info.getPath());
return "CONTENT";
Expand All @@ -41,16 +41,16 @@ public String get(@Context UriInfo info, @QueryParam("abs") String abs) {
@Path("/simple/fromField")
@GET
public String get(@QueryParam("abs") String abs) {
logger.info("abs query: " + abs);
LOG.debug("abs query: " + abs);
URI base = null;
if (abs == null) {
base = PortProviderUtil.createURI("/");
} else {
base = PortProviderUtil.createURI("/" + abs + "/");
}

logger.info("BASE URI: " + myInfo.getBaseUri());
logger.info("Request URI: " + myInfo.getRequestUri());
LOG.debug("BASE URI: " + myInfo.getBaseUri());
LOG.debug("Request URI: " + myInfo.getRequestUri());
Assertions.assertEquals(base.getPath(), myInfo.getBaseUri().getPath());
Assertions.assertEquals("/simple/fromField", myInfo.getPath());
return "CONTENT";
Expand Down
Loading

0 comments on commit 94ea17a

Please sign in to comment.