├── security-jose └── src │ ├── test │ ├── resources │ │ ├── empty.json │ │ ├── hammock.properties │ │ └── samplejwt.txt │ └── java │ │ └── ws │ │ └── ament │ │ └── hammock │ │ └── jwt │ │ └── RequiredLoggedIn.java │ └── main │ ├── resources │ └── META-INF │ │ ├── services │ │ ├── javax.enterprise.inject.spi.Extension │ │ └── org.eclipse.microprofile.config.spi.Converter │ │ ├── microprofile-config.properties │ │ └── beans.xml │ └── java │ └── ws │ └── ament │ └── hammock │ └── jwt │ ├── JWTException.java │ ├── processor │ └── JWTProcessor.java │ ├── bean │ ├── ClaimLiteral.java │ └── JWTIdentityHolder.java │ ├── JWTIdentity.java │ └── JWTProcessorConverter.java ├── web-spi └── src │ ├── test │ ├── resources │ │ └── META-INF │ │ │ └── resources │ │ │ └── boop.txt │ └── java │ │ └── ws │ │ └── ament │ │ └── hammock │ │ └── web │ │ └── resource │ │ └── ResourceManagerTest.java │ └── main │ ├── resources │ └── META-INF │ │ ├── services │ │ └── javax.enterprise.inject.spi.Extension │ │ └── beans.xml │ └── java │ └── ws │ └── ament │ └── hammock │ └── web │ ├── spi │ ├── ServletContextAttributeProvider.java │ ├── WebParam.java │ └── RestServerConfiguration.java │ ├── base │ └── Constants.java │ ├── extension │ └── StartWebServerExtension.java │ └── resource │ └── IOUtils.java ├── util-flyway └── src │ ├── test │ └── resources │ │ ├── db │ │ └── migration │ │ │ └── V1_1__DoNothing.sql │ │ └── META-INF │ │ └── microprofile-config.properties │ └── main │ └── resources │ └── META-INF │ └── services │ └── javax.enterprise.inject.spi.Extension ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── web-tomcat └── src │ ├── test │ ├── keystore.jks │ ├── resources │ │ ├── META-INF │ │ │ └── services │ │ │ │ └── org.jboss.arquillian.core.spi.LoadableExtension │ │ └── hammock.properties │ └── java │ │ └── ws │ │ └── ament │ │ └── hammock │ │ └── web │ │ └── tomcat │ │ ├── TomcatFilterTest.java │ │ ├── TomcatServletTest.java │ │ └── TomcatListenerTest.java │ └── main │ └── resources │ └── META-INF │ └── beans.xml ├── rest-jersey └── src │ ├── test │ ├── resources │ │ └── META-INF │ │ │ └── microprofile-config.properties │ └── java │ │ └── org │ │ └── hammock │ │ └── test │ │ └── jersey │ │ ├── JerseyTest.java │ │ ├── JerseyCustomTest.java │ │ ├── JerseyURITest.java │ │ └── sse │ │ └── SseModel.java │ └── main │ └── resources │ └── META-INF │ ├── services │ └── javax.enterprise.inject.spi.Extension │ └── beans.xml ├── messaging-rabbitmq └── src │ └── main │ ├── resources │ └── META-INF │ │ ├── services │ │ └── javax.enterprise.inject.spi.Extension │ │ └── beans.xml │ └── java │ └── ws │ └── ament │ └── hammock │ └── rabbitmq │ └── NoOpMetricCollectorBean.java ├── security-spi └── src │ └── main │ ├── resources │ └── META-INF │ │ ├── services │ │ └── javax.enterprise.inject.spi.Extension │ │ └── beans.xml │ └── java │ └── ws │ └── ament │ └── hammock │ └── security │ ├── api │ ├── Identity.java │ ├── MissingRolesException.java │ ├── NotLoggedInException.java │ ├── GroupRolesMapper.java │ ├── HasAllRoles.java │ ├── LoggedIn.java │ └── Secured.java │ ├── impl │ ├── MissingRolesExceptionHandler.java │ └── NotLoggedInExceptionHandler.java │ └── internal │ └── AnnotationUtil.java ├── web-jetty └── src │ ├── test │ ├── resources │ │ ├── keystore.jks │ │ └── hammock.properties │ └── java │ │ └── ws │ │ └── ament │ │ └── hammock │ │ └── web │ │ └── jetty │ │ ├── JettyBootTest.java │ │ ├── JettyFilterTest.java │ │ └── JettyListenerTest.java │ └── main │ └── resources │ └── META-INF │ └── beans.xml ├── .gitignore ├── web-undertow └── src │ ├── test │ ├── resources │ │ ├── keystore.jks │ │ └── hammock.properties │ └── java │ │ └── ws │ │ └── ament │ │ └── hammock │ │ └── web │ │ └── undertow │ │ ├── UndertowFilterTest.java │ │ ├── UndertowServletTest.java │ │ └── UndertowListenerTest.java │ └── main │ ├── resources │ └── META-INF │ │ ├── services │ │ ├── io.undertow.servlet.ServletExtension │ │ └── javax.enterprise.inject.spi.Extension │ │ └── beans.xml │ └── java │ └── ws │ └── ament │ └── hammock │ └── web │ └── undertow │ ├── BasicInstanceFactory.java │ └── HammockInstanceHandle.java ├── dist-microprofile └── src │ └── test │ ├── resources │ ├── META-INF │ │ └── services │ │ │ ├── org.jboss.arquillian.core.spi.LoadableExtension │ │ │ └── org.eclipse.microprofile.jwt.tck.util.ITokenParser │ └── hammock.properties │ └── java │ └── ws │ └── ament │ └── hammock │ └── mp │ └── test │ ├── HammockArchiveAppender.java │ ├── Group1MappedRoleMapper.java │ ├── HealthArchiveAppender.java │ └── ArchiveAppenderExtension.java ├── swagger-ui ├── src │ └── main │ │ └── resources │ │ └── META-INF │ │ ├── services │ │ └── org.eclipse.microprofile.config.spi.ConfigSource │ │ └── beans.xml └── README.md ├── jpa-core └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ ├── services │ │ │ └── javax.enterprise.inject.spi.Extension │ │ │ └── beans.xml │ └── java │ │ └── ws │ │ └── ament │ │ └── hammock │ │ └── jpa │ │ └── DataSourceWrapper.java │ └── test │ ├── resources │ └── hammock.properties │ └── java │ └── ws │ └── ament │ └── hammock │ └── jpa │ ├── BeanWithDataSource.java │ ├── BuilderBackedBean.java │ └── SimpleWrapper.java ├── jpa-eclipselink └── src │ └── test │ ├── resources │ └── META-INF │ │ ├── load.sql │ │ ├── beans.xml │ │ └── microprofile-config.properties │ └── java │ └── ws │ └── ament │ └── hammock │ └── jpa │ └── eclipselink │ ├── SimpleEmployeeService.java │ ├── EmployeeService.java │ └── AnotherEmployeeService.java ├── jpa-hibernate └── src │ └── test │ ├── resources │ └── META-INF │ │ ├── load.sql │ │ ├── beans.xml │ │ └── microprofile-config.properties │ └── java │ └── ws │ └── ament │ └── hammock │ └── jpa │ └── hibernate │ ├── package-info.java │ ├── UUIDEntity.java │ ├── SimpleEmployeeService.java │ ├── EmployeeService.java │ └── AnotherEmployeeService.java ├── .travis.yml ├── NOTICE ├── jpa-openjpa └── src │ └── test │ ├── resources │ ├── db │ │ └── migration │ │ │ └── V1_1__Initialize.sql │ └── META-INF │ │ ├── beans.xml │ │ ├── microprofile-config.properties │ │ └── persistence.xml │ └── java │ └── ws │ └── ament │ └── hammock │ └── jpa │ └── openjpa │ ├── SimpleEmployeeService.java │ ├── EmployeeService.java │ └── AnotherEmployeeService.java ├── core └── src │ ├── test │ ├── resources │ │ ├── testing.properties │ │ └── META-INF │ │ │ └── services │ │ │ └── ws.ament.hammock.bootstrap.Bootstrapper │ └── java │ │ └── ws │ │ └── ament │ │ └── hammock │ │ ├── BootstrapTest.java │ │ ├── DummyBootstrap.java │ │ └── core │ │ └── config │ │ └── CLIPropertySourceTest.java │ └── main │ ├── resources │ ├── META-INF │ │ ├── beans.xml │ │ └── services │ │ │ └── org.eclipse.microprofile.config.spi.ConfigSourceProvider │ └── log4j2.xml │ └── java │ └── ws │ └── ament │ └── hammock │ ├── bootstrap │ └── Bootstrapper.java │ ├── web │ └── api │ │ └── WebServer.java │ ├── utils │ ├── ClassUtils.java │ └── Unmanageable.java │ └── annotations │ ├── Disposing.java │ └── Configuring.java ├── bootstrap-owb2 └── src │ ├── test │ ├── resources │ │ ├── microprofile.properties │ │ └── META-INF │ │ │ ├── microprofile.properties │ │ │ └── beans.xml │ └── java │ │ └── ws │ │ └── ament │ │ └── hammock │ │ └── bootstrap │ │ └── owb │ │ └── SomeBean.java │ └── main │ ├── resources │ └── META-INF │ │ ├── services │ │ ├── ws.ament.hammock.bootstrap.Bootstrapper │ │ └── org.apache.openwebbeans.se.SeContainerSelector │ │ └── openwebbeans │ │ └── openwebbeans.properties │ └── java │ └── ws │ └── ament │ └── hammock │ └── bootstrap │ └── owb │ └── HammockSeContainerSelector.java ├── bootstrap-weld3 └── src │ ├── test │ ├── resources │ │ ├── microprofile.properties │ │ └── META-INF │ │ │ ├── microprofile-config.properties │ │ │ └── beans.xml │ └── java │ │ └── ws │ │ └── ament │ │ └── hammock │ │ └── bootstrap │ │ └── weld │ │ ├── jpa │ │ └── BeanWithPersistence.java │ │ └── SomeBean.java │ └── main │ ├── resources │ └── META-INF │ │ └── services │ │ ├── ws.ament.hammock.bootstrap.Bootstrapper │ │ └── org.jboss.weld.bootstrap.api.Service │ └── java │ └── ws │ └── ament │ └── hammock │ └── bootstrap │ └── weld3 │ └── HammockContainer.java ├── rest-spark └── src │ ├── main │ └── resources │ │ └── META-INF │ │ ├── microprofile-config.properties │ │ └── beans.xml │ └── test │ ├── resources │ └── META-INF │ │ └── beans.xml │ └── java │ └── ws │ └── ament │ └── hammock │ └── rest │ └── spark │ ├── RequestScopedBean.java │ └── RestApplication.java ├── util-camel └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ ├── microprofile-config.properties │ │ │ └── beans.xml │ └── java │ │ └── ws │ │ └── ament │ │ └── hammock │ │ └── camel │ │ └── servlet │ │ └── HammockCamelServlet.java │ └── test │ └── java │ └── ws │ └── ament │ └── hammock │ └── camel │ └── test │ ├── TestCamelRoutes.java │ └── BasicProcessor.java ├── util-health └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ ├── microprofile-config.properties │ │ │ ├── beans.xml │ │ │ └── services │ │ │ └── org.eclipse.microprofile.health.spi.HealthCheckResponseProvider │ └── java │ │ └── ws │ │ └── ament │ │ └── hammock │ │ └── health │ │ ├── HealthCheckModel.java │ │ ├── HealthLiteral.java │ │ ├── HammockHealthProvider.java │ │ ├── HammockHealthCDI.java │ │ ├── ArrayHealthCheckModel.java │ │ └── ObjectHealthCheckModel.java │ └── test │ └── java │ └── ws │ └── ament │ └── hammock │ └── health │ └── InjectedCheck.java ├── web-tck └── src │ └── main │ ├── resources │ └── META-INF │ │ ├── microprofile-config.properties │ │ └── beans.xml │ └── java │ └── ws │ └── ament │ └── hammock │ └── web │ └── tck │ ├── MessageProvider.java │ ├── DefaultListener.java │ └── DefaultFilter.java ├── johnzon └── src │ └── main │ ├── resources │ └── META-INF │ │ └── beans.xml │ └── java │ └── ws │ └── ament │ └── hammock │ └── johnzon │ └── JohnzonExtension.java ├── rest-cxf └── src │ ├── main │ └── resources │ │ └── META-INF │ │ └── beans.xml │ └── test │ └── java │ └── org │ └── hammock │ └── test │ └── cxf │ ├── CXFTest.java │ ├── CXFCustomTest.java │ ├── CXFURITest.java │ ├── SseEvent.java │ └── SseEventEndpoint.java ├── util-metrics └── src │ └── main │ └── resources │ └── META-INF │ └── beans.xml ├── messaging-artemis └── src │ └── main │ └── resources │ └── META-INF │ └── beans.xml ├── rest-resteasy └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ └── beans.xml │ └── java │ │ └── ws │ │ └── ament │ │ └── hammock │ │ └── rest │ │ └── resteasy │ │ └── Cdi11InjectorFactory.java │ └── test │ └── java │ └── org │ └── hammock │ └── test │ ├── ResteasyTest.java │ ├── ResteasyCustomTest.java │ └── ResteasyURITest.java ├── util-brave └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ └── beans.xml │ └── java │ │ └── ws │ │ └── ament │ │ └── hammock │ │ └── brave │ │ └── BraveTracingFeatureProvider.java │ └── test │ └── java │ └── ws │ └── ament │ └── hammock │ └── brave │ ├── SpanReporter.java │ └── SimpleResource.java ├── util-flexypool └── src │ └── main │ └── resources │ └── META-INF │ └── beans.xml ├── security-keycloak └── src │ └── main │ ├── resources │ └── META-INF │ │ └── beans.xml │ └── java │ └── ws │ └── ament │ └── hammock │ └── security │ └── keycloak │ └── EmptyUserSessionManagement.java ├── test-arquillian └── src │ └── main │ ├── resources │ └── META-INF │ │ └── services │ │ └── org.jboss.arquillian.core.spi.LoadableExtension │ └── java │ └── ws │ └── ament │ └── hammock │ └── test │ └── support │ ├── RandomWebServerPort.java │ ├── RandomWebServerSecuredPort.java │ ├── EnableRandomWebServerPort.java │ └── HammockURLProvider.java ├── dist-microprofile-cochise └── src │ └── test │ ├── resources │ ├── META-INF │ │ └── services │ │ │ └── org.jboss.arquillian.core.spi.LoadableExtension │ └── hammock.properties │ └── java │ └── ws │ └── ament │ └── hammock │ └── mp │ └── cochise │ └── test │ ├── Group1MappedRoleMapper.java │ └── HammockURIProvider.java ├── swagger └── README.md └── jaxrs-rest-tck └── src └── main └── java └── org └── hammock └── rest └── tck ├── RestApp.java ├── CustomRestApp.java ├── RestController.java └── URIConfigSource.java /security-jose/src/test/resources/empty.json: -------------------------------------------------------------------------------- 1 | {"keys":[]} -------------------------------------------------------------------------------- /web-spi/src/test/resources/META-INF/resources/boop.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /util-flyway/src/test/resources/db/migration/V1_1__DoNothing.sql: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hammock-project/hammock/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /web-tomcat/src/test/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hammock-project/hammock/HEAD/web-tomcat/src/test/keystore.jks -------------------------------------------------------------------------------- /security-jose/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | ws.ament.hammock.jwt.bean.JWTExtension -------------------------------------------------------------------------------- /util-flyway/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | ws.ament.hammock.flyway.FlywayExtension -------------------------------------------------------------------------------- /rest-jersey/src/test/resources/META-INF/microprofile-config.properties: -------------------------------------------------------------------------------- 1 | jersey.config.server.application.name=load properties test 2 | -------------------------------------------------------------------------------- /messaging-rabbitmq/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | ws.ament.hammock.rabbitmq.RabbitMQExtension -------------------------------------------------------------------------------- /security-spi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | ws.ament.hammock.security.internal.SecurityExtension -------------------------------------------------------------------------------- /web-jetty/src/test/resources/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hammock-project/hammock/HEAD/web-jetty/src/test/resources/keystore.jks -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | target 4 | *.ipr 5 | *.iws 6 | .project 7 | .classpath 8 | .settings 9 | dependency-reduced-pom.xml 10 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip -------------------------------------------------------------------------------- /web-undertow/src/test/resources/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hammock-project/hammock/HEAD/web-undertow/src/test/resources/keystore.jks -------------------------------------------------------------------------------- /dist-microprofile/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension: -------------------------------------------------------------------------------- 1 | ws.ament.hammock.mp.test.ArchiveAppenderExtension -------------------------------------------------------------------------------- /swagger-ui/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource: -------------------------------------------------------------------------------- 1 | ws.ament.hammock.swagger.ui.SwaggerUIVersionConfigSource 2 | -------------------------------------------------------------------------------- /jpa-core/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | ws.ament.hammock.jpa.JPAExtension 2 | ws.ament.hammock.jpa.DataSourceExtension -------------------------------------------------------------------------------- /web-spi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | ws.ament.hammock.web.extension.WebServerExtension 2 | ws.ament.hammock.web.extension.StartWebServerExtension -------------------------------------------------------------------------------- /jpa-eclipselink/src/test/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO EMPLOYEES("NAME") VALUES ('Penny') 2 | INSERT INTO EMPLOYEES("NAME") VALUES ('Sheldon') 3 | INSERT INTO EMPLOYEES("NAME") VALUES ('Amy') 4 | INSERT INTO EMPLOYEES("NAME") VALUES ('Leonard') 5 | INSERT INTO EMPLOYEES("NAME") VALUES ('Bernadette') 6 | INSERT INTO EMPLOYEES("NAME") VALUES ('Raj') 7 | INSERT INTO EMPLOYEES("NAME") VALUES ('Howard') 8 | INSERT INTO EMPLOYEES("NAME") VALUES ('Priya') -------------------------------------------------------------------------------- /jpa-hibernate/src/test/resources/META-INF/load.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO EMPLOYEES("NAME") VALUES ('Penny') 2 | INSERT INTO EMPLOYEES("NAME") VALUES ('Sheldon') 3 | INSERT INTO EMPLOYEES("NAME") VALUES ('Amy') 4 | INSERT INTO EMPLOYEES("NAME") VALUES ('Leonard') 5 | INSERT INTO EMPLOYEES("NAME") VALUES ('Bernadette') 6 | INSERT INTO EMPLOYEES("NAME") VALUES ('Raj') 7 | INSERT INTO EMPLOYEES("NAME") VALUES ('Howard') 8 | INSERT INTO EMPLOYEES("NAME") VALUES ('Priya') 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: trusty 2 | 3 | language: java 4 | 5 | matrix: 6 | include: 7 | - jdk: oraclejdk8 8 | script: mvn -q install -PWeld3 -Pundertow-test 9 | - jdk: oraclejdk8 10 | script: mvn -q install -PWeld3 -Ptomcat-test 11 | - jdk: oraclejdk8 12 | script: mvn -q install -PWeld3 -Pjetty-test 13 | - jdk: oraclejdk8 14 | script: mvn -q install -POWB2 -Pundertow-test 15 | - jdk: oraclejdk8 16 | script: mvn -q install -POWB2 -Ptomcat-test 17 | - jdk: oraclejdk8 18 | script: mvn -q install -POWB2 -Pjetty-test -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | The Hammock Project 2 | Copyright 2015 - 2018 The Hammock Project and individual contributors as listed 3 | 4 | This product includes software developed by 5 | John D. Ament 6 | Antoine Sabot-Durand 7 | Libor Kramoliš 8 | Derek P. Moore 9 | Willem Cazander 10 | 11 | This project includes software developed at The Apache Software Foundation. 12 | The Apache Software Foundation (http://www.apache.org/). 13 | 14 | Apache Tamaya: 15 | ws.ament.hammock.core.config.CLIPropertySource 16 | 17 | Apache Commons IO: 18 | ws.ament.hammock.web.resource.IOUtils 19 | 20 | -------------------------------------------------------------------------------- /jpa-openjpa/src/test/resources/db/migration/V1_1__Initialize.sql: -------------------------------------------------------------------------------- 1 | create table EMPLOYEES( 2 | id integer auto_increment primary key, 3 | name varchar(255) 4 | ); 5 | 6 | INSERT INTO EMPLOYEES(name) VALUES ('Penny'); 7 | INSERT INTO EMPLOYEES(name) VALUES ('Sheldon'); 8 | INSERT INTO EMPLOYEES(name) VALUES ('Amy'); 9 | INSERT INTO EMPLOYEES(name) VALUES ('Leonard'); 10 | INSERT INTO EMPLOYEES(name) VALUES ('Bernadette'); 11 | INSERT INTO EMPLOYEES(name) VALUES ('Raj'); 12 | INSERT INTO EMPLOYEES(name) VALUES ('Howard'); 13 | INSERT INTO EMPLOYEES(name) VALUES ('Priya'); 14 | -------------------------------------------------------------------------------- /core/src/test/resources/testing.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | something.random=1492 -------------------------------------------------------------------------------- /bootstrap-owb2/src/test/resources/microprofile.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | key1=prop1 -------------------------------------------------------------------------------- /bootstrap-weld3/src/test/resources/microprofile.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | key1=prop1 -------------------------------------------------------------------------------- /bootstrap-owb2/src/test/resources/META-INF/microprofile.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | key2=prop2 -------------------------------------------------------------------------------- /bootstrap-weld3/src/test/resources/META-INF/microprofile-config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | key2=prop2 -------------------------------------------------------------------------------- /rest-spark/src/main/resources/META-INF/microprofile-config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | spark.filter=/* -------------------------------------------------------------------------------- /security-jose/src/main/resources/META-INF/microprofile-config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | jwt.filter.uris=/* -------------------------------------------------------------------------------- /util-camel/src/main/resources/META-INF/microprofile-config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | camel.servlet.uri=/camel/* -------------------------------------------------------------------------------- /security-jose/src/test/resources/hammock.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | jwt.jwk.source.file=src/test/resources/empty.json -------------------------------------------------------------------------------- /util-health/src/main/resources/META-INF/microprofile-config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | health.servlet.uri=/health -------------------------------------------------------------------------------- /web-tck/src/main/resources/META-INF/microprofile-config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | default.servlet=/ 19 | default.filter=/* -------------------------------------------------------------------------------- /core/src/test/resources/META-INF/services/ws.ament.hammock.bootstrap.Bootstrapper: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ws.ament.hammock.DummyBootstrap -------------------------------------------------------------------------------- /bootstrap-owb2/src/main/resources/META-INF/services/ws.ament.hammock.bootstrap.Bootstrapper: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ws.ament.hammock.bootstrap.owb.OWBBootstrapper -------------------------------------------------------------------------------- /rest-jersey/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ws.ament.hammock.rest.jersey.JerseyCdiExtension 20 | -------------------------------------------------------------------------------- /security-jose/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.Converter: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ws.ament.hammock.jwt.JWTProcessorConverter -------------------------------------------------------------------------------- /web-undertow/src/main/resources/META-INF/services/io.undertow.servlet.ServletExtension: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ws.ament.hammock.web.undertow.HammockUndertowExtension -------------------------------------------------------------------------------- /bootstrap-weld3/src/main/resources/META-INF/services/ws.ament.hammock.bootstrap.Bootstrapper: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ws.ament.hammock.bootstrap.weld3.Weld3Bootstrapper -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /core/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ws.ament.hammock.HammockConfigSourceProvider -------------------------------------------------------------------------------- /dist-microprofile/src/test/resources/META-INF/services/org.eclipse.microprofile.jwt.tck.util.ITokenParser: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ws.ament.hammock.mp.test.TCKTokenParser -------------------------------------------------------------------------------- /johnzon/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /jpa-core/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /jpa-hibernate/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /jpa-openjpa/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /rest-cxf/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /rest-spark/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /util-flyway/src/test/resources/META-INF/microprofile-config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | flyway.url=jdbc:h2:./target/hammocktest 20 | flyway.execute=clean,migrate -------------------------------------------------------------------------------- /util-metrics/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /web-spi/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /web-tck/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /jpa-eclipselink/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /messaging-artemis/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /messaging-rabbitmq/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /rest-jersey/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /rest-resteasy/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /rest-spark/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /security-jose/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /security-spi/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /swagger-ui/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /util-brave/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /util-camel/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /util-flexypool/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /util-health/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /web-jetty/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /web-tomcat/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /web-undertow/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /bootstrap-owb2/src/main/resources/META-INF/services/org.apache.openwebbeans.se.SeContainerSelector: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2018 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ws.ament.hammock.bootstrap.owb.HammockSeContainerSelector -------------------------------------------------------------------------------- /bootstrap-owb2/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /bootstrap-weld3/src/main/resources/META-INF/services/org.jboss.weld.bootstrap.api.Service: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ws.ament.hammock.bootstrap.weld3.jpa.BasicJpaInjectionServices -------------------------------------------------------------------------------- /bootstrap-weld3/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /security-keycloak/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /web-tomcat/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ws.ament.hammock.web.tomcat.SecureTomcatArquillianExtension -------------------------------------------------------------------------------- /web-undertow/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ws.ament.hammock.web.undertow.websocket.UndertowWebSocketExtension -------------------------------------------------------------------------------- /test-arquillian/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ws.ament.hammock.test.support.HammockArquillianExtension -------------------------------------------------------------------------------- /util-health/src/main/resources/META-INF/services/org.eclipse.microprofile.health.spi.HealthCheckResponseProvider: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ws.ament.hammock.health.HammockHealthProvider -------------------------------------------------------------------------------- /web-tomcat/src/test/resources/hammock.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | webserver.keystore.path=./keystore.jks 20 | webserver.keystore.type=JKS 21 | webserver.keystore.password=123456 22 | -------------------------------------------------------------------------------- /dist-microprofile-cochise/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ws.ament.hammock.mp.cochise.test.ArchiveAppenderExtension -------------------------------------------------------------------------------- /jpa-core/src/test/resources/hammock.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | hammock.datasource.__default.url=jdbc:h2:mem:__default 20 | flyway.url=jdbc:h2:./target/hammocktest 21 | flyway.execute=clean,migrate -------------------------------------------------------------------------------- /jpa-openjpa/src/test/resources/META-INF/microprofile-config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | hammock.datasource.__default.url=jdbc:h2:./target/default 19 | flyway.url=jdbc:h2:./target/default 20 | flyway.execute=clean,migrate -------------------------------------------------------------------------------- /util-health/src/main/java/ws/ament/hammock/health/HealthCheckModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.health; 20 | 21 | public interface HealthCheckModel { 22 | String getOutcome(); 23 | } 24 | -------------------------------------------------------------------------------- /dist-microprofile/src/test/resources/hammock.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | webserver.port=8766 20 | hammock.health.require.annotation=true 21 | org.eclipse.microprofile.rest.client.tck.interfaces.SimpleGetApi/mp-rest/url=http://localhost:8765 -------------------------------------------------------------------------------- /rest-cxf/src/test/java/org/hammock/test/cxf/CXFTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.test.cxf; 20 | 21 | import org.hammock.rest.tck.BaseURITest; 22 | 23 | public class CXFTest extends BaseURITest { 24 | } 25 | -------------------------------------------------------------------------------- /rest-resteasy/src/test/java/org/hammock/test/ResteasyTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.test; 20 | 21 | import org.hammock.rest.tck.BaseURITest; 22 | 23 | public class ResteasyTest extends BaseURITest{ 24 | } 25 | -------------------------------------------------------------------------------- /rest-cxf/src/test/java/org/hammock/test/cxf/CXFCustomTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.test.cxf; 20 | 21 | import org.hammock.rest.tck.CustomURITest; 22 | 23 | public class CXFCustomTest extends CustomURITest { 24 | } 25 | -------------------------------------------------------------------------------- /rest-cxf/src/test/java/org/hammock/test/cxf/CXFURITest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.test.cxf; 20 | 21 | import org.hammock.rest.tck.PropertyURITest; 22 | 23 | public class CXFURITest extends PropertyURITest { 24 | } 25 | -------------------------------------------------------------------------------- /rest-jersey/src/test/java/org/hammock/test/jersey/JerseyTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.test.jersey; 20 | 21 | import org.hammock.rest.tck.BaseURITest; 22 | 23 | public class JerseyTest extends BaseURITest{ 24 | 25 | } 26 | -------------------------------------------------------------------------------- /rest-resteasy/src/test/java/org/hammock/test/ResteasyCustomTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.test; 20 | 21 | import org.hammock.rest.tck.CustomURITest; 22 | 23 | public class ResteasyCustomTest extends CustomURITest { 24 | } 25 | -------------------------------------------------------------------------------- /rest-resteasy/src/test/java/org/hammock/test/ResteasyURITest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.test; 20 | 21 | import org.hammock.rest.tck.PropertyURITest; 22 | 23 | public class ResteasyURITest extends PropertyURITest { 24 | } 25 | -------------------------------------------------------------------------------- /rest-jersey/src/test/java/org/hammock/test/jersey/JerseyCustomTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.test.jersey; 20 | 21 | import org.hammock.rest.tck.CustomURITest; 22 | 23 | public class JerseyCustomTest extends CustomURITest { 24 | } 25 | -------------------------------------------------------------------------------- /rest-jersey/src/test/java/org/hammock/test/jersey/JerseyURITest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.test.jersey; 20 | 21 | import org.hammock.rest.tck.PropertyURITest; 22 | 23 | public class JerseyURITest extends PropertyURITest { 24 | } 25 | -------------------------------------------------------------------------------- /swagger/README.md: -------------------------------------------------------------------------------- 1 | # Swagger OpenAPI Integration 2 | 3 | This module adds OpenAPI v3 integration. 4 | 5 | ## Provides 6 | 7 | - Automatic scanning of all rest endpoints based on @Path annotation. 8 | - Support for all OpenApi annotations like; 9 | - `@OpenAPIDefinition` 10 | - `@Operation` 11 | - Adds two OpenApi specification exports; 12 | - `@ApplicationPath(/openapi.{json|yaml})` 13 | - `@ApplicationPath(/openapi)` (accept header variant) 14 | - Adds optional (json|yaml) `MessageBodyWriter` for OpenAPI model. 15 | (only used for custom endpoint and returning OpenAPI model as entity) 16 | 17 | ## Usage 18 | 19 | - Add hammock _swagger_ artifact. 20 | - Optional configure rest endpoint scanning. 21 | - Add rest endpoints in jaxrs _Application_ class. 22 | - Or add `/openapi-configuration.json` in classpath resources; 23 | ``` 24 | { 25 | "resourcePackages": [ 26 | "com.example.project" 27 | ] 28 | } 29 | ``` 30 | -------------------------------------------------------------------------------- /web-spi/src/main/java/ws/ament/hammock/web/spi/ServletContextAttributeProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.spi; 20 | 21 | import java.util.Map; 22 | 23 | public interface ServletContextAttributeProvider { 24 | Map getAttributes(); 25 | } 26 | -------------------------------------------------------------------------------- /jpa-eclipselink/src/test/resources/META-INF/microprofile-config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | hammock.datasource.__default.url=jdbc:h2:mem:__default 19 | hammock.jpa.__default.javax.persistence.schema-generation.database.action=drop-and-create 20 | hammock.jpa.__default.javax.persistence.sql-load-script-source=META-INF/load.sql -------------------------------------------------------------------------------- /security-jose/src/main/java/ws/ament/hammock/jwt/JWTException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jwt; 20 | 21 | public class JWTException extends RuntimeException { 22 | public JWTException(String message, Throwable cause) { 23 | super(message, cause); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /security-spi/src/main/java/ws/ament/hammock/security/api/Identity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.security.api; 20 | 21 | import java.security.Principal; 22 | 23 | public interface Identity { 24 | boolean isLoggedIn(); 25 | 26 | boolean hasRole(String x); 27 | 28 | Principal getPrincipal(); 29 | } 30 | -------------------------------------------------------------------------------- /security-spi/src/main/java/ws/ament/hammock/security/api/MissingRolesException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.security.api; 20 | 21 | public class MissingRolesException extends RuntimeException { 22 | public MissingRolesException(String missingRoles) { 23 | super(missingRoles); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /security-jose/src/main/java/ws/ament/hammock/jwt/processor/JWTProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jwt.processor; 20 | 21 | import ws.ament.hammock.jwt.JWTException; 22 | 23 | import javax.json.JsonObject; 24 | 25 | public interface JWTProcessor { 26 | JsonObject process(String jwt) throws JWTException; 27 | } 28 | -------------------------------------------------------------------------------- /core/src/main/java/ws/ament/hammock/bootstrap/Bootstrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.bootstrap; 20 | 21 | import ws.ament.hammock.web.api.WebServer; 22 | 23 | public interface Bootstrapper { 24 | void start(); 25 | 26 | void stop(); 27 | 28 | default void configure(WebServer webServer) { 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /rest-spark/src/test/java/ws/ament/hammock/rest/spark/RequestScopedBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.rest.spark; 20 | 21 | import javax.enterprise.context.RequestScoped; 22 | 23 | @RequestScoped 24 | public class RequestScopedBean { 25 | public String getResponse() { 26 | return "Hello, World!"; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /security-spi/src/main/java/ws/ament/hammock/security/api/NotLoggedInException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.security.api; 20 | 21 | /** 22 | * Created by johnament on 5/28/16. 23 | */ 24 | public class NotLoggedInException extends RuntimeException{ 25 | public NotLoggedInException(String s) { 26 | super(s); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /web-tck/src/main/java/ws/ament/hammock/web/tck/MessageProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.tck; 20 | 21 | import javax.enterprise.context.RequestScoped; 22 | 23 | @RequestScoped 24 | public class MessageProvider { 25 | static final String DATA = "Some data"; 26 | String getMessage() { 27 | return DATA; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /jaxrs-rest-tck/src/main/java/org/hammock/rest/tck/RestApp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.rest.tck; 20 | 21 | import javax.enterprise.context.ApplicationScoped; 22 | import javax.ws.rs.ApplicationPath; 23 | import javax.ws.rs.core.Application; 24 | 25 | @ApplicationPath("/") 26 | @ApplicationScoped 27 | public class RestApp extends Application { 28 | } 29 | -------------------------------------------------------------------------------- /jaxrs-rest-tck/src/main/java/org/hammock/rest/tck/CustomRestApp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.rest.tck; 20 | 21 | import javax.enterprise.context.ApplicationScoped; 22 | import javax.ws.rs.ApplicationPath; 23 | import javax.ws.rs.core.Application; 24 | 25 | @ApplicationPath("/custom") 26 | @ApplicationScoped 27 | public class CustomRestApp extends Application { 28 | } 29 | -------------------------------------------------------------------------------- /jpa-hibernate/src/test/java/ws/ament/hammock/jpa/hibernate/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | @GenericGenerator(name = "customer-registered", strategy = "uuid2") 20 | @NamedQuery(name="UUIDPKG.find", query = "select s from UUIDEntity s") 21 | package ws.ament.hammock.jpa.hibernate; 22 | 23 | import org.hibernate.annotations.GenericGenerator; 24 | import org.hibernate.annotations.NamedQuery; -------------------------------------------------------------------------------- /security-jose/src/test/java/ws/ament/hammock/jwt/RequiredLoggedIn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jwt; 20 | 21 | import ws.ament.hammock.security.api.LoggedIn; 22 | 23 | import javax.enterprise.context.ApplicationScoped; 24 | 25 | @ApplicationScoped 26 | @LoggedIn 27 | public class RequiredLoggedIn { 28 | public void shouldRequireLogin() { 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /web-spi/src/main/java/ws/ament/hammock/web/base/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.base; 20 | 21 | import javax.servlet.DispatcherType; 22 | 23 | public interface Constants { 24 | DispatcherType[] DISPATCHER_TYPES = new DispatcherType[]{DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.ASYNC, DispatcherType.INCLUDE, DispatcherType.ERROR}; 25 | } 26 | -------------------------------------------------------------------------------- /test-arquillian/src/main/java/ws/ament/hammock/test/support/RandomWebServerPort.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.test.support; 20 | 21 | public class RandomWebServerPort extends AbstractRandomPortConfigSource { 22 | private static final String WEBSERVER_PORT = "webserver.port"; 23 | 24 | public RandomWebServerPort() { 25 | super(WEBSERVER_PORT); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /jpa-core/src/test/java/ws/ament/hammock/jpa/BeanWithDataSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jpa; 20 | 21 | import javax.annotation.sql.DataSourceDefinition; 22 | import javax.enterprise.context.ApplicationScoped; 23 | 24 | @ApplicationScoped 25 | @DataSourceDefinition(name="testds",url="jdbc:h2:mem:test_mem", className = "org.h2.Driver") 26 | public class BeanWithDataSource { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /jaxrs-rest-tck/src/main/java/org/hammock/rest/tck/RestController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.rest.tck; 20 | 21 | import javax.enterprise.context.RequestScoped; 22 | import javax.ws.rs.GET; 23 | import javax.ws.rs.Path; 24 | 25 | @Path("/rest") 26 | @RequestScoped 27 | public class RestController { 28 | @GET 29 | public String doGet() { 30 | return "Hello, World!"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /core/src/test/java/ws/ament/hammock/BootstrapTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock; 20 | 21 | import org.junit.Test; 22 | 23 | import static org.assertj.core.api.Assertions.assertThat; 24 | 25 | public class BootstrapTest { 26 | @Test 27 | public void shouldBootstrapDummyInstance() { 28 | Bootstrap.main(); 29 | assertThat(DummyBootstrap.getStartCalled()).isEqualTo(1); 30 | } 31 | } -------------------------------------------------------------------------------- /test-arquillian/src/main/java/ws/ament/hammock/test/support/RandomWebServerSecuredPort.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.test.support; 20 | 21 | public class RandomWebServerSecuredPort extends AbstractRandomPortConfigSource { 22 | private static final String WEBSERVER_SECURED_PORT = "webserver.secured.port"; 23 | 24 | public RandomWebServerSecuredPort() { 25 | super(WEBSERVER_SECURED_PORT); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /jpa-hibernate/src/test/resources/META-INF/microprofile-config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 - 2018 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | hammock.datasource.__default.url=jdbc:h2:mem:__default 19 | hammock.jpa.__default.javax.persistence.schema-generation.database.action=drop-and-create 20 | hammock.jpa.__default.javax.persistence.sql-load-script-source=META-INF/load.sql 21 | hammock.datasource.__default.user=sa 22 | hammock.datasource.__default.password=sa 23 | hammock.jpa.__default.entities=ws.ament.hammock.jpa.hibernate -------------------------------------------------------------------------------- /util-health/src/main/java/ws/ament/hammock/health/HealthLiteral.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.health; 20 | 21 | import org.eclipse.microprofile.health.Health; 22 | 23 | import javax.enterprise.inject.Vetoed; 24 | import javax.enterprise.util.AnnotationLiteral; 25 | 26 | @Vetoed 27 | public class HealthLiteral extends AnnotationLiteral implements Health { 28 | public static final Health INSTANCE = new HealthLiteral(); 29 | } 30 | -------------------------------------------------------------------------------- /bootstrap-weld3/src/test/java/ws/ament/hammock/bootstrap/weld/jpa/BeanWithPersistence.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.bootstrap.weld.jpa; 20 | 21 | import javax.enterprise.context.Dependent; 22 | import javax.persistence.EntityManager; 23 | import javax.persistence.PersistenceContext; 24 | 25 | 26 | @Dependent 27 | class BeanWithPersistence { 28 | 29 | 30 | @PersistenceContext(unitName = JpaInjectionTest.MY_PU) 31 | EntityManager em; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /rest-cxf/src/test/java/org/hammock/test/cxf/SseEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.test.cxf; 20 | 21 | import javax.ws.rs.sse.Sse; 22 | import javax.ws.rs.sse.SseEventSink; 23 | 24 | public class SseEvent { 25 | final SseEventSink sink; 26 | final Sse sse; 27 | final String id; 28 | 29 | public SseEvent(SseEventSink sink, Sse sse, String id) { 30 | this.sink = sink; 31 | this.sse = sse; 32 | this.id = id; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /jpa-core/src/test/java/ws/ament/hammock/jpa/BuilderBackedBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jpa; 20 | 21 | import javax.enterprise.context.Dependent; 22 | import javax.enterprise.inject.Produces; 23 | 24 | @Dependent 25 | public class BuilderBackedBean { 26 | @Produces 27 | @Database("test2") 28 | public DataSourceDefinition createDataSource(DataSourceDefinitionBuilder builder) { 29 | return builder.url("jdbc:h2:mem:test_mem").build(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /bootstrap-owb2/src/main/java/ws/ament/hammock/bootstrap/owb/HammockSeContainerSelector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.bootstrap.owb; 20 | 21 | import org.apache.openwebbeans.se.SeContainerSelector; 22 | 23 | import javax.enterprise.inject.se.SeContainerInitializer; 24 | 25 | public class HammockSeContainerSelector implements SeContainerSelector { 26 | @Override 27 | public SeContainerInitializer find() { 28 | return new HammockInitializer(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /rest-jersey/src/test/java/org/hammock/test/jersey/sse/SseModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.test.jersey.sse; 20 | 21 | public class SseModel { 22 | private String name; 23 | 24 | public SseModel() { 25 | } 26 | 27 | public SseModel(String name) { 28 | this.name = name; 29 | } 30 | 31 | public String getName() { 32 | return name; 33 | } 34 | 35 | public void setName(String name) { 36 | this.name = name; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /web-jetty/src/test/resources/hammock.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | webserver.keystore.path=/keystore.jks 20 | webserver.keystore.type=JKS 21 | webserver.keystore.password=123456 22 | webserver.truststore.path=/keystore.jks 23 | webserver.truststore.type=JKS 24 | webserver.truststore.password=123456 25 | org.apache.deltaspike.core.spi.activation.ClassDeactivator=org.apache.deltaspike.core.impl.activation.DefaultClassDeactivator 26 | deactivate.org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension=true 27 | -------------------------------------------------------------------------------- /web-undertow/src/test/resources/hammock.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | webserver.keystore.path=/keystore.jks 20 | webserver.keystore.type=JKS 21 | webserver.keystore.password=123456 22 | webserver.truststore.path=/keystore.jks 23 | webserver.truststore.type=JKS 24 | webserver.truststore.password=123456 25 | org.apache.deltaspike.core.spi.activation.ClassDeactivator=org.apache.deltaspike.core.impl.activation.DefaultClassDeactivator 26 | deactivate.org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension=true 27 | -------------------------------------------------------------------------------- /util-camel/src/main/java/ws/ament/hammock/camel/servlet/HammockCamelServlet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.camel.servlet; 20 | 21 | import org.apache.camel.component.servlet.CamelHttpTransportServlet; 22 | 23 | import javax.enterprise.context.Dependent; 24 | import javax.servlet.annotation.WebServlet; 25 | 26 | @WebServlet(urlPatterns = {"${camel.servlet.uri}"}, name = "CamelServlet") 27 | @Dependent 28 | public class HammockCamelServlet extends CamelHttpTransportServlet { 29 | } 30 | -------------------------------------------------------------------------------- /core/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /web-jetty/src/test/java/ws/ament/hammock/web/jetty/JettyBootTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.jetty; 20 | 21 | import org.jboss.arquillian.container.test.api.Deployment; 22 | import org.jboss.shrinkwrap.api.spec.JavaArchive; 23 | import ws.ament.hammock.web.tck.ServletTest; 24 | 25 | public class JettyBootTest extends ServletTest { 26 | @Deployment 27 | public static JavaArchive createArchive() { 28 | return ServletTest.createArchive(JettyWebServer.class); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /web-jetty/src/test/java/ws/ament/hammock/web/jetty/JettyFilterTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.jetty; 20 | 21 | import org.jboss.arquillian.container.test.api.Deployment; 22 | import org.jboss.shrinkwrap.api.spec.JavaArchive; 23 | import ws.ament.hammock.web.tck.FilterTest; 24 | 25 | public class JettyFilterTest extends FilterTest{ 26 | @Deployment 27 | public static JavaArchive createArchive() { 28 | return FilterTest.createArchive(JettyWebServer.class); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /web-tomcat/src/test/java/ws/ament/hammock/web/tomcat/TomcatFilterTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.tomcat; 20 | 21 | import org.jboss.arquillian.container.test.api.Deployment; 22 | import org.jboss.shrinkwrap.api.spec.JavaArchive; 23 | import ws.ament.hammock.web.tck.FilterTest; 24 | 25 | public class TomcatFilterTest extends FilterTest{ 26 | @Deployment 27 | public static JavaArchive createArchive() { 28 | return FilterTest.createArchive(TomcatWebServer.class); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /web-jetty/src/test/java/ws/ament/hammock/web/jetty/JettyListenerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.jetty; 20 | 21 | import org.jboss.arquillian.container.test.api.Deployment; 22 | import org.jboss.shrinkwrap.api.spec.JavaArchive; 23 | import ws.ament.hammock.web.tck.ListenerTest; 24 | 25 | public class JettyListenerTest extends ListenerTest { 26 | @Deployment 27 | public static JavaArchive createArchive() { 28 | return ListenerTest.createArchive(JettyWebServer.class); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /web-tomcat/src/test/java/ws/ament/hammock/web/tomcat/TomcatServletTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.tomcat; 20 | 21 | import org.jboss.arquillian.container.test.api.Deployment; 22 | import org.jboss.shrinkwrap.api.spec.JavaArchive; 23 | import ws.ament.hammock.web.tck.ServletTest; 24 | 25 | public class TomcatServletTest extends ServletTest { 26 | @Deployment 27 | public static JavaArchive createArchive() { 28 | return ServletTest.createArchive(TomcatWebServer.class); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /security-spi/src/main/java/ws/ament/hammock/security/api/GroupRolesMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.security.api; 20 | 21 | import java.util.Collection; 22 | import java.util.function.Function; 23 | 24 | @FunctionalInterface 25 | public interface GroupRolesMapper extends Function> { 26 | @Override 27 | default Collection apply(String s) { 28 | return convertGroupsToRoles(s); 29 | } 30 | 31 | Collection convertGroupsToRoles(String s); 32 | } 33 | -------------------------------------------------------------------------------- /web-tomcat/src/test/java/ws/ament/hammock/web/tomcat/TomcatListenerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.tomcat; 20 | 21 | import org.jboss.arquillian.container.test.api.Deployment; 22 | import org.jboss.shrinkwrap.api.spec.JavaArchive; 23 | import ws.ament.hammock.web.tck.ListenerTest; 24 | 25 | public class TomcatListenerTest extends ListenerTest { 26 | @Deployment 27 | public static JavaArchive createArchive() { 28 | return ListenerTest.createArchive(TomcatWebServer.class); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /security-spi/src/main/java/ws/ament/hammock/security/api/HasAllRoles.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.security.api; 20 | 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.Target; 23 | 24 | import static java.lang.annotation.ElementType.METHOD; 25 | import static java.lang.annotation.ElementType.TYPE; 26 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 27 | 28 | @Retention(RUNTIME) 29 | @Target({TYPE, METHOD}) 30 | public @interface HasAllRoles { 31 | String[] value(); 32 | } 33 | -------------------------------------------------------------------------------- /bootstrap-owb2/src/main/resources/META-INF/openwebbeans/openwebbeans.properties: -------------------------------------------------------------------------------- 1 | configuration.ordinal=20 2 | 3 | ################################### WEB Container Lifecycle ################################ 4 | #Default implementation of org.apache.webbeans.corespi.ContainerLifecycle. 5 | org.apache.webbeans.spi.ContainerLifecycle=org.apache.webbeans.lifecycle.StandaloneLifeCycle 6 | ################################################################################################ 7 | 8 | ################################### WEB Scanner Service #################################### 9 | #Default implementation of org.apache.webbeans.corespi.ScannerService. 10 | org.apache.webbeans.spi.ScannerService=org.apache.webbeans.corespi.se.DefaultScannerService 11 | ################################################################################################ 12 | 13 | ################################### WEB Contexts Service #################################### 14 | #Default implementation of org.apache.webbeans.corespi.ContextsService. 15 | org.apache.webbeans.spi.ContextsService=org.apache.webbeans.web.context.WebContextsService 16 | ################################################################################################ -------------------------------------------------------------------------------- /web-undertow/src/test/java/ws/ament/hammock/web/undertow/UndertowFilterTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.undertow; 20 | 21 | import org.jboss.arquillian.container.test.api.Deployment; 22 | import org.jboss.shrinkwrap.api.spec.JavaArchive; 23 | import ws.ament.hammock.web.tck.FilterTest; 24 | 25 | public class UndertowFilterTest extends FilterTest { 26 | @Deployment 27 | public static JavaArchive createJar() { 28 | return FilterTest.createArchive(UndertowWebServer.class, UndertowServletMapper.class); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /web-undertow/src/test/java/ws/ament/hammock/web/undertow/UndertowServletTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.undertow; 20 | 21 | import org.jboss.arquillian.container.test.api.Deployment; 22 | import org.jboss.shrinkwrap.api.spec.JavaArchive; 23 | import ws.ament.hammock.web.tck.ServletTest; 24 | 25 | public class UndertowServletTest extends ServletTest{ 26 | @Deployment 27 | public static JavaArchive createJar() { 28 | return ServletTest.createArchive(UndertowWebServer.class, UndertowServletMapper.class); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /jpa-core/src/main/java/ws/ament/hammock/jpa/DataSourceWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jpa; 20 | 21 | import javax.sql.DataSource; 22 | 23 | /** 24 | * Define managed beans that implement this interface, and any DataSource created will be passed here to be wrapped. 25 | * 26 | * Implementations must return a non-null value, if they cannot wrap the input they should return the input. 27 | * Exceptions thrown will propagate up. 28 | */ 29 | public interface DataSourceWrapper { 30 | DataSource wrap(String name, DataSource dataSource); 31 | } 32 | -------------------------------------------------------------------------------- /web-undertow/src/test/java/ws/ament/hammock/web/undertow/UndertowListenerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.undertow; 20 | 21 | import org.jboss.arquillian.container.test.api.Deployment; 22 | import org.jboss.shrinkwrap.api.spec.JavaArchive; 23 | import ws.ament.hammock.web.tck.ListenerTest; 24 | 25 | public class UndertowListenerTest extends ListenerTest { 26 | @Deployment 27 | public static JavaArchive createArchive() { 28 | return ListenerTest.createArchive(UndertowWebServer.class, UndertowServletMapper.class); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /jpa-hibernate/src/test/java/ws/ament/hammock/jpa/hibernate/UUIDEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jpa.hibernate; 20 | 21 | import javax.persistence.*; 22 | 23 | @Entity 24 | @Table(name="uuid_entities") 25 | public class UUIDEntity { 26 | @Id 27 | @GeneratedValue(generator = "customer-registered") 28 | @Column(name = "uuid", unique = true) 29 | private String uuid; 30 | 31 | public String getUuid() { 32 | return uuid; 33 | } 34 | 35 | public void setUuid(String uuid) { 36 | this.uuid = uuid; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /jpa-openjpa/src/test/java/ws/ament/hammock/jpa/openjpa/SimpleEmployeeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jpa.openjpa; 20 | 21 | import javax.enterprise.context.ApplicationScoped; 22 | import javax.inject.Inject; 23 | import javax.persistence.EntityManager; 24 | import java.util.List; 25 | 26 | @ApplicationScoped 27 | public class SimpleEmployeeService { 28 | @Inject 29 | private EntityManager em; 30 | 31 | List getAll() { 32 | return em.createNamedQuery("Employee.findAll", Employee.class).getResultList(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /util-camel/src/test/java/ws/ament/hammock/camel/test/TestCamelRoutes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.camel.test; 20 | 21 | import org.apache.camel.builder.RouteBuilder; 22 | 23 | import javax.enterprise.context.ApplicationScoped; 24 | import javax.inject.Inject; 25 | 26 | @ApplicationScoped 27 | public class TestCamelRoutes extends RouteBuilder { 28 | @Inject 29 | private BasicProcessor basicProcessor; 30 | @Override 31 | public void configure() throws Exception { 32 | from("servlet://hello").process(basicProcessor); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /jpa-hibernate/src/test/java/ws/ament/hammock/jpa/hibernate/SimpleEmployeeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jpa.hibernate; 20 | 21 | import javax.enterprise.context.ApplicationScoped; 22 | import javax.inject.Inject; 23 | import javax.persistence.EntityManager; 24 | import java.util.List; 25 | 26 | @ApplicationScoped 27 | public class SimpleEmployeeService { 28 | @Inject 29 | private EntityManager em; 30 | 31 | List getAll() { 32 | return em.createNamedQuery("Employee.findAll", Employee.class).getResultList(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test-arquillian/src/main/java/ws/ament/hammock/test/support/EnableRandomWebServerPort.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.test.support; 20 | 21 | import java.lang.annotation.Inherited; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.Target; 24 | 25 | import static java.lang.annotation.ElementType.TYPE; 26 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 27 | 28 | @Retention(RUNTIME) 29 | @Target(TYPE) 30 | @Inherited 31 | public @interface EnableRandomWebServerPort { 32 | 33 | boolean enableSecure() default false; 34 | } 35 | -------------------------------------------------------------------------------- /jpa-eclipselink/src/test/java/ws/ament/hammock/jpa/eclipselink/SimpleEmployeeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jpa.eclipselink; 20 | 21 | import javax.enterprise.context.ApplicationScoped; 22 | import javax.inject.Inject; 23 | import javax.persistence.EntityManager; 24 | import java.util.List; 25 | 26 | @ApplicationScoped 27 | public class SimpleEmployeeService { 28 | @Inject 29 | private EntityManager em; 30 | 31 | List getAll() { 32 | return em.createNamedQuery("Employee.findAll", Employee.class).getResultList(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /util-camel/src/test/java/ws/ament/hammock/camel/test/BasicProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.camel.test; 20 | 21 | import org.apache.camel.Exchange; 22 | import org.apache.camel.Processor; 23 | 24 | import javax.enterprise.context.ApplicationScoped; 25 | 26 | @ApplicationScoped 27 | public class BasicProcessor implements Processor { 28 | private int hits = 0; 29 | @Override 30 | public void process(Exchange exchange) throws Exception { 31 | hits++; 32 | } 33 | 34 | public int getHits() { 35 | return hits; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /util-health/src/main/java/ws/ament/hammock/health/HammockHealthProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.health; 20 | 21 | import org.eclipse.microprofile.health.HealthCheckResponseBuilder; 22 | import org.eclipse.microprofile.health.spi.HealthCheckResponseProvider; 23 | 24 | import javax.enterprise.inject.Vetoed; 25 | 26 | @Vetoed 27 | public class HammockHealthProvider implements HealthCheckResponseProvider { 28 | @Override 29 | public HealthCheckResponseBuilder createResponseBuilder() { 30 | return new HammockResponseBuilder(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /jpa-core/src/test/java/ws/ament/hammock/jpa/SimpleWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jpa; 20 | 21 | import javax.enterprise.context.ApplicationScoped; 22 | import javax.sql.DataSource; 23 | 24 | @ApplicationScoped 25 | public class SimpleWrapper implements DataSourceWrapper{ 26 | private boolean invoked = false; 27 | 28 | @Override 29 | public DataSource wrap(String name, DataSource dataSource) { 30 | invoked = true; 31 | return dataSource; 32 | } 33 | 34 | public boolean isInvoked() { 35 | return invoked; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /security-jose/src/test/resources/samplejwt.txt: -------------------------------------------------------------------------------- 1 | eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJPMnRTY1JHQ3ZZTFNMT0tpa2I5a2t6eXVaZ0JwRDc1dHlwY1RVQzl5VHhnIn0.eyJqdGkiOiI4OTRhNDM4Yi0yNjhmLTQ1NGMtYTVlOS1jOWZlZjIxNzFjNTQiLCJleHAiOjE0OTg4MjY2MDUsIm5iZiI6MCwiaWF0IjoxNDk4ODI2NTQ1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvbWFzdGVyIiwiYXVkIjoic2VjdXJpdHktYWRtaW4tY29uc29sZSIsInN1YiI6ImZjYzVmOGNlLTFjYTgtNGViNi1iNDQ5LWYzNjViZGIxNzcwZCIsInR5cCI6IkJlYXJlciIsImF6cCI6InNlY3VyaXR5LWFkbWluLWNvbnNvbGUiLCJub25jZSI6ImRjMmZkNWE1LTNhYTgtNDk2ZC04MDFmLWU2Nzg2ZjBiNGM2MyIsImF1dGhfdGltZSI6MTQ5ODgyNDk3MSwic2Vzc2lvbl9zdGF0ZSI6IjAzOWIwNzE3LTk3N2YtNDBkNS04ZDE4LWQ1YmUwODE3ZDIyYiIsImFjciI6IjAiLCJhbGxvd2VkLW9yaWdpbnMiOltdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsiYm9iIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiQWRtaW4gTGFzdG5hbWUiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJhZG1pbiIsImdpdmVuX25hbWUiOiJBZG1pbiIsImZhbWlseV9uYW1lIjoiTGFzdG5hbWUiLCJlbWFpbCI6ImFkbWluQGFkbWluLmNvbSJ9.NKWjFNfcCzH7_KxssRK7rX32AFDPd9cc1pjdp0NSnhFt9HgV2rjs3dtXL4jfxXl-jeecvNAgwnULHIrkDAg89UVDa5CF5EkDvE1AK44uAfl_OOSupBilCfjUiB-8V3fF5dfm3PXv4uD8PvFub0Wndbm5_foJ-WbVv8Tm9CSd4_I96kImnqak7yKSPIIMLZZAEcC9OBLHSilCrXYTE7qZTxEw71Q05qw3JkG_FcfIyuDl4OvBdEX5eE7ZylDsHrOPKepWSz1RF3DzSS5mQrjnAvGQANkTg4W1NCVpBxDoZb93oO663aEFLDDOrFbYlbSKCtubm45wqb5OUUyPdHyaDA -------------------------------------------------------------------------------- /web-undertow/src/main/java/ws/ament/hammock/web/undertow/BasicInstanceFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.undertow; 20 | 21 | import io.undertow.servlet.api.InstanceHandle; 22 | 23 | public class BasicInstanceFactory implements InstanceHandle { 24 | private final T instance; 25 | 26 | public BasicInstanceFactory(T instance) { 27 | this.instance = instance; 28 | } 29 | 30 | @Override 31 | public T getInstance() { 32 | return instance; 33 | } 34 | 35 | @Override 36 | public void release() { 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /security-keycloak/src/main/java/ws/ament/hammock/security/keycloak/EmptyUserSessionManagement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.security.keycloak; 20 | 21 | import org.keycloak.adapters.spi.UserSessionManagement; 22 | 23 | import javax.enterprise.context.ApplicationScoped; 24 | import java.util.List; 25 | 26 | @ApplicationScoped 27 | public class EmptyUserSessionManagement implements UserSessionManagement { 28 | @Override 29 | public void logoutAll() { 30 | 31 | } 32 | 33 | @Override 34 | public void logoutHttpSessions(List list) { 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /jpa-openjpa/src/test/java/ws/ament/hammock/jpa/openjpa/EmployeeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jpa.openjpa; 20 | 21 | import javax.enterprise.context.ApplicationScoped; 22 | import javax.persistence.EntityManager; 23 | import javax.persistence.PersistenceContext; 24 | import java.util.List; 25 | 26 | @ApplicationScoped 27 | public class EmployeeService { 28 | 29 | @PersistenceContext(unitName = "MyPU") 30 | private EntityManager em; 31 | 32 | List getAll() { 33 | return em.createNamedQuery("Employee.findAll", Employee.class).getResultList(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/ws/ament/hammock/web/api/WebServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.api; 20 | 21 | import javax.servlet.ServletContextListener; 22 | 23 | public interface WebServer { 24 | 25 | void addServlet(ServletDescriptor servletDescriptor); 26 | 27 | void addFilter(FilterDescriptor filterDescriptor); 28 | 29 | void addServletContextAttribute(String name, Object value); 30 | 31 | void addInitParameter(String key, String value); 32 | 33 | void addListener(Class listenerClass); 34 | 35 | void start(); 36 | 37 | void stop(); 38 | } 39 | -------------------------------------------------------------------------------- /jpa-hibernate/src/test/java/ws/ament/hammock/jpa/hibernate/EmployeeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jpa.hibernate; 20 | 21 | import javax.enterprise.context.ApplicationScoped; 22 | import javax.persistence.EntityManager; 23 | import javax.persistence.PersistenceContext; 24 | import java.util.List; 25 | 26 | @ApplicationScoped 27 | public class EmployeeService { 28 | 29 | @PersistenceContext(unitName = "MyPU") 30 | private EntityManager em; 31 | 32 | List getAll() { 33 | return em.createNamedQuery("Employee.findAll", Employee.class).getResultList(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /security-jose/src/main/java/ws/ament/hammock/jwt/bean/ClaimLiteral.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jwt.bean; 20 | 21 | import org.eclipse.microprofile.jwt.Claim; 22 | import org.eclipse.microprofile.jwt.Claims; 23 | 24 | import javax.enterprise.inject.Vetoed; 25 | import javax.enterprise.util.AnnotationLiteral; 26 | 27 | @Vetoed 28 | public class ClaimLiteral extends AnnotationLiteral implements Claim{ 29 | @Override 30 | public String value() { 31 | return ""; 32 | } 33 | 34 | @Override 35 | public Claims standard() { 36 | return Claims.UNKNOWN; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /dist-microprofile-cochise/src/test/resources/hammock.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hammock and its contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | # implied. 14 | # 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | webserver.port=8766 20 | tomcat.catalina.base=target/tomcat-work 21 | hammock.health.require.annotation=true 22 | org.eclipse.microprofile.rest.client.tck.interfaces.SimpleGetApi/mp-rest/url=http://localhost:8765 23 | org.eclipse.microprofile.rest.client.tck.interfaces.InterfaceWithProvidersDefined/mp-rest/url=http://localhost:8765 24 | org.eclipse.microprofile.rest.client.tck.interfaces.FeatureProviderClient/mp-rest/url=http://localhost:8765 25 | org.eclipse.microprofile.rest.client.tck.cditests.HasSingletonScopeTest$MySingletonApi/mp-rest/url=http://localhost:8765 26 | -------------------------------------------------------------------------------- /rest-spark/src/test/java/ws/ament/hammock/rest/spark/RestApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.rest.spark; 20 | 21 | import spark.servlet.SparkApplication; 22 | 23 | import javax.enterprise.context.ApplicationScoped; 24 | import javax.inject.Inject; 25 | 26 | import static spark.Spark.get; 27 | 28 | @ApplicationScoped 29 | public class RestApplication implements SparkApplication { 30 | @Inject 31 | private RequestScopedBean requestScopedBean; 32 | 33 | @Override 34 | public void init() { 35 | get("/rest", (request, response) -> requestScopedBean.getResponse()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /jpa-eclipselink/src/test/java/ws/ament/hammock/jpa/eclipselink/EmployeeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jpa.eclipselink; 20 | 21 | import javax.enterprise.context.ApplicationScoped; 22 | import javax.persistence.EntityManager; 23 | import javax.persistence.PersistenceContext; 24 | import java.util.List; 25 | 26 | @ApplicationScoped 27 | public class EmployeeService { 28 | 29 | @PersistenceContext(unitName = "MyPU") 30 | private EntityManager em; 31 | 32 | List getAll() { 33 | return em.createNamedQuery("Employee.findAll", Employee.class).getResultList(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /util-brave/src/test/java/ws/ament/hammock/brave/SpanReporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.brave; 20 | 21 | import zipkin.Span; 22 | import zipkin.reporter.Reporter; 23 | 24 | import javax.enterprise.context.ApplicationScoped; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | 28 | @ApplicationScoped 29 | public class SpanReporter implements Reporter { 30 | private List spans = new ArrayList<>(); 31 | @Override 32 | public void report(Span span) { 33 | spans.add(span); 34 | } 35 | 36 | public List getSpans() { 37 | return spans; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /rest-resteasy/src/main/java/ws/ament/hammock/rest/resteasy/Cdi11InjectorFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.rest.resteasy; 20 | 21 | import org.jboss.resteasy.cdi.CdiInjectorFactory; 22 | 23 | import javax.enterprise.inject.spi.BeanManager; 24 | import javax.enterprise.inject.spi.CDI; 25 | 26 | /** 27 | * An extension of the CdiInjectorFactory that statically loads the bean manager without additional look ups. 28 | */ 29 | public class Cdi11InjectorFactory extends CdiInjectorFactory{ 30 | @Override 31 | protected BeanManager lookupBeanManager() { 32 | return CDI.current().getBeanManager(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /dist-microprofile/src/test/java/ws/ament/hammock/mp/test/HammockArchiveAppender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.mp.test; 20 | 21 | import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; 22 | import org.jboss.arquillian.test.spi.TestClass; 23 | import org.jboss.shrinkwrap.api.Archive; 24 | import org.jboss.shrinkwrap.api.spec.JavaArchive; 25 | 26 | public class HammockArchiveAppender implements ApplicationArchiveProcessor { 27 | @Override 28 | public void process(Archive archive, TestClass testClass) { 29 | archive.as(JavaArchive.class).addPackages(true, "ws.ament.hammock"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/ws/ament/hammock/utils/ClassUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.utils; 20 | 21 | import java.lang.annotation.Annotation; 22 | 23 | public final class ClassUtils { 24 | private ClassUtils() {} 25 | 26 | public static T getAnnotation(Class clazz, Class annotationClass) { 27 | T annotation = clazz.getAnnotation(annotationClass); 28 | if(annotation == null && clazz.getSuperclass() != Object.class) { 29 | return getAnnotation(clazz.getSuperclass(), annotationClass); 30 | } 31 | else { 32 | return annotation; 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /util-health/src/test/java/ws/ament/hammock/health/InjectedCheck.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.health; 20 | 21 | import org.eclipse.microprofile.health.HealthCheck; 22 | import org.eclipse.microprofile.health.HealthCheckResponse; 23 | import org.eclipse.microprofile.health.HealthCheckResponseBuilder; 24 | 25 | import javax.enterprise.context.Dependent; 26 | import javax.inject.Inject; 27 | 28 | @Dependent 29 | public class InjectedCheck implements HealthCheck { 30 | @Inject 31 | private HealthCheckResponseBuilder responseBuilder; 32 | @Override 33 | public HealthCheckResponse call() { 34 | return responseBuilder.up().build(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /bootstrap-owb2/src/test/java/ws/ament/hammock/bootstrap/owb/SomeBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.bootstrap.owb; 20 | 21 | import org.eclipse.microprofile.config.inject.ConfigProperty; 22 | 23 | import javax.enterprise.context.ApplicationScoped; 24 | import javax.inject.Inject; 25 | 26 | @ApplicationScoped 27 | public class SomeBean { 28 | @Inject 29 | @ConfigProperty(name="key1") 30 | private String key1; 31 | 32 | @Inject 33 | @ConfigProperty(name="key2") 34 | private String key2; 35 | 36 | public String getKey1() { 37 | return key1; 38 | } 39 | 40 | public String getKey2() { 41 | return key2; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /bootstrap-weld3/src/test/java/ws/ament/hammock/bootstrap/weld/SomeBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.bootstrap.weld; 20 | 21 | import org.eclipse.microprofile.config.inject.ConfigProperty; 22 | 23 | import javax.enterprise.context.ApplicationScoped; 24 | import javax.inject.Inject; 25 | 26 | @ApplicationScoped 27 | public class SomeBean { 28 | @Inject 29 | @ConfigProperty(name="key1") 30 | private String key1; 31 | 32 | @Inject 33 | @ConfigProperty(name="key2") 34 | private String key2; 35 | 36 | public String getKey1() { 37 | return key1; 38 | } 39 | 40 | public String getKey2() { 41 | return key2; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /core/src/test/java/ws/ament/hammock/DummyBootstrap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock; 20 | 21 | import ws.ament.hammock.bootstrap.Bootstrapper; 22 | 23 | public class DummyBootstrap implements Bootstrapper { 24 | private static int START_CALLED = 0; 25 | private static int STOP_CALLED = 0; 26 | @Override 27 | public void start() { 28 | START_CALLED++; 29 | } 30 | 31 | @Override 32 | public void stop() { 33 | STOP_CALLED++; 34 | } 35 | 36 | public static int getStartCalled() { 37 | return START_CALLED; 38 | } 39 | 40 | public static int getStopCalled() { 41 | return STOP_CALLED; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /jpa-openjpa/src/test/java/ws/ament/hammock/jpa/openjpa/AnotherEmployeeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jpa.openjpa; 20 | 21 | import ws.ament.hammock.jpa.Database; 22 | 23 | import javax.enterprise.context.ApplicationScoped; 24 | import javax.inject.Inject; 25 | import javax.persistence.EntityManager; 26 | import java.util.List; 27 | 28 | @ApplicationScoped 29 | public class AnotherEmployeeService { 30 | 31 | @Inject 32 | @Database("another") 33 | private EntityManager entityManager; 34 | 35 | public List findAll() { 36 | return entityManager.createNamedQuery("Employee.findAll", Employee.class).getResultList(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /web-spi/src/test/java/ws/ament/hammock/web/resource/ResourceManagerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.resource; 20 | 21 | import org.junit.Test; 22 | 23 | import static org.assertj.core.api.Assertions.assertThat; 24 | 25 | public class ResourceManagerTest { 26 | private ResourceManager resourceManager = new ResourceManager("/META-INF/resources"); 27 | @Test 28 | public void shouldLoadFromURI() throws Exception{ 29 | assertThat(resourceManager.load("boop.txt")).isNotNull(); 30 | } 31 | 32 | @Test 33 | public void shouldReturnNullWhenNotFound() throws Exception { 34 | assertThat(resourceManager.load("idontexist.xls")).isNull(); 35 | } 36 | } -------------------------------------------------------------------------------- /jpa-hibernate/src/test/java/ws/ament/hammock/jpa/hibernate/AnotherEmployeeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jpa.hibernate; 20 | 21 | import ws.ament.hammock.jpa.Database; 22 | 23 | import javax.enterprise.context.ApplicationScoped; 24 | import javax.inject.Inject; 25 | import javax.persistence.EntityManager; 26 | import java.util.List; 27 | 28 | @ApplicationScoped 29 | public class AnotherEmployeeService { 30 | 31 | @Inject 32 | @Database("another") 33 | private EntityManager entityManager; 34 | 35 | public List findAll() { 36 | return entityManager.createNamedQuery("Employee.findAll", Employee.class).getResultList(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /security-spi/src/main/java/ws/ament/hammock/security/impl/MissingRolesExceptionHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.security.impl; 20 | 21 | import ws.ament.hammock.security.api.MissingRolesException; 22 | 23 | import javax.enterprise.context.Dependent; 24 | import javax.ws.rs.core.Response; 25 | import javax.ws.rs.ext.ExceptionMapper; 26 | import javax.ws.rs.ext.Provider; 27 | 28 | @Dependent 29 | @Provider 30 | public class MissingRolesExceptionHandler implements ExceptionMapper{ 31 | @Override 32 | public Response toResponse(MissingRolesException e) { 33 | return Response.status(Response.Status.FORBIDDEN).build(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/ws/ament/hammock/utils/Unmanageable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.utils; 20 | 21 | import javax.enterprise.inject.spi.Unmanaged; 22 | 23 | public class Unmanageable implements AutoCloseable{ 24 | 25 | private final Unmanaged.UnmanagedInstance instance; 26 | 27 | public Unmanageable(Class clazz) { 28 | this.instance = new Unmanaged(clazz).newInstance(); 29 | this.instance.produce().inject().postConstruct(); 30 | } 31 | 32 | public T get() { 33 | return this.instance.get(); 34 | } 35 | 36 | @Override 37 | public void close() { 38 | this.instance.preDestroy().dispose(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /jpa-eclipselink/src/test/java/ws/ament/hammock/jpa/eclipselink/AnotherEmployeeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jpa.eclipselink; 20 | 21 | import ws.ament.hammock.jpa.Database; 22 | 23 | import javax.enterprise.context.ApplicationScoped; 24 | import javax.inject.Inject; 25 | import javax.persistence.EntityManager; 26 | import java.util.List; 27 | 28 | @ApplicationScoped 29 | public class AnotherEmployeeService { 30 | 31 | @Inject 32 | @Database("another") 33 | private EntityManager entityManager; 34 | 35 | public List findAll() { 36 | return entityManager.createNamedQuery("Employee.findAll", Employee.class).getResultList(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /web-spi/src/main/java/ws/ament/hammock/web/extension/StartWebServerExtension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.extension; 20 | 21 | import ws.ament.hammock.web.spi.StartWebServer; 22 | 23 | import javax.enterprise.event.Observes; 24 | import javax.enterprise.inject.spi.AfterDeploymentValidation; 25 | import javax.enterprise.inject.spi.CDI; 26 | import javax.enterprise.inject.spi.Extension; 27 | 28 | public class StartWebServerExtension implements Extension{ 29 | public void startWebTier(@Observes AfterDeploymentValidation adv) { 30 | StartWebServer startWebServer = CDI.current().select(StartWebServer.class).get(); 31 | startWebServer.start(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /security-spi/src/main/java/ws/ament/hammock/security/api/LoggedIn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.security.api; 20 | 21 | import javax.enterprise.util.AnnotationLiteral; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.Target; 24 | 25 | import static java.lang.annotation.ElementType.METHOD; 26 | import static java.lang.annotation.ElementType.TYPE; 27 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 28 | 29 | @Retention(value = RUNTIME) 30 | @Target({TYPE, METHOD}) 31 | public @interface LoggedIn { 32 | 33 | LoggedIn INSTANCE = new LoggedInLiteral(); 34 | 35 | class LoggedInLiteral extends AnnotationLiteral implements LoggedIn{} 36 | } 37 | -------------------------------------------------------------------------------- /web-spi/src/main/java/ws/ament/hammock/web/resource/IOUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.resource; 20 | 21 | import java.io.IOException; 22 | import java.io.InputStream; 23 | import java.io.OutputStream; 24 | 25 | /** 26 | * Adapted from Apache Commons IO 27 | */ 28 | public final class IOUtils { 29 | private IOUtils() { 30 | 31 | } 32 | 33 | static public long copy(InputStream input, OutputStream output) throws IOException{ 34 | byte[] buffer = new byte[4096]; 35 | long count; 36 | int n; 37 | for(count = 0L; -1 != (n = input.read(buffer)); count += (long)n) { 38 | output.write(buffer, 0, n); 39 | } 40 | return count; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /dist-microprofile/src/test/java/ws/ament/hammock/mp/test/Group1MappedRoleMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.mp.test; 20 | 21 | import ws.ament.hammock.security.api.GroupRolesMapper; 22 | 23 | import javax.enterprise.context.ApplicationScoped; 24 | import java.util.Collection; 25 | 26 | import static java.util.Collections.emptySet; 27 | import static java.util.Collections.singleton; 28 | 29 | @ApplicationScoped 30 | public class Group1MappedRoleMapper implements GroupRolesMapper { 31 | @Override 32 | public Collection convertGroupsToRoles(String s) { 33 | if(s.equals("group1")) { 34 | return singleton("Group1MappedRole"); 35 | } 36 | return emptySet(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /bootstrap-weld3/src/main/java/ws/ament/hammock/bootstrap/weld3/HammockContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.bootstrap.weld3; 20 | 21 | import org.jboss.weld.environment.servlet.Container; 22 | import org.jboss.weld.environment.servlet.ContainerContext; 23 | import org.jboss.weld.resources.spi.ResourceLoader; 24 | 25 | public class HammockContainer implements Container { 26 | @Override 27 | public boolean touch(ResourceLoader resourceLoader, ContainerContext context) throws Exception { 28 | return true; 29 | } 30 | 31 | @Override 32 | public void initialize(ContainerContext context) { 33 | 34 | } 35 | 36 | @Override 37 | public void destroy(ContainerContext context) { 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /core/src/test/java/ws/ament/hammock/core/config/CLIPropertySourceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.core.config; 20 | 21 | import org.eclipse.microprofile.config.spi.ConfigSource; 22 | import org.junit.Test; 23 | 24 | import static org.junit.Assert.assertEquals; 25 | 26 | public class CLIPropertySourceTest { 27 | 28 | @Test 29 | public void shouldReadPropertiesFromDefinedLocation() { 30 | String[] args = {"--key=value","-s","j"}; 31 | ConfigSource cliPropertySource = CLIPropertySource.parseMainArgs(args); 32 | String key = cliPropertySource.getValue("key"); 33 | assertEquals(key, "value"); 34 | String s = cliPropertySource.getValue("s"); 35 | assertEquals("j", s); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /dist-microprofile/src/test/java/ws/ament/hammock/mp/test/HealthArchiveAppender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.mp.test; 20 | 21 | import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; 22 | import org.jboss.arquillian.test.spi.TestClass; 23 | import org.jboss.shrinkwrap.api.Archive; 24 | import org.jboss.shrinkwrap.api.spec.JavaArchive; 25 | import ws.ament.hammock.health.HealthCheckManager; 26 | 27 | public class HealthArchiveAppender implements ApplicationArchiveProcessor { 28 | @Override 29 | public void process(Archive archive, TestClass testClass) { 30 | archive.as(JavaArchive.class) 31 | .addPackages(true, HealthCheckManager.class.getPackage()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /dist-microprofile-cochise/src/test/java/ws/ament/hammock/mp/cochise/test/Group1MappedRoleMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.mp.cochise.test; 20 | 21 | import ws.ament.hammock.security.api.GroupRolesMapper; 22 | 23 | import javax.enterprise.context.ApplicationScoped; 24 | import java.util.Collection; 25 | 26 | import static java.util.Collections.emptySet; 27 | import static java.util.Collections.singleton; 28 | 29 | @ApplicationScoped 30 | public class Group1MappedRoleMapper implements GroupRolesMapper { 31 | @Override 32 | public Collection convertGroupsToRoles(String s) { 33 | if(s.equals("group1")) { 34 | return singleton("Group1MappedRole"); 35 | } 36 | return emptySet(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /web-tck/src/main/java/ws/ament/hammock/web/tck/DefaultListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.tck; 20 | 21 | import javax.enterprise.context.Dependent; 22 | import javax.servlet.ServletContextEvent; 23 | import javax.servlet.ServletContextListener; 24 | import javax.servlet.annotation.WebListener; 25 | 26 | @WebListener 27 | @Dependent 28 | public class DefaultListener implements ServletContextListener { 29 | static boolean INITIALIZED = false; 30 | @Override 31 | public void contextInitialized(ServletContextEvent servletContextEvent) { 32 | INITIALIZED = true; 33 | } 34 | 35 | @Override 36 | public void contextDestroyed(ServletContextEvent servletContextEvent) { 37 | INITIALIZED = false; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /jaxrs-rest-tck/src/main/java/org/hammock/rest/tck/URIConfigSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.rest.tck; 20 | 21 | import org.apache.geronimo.config.configsource.BaseConfigSource; 22 | 23 | import java.util.Collections; 24 | import java.util.Map; 25 | 26 | public class URIConfigSource extends BaseConfigSource { 27 | private final Map properties = Collections.singletonMap("rest.uri.path", "/custom-uri"); 28 | 29 | @Override 30 | public Map getProperties() { 31 | return properties; 32 | } 33 | 34 | @Override 35 | public String getValue(String s) { 36 | return properties.get(s); 37 | } 38 | 39 | @Override 40 | public String getName() { 41 | return "uri"; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /util-health/src/main/java/ws/ament/hammock/health/HammockHealthCDI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.health; 20 | 21 | import org.eclipse.microprofile.health.HealthCheckResponseBuilder; 22 | 23 | import javax.enterprise.context.ApplicationScoped; 24 | import javax.enterprise.context.Dependent; 25 | import javax.enterprise.inject.Produces; 26 | import javax.enterprise.inject.spi.InjectionPoint; 27 | 28 | @ApplicationScoped 29 | public class HammockHealthCDI { 30 | @Produces 31 | @Dependent 32 | public HealthCheckResponseBuilder createResponseBuilder(InjectionPoint injectionPoint) { 33 | String name = injectionPoint.getMember().getDeclaringClass().getSimpleName(); 34 | return new HammockResponseBuilder().name(name); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /security-spi/src/main/java/ws/ament/hammock/security/internal/AnnotationUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.security.internal; 20 | 21 | import javax.interceptor.InvocationContext; 22 | import java.lang.annotation.Annotation; 23 | 24 | public abstract class AnnotationUtil { 25 | private AnnotationUtil() {} 26 | public static A getAnnotation(InvocationContext invocationContext, Class annotationClass) { 27 | A annotation = invocationContext.getMethod().getAnnotation(annotationClass); 28 | if(annotation != null) { 29 | return annotation; 30 | } 31 | else { 32 | return invocationContext.getMethod().getDeclaringClass().getAnnotation(annotationClass); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /dist-microprofile/src/test/java/ws/ament/hammock/mp/test/ArchiveAppenderExtension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.mp.test; 20 | 21 | import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; 22 | import org.jboss.arquillian.core.spi.LoadableExtension; 23 | 24 | public class ArchiveAppenderExtension implements LoadableExtension { 25 | @Override 26 | public void register(ExtensionBuilder extensionBuilder) { 27 | extensionBuilder.service(ApplicationArchiveProcessor.class, ConfigArchiveAppender.class); 28 | extensionBuilder.service(ApplicationArchiveProcessor.class, HealthArchiveAppender.class); 29 | extensionBuilder.service(ApplicationArchiveProcessor.class, HammockArchiveAppender.class); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /util-brave/src/main/java/ws/ament/hammock/brave/BraveTracingFeatureProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.brave; 20 | 21 | import com.github.kristofa.brave.Brave; 22 | import com.github.kristofa.brave.http.SpanNameProvider; 23 | import com.github.kristofa.brave.jaxrs2.BraveTracingFeature; 24 | 25 | import javax.enterprise.context.ApplicationScoped; 26 | import javax.enterprise.inject.Produces; 27 | import javax.inject.Singleton; 28 | 29 | @ApplicationScoped 30 | public class BraveTracingFeatureProvider { 31 | @Produces 32 | @Singleton 33 | public BraveTracingFeature createBraveTracingFeature(Brave brave, SpanNameProvider spanNameProvider) { 34 | return BraveTracingFeature.builder(brave).spanNameProvider(spanNameProvider).build(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /web-spi/src/main/java/ws/ament/hammock/web/spi/WebParam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.spi; 20 | 21 | import javax.enterprise.util.AnnotationLiteral; 22 | import javax.servlet.annotation.WebInitParam; 23 | 24 | public class WebParam extends AnnotationLiteral implements WebInitParam { 25 | private final String name; 26 | private final String value; 27 | 28 | public WebParam(String name, String value) { 29 | this.name = name; 30 | this.value = value; 31 | } 32 | 33 | @Override 34 | public String name() { 35 | return name; 36 | } 37 | 38 | @Override 39 | public String value() { 40 | return value; 41 | } 42 | 43 | @Override 44 | public String description() { 45 | return ""; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /security-spi/src/main/java/ws/ament/hammock/security/impl/NotLoggedInExceptionHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.security.impl; 20 | 21 | import ws.ament.hammock.security.api.NotLoggedInException; 22 | 23 | import javax.enterprise.context.Dependent; 24 | import javax.ws.rs.core.HttpHeaders; 25 | import javax.ws.rs.core.Response; 26 | import javax.ws.rs.ext.ExceptionMapper; 27 | import javax.ws.rs.ext.Provider; 28 | 29 | @Dependent 30 | @Provider 31 | public class NotLoggedInExceptionHandler implements ExceptionMapper{ 32 | @Override 33 | public Response toResponse(NotLoggedInException e) { 34 | return Response.status(Response.Status.UNAUTHORIZED) 35 | .header(HttpHeaders.WWW_AUTHENTICATE,"Bearer") 36 | .build(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /security-spi/src/main/java/ws/ament/hammock/security/api/Secured.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.security.api; 20 | 21 | import javax.enterprise.util.AnnotationLiteral; 22 | import javax.interceptor.InterceptorBinding; 23 | import java.lang.annotation.Documented; 24 | import java.lang.annotation.Retention; 25 | import java.lang.annotation.RetentionPolicy; 26 | import java.lang.annotation.Target; 27 | 28 | import static java.lang.annotation.ElementType.METHOD; 29 | import static java.lang.annotation.ElementType.TYPE; 30 | 31 | @InterceptorBinding 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target({TYPE, METHOD}) 34 | @Documented 35 | public @interface Secured { 36 | 37 | Secured INSTANCE = new SecuredLiteral(); 38 | 39 | class SecuredLiteral extends AnnotationLiteral implements Secured{} 40 | } 41 | -------------------------------------------------------------------------------- /web-undertow/src/main/java/ws/ament/hammock/web/undertow/HammockInstanceHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.undertow; 20 | 21 | import io.undertow.servlet.api.InstanceHandle; 22 | 23 | import javax.enterprise.inject.spi.Unmanaged; 24 | 25 | public class HammockInstanceHandle implements InstanceHandle { 26 | 27 | private final Unmanaged.UnmanagedInstance instance; 28 | 29 | HammockInstanceHandle(Unmanaged.UnmanagedInstance instance) { 30 | this.instance = instance; 31 | instance.produce().inject().postConstruct(); 32 | } 33 | 34 | @Override 35 | public T getInstance() { 36 | return instance.get(); 37 | } 38 | 39 | @Override 40 | public void release() { 41 | instance.preDestroy(); 42 | instance.dispose(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /web-spi/src/main/java/ws/ament/hammock/web/spi/RestServerConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.spi; 20 | 21 | import org.eclipse.microprofile.config.inject.ConfigProperty; 22 | 23 | import javax.enterprise.context.ApplicationScoped; 24 | import javax.inject.Inject; 25 | 26 | @ApplicationScoped 27 | public class RestServerConfiguration { 28 | @Inject 29 | @ConfigProperty(name="rest.uri.path", defaultValue = "/") 30 | private String restUriPath; 31 | 32 | public String getRestServerUri() { 33 | return restUriPath; 34 | } 35 | 36 | public String getRestServletMapping() { 37 | String propertyValue = restUriPath; 38 | if(!propertyValue.endsWith("/")) { 39 | propertyValue += "/"; 40 | } 41 | return propertyValue + "*"; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /swagger-ui/README.md: -------------------------------------------------------------------------------- 1 | # Swagger UI Integration 2 | 3 | This module adds Swagger UI v3 integration. 4 | 5 | ## Provides 6 | 7 | - Swagger UI v3 web resources. 8 | - Boot ui redirect with configurable api url. 9 | 10 | ## Usage 11 | 12 | - Add hammock _swagger-ui_ artifact. 13 | - When not using hammock _swagger_ then provide the swagger api url. 14 | - To disable the online validator use; `swagger-ui.redirect=index.html?validatorUrl=` 15 | 16 | ## Config 17 | 18 | Property | default | Description 19 | --- | --- | --- 20 | swagger-ui.enable | `true` | Enable/Disable swagger ui per environment. 21 | swagger-ui.version | `` | Allows for usage of different webjar version. 22 | swagger-ui.redirect | `index.html` | UI Boot redirect url, note; needs to start with slash or http. 23 | swagger-ui.path | `/openapi.ui` | Base path for ui resources. 24 | swagger-ui.api | `/openapi.json` | The url location to start the swagger ui with. 25 | 26 | ### Default request sequence 27 | 28 | - request /openapi.ui 29 | - redirect /openapi.ui/index.html?url=/openapi.json 30 | - forwards /openapi.ui/* to /META-INF/resources/webjars/swagger-ui/ 31 | 32 | ### UI Customization 33 | 34 | There are a couple of options but most common would be a cloned index; 35 | 36 | - Make a copy of the original index.html 37 | - place it in `static.resource.location` like META-INF/resources/example/index.html 38 | - Modify the js/css resources paths to prefix with /openapi.ui 39 | - Change `swagger-ui.redirect` to /example/index.html 40 | -------------------------------------------------------------------------------- /security-jose/src/main/java/ws/ament/hammock/jwt/JWTIdentity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jwt; 20 | 21 | import ws.ament.hammock.security.api.Identity; 22 | 23 | import javax.enterprise.inject.Vetoed; 24 | 25 | @Vetoed 26 | public class JWTIdentity implements Identity{ 27 | private final JWTPrincipal principal; 28 | 29 | JWTIdentity() { 30 | this(null); 31 | } 32 | 33 | public JWTIdentity(JWTPrincipal principal) { 34 | this.principal = principal; 35 | } 36 | 37 | @Override 38 | public JWTPrincipal getPrincipal() { 39 | return principal; 40 | } 41 | 42 | @Override 43 | public boolean isLoggedIn() { 44 | return principal.getName() != null; 45 | } 46 | 47 | @Override 48 | public boolean hasRole(String role) { 49 | return principal.isUserInRole(role); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /messaging-rabbitmq/src/main/java/ws/ament/hammock/rabbitmq/NoOpMetricCollectorBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.rabbitmq; 20 | 21 | import com.rabbitmq.client.MetricsCollector; 22 | import com.rabbitmq.client.NoOpMetricsCollector; 23 | 24 | import javax.enterprise.context.spi.CreationalContext; 25 | import javax.enterprise.inject.spi.InjectionTarget; 26 | 27 | final class NoOpMetricCollectorBean extends MetricCollectorBean { 28 | NoOpMetricCollectorBean(InjectionTarget injectionTarget) { 29 | super(injectionTarget); 30 | } 31 | 32 | @Override 33 | public Class getBeanClass() { 34 | return NoOpMetricsCollector.class; 35 | } 36 | 37 | @Override 38 | public MetricsCollector create(CreationalContext creationalContext) { 39 | return new NoOpMetricsCollector(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /security-jose/src/main/java/ws/ament/hammock/jwt/bean/JWTIdentityHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jwt.bean; 20 | 21 | import ws.ament.hammock.jwt.JWTIdentity; 22 | import ws.ament.hammock.jwt.JWTPrincipal; 23 | 24 | import javax.enterprise.context.RequestScoped; 25 | import javax.enterprise.inject.Produces; 26 | 27 | @RequestScoped 28 | public class JWTIdentityHolder { 29 | 30 | private JWTIdentity jwtIdentity = new JWTIdentity(new JWTPrincipal()); 31 | 32 | @Produces 33 | @RequestScoped 34 | public JWTIdentity getJwtIdentity() { 35 | return jwtIdentity; 36 | } 37 | 38 | @Produces 39 | @RequestScoped 40 | public JWTPrincipal getPrincipal() { 41 | return jwtIdentity.getPrincipal(); 42 | } 43 | 44 | public void setJwtIdentity(JWTIdentity jwtIdentity) { 45 | this.jwtIdentity = jwtIdentity; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /johnzon/src/main/java/ws/ament/hammock/johnzon/JohnzonExtension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.johnzon; 20 | 21 | import org.apache.johnzon.jaxrs.*; 22 | 23 | import javax.enterprise.context.ApplicationScoped; 24 | import javax.ws.rs.core.Feature; 25 | import javax.ws.rs.core.FeatureContext; 26 | import javax.ws.rs.ext.Provider; 27 | 28 | @ApplicationScoped 29 | @Provider 30 | public class JohnzonExtension implements Feature { 31 | 32 | @Override 33 | public boolean configure(FeatureContext featureContext) { 34 | featureContext.register(ConfigurableJohnzonProvider.class); 35 | featureContext.register(JsrProvider.class); 36 | featureContext.register(JohnzonProvider.class); 37 | featureContext.register(WildcardJsrProvider.class); 38 | featureContext.register(WildcardJohnzonProvider.class); 39 | return true; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /security-jose/src/main/java/ws/ament/hammock/jwt/JWTProcessorConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.jwt; 20 | 21 | import org.eclipse.microprofile.config.spi.Converter; 22 | import ws.ament.hammock.jwt.processor.JWTProcessor; 23 | 24 | import javax.annotation.Priority; 25 | import javax.enterprise.inject.spi.CDI; 26 | 27 | @Priority(1) 28 | public class JWTProcessorConverter implements Converter { 29 | public static final Converter INSTANCE = new JWTProcessorConverter(); 30 | 31 | @Override 32 | public JWTProcessor convert(String s) { 33 | try { 34 | Class aClass = (Class)Class.forName(s); 35 | return CDI.current().select(aClass).get(); 36 | } catch (ClassNotFoundException e) { 37 | throw new RuntimeException("No class "+s,e); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /core/src/main/java/ws/ament/hammock/annotations/Disposing.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.annotations; 20 | 21 | import javax.enterprise.util.AnnotationLiteral; 22 | import javax.inject.Qualifier; 23 | import java.lang.annotation.ElementType; 24 | import java.lang.annotation.Retention; 25 | import java.lang.annotation.RetentionPolicy; 26 | import java.lang.annotation.Target; 27 | 28 | @Qualifier 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Target({ 31 | ElementType.TYPE, ElementType.PARAMETER, ElementType.FIELD, 32 | ElementType.METHOD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, 33 | ElementType.LOCAL_VARIABLE, ElementType.PACKAGE, ElementType.TYPE_PARAMETER, 34 | ElementType.TYPE_USE}) 35 | public @interface Disposing { 36 | Disposing INSTANCE = new Literal(); 37 | class Literal extends AnnotationLiteral implements Disposing {} 38 | } 39 | -------------------------------------------------------------------------------- /web-tck/src/main/java/ws/ament/hammock/web/tck/DefaultFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.web.tck; 20 | 21 | import javax.enterprise.context.Dependent; 22 | import javax.servlet.*; 23 | import javax.servlet.annotation.WebFilter; 24 | import java.io.IOException; 25 | 26 | @Dependent 27 | @WebFilter(filterName = "Default",urlPatterns = "${default.filter}", dispatcherTypes = DispatcherType.REQUEST) 28 | public class DefaultFilter implements Filter { 29 | @Override 30 | public void init(FilterConfig filterConfig) throws ServletException { 31 | 32 | } 33 | 34 | @Override 35 | public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { 36 | servletResponse.getWriter().print("Hello, world!"); 37 | } 38 | 39 | @Override 40 | public void destroy() { 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /core/src/main/java/ws/ament/hammock/annotations/Configuring.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.annotations; 20 | 21 | import javax.enterprise.util.AnnotationLiteral; 22 | import javax.inject.Qualifier; 23 | import java.lang.annotation.ElementType; 24 | import java.lang.annotation.Retention; 25 | import java.lang.annotation.RetentionPolicy; 26 | import java.lang.annotation.Target; 27 | 28 | @Qualifier 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Target({ 31 | ElementType.TYPE, ElementType.PARAMETER, ElementType.FIELD, 32 | ElementType.METHOD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, 33 | ElementType.LOCAL_VARIABLE, ElementType.PACKAGE, ElementType.TYPE_PARAMETER, 34 | ElementType.TYPE_USE}) 35 | public @interface Configuring { 36 | Configuring INSTANCE = new Literal(); 37 | class Literal extends AnnotationLiteral implements Configuring {} 38 | } 39 | -------------------------------------------------------------------------------- /jpa-openjpa/src/test/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 25 | 26 | ws.ament.hammock.jpa.openjpa.Employee 27 | true 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /util-health/src/main/java/ws/ament/hammock/health/ArrayHealthCheckModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.health; 20 | 21 | import java.util.List; 22 | 23 | public class ArrayHealthCheckModel implements HealthCheckModel { 24 | private final String outcome; 25 | private final List checks; 26 | 27 | public ArrayHealthCheckModel(String outcome, List checks) { 28 | this.outcome = outcome; 29 | this.checks = checks; 30 | } 31 | 32 | @Override 33 | public String getOutcome() { 34 | return outcome; 35 | } 36 | 37 | public List getChecks() { 38 | return checks; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | return "ArrayHealthCheckModel{" + "outcome='" + outcome + '\'' + 44 | ", checks=" + checks + 45 | '}'; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /test-arquillian/src/main/java/ws/ament/hammock/test/support/HammockURLProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.test.support; 20 | 21 | import org.jboss.arquillian.test.api.ArquillianResource; 22 | 23 | import java.lang.annotation.Annotation; 24 | import java.net.MalformedURLException; 25 | import java.net.URI; 26 | import java.net.URL; 27 | 28 | public class HammockURLProvider extends HammockURIProvider { 29 | 30 | @Override 31 | public Object lookup(ArquillianResource arquillianResource, Annotation... annotations) { 32 | try { 33 | return URI.class.cast(super.lookup(arquillianResource, annotations)).toURL(); 34 | } catch (MalformedURLException e) { 35 | throw new RuntimeException("Unable to create URL", e); 36 | } 37 | } 38 | 39 | @Override 40 | public boolean canProvide(Class type) { 41 | return type.isAssignableFrom(URL.class); 42 | } 43 | } -------------------------------------------------------------------------------- /util-health/src/main/java/ws/ament/hammock/health/ObjectHealthCheckModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.health; 20 | 21 | import java.util.Map; 22 | 23 | public class ObjectHealthCheckModel implements HealthCheckModel{ 24 | private final String outcome; 25 | private final Map checks; 26 | 27 | public ObjectHealthCheckModel(String outcome, Map checks) { 28 | this.outcome = outcome; 29 | this.checks = checks; 30 | } 31 | 32 | @Override 33 | public String getOutcome() { 34 | return outcome; 35 | } 36 | 37 | public Map getChecks() { 38 | return checks; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | return "ObjectHealthCheckModel{" + "outcome='" + outcome + '\'' + 44 | ", checks=" + checks + 45 | '}'; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /rest-cxf/src/test/java/org/hammock/test/cxf/SseEventEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.hammock.test.cxf; 20 | 21 | import javax.enterprise.context.RequestScoped; 22 | import javax.enterprise.event.Event; 23 | import javax.inject.Inject; 24 | import javax.ws.rs.GET; 25 | import javax.ws.rs.Path; 26 | import javax.ws.rs.PathParam; 27 | import javax.ws.rs.Produces; 28 | import javax.ws.rs.core.Context; 29 | import javax.ws.rs.core.MediaType; 30 | import javax.ws.rs.sse.Sse; 31 | import javax.ws.rs.sse.SseEventSink; 32 | 33 | @Path("/sse") 34 | @RequestScoped 35 | public class SseEventEndpoint { 36 | @Inject 37 | private Event event; 38 | 39 | @GET 40 | @Path("{connectionId}") 41 | @Produces(MediaType.SERVER_SENT_EVENTS) 42 | public void onEvent(@Context SseEventSink sink, @PathParam("connectionId") final String id, @Context Sse sse) { 43 | event.fire(new SseEvent(sink, sse, id)); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /dist-microprofile-cochise/src/test/java/ws/ament/hammock/mp/cochise/test/HammockURIProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.mp.cochise.test; 20 | 21 | import org.jboss.arquillian.test.api.ArquillianResource; 22 | import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider; 23 | import ws.ament.hammock.HammockRuntime; 24 | 25 | import javax.enterprise.inject.spi.CDI; 26 | import java.lang.annotation.Annotation; 27 | import java.net.URI; 28 | 29 | public class HammockURIProvider implements ResourceProvider { 30 | @Override 31 | public Object lookup(ArquillianResource arquillianResource, Annotation... annotations) { 32 | HammockRuntime hammockRuntime = CDI.current().select(HammockRuntime.class).get(); 33 | return URI.create(hammockRuntime.getMachineURL()); 34 | } 35 | 36 | @Override 37 | public boolean canProvide(Class type) { 38 | return type.isAssignableFrom(URI.class); 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /util-brave/src/test/java/ws/ament/hammock/brave/SimpleResource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hammock and its contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 | * implied. 14 | * 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package ws.ament.hammock.brave; 20 | 21 | import ws.ament.hammock.HammockRuntime; 22 | 23 | import javax.enterprise.context.RequestScoped; 24 | import javax.inject.Inject; 25 | import javax.ws.rs.GET; 26 | import javax.ws.rs.Path; 27 | import javax.ws.rs.client.Client; 28 | 29 | @Path("/simple") 30 | @RequestScoped 31 | public class SimpleResource { 32 | @Inject 33 | private BraveCDIFeature braveCDIFeature; 34 | @Inject 35 | private HammockRuntime hammockRuntime; 36 | @Inject 37 | private Client client; 38 | @GET 39 | public String sayHello() { 40 | String requestURL = hammockRuntime.getMachineURL() + "/simple/second"; 41 | client.target(requestURL).request().get(); 42 | return "hello"; 43 | } 44 | @GET 45 | @Path("/second") 46 | public String saySecond() { 47 | return "second"; 48 | } 49 | } 50 | --------------------------------------------------------------------------------