Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added HelloWorld tests #269

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<!-- Dependency versions -->
<version.arquillian.junit>1.9.1.Final</version.arquillian.junit>
<version.checkstyle.config>1.0.8.Final</version.checkstyle.config>
<version.grpc>1.65.1</version.grpc>
<version.grpc>1.66.0</version.grpc>
<version.javax.annotation>1.3.2</version.javax.annotation>
<version.kotlin.stdlib>2.0.0</version.kotlin.stdlib>
<version.okhttp>4.12.0</version.okhttp>
Expand Down
40 changes: 36 additions & 4 deletions subsystem/src/main/resources/schema/grpc-subsystem_1_0.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
targetNamespace="urn:wildfly:grpc:1.0"
xmlns="urn:wildfly:grpc:1.0"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="1.0">

<!-- The subsystem root element -->
<xs:element name="subsystem" type="grpc-subsystemType"/>

<xs:complexType name="grpc-subsystemType">
<xs:annotation>
<xs:documentation>
Expand All @@ -33,7 +32,40 @@
]]>
</xs:documentation>
</xs:annotation>
<xs:attribute name="server-host" type="xs:string"/>
<xs:attribute name="server-port" type="xs:positiveInteger"/>
<xs:attribute name="flow-control-window" type="nonnegativeJavaInt"/>
<xs:attribute name="handshake-timeout" type="nonnegativeJavaInt" />
<xs:attribute name="initial-flow-control-window" type="nonnegativeJavaInt" />
<xs:attribute name="keep-alive-time" type="nonnegativeJavaInt" />
<xs:attribute name="keep-alive-timeout" type="nonnegativeJavaInt" />
<xs:attribute name="key-manager-name" type="xs:string"/>
<xs:attribute name="max-concurrent-calls-per-connection" type="nonnegativeJavaInt" />
<xs:attribute name="max-connection-age" type="nonnegativeJavaInt" />
<xs:attribute name="max-connection-age-grace" type="nonnegativeJavaInt" />
<xs:attribute name="max-connection-idle" type="nonnegativeJavaInt" />
<xs:attribute name="max-inbound-message-size" type="nonnegativeJavaInt" />
<xs:attribute name="max-inbound-metadata-size" type="nonnegativeJavaInt" />
<xs:attribute name="permit-keep-alive-time" type="nonnegativeJavaInt" />
<xs:attribute name="permit-keep-alive-without-calls" type="xs:boolean" />
<xs:attribute name="protocol-provider" type="xs:string"/>
<xs:attribute name="server-host" type="xs:string"/>
<xs:attribute name="server-port" type="xs:positiveInteger"/>
<xs:attribute name="session-cache-size" type="nonnegativeJavaLong" />
<xs:attribute name="session-timeout" type="nonnegativeJavaLong" />
<xs:attribute name="shutdown-timeout" type="nonnegativeJavaInt" />
<xs:attribute name="ssl-context-name" type="xs:string"/>
<xs:attribute name="start-tls" type="xs:boolean" />
<xs:attribute name="trust-manager-name" type="xs:string"/>
</xs:complexType>

<xs:simpleType name="nonnegativeJavaInt" id="nonnegativeJavaInt">
<xs:restriction base="xs:unsignedLong">
<xs:maxInclusive value="2147483647"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="nonnegativeJavaLong" id="nonnegativeJavaLong">
<xs:restriction base="xs:unsignedLong">
<xs:maxInclusive value="9223372036854775807"/>
</xs:restriction>
</xs:simpleType>

</xs:schema>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest;
import org.jboss.as.subsystem.test.AdditionalInitialization;
import org.junit.Test;

