This file contains hidden or 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
#!/usr/bin/env bash | |
mvn archetype:generate \ | |
-DarchetypeGroupId=com.agritsik.maven.archetypes \ | |
-DarchetypeArtifactId=javaee7-micro \ | |
-DarchetypeVersion=1.0-beta-1 | |
# mvn test -Parquillian-glassfish | |
# OR | |
# mvn test -Parquillian-wildfly |
This file contains hidden or 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
import junit.framework.TestCase; | |
import org.glassfish.jersey.filter.LoggingFilter; | |
import org.jboss.arquillian.container.test.api.Deployment; | |
import org.jboss.arquillian.junit.Arquillian; | |
import org.jboss.arquillian.test.api.ArquillianResource; | |
import org.jboss.shrinkwrap.api.Archive; | |
import org.jboss.shrinkwrap.api.ShrinkWrap; | |
import org.jboss.shrinkwrap.api.asset.EmptyAsset; | |
import org.jboss.shrinkwrap.api.spec.WebArchive; | |
import org.junit.Before; |
This file contains hidden or 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
import junit.framework.TestCase; | |
import org.jboss.arquillian.container.test.api.Deployment; | |
import org.jboss.arquillian.junit.Arquillian; | |
import org.jboss.shrinkwrap.api.Archive; | |
import org.jboss.shrinkwrap.api.ShrinkWrap; | |
import org.jboss.shrinkwrap.api.asset.EmptyAsset; | |
import org.jboss.shrinkwrap.api.spec.WebArchive; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; |
This file contains hidden or 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
#!/usr/bin/env bash | |
mvn archetype:generate \ | |
-DarchetypeArtifactId=maven-archetype-quickstart \ | |
-DgroupId=com.agritsik.samples.app \ | |
-DartifactId=test-app | |
# mvn package && java -cp target/test-app-1.0-SNAPSHOT.jar com.agritsik.samples.app.App | |
# Output example: Hello World! |
This file contains hidden or 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
# note, netcat utility should be installed in docker container | |
while ! nc -z DB 3306; do sleep 3; done | |
# DB is available here, so we can start our applicaiton | |
# java -jar /app.jar |
This file contains hidden or 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
#!/usr/bin/env bash | |
# Remove all stopped containers | |
docker rm -v $(docker ps -a -q) | |
# Remove all untagged images | |
docker rmi $(docker images | grep "^<none>" | awk "{print $3}") |
This file contains hidden or 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
# Glassfish container configured for Blog app | |
# | |
# VERSION 0.1 | |
FROM glassfish | |
MAINTAINER Andrii Grytsyk | |
RUN apt-get update | |
RUN curl http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.34/mysql-connector-java-5.1.34.jar -o glassfish/lib/mysql-connector-java-5.1.34.jar | |
This file contains hidden or 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
# check Jersey version | |
unzip -p jersey-common.jar META-INF/MANIFEST.MF | grep Bundle-Version | |
# Output example: Bundle-Version: 2.10.4 | |
# check Eclipselink version | |
unzip -p org.eclipse.persistence.core.jar META-INF/MANIFEST.MF | grep Bundle-Version | |
# Output example: Bundle-Version: 2.5.2.v20140319-9ad6abd | |
# check JSF version | |
unzip -p javax.faces.jar META-INF/MANIFEST.MF | grep Bundle-Version |
This file contains hidden or 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
#!/usr/bin/env bash | |
rm -rf $GLASSFISH_HOME/glassfish/domains/domain1/generated/* | |
rm -rf $GLASSFISH_HOME/glassfish/domains/domain1/osgi-cache/* | |
rm -rf $GLASSFISH_HOME/glassfish/domains/domain1/applications/* |
This file contains hidden or 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
#!/usr/bin/env bash | |
# returns response body and headers | |
curl -i http://localhost:8080/app/resources/countries | |
# returns response body and headers in verbose mode, useful for debugging | |
curl -v http://localhost:8080/app/resources/countries | |
# returns response body and headers | |
wget -qSO - http://localhost:8080/app/resources/countries |
NewerOlder