Skip to content

Merge annotation-processor-test into annotation-processor #44639

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
1 change: 0 additions & 1 deletion eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ io.clientcore:http-okhttp3;1.0.0-beta.1;1.0.0-beta.2
io.clientcore:http-stress;1.0.0-beta.1;1.0.0-beta.1
io.clientcore:optional-dependency-tests;1.0.0-beta.1;1.0.0-beta.1
io.clientcore:annotation-processor;1.0.0-beta.1;1.0.0-beta.1
io.clientcore:annotation-processor-test;1.0.0-beta.1;1.0.0-beta.1


# Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current
Expand Down
3 changes: 0 additions & 3 deletions sdk/clientcore/annotation-processor-test/CHANGELOG.md

This file was deleted.

19 changes: 0 additions & 19 deletions sdk/clientcore/annotation-processor-test/README.md

This file was deleted.

177 changes: 0 additions & 177 deletions sdk/clientcore/annotation-processor-test/pom.xml

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
<!-- This file is generated by the /eng/scripts/linting_suppression_generator.py script. -->

<suppressions>
<suppress files="TestInterfaceClientServiceImpl.java" checks="FinalClassCheck" />
<suppress files="TestInterfaceClientServiceImpl.java" checks="JavadocPackageCheck" />
<suppress files="io.clientcore.annotation.processor.integration.PagingOperationTests.java" checks="MissingDeprecatedCheck" />
<suppress files="TestInterfaceClientServiceImpl.java" checks="MissingJavadocTypeCheck" />
<suppress files="io.clientcore.annotation.processor.utils.ResponseBodyModeGeneration.java" checks="com.azure.tools.checkstyle.checks.ExternalDependencyExposedCheck" />
<suppress files="TestInterfaceClientServiceImpl.java" checks="com.azure.tools.checkstyle.checks.GoodLoggingCheck" />
<suppress files="io.clientcore.annotation.processor.AnnotationProcessor.java" checks="com.azure.tools.checkstyle.checks.ThrowFromClientLoggerCheck" />
<suppress files="io.clientcore.annotation.processor.models.HttpRequestContext.java" checks="com.azure.tools.checkstyle.checks.ThrowFromClientLoggerCheck" />
<suppress files="TestInterfaceClientServiceImpl.java" checks="com.azure.tools.checkstyle.checks.ThrowFromClientLoggerCheck" />
</suppressions>
3 changes: 0 additions & 3 deletions sdk/clientcore/annotation-processor/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,3 @@ extends:
groupId: io.clientcore
safeName: annotationprocessor
releaseInBatch: ${{ parameters.release_clientcoreannotationprocessor }}
AdditionalModules:
- name: annotation-processor-test
groupId: io.clientcore
73 changes: 73 additions & 0 deletions sdk/clientcore/annotation-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,31 @@
</dependency>

<!-- Unit Test -->
<dependency>
<groupId>io.clientcore</groupId>
<artifactId>core</artifactId>
<version>1.0.0-beta.7</version> <!-- {x-version-update;unreleased_io.clientcore:core;dependency} -->
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.clientcore</groupId>
<artifactId>http-okhttp3</artifactId>
<version>1.0.0-beta.2</version> <!-- {x-version-update;io.clientcore:http-okhttp3;current} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>9.4.56.v20240826</version> <!-- {x-version-update;org.eclipse.jetty:jetty-server;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>9.4.56.v20240826</version> <!-- {x-version-update;org.eclipse.jetty:jetty-servlet;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Expand Down Expand Up @@ -150,6 +175,54 @@
</rules>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version> <!-- {x-version-update;org.apache.maven.plugins:maven-compiler-plugin;external_dependency} -->
<executions>
<execution>
<id>run-annotation-processing</id>
<phase>generate-test-sources</phase>
<goals>
<goal>testCompile</goal>
</goals>

<configuration>
<release>11</release>
<proc>only</proc>
<generatedTestSourcesDirectory>${project.build.directory}/generated-test-sources/</generatedTestSourcesDirectory>
<annotationProcessors>
<annotationProcessor>io.clientcore.annotation.processor.AnnotationProcessor</annotationProcessor>
</annotationProcessors>

<compilerArgs>
<arg>-Xlint:-options</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.6.0</version> <!-- {x-version-update;org.codehaus.mojo:build-helper-maven-plugin;external_dependency} -->
<executions>
<execution>
<id>add-generated-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/target/generated-test-sources</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
16 changes: 16 additions & 0 deletions sdk/clientcore/annotation-processor/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,28 @@
<Bug pattern="BC_UNCONFIRMED_CAST" />
<Class name="io.clientcore.annotation.processor.models.TemplateInput" />
</Match>
<Match>
<Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE" />
<Class name="io.clientcore.annotation.processor.integration.implementation.TestInterfaceClientServiceImpl" />
</Match>
<Match>
<Bug pattern="DCN_NULLPOINTER_EXCEPTION" />
<Class name="io.clientcore.annotation.processor.utils.PathBuilderTest" />
</Match>
<Match>
<Bug pattern="DLS_DEAD_LOCAL_STORE" />
<Class name="io.clientcore.annotation.processor.integration.implementation.TestInterfaceClientServiceImpl" />
</Match>
<Match>
<Bug pattern="DM_DEFAULT_ENCODING" />
<Class name="io.clientcore.annotation.processor.integration.RestProxyTests" />
</Match>
<Match>
<Bug pattern="NM_CONFUSING" />
<Class name="io.clientcore.annotation.processor.templating.BodyContentTypeProcessorTest" />
</Match>
<Match>
<Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS" />
<Class name="io.clientcore.annotation.processor.integration.implementation.TestInterfaceClientServiceImpl" />
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ void addImports(TemplateInput templateInput) {
}

void addOrphanComments() {
compilationUnit.addOrphanComment(new LineComment("Copyright (c) Microsoft Corporation. All rights reserved."));
compilationUnit.addOrphanComment(new LineComment("Licensed under the MIT License."));
compilationUnit.addOrphanComment(new LineComment(" Copyright (c) Microsoft Corporation. All rights reserved."));
compilationUnit.addOrphanComment(new LineComment(" Licensed under the MIT License."));
}

void setPackageDeclaration(String packageName) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package io.clientcore.annotation.processor.test;
package io.clientcore.annotation.processor.integration;

import io.clientcore.core.http.client.HttpClient;
import io.clientcore.core.http.models.HttpHeaderName;
Expand All @@ -28,8 +28,8 @@ public Response<BinaryData> send(HttpRequest request) {
if (request.getHttpMethod().equals(HttpMethod.POST)) {
success &= "application/json".equals(request.getHeaders().getValue(HttpHeaderName.CONTENT_TYPE));
} else {
success &= request.getHttpMethod().equals(HttpMethod.GET)
|| request.getHttpMethod().equals(HttpMethod.HEAD);
success
&= request.getHttpMethod().equals(HttpMethod.GET) || request.getHttpMethod().equals(HttpMethod.HEAD);
}

return new Response<BinaryData>(request, success ? 200 : 400, new HttpHeaders(), BinaryData.empty()) {
Expand Down
Loading