// Path: itests/src/main/java/org/wildfly/camel/examples/test/common/FileCopyTestSupport.java
// public abstract class FileCopyTestSupport {
// 
//     @Before
//     public void setUp() throws Exception {
//         String packageName = getClass().getPackage().getName();
//         String fileLocation = packageName.replace("org.wildfly.camel.examples.test.", "").replace(".", "/");
//         String sourceFileName = sourceFilename();
//         InputStream input = getClass().getResourceAsStream("/" + fileLocation + "/" + sourceFileName);
//         Files.copy(input, destinationPath().resolve(sourceFileName));
//         input.close();
// 
//         boolean await = awaitFileProcessed();
//         Assert.assertTrue("Gave up waiting for file to be processed", await);
//     }
// 
//     @After
//     public void tearDown () throws IOException {
//         Files.walkFileTree(destinationPath(), new SimpleFileVisitor<Path>() {
//             @Override
//             public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
//                 Files.delete(file);
//                 return FileVisitResult.CONTINUE;
//             }
// 
//             @Override
//             public FileVisitResult visitFileFailed(Path file, IOException exception) throws IOException {
//                 exception.printStackTrace();
//                 return FileVisitResult.CONTINUE;
//             }
// 
//             @Override
//             public FileVisitResult postVisitDirectory(Path dir, IOException exception) throws IOException {
//                 if (exception == null) {
//                     Files.delete(dir);
//                 }
//                 return FileVisitResult.CONTINUE;
//             }
//         });
//     }
// 
//     private boolean awaitFileProcessed() throws Exception {
//         long start = System.currentTimeMillis();
//         long timeout = 15000;
//         do {
//             File file = processedPath().toFile();
//             if (file.exists()) {
//                 if ((file.isDirectory() && file.list().length > 0) || (file.isFile())) {
//                     return true;
//                 }
//             }
//             try {
//                 Thread.sleep(100L);
//             } catch (InterruptedException e) {
//                 Thread.currentThread().interrupt();
//                 return false;
//             }
//         } while (!((System.currentTimeMillis() - start) >= timeout));
//         return false;
//     }
// 
//     protected abstract String sourceFilename();
//     protected abstract Path destinationPath();
//     protected abstract Path processedPath();
// }


import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.examples.test.common.FileCopyTestSupport;
import org.wildfly.camel.test.common.http.HttpRequest;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.as.arquillian.api.ServerSetup;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
/*
 * #%L
 * Wildfly Camel :: Testsuite
 * %%
 * Copyright (C) 2013 - 2017 RedHat
 * %%
 * 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.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
package org.wildfly.camel.examples.test.jms;



@RunAsClient
@RunWith(Arquillian.class)
@ServerSetup({ AbstractJMSExampleTest.JmsQueueSetup.class })
// Path: itests/src/main/java/org/wildfly/camel/examples/test/common/FileCopyTestSupport.java
// public abstract class FileCopyTestSupport {
// 
//     @Before
//     public void setUp() throws Exception {
//         String packageName = getClass().getPackage().getName();
//         String fileLocation = packageName.replace("org.wildfly.camel.examples.test.", "").replace(".", "/");
//         String sourceFileName = sourceFilename();
//         InputStream input = getClass().getResourceAsStream("/" + fileLocation + "/" + sourceFileName);
//         Files.copy(input, destinationPath().resolve(sourceFileName));
//         input.close();
// 
//         boolean await = awaitFileProcessed();
//         Assert.assertTrue("Gave up waiting for file to be processed", await);
//     }
// 
//     @After
//     public void tearDown () throws IOException {
//         Files.walkFileTree(destinationPath(), new SimpleFileVisitor<Path>() {
//             @Override
//             public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
//                 Files.delete(file);
//                 return FileVisitResult.CONTINUE;
//             }
// 
//             @Override
//             public FileVisitResult visitFileFailed(Path file, IOException exception) throws IOException {
//                 exception.printStackTrace();
//                 return FileVisitResult.CONTINUE;
//             }
// 
//             @Override
//             public FileVisitResult postVisitDirectory(Path dir, IOException exception) throws IOException {
//                 if (exception == null) {
//                     Files.delete(dir);
//                 }
//                 return FileVisitResult.CONTINUE;
//             }
//         });
//     }
// 
//     private boolean awaitFileProcessed() throws Exception {
//         long start = System.currentTimeMillis();
//         long timeout = 15000;
//         do {
//             File file = processedPath().toFile();
//             if (file.exists()) {
//                 if ((file.isDirectory() && file.list().length > 0) || (file.isFile())) {
//                     return true;
//                 }
//             }
//             try {
//                 Thread.sleep(100L);
//             } catch (InterruptedException e) {
//                 Thread.currentThread().interrupt();
//                 return false;
//             }
//         } while (!((System.currentTimeMillis() - start) >= timeout));
//         return false;
//     }
// 
//     protected abstract String sourceFilename();
//     protected abstract Path destinationPath();
//     protected abstract Path processedPath();
// }


// Path: itests/src/main/java/org/wildfly/camel/examples/test/jms/TransactedJMSSpringExampleTest.java
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.examples.test.common.FileCopyTestSupport;
import org.wildfly.camel.test.common.http.HttpRequest;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.as.arquillian.api.ServerSetup;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;

/*
 * #%L
 * Wildfly Camel :: Testsuite
 * %%
 * Copyright (C) 2013 - 2017 RedHat
 * %%
 * 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.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
package org.wildfly.camel.examples.test.jms;



@RunAsClient
@RunWith(Arquillian.class)
@ServerSetup({ AbstractJMSExampleTest.JmsQueueSetup.class })
public class TransactedJMSSpringExampleTest extends FileCopyTestSupport {