This is an automated email from the ASF dual-hosted git repository. alien11689 pushed a commit to branch ARIES-2177-stop-using-aries-application-in-samples in repository https://gitbox.apache.org/repos/asf/aries.git
commit ae62f1703290b663ece4d10ea6442c30f981ae57 Author: Dominik Przybysz <[email protected]> AuthorDate: Fri Apr 18 23:34:02 2025 +0200 ARIES-2177: Remove eba usage from samples/blueprint --- .../blueprint/helloworld/helloworld-eba/pom.xml | 69 ---------------- .../helloworld/itests/AbstractIntegrationTest.java | 96 +--------------------- samples/blueprint/helloworld/pom.xml | 1 - samples/blueprint/idverifier/pom.xml | 6 -- 4 files changed, 1 insertion(+), 171 deletions(-) diff --git a/samples/blueprint/helloworld/helloworld-eba/pom.xml b/samples/blueprint/helloworld/helloworld-eba/pom.xml deleted file mode 100644 index a9eea1a31..000000000 --- a/samples/blueprint/helloworld/helloworld-eba/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -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. ---> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.aries.samples</groupId> - <artifactId>helloworld</artifactId> - <version>1.0.1-SNAPSHOT</version> - </parent> - - <groupId>org.apache.aries.samples.blueprint.helloworld</groupId> - <artifactId>org.apache.aries.samples.blueprint.helloworld.eba</artifactId> - <name>Apache Aries Blueprint HelloWorld EBA</name> - <description>This is the module that constructs the Hello World application</description> - <packaging>eba</packaging> - - <dependencies> - <dependency> - <groupId>org.apache.aries.samples.blueprint.helloworld</groupId> - <artifactId>org.apache.aries.samples.blueprint.helloworld.api</artifactId> - </dependency> - <dependency> - <groupId>org.apache.aries.samples.blueprint.helloworld</groupId> - <artifactId>org.apache.aries.samples.blueprint.helloworld.client</artifactId> - </dependency> - <dependency> - <groupId>org.apache.aries.samples.blueprint.helloworld</groupId> - <artifactId>org.apache.aries.samples.blueprint.helloworld.server</artifactId> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.aries</groupId> - <artifactId>eba-maven-plugin</artifactId> - <version>${eba-maven-plugin.version}</version> - <extensions>true</extensions> - <configuration> - <generateManifest>true</generateManifest> - <instructions> - <Application-SymbolicName>${project.artifactId}</Application-SymbolicName> - </instructions> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/samples/blueprint/helloworld/helloworld-itests/src/test/java/org/apache/aries/samples/blueprint/helloworld/itests/AbstractIntegrationTest.java b/samples/blueprint/helloworld/helloworld-itests/src/test/java/org/apache/aries/samples/blueprint/helloworld/itests/AbstractIntegrationTest.java index d99e860fc..265d77282 100644 --- a/samples/blueprint/helloworld/helloworld-itests/src/test/java/org/apache/aries/samples/blueprint/helloworld/itests/AbstractIntegrationTest.java +++ b/samples/blueprint/helloworld/helloworld-itests/src/test/java/org/apache/aries/samples/blueprint/helloworld/itests/AbstractIntegrationTest.java @@ -22,13 +22,9 @@ import static org.ops4j.pax.exam.CoreOptions.options; import static org.ops4j.pax.exam.CoreOptions.wrappedBundle; import static org.ops4j.pax.exam.OptionUtils.combine; -import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.List; @@ -39,15 +35,12 @@ import org.junit.Before; import org.ops4j.pax.exam.CoreOptions; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.options.MavenArtifactProvisionOption; -import org.ops4j.pax.url.mvn.Handler; -import org.ops4j.pax.url.mvn.ServiceConstants; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.Constants; import org.osgi.framework.Filter; import org.osgi.framework.FrameworkUtil; import org.osgi.framework.InvalidSyntaxException; -import org.osgi.framework.ServiceReference; import org.osgi.util.tracker.ServiceTracker; import javax.inject.Inject; @@ -55,10 +48,7 @@ import javax.inject.Inject; public abstract class AbstractIntegrationTest { - private static final int CONNECTION_TIMEOUT = 30000; - public static final long DEFAULT_TIMEOUT = 60000; - - @Inject + @Inject protected BundleContext bundleContext; private List<ServiceTracker> srs; @@ -145,45 +135,6 @@ public abstract class AbstractIntegrationTest { } } - protected void listBundleServices(Bundle b) { - ServiceReference []srb = b.getRegisteredServices(); - for(ServiceReference sr:srb){ - System.out.println(b.getSymbolicName() + " SERVICE: "+sr); - } - } - - protected Boolean isServiceRegistered(Bundle b) { - ServiceReference []srb = b.getRegisteredServices(); - if(srb == null) { - return false; - } - return true; - } - - protected void waitForServices(Bundle b, String sclass) { - try { - BundleContext bc = b.getBundleContext(); - String bsn = b.getSymbolicName(); - ServiceTracker st = new ServiceTracker(bc, sclass, null); - st.open(); - Object bac = st.waitForService(DEFAULT_TIMEOUT); - /* Uncomment for debug */ - /* - if(bac == null) { - System.out.println("SERVICE NOTFOUND " + bsn); - } else { - System.out.println("SERVICE FOUND " + bsn); - } - */ - st.close(); - return; - } - catch (Exception e) { - System.out.println("Failed to register services for " + b.getSymbolicName() + e.getMessage()); - } - } - - protected static Option[] updateOptions(Option[] options) { if ("IBM Corporation".equals(System.getProperty("java.vendor"))) { Option[] ibmOptions = options( @@ -194,42 +145,7 @@ public abstract class AbstractIntegrationTest { return options; } - - public static String getHTTPResponse(HttpURLConnection conn) throws IOException - { - StringBuilder response = new StringBuilder(); - BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), - "ISO-8859-1")); - try { - for (String s = reader.readLine(); s != null; s = reader.readLine()) { - response.append(s).append("\r\n"); - } - } finally { - reader.close(); - } - - return response.toString(); - } - - public static HttpURLConnection makeConnection(String contextPath) throws IOException - { - URL url = new URL(contextPath); - HttpURLConnection conn = (HttpURLConnection) url.openConnection(); - - conn.setConnectTimeout(CONNECTION_TIMEOUT); - conn.connect(); - - return conn; - } - protected <T> T getOsgiService(Class<T> type, long timeout) { - return getOsgiService(type, null, timeout); - } - - protected <T> T getOsgiService(Class<T> type) { - return getOsgiService(type, null, DEFAULT_TIMEOUT); - } - protected <T> T getOsgiService(Class<T> type, String filter, long timeout) { return getOsgiService(null, type, filter, timeout); } @@ -269,15 +185,5 @@ public abstract class AbstractIntegrationTest { throw new RuntimeException(e); } } - - public static URL getUrlToEba(String groupId, String artifactId) throws MalformedURLException { - String artifactVersion = getArtifactVersion(groupId, artifactId); - - // Need to use handler from org.ops4j.pax.url.aether - URL urlToEba = new URL(null, - ServiceConstants.PROTOCOL + ":" + groupId + "/" +artifactId + "/" - + artifactVersion + "/eba", new Handler()); - return urlToEba; - } } diff --git a/samples/blueprint/helloworld/pom.xml b/samples/blueprint/helloworld/pom.xml index d41ef5a73..99102e148 100644 --- a/samples/blueprint/helloworld/pom.xml +++ b/samples/blueprint/helloworld/pom.xml @@ -64,7 +64,6 @@ <module>helloworld-server</module> <module>helloworld-client</module> <module>helloworld-assembly</module> - <module>helloworld-eba</module> <module>helloworld-itests</module> </modules> diff --git a/samples/blueprint/idverifier/pom.xml b/samples/blueprint/idverifier/pom.xml index 06e72a8d2..4e5efdbef 100644 --- a/samples/blueprint/idverifier/pom.xml +++ b/samples/blueprint/idverifier/pom.xml @@ -37,12 +37,6 @@ <artifactId>org.apache.aries.samples.blueprint.idverifier.api</artifactId> <version>${project.version}</version> </dependency> - <dependency> - <groupId>org.apache.aries.samples.blueprint.idverifier</groupId> - <artifactId>org.apache.aries.samples.blueprint.idverifier.assembly</artifactId> - <type>eba</type> - <version>${project.version}</version> - </dependency> <dependency> <groupId>org.apache.aries.samples.blueprint.idverifier</groupId> <artifactId>org.apache.aries.samples.blueprint.idverifier.client</artifactId>
