Skip to content

Commit

Permalink
chore: ignore robolectric test
Browse files Browse the repository at this point in the history
  • Loading branch information
juherr committed Aug 25, 2024
1 parent f9226d4 commit ba17d01
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
22 changes: 22 additions & 0 deletions jsonschema2pojo-integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,26 @@
</dependency>
</dependencies>

<profiles>
<profile>
<id>ignore-android</id>
<activation>
<jdk>[1.9,)</jdk>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<excludes>
<exclude>org.jsonschema2pojo.integration.config.ParcelableIT</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static org.hamcrest.Matchers.*;
import static org.jsonschema2pojo.integration.util.CodeGenerationHelper.*;
import static org.jsonschema2pojo.integration.util.ParcelUtils.*;
import static org.junit.Assume.assumeTrue;

import java.io.File;
import java.io.IOException;
Expand All @@ -45,13 +44,10 @@
@Config(manifest=Config.NONE, sdk=23)
public class ParcelableIT {

private static final boolean JAVA_8_OR_EARLIER = System.getProperty("java.specification.version").compareTo("1.9") < 0;

@Rule public Jsonschema2PojoRule schemaRule = new Jsonschema2PojoRule();

@Test
public void parcelableTreeIsParcelable() throws ClassNotFoundException, IOException {
assumeTrue(JAVA_8_OR_EARLIER);
Class<?> parcelableType = schemaRule.generateAndCompile("/schema/parcelable/parcelable-schema.json", "com.example",
config("parcelable", true))
.loadClass("com.example.ParcelableSchema");
Expand All @@ -66,7 +62,6 @@ public void parcelableTreeIsParcelable() throws ClassNotFoundException, IOExcept

@Test
public void parcelableTypeDoesNotHaveAnyDuplicateImports() throws ClassNotFoundException, IOException {
assumeTrue(JAVA_8_OR_EARLIER);
schemaRule.generate("/schema/parcelable/parcelable-schema.json", "com.example", config("parcelable", true));
File generated = schemaRule.generated("com/example/ParcelableSchema.java");
String content = FileUtils.readFileToString(generated);
Expand All @@ -80,7 +75,6 @@ public void parcelableTypeDoesNotHaveAnyDuplicateImports() throws ClassNotFoundE

@Test
public void parcelableSuperclassIsUnparceled() throws ClassNotFoundException, IOException {
assumeTrue(JAVA_8_OR_EARLIER);
// Explicitly set includeConstructors to false if default value changes in the future
Class<?> parcelableType = schemaRule.generateAndCompile("/schema/parcelable/parcelable-superclass-schema.json", "com.example",
config("parcelable", true, "includeConstructors", false))
Expand All @@ -95,7 +89,6 @@ public void parcelableSuperclassIsUnparceled() throws ClassNotFoundException, IO

@Test
public void parcelableDefaultConstructorDoesNotConflict() throws ClassNotFoundException, IOException {
assumeTrue(JAVA_8_OR_EARLIER);
Class<?> parcelableType = schemaRule.generateAndCompile("/schema/parcelable/parcelable-superclass-schema.json", "com.example",
config("parcelable", true, "includeConstructors", true))
.loadClass("com.example.ParcelableSuperclassSchema");
Expand Down
25 changes: 20 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<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">
<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>

Expand Down Expand Up @@ -311,6 +312,20 @@
<!-- latest ecj build with 1.8 target, next 11 -->
<ecj.version>3.26.0</ecj.version>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>org.jsonschema2pojo.integration.config.ParcelableIT</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>jdk11</id>
Expand Down Expand Up @@ -548,10 +563,10 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.robolectric</groupId>
<artifactId>robolectric</artifactId>
<version>${robolectric.version}</version>
<scope>test</scope>
<groupId>org.robolectric</groupId>
<artifactId>robolectric</artifactId>
<version>${robolectric.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.skyscreamer</groupId>
Expand Down

0 comments on commit ba17d01

Please sign in to comment.