/**
* @author <a href="mailto:kabir.khan@jboss.com">Kabir Khan</a>
Expand All @@ -43,4 +44,9 @@ protected String getSubsystemXsdPath() {
protected AdditionalInitialization createAdditionalInitialization() {
return AdditionalInitialization.withCapabilities("org.wildfly.weld");
}

@Test
public void testExpressions() throws Exception {
standardSubsystemTest("grpc-subsystem-expressions.xml", false);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!--

Copyright 2024 Red Hat

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://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.

-->
<subsystem xmlns="urn:wildfly:grpc:1.0"
flow-control-window="${test.flow-control-window:3}"
handshake-timeout="${test.handshake-timeout:5}"
initial-flow-control-window="${test.initial-flow-control-window:7}"
keep-alive-time="${test.keep-alive-time:11}"
keep-alive-timeout="${test.keep-alive-timeout:13}"
key-manager-name="${test.key-manager-name:aaa}"
max-concurrent-calls-per-connection="${test.max-concurrent-calls-per-connection:17}"
max-connection-age="${test.max-connection-age:19}"
max-connection-age-grace="${test.max-connection-age-grace:23}"
max-connection-idle="${test.max-connection-idle:29}"
max-inbound-message-size="${test.max-inbound-message-size:31}"
max-inbound-metadata-size="${test.max-inbound-metadata-size:37}"
permit-keep-alive-time="${test.permit-keep-alive-time:39}"
permit-keep-alive-without-calls="${test.permit-keep-alive-without-calls:true}"
protocol-provider="${test.protocol-provider:bbb}"
server-host="${test.server-host:ccc}"
server-port="${test.server-port:43}"
session-cache-size="${test.session-cache-size:47}"
session-timeout="${test.session-timeout:51}"
shutdown-timeout="${test.shutdown-timeout:53}"
ssl-context-name="${test.ssl-context-name:ddd}"
start-tls="${test.start-tls:true}"
trust-manager-name="${test.trust-manager-name:eee}"
/>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--

Copyright 2022 Red Hat
Copyright 2024 Red Hat

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -15,4 +15,9 @@
limitations under the License.

-->
<subsystem xmlns="urn:wildfly:grpc:1.0" server-host="localhost" server-port="10999" />
<subsystem xmlns="urn:wildfly:grpc:1.0" flow-control-window="3" handshake-timeout="5" initial-flow-control-window="7"
keep-alive-time="11" keep-alive-timeout="13" key-manager-name="aaa" max-concurrent-calls-per-connection="17"
max-connection-age="19" max-connection-age-grace="23" max-connection-idle="29" max-inbound-message-size="31"
max-inbound-metadata-size="37" permit-keep-alive-time="39" permit-keep-alive-without-calls="true"
protocol-provider="bbb" server-host="ccc" server-port="43" session-cache-size="47" session-timeout="51"
shutdown-timeout="53" ssl-context-name="ddd" start-tls="true" trust-manager-name="eee" />
16 changes: 16 additions & 0 deletions testsuite/integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-dmr</artifactId>
<version>1.7.0.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
Expand All @@ -61,10 +66,21 @@
<artifactId>shrinkwrap-impl-base</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-common</artifactId>
<version>5.1.0.Beta4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-controller-client</artifactId>
<version>25.0.0.Final</version>
</dependency>
</dependencies>
</project>
206 changes: 134 additions & 72 deletions testsuite/integration/subsystem/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,80 +16,142 @@
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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>wildfly-grpc-testsuite-integration</artifactId>
<groupId>org.wildfly.extras.grpc</groupId>
<version>0.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<parent>
<artifactId>wildfly-grpc-testsuite-integration</artifactId>
<groupId>org.wildfly.extras.grpc</groupId>
<version>0.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>wildfly-grpc-testsuite-integration-subsystem</artifactId>
<name>WildFly gRPC :: Test Suite :: Integration :: Subsystem</name>
<artifactId>wildfly-grpc-testsuite-integration-subsystem</artifactId>
<name>WildFly gRPC :: Test Suite :: Integration :: Subsystem</name>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>wildfly-grpc-feature-pack</artifactId>
<type>pom</type>
<scope>provided</scope>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>wildfly-grpc-feature-pack</artifactId>
<type>pom</type>
<scope>provided</scope>
</dependency>

<build>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<feature-packs>
<feature-pack>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-galleon-pack</artifactId>
<version>${version.wildfly}</version>
</feature-pack>
<feature-pack>
<groupId>${project.groupId}</groupId>
<artifactId>wildfly-grpc-feature-pack</artifactId>
<version>${project.version}</version>
</feature-pack>
</feature-packs>
<layers>
<layer>web-server</layer>
<layer>jmx-remoting</layer>
<!-- Layers from this FP -->
<layer>grpc</layer>
</layers>
<galleon-options>
<jboss-fork-embedded>${galleon.fork.embedded}</jboss-fork-embedded>
</galleon-options>
<provisioning-dir>wildfly</provisioning-dir>
<log-provisioning-time>${galleon.log.time}</log-provisioning-time>
<offline>true</offline>
</configuration>
<executions>
<execution>
<id>server-provisioning</id>
<goals>
<goal>provision</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables combine.children="append">
<jboss.install.dir>${jboss.dist}</jboss.install.dir>
<server.jvm.args>${server.jvm.args}</server.jvm.args>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>failureaccess</artifactId>
</dependency>
<dependency>
<groupId>org.wildfly.extras.grpc</groupId>
<artifactId>wildfly-grpc-subsystem</artifactId>
</dependency>
</dependencies>

<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.6.1</version>
<executions>
<execution>
<id>compile-proto</id>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
<configuration>
<pluginId>grpc-java</pluginId>
<protocArtifact>
com.google.protobuf:protoc:${version.protobuf}:exe:${os.detected.classifier}</protocArtifact>
<pluginArtifact>
io.grpc:protoc-gen-grpc-java:${version.grpc}:exe:${os.detected.classifier}</pluginArtifact>
<protoSourceRoot>
/home/rsigal/tmp/wildfly.grpc.v014/wildfly-grpc-feature-pack/testsuite/integration/subsystem/src/main/proto/</protoSourceRoot>
<clearOutputDirectory>true</clearOutputDirectory>
<includes>
<include>helloworld.proto</include>
<include>chat.proto</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<feature-packs>
<feature-pack>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-galleon-pack</artifactId>
<version>${version.wildfly}</version>
</feature-pack>
<feature-pack>
<groupId>${project.groupId}</groupId>
<artifactId>wildfly-grpc-feature-pack</artifactId>
<version>${project.version}</version>
</feature-pack>
</feature-packs>
<layers>
<layer>web-server</layer>
<layer>jmx-remoting</layer>
<!-- Layers from this FP -->
<layer>grpc</layer>
</layers>
<galleon-options>
<jboss-fork-embedded>${galleon.fork.embedded}</jboss-fork-embedded>
</galleon-options>
<provisioning-dir>wildfly</provisioning-dir>
<log-provisioning-time>${galleon.log.time}</log-provisioning-time>
<offline>true</offline>
</configuration>
<executions>
<execution>
<id>server-provisioning</id>
<goals>
<goal>provision</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables combine.children="append">
<jboss.install.dir>${jboss.dist}</jboss.install.dir>
<server.jvm.args>${server.jvm.args}</server.jvm.args>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading
Loading