Consistent package names for MP Metrics TCK.
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/8e466611 Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/8e466611 Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/8e466611 Branch: refs/heads/master Commit: 8e466611c483c2314def701fc2a991011288aa6a Parents: 85f7ce8 Author: Roberto Cortez <radcor...@yahoo.com> Authored: Wed Aug 8 19:07:50 2018 +0100 Committer: Roberto Cortez <radcor...@yahoo.com> Committed: Mon Aug 13 16:36:35 2018 +0100 ---------------------------------------------------------------------- ...icroProfileMetricsTCKDeploymentPackager.java | 89 -------------------- .../MicroProfileMetricsTCKExtension.java | 31 ------- .../metrics/MicroProfileMetricsTCKObserver.java | 32 ------- .../metrics/MicroProfileMetricsTCKProtocol.java | 27 ------ ...icroProfileMetricsTCKDeploymentPackager.java | 89 ++++++++++++++++++++ .../MicroProfileMetricsTCKExtension.java | 31 +++++++ .../metrics/MicroProfileMetricsTCKObserver.java | 32 +++++++ .../metrics/MicroProfileMetricsTCKProtocol.java | 27 ++++++ ....jboss.arquillian.core.spi.LoadableExtension | 2 +- 9 files changed, 180 insertions(+), 180 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/8e466611/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKDeploymentPackager.java ---------------------------------------------------------------------- diff --git a/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKDeploymentPackager.java b/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKDeploymentPackager.java deleted file mode 100644 index ece8314..0000000 --- a/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKDeploymentPackager.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.openejb.tck.microprofile.metrics; - -import org.jboss.arquillian.container.spi.client.deployment.TargetDescription; -import org.jboss.arquillian.container.spi.client.protocol.ProtocolDescription; -import org.jboss.arquillian.container.test.spi.TestDeployment; -import org.jboss.arquillian.container.test.spi.client.deployment.ProtocolArchiveProcessor; -import org.jboss.arquillian.protocol.servlet.v_2_5.ServletProtocolDeploymentPackager; -import org.jboss.shrinkwrap.api.Archive; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; - -import java.util.Collection; - -/** - * Metrics TCK provides Archives in JAR format. Arquillian transforms them in EAR. To simplify, override the behavior - * and wrap them into a WAR. - */ -public class MicroProfileMetricsTCKDeploymentPackager extends ServletProtocolDeploymentPackager { - @Override - public Archive<?> generateDeployment(final TestDeployment testDeployment, - final Collection<ProtocolArchiveProcessor> processors) { - final Archive<?> applicationArchive = testDeployment.getApplicationArchive(); - if (applicationArchive instanceof JavaArchive) { - final WebArchive wrapperWar = - ShrinkWrap.create(WebArchive.class, "microprofile-metrics.war").addAsLibrary(applicationArchive); - return super.generateDeployment(new TestDeploymentDelegate(testDeployment, wrapperWar), processors); - } - - return super.generateDeployment(testDeployment, processors); - } - - private static class TestDeploymentDelegate extends TestDeployment { - private TestDeployment testDeployment; - private Archive<?> archive; - - public TestDeploymentDelegate(final TestDeployment testDeployment, final Archive<?> archive) { - super(null, archive, testDeployment.getAuxiliaryArchives()); - this.testDeployment = testDeployment; - this.archive = archive; - } - - @Override - public TargetDescription getTargetDescription() { - return testDeployment.getTargetDescription(); - } - - @Override - public ProtocolDescription getProtocolDescription() { - return testDeployment.getProtocolDescription(); - } - - @Override - public String getDeploymentName() { - return testDeployment.getDeploymentName(); - } - - @Override - public Archive<?> getArchiveForEnrichment() { - return testDeployment.getArchiveForEnrichment(); - } - - @Override - public Archive<?> getApplicationArchive() { - return archive; - } - - @Override - public Collection<Archive<?>> getAuxiliaryArchives() { - return testDeployment.getAuxiliaryArchives(); - } - } -} http://git-wip-us.apache.org/repos/asf/tomee/blob/8e466611/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKExtension.java ---------------------------------------------------------------------- diff --git a/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKExtension.java b/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKExtension.java deleted file mode 100644 index 8d4a085..0000000 --- a/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKExtension.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.openejb.tck.microprofile.metrics; - -import org.jboss.arquillian.container.test.spi.client.protocol.Protocol; -import org.jboss.arquillian.core.spi.LoadableExtension; -import org.jboss.arquillian.protocol.servlet.v_2_5.ServletProtocol; - -public class MicroProfileMetricsTCKExtension implements LoadableExtension { - @Override - public void register(final ExtensionBuilder extensionBuilder) { - extensionBuilder - .override(Protocol.class, ServletProtocol.class, MicroProfileMetricsTCKProtocol.class) - .observer(MicroProfileMetricsTCKObserver.class) - ; - } -} http://git-wip-us.apache.org/repos/asf/tomee/blob/8e466611/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKObserver.java ---------------------------------------------------------------------- diff --git a/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKObserver.java b/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKObserver.java deleted file mode 100644 index 4589234..0000000 --- a/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKObserver.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.openejb.tck.microprofile.metrics; - -import com.jayway.restassured.RestAssured; -import org.apache.openejb.arquillian.common.TomEEContainer; -import org.jboss.arquillian.container.spi.event.container.AfterDeploy; -import org.jboss.arquillian.core.api.annotation.Observes; - -/** - * Metrics TCK expect the deployed test archives to be in the root context. In here, we just set the RestAssured path - * so the test archives are not required to be deployed in the / context root. - */ -public class MicroProfileMetricsTCKObserver { - public void AfterDeploy(@Observes final AfterDeploy afterDeploy) { - RestAssured.basePath = "microprofile-metrics"; - } -} http://git-wip-us.apache.org/repos/asf/tomee/blob/8e466611/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKProtocol.java ---------------------------------------------------------------------- diff --git a/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKProtocol.java b/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKProtocol.java deleted file mode 100644 index 4defccf..0000000 --- a/tck/microprofile-tck/metrics/src/test/java/org/apache/openejb/tck/microprofile/metrics/MicroProfileMetricsTCKProtocol.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.openejb.tck.microprofile.metrics; - -import org.jboss.arquillian.container.test.spi.client.deployment.DeploymentPackager; -import org.jboss.arquillian.protocol.servlet.v_2_5.ServletProtocol; - -public class MicroProfileMetricsTCKProtocol extends ServletProtocol { - @Override - public DeploymentPackager getPackager() { - return new MicroProfileMetricsTCKDeploymentPackager(); - } -} http://git-wip-us.apache.org/repos/asf/tomee/blob/8e466611/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKDeploymentPackager.java ---------------------------------------------------------------------- diff --git a/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKDeploymentPackager.java b/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKDeploymentPackager.java new file mode 100644 index 0000000..eb6762f --- /dev/null +++ b/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKDeploymentPackager.java @@ -0,0 +1,89 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.tomee.microprofile.tck.metrics; + +import org.jboss.arquillian.container.spi.client.deployment.TargetDescription; +import org.jboss.arquillian.container.spi.client.protocol.ProtocolDescription; +import org.jboss.arquillian.container.test.spi.TestDeployment; +import org.jboss.arquillian.container.test.spi.client.deployment.ProtocolArchiveProcessor; +import org.jboss.arquillian.protocol.servlet.v_2_5.ServletProtocolDeploymentPackager; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.jboss.shrinkwrap.api.spec.WebArchive; + +import java.util.Collection; + +/** + * Metrics TCK provides Archives in JAR format. Arquillian transforms them in EAR. To simplify, override the behavior + * and wrap them into a WAR. + */ +public class MicroProfileMetricsTCKDeploymentPackager extends ServletProtocolDeploymentPackager { + @Override + public Archive<?> generateDeployment(final TestDeployment testDeployment, + final Collection<ProtocolArchiveProcessor> processors) { + final Archive<?> applicationArchive = testDeployment.getApplicationArchive(); + if (applicationArchive instanceof JavaArchive) { + final WebArchive wrapperWar = + ShrinkWrap.create(WebArchive.class, "microprofile-metrics.war").addAsLibrary(applicationArchive); + return super.generateDeployment(new TestDeploymentDelegate(testDeployment, wrapperWar), processors); + } + + return super.generateDeployment(testDeployment, processors); + } + + private static class TestDeploymentDelegate extends TestDeployment { + private TestDeployment testDeployment; + private Archive<?> archive; + + public TestDeploymentDelegate(final TestDeployment testDeployment, final Archive<?> archive) { + super(null, archive, testDeployment.getAuxiliaryArchives()); + this.testDeployment = testDeployment; + this.archive = archive; + } + + @Override + public TargetDescription getTargetDescription() { + return testDeployment.getTargetDescription(); + } + + @Override + public ProtocolDescription getProtocolDescription() { + return testDeployment.getProtocolDescription(); + } + + @Override + public String getDeploymentName() { + return testDeployment.getDeploymentName(); + } + + @Override + public Archive<?> getArchiveForEnrichment() { + return testDeployment.getArchiveForEnrichment(); + } + + @Override + public Archive<?> getApplicationArchive() { + return archive; + } + + @Override + public Collection<Archive<?>> getAuxiliaryArchives() { + return testDeployment.getAuxiliaryArchives(); + } + } +} http://git-wip-us.apache.org/repos/asf/tomee/blob/8e466611/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKExtension.java ---------------------------------------------------------------------- diff --git a/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKExtension.java b/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKExtension.java new file mode 100644 index 0000000..35c9f40 --- /dev/null +++ b/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKExtension.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.tomee.microprofile.tck.metrics; + +import org.jboss.arquillian.container.test.spi.client.protocol.Protocol; +import org.jboss.arquillian.core.spi.LoadableExtension; +import org.jboss.arquillian.protocol.servlet.v_2_5.ServletProtocol; + +public class MicroProfileMetricsTCKExtension implements LoadableExtension { + @Override + public void register(final ExtensionBuilder extensionBuilder) { + extensionBuilder + .override(Protocol.class, ServletProtocol.class, MicroProfileMetricsTCKProtocol.class) + .observer(MicroProfileMetricsTCKObserver.class) + ; + } +} http://git-wip-us.apache.org/repos/asf/tomee/blob/8e466611/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKObserver.java ---------------------------------------------------------------------- diff --git a/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKObserver.java b/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKObserver.java new file mode 100644 index 0000000..399b702 --- /dev/null +++ b/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKObserver.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.tomee.microprofile.tck.metrics; + +import com.jayway.restassured.RestAssured; +import org.apache.openejb.arquillian.common.TomEEContainer; +import org.jboss.arquillian.container.spi.event.container.AfterDeploy; +import org.jboss.arquillian.core.api.annotation.Observes; + +/** + * Metrics TCK expect the deployed test archives to be in the root context. In here, we just set the RestAssured path + * so the test archives are not required to be deployed in the / context root. + */ +public class MicroProfileMetricsTCKObserver { + public void AfterDeploy(@Observes final AfterDeploy afterDeploy) { + RestAssured.basePath = "microprofile-metrics"; + } +} http://git-wip-us.apache.org/repos/asf/tomee/blob/8e466611/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKProtocol.java ---------------------------------------------------------------------- diff --git a/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKProtocol.java b/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKProtocol.java new file mode 100644 index 0000000..630bdb3 --- /dev/null +++ b/tck/microprofile-tck/metrics/src/test/java/org/apache/tomee/microprofile/tck/metrics/MicroProfileMetricsTCKProtocol.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.tomee.microprofile.tck.metrics; + +import org.jboss.arquillian.container.test.spi.client.deployment.DeploymentPackager; +import org.jboss.arquillian.protocol.servlet.v_2_5.ServletProtocol; + +public class MicroProfileMetricsTCKProtocol extends ServletProtocol { + @Override + public DeploymentPackager getPackager() { + return new MicroProfileMetricsTCKDeploymentPackager(); + } +} http://git-wip-us.apache.org/repos/asf/tomee/blob/8e466611/tck/microprofile-tck/metrics/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension ---------------------------------------------------------------------- diff --git a/tck/microprofile-tck/metrics/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/tck/microprofile-tck/metrics/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension index 5c60218..660d60a 100644 --- a/tck/microprofile-tck/metrics/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension +++ b/tck/microprofile-tck/metrics/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension @@ -1 +1 @@ -org.apache.openejb.tck.microprofile.metrics.MicroProfileMetricsTCKExtension +org.apache.tomee.microprofile.tck.metrics.MicroProfileMetricsTCKExtension