Skip to content

Commit

Permalink
[resolves #395] Provide camel-swagger support
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Diesler committed May 6, 2015
1 parent 0790305 commit 849cb5b
Show file tree
Hide file tree
Showing 34 changed files with 449 additions and 128 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@
*/
package org.wildfly.camel.examples.activemq;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.test.common.HttpRequest;
import org.wildfly.camel.test.common.HttpResponse;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -38,6 +29,15 @@
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.test.common.HttpRequest;
import org.wildfly.camel.test.common.HttpRequest.HttpResponse;

@RunAsClient
@RunWith(Arquillian.class)
public class ActiveMQExampleTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* Licensed 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.
Expand All @@ -19,15 +19,15 @@
*/
package org.wildfly.camel.examples.cdi;

import java.net.MalformedURLException;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.test.common.HttpRequest;
import org.wildfly.camel.test.common.HttpResponse;

import java.net.MalformedURLException;
import org.wildfly.camel.test.common.HttpRequest.HttpResponse;

/**
* Test the CDI component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* Licensed 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.
Expand All @@ -25,7 +25,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.test.common.HttpRequest;
import org.wildfly.camel.test.common.HttpResponse;
import org.wildfly.camel.test.common.HttpRequest.HttpResponse;


@RunAsClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
*/
package org.wildfly.camel.examples.jaxws;

import javax.ws.rs.core.MediaType;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.test.common.HttpRequest;
import org.wildfly.camel.test.common.HttpResponse;

import javax.ws.rs.core.MediaType;
import org.wildfly.camel.test.common.HttpRequest.HttpResponse;

@RunAsClient
@RunWith(Arquillian.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@
*/
package org.wildfly.camel.examples.jms;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.test.common.HttpRequest;
import org.wildfly.camel.test.common.HttpResponse;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -38,6 +29,15 @@
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.test.common.HttpRequest;
import org.wildfly.camel.test.common.HttpRequest.HttpResponse;

@RunAsClient
@RunWith(Arquillian.class)
public class JMSExampleTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* Licensed 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.
Expand All @@ -19,15 +19,15 @@
*/
package org.wildfly.camel.examples.jpa;

import java.net.MalformedURLException;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.test.common.HttpRequest;
import org.wildfly.camel.test.common.HttpResponse;

import java.net.MalformedURLException;
import org.wildfly.camel.test.common.HttpRequest.HttpResponse;

@RunAsClient
@RunWith(Arquillian.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
*/
package org.wildfly.camel.examples.mail;

import java.net.MalformedURLException;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.test.common.HttpRequest;
import org.wildfly.camel.test.common.HttpResponse;

import java.net.MalformedURLException;
import org.wildfly.camel.test.common.HttpRequest.HttpResponse;

@RunAsClient
@RunWith(Arquillian.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* Licensed 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.
Expand All @@ -19,19 +19,20 @@
*/
package org.wildfly.camel.examples.rest;

import java.net.MalformedURLException;
import java.nio.file.Files;
import java.nio.file.Paths;

import javax.ws.rs.core.MediaType;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.test.common.HttpRequest;
import org.wildfly.camel.test.common.HttpResponse;

import javax.ws.rs.core.MediaType;
import java.net.MalformedURLException;
import java.nio.file.Files;
import java.nio.file.Paths;
import org.wildfly.camel.test.common.HttpRequest.HttpResponse;


@RunWith(Arquillian.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@
*/
package org.wildfly.camel.examples.jms.transacted;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.test.common.HttpRequest;
import org.wildfly.camel.test.common.HttpResponse;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -38,6 +29,15 @@
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.test.common.HttpRequest;
import org.wildfly.camel.test.common.HttpRequest.HttpResponse;

@RunAsClient
@RunWith(Arquillian.class)
public class TransactedJMSExampleTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@
/**
* @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
*/
public class HttpRequest {
public final class HttpRequest {

// Hide ctor
private HttpRequest(){
}

Expand Down Expand Up @@ -181,10 +182,12 @@ private HttpResponse processResponse(HttpURLConnection conn) throws IOException

if (throwExceptionOnFailure && responseCode != HttpURLConnection.HTTP_OK) {
final InputStream err = conn.getErrorStream();
try {
throw new IOException(read(err));
} finally {
err.close();
if (err != null) {
try {
throw new IOException(read(err));
} finally {
err.close();
}
}
}
final InputStream in = conn.getInputStream();
Expand All @@ -198,4 +201,29 @@ private HttpResponse processResponse(HttpURLConnection conn) throws IOException
}
}
}

public static class HttpResponse {
private int statusCode;
private String body;

public int getStatusCode() {
return statusCode;
}

public void setStatusCode(int statusCode) {
this.statusCode = statusCode;
}

public String getBody() {
return body;
}

public void setBody(String body) {
this.body = body;
}

public String toString() {
return "HttpResponse{status=" + statusCode + "}";
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
*/
package org.wildfly.camel.test.docker.domain;

import java.io.File;
import java.io.FilenameFilter;
import java.util.concurrent.TimeUnit;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.as.arquillian.api.ContainerResource;
Expand All @@ -27,14 +31,10 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.test.common.HttpRequest;
import org.wildfly.camel.test.common.HttpResponse;
import org.wildfly.camel.test.common.HttpRequest.HttpResponse;
import org.wildfly.camel.test.common.docker.DeployCommand;
import org.wildfly.camel.test.common.docker.DockerCommand.Result;

import java.io.File;
import java.io.FilenameFilter;
import java.util.concurrent.TimeUnit;


@RunAsClient
@RunWith(Arquillian.class)
Expand Down
Loading

0 comments on commit 849cb5b

Please sign in to comment.