Skip to content
This repository has been archived by the owner on Feb 12, 2018. It is now read-only.

Commit

Permalink
#38 Added an integration test for test-compile-javanano mojo
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-ivanov committed Sep 15, 2015
1 parent ca50e1b commit 5e991ee
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/it/TEST-27/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# An optional description for this build job to be included in the build reports.
invoker.description = Verifies that javanano generation works for test protos

# A comma or space separated list of goals/phases to execute, may
# specify an empty list to execute the default goal of the IT project
invoker.goals = clean generate-test-sources
53 changes: 53 additions & 0 deletions src/it/TEST-27/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>

<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>
<groupId>com.google.protobuf.tools.maven-protoc-plugin.its</groupId>
<artifactId>it-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>TEST-27</artifactId>
<version>0.0.1-SNAPSHOT</version>

<name>Integration Test 27</name>

<properties>
<protobufVersion>3.0.0-alpha-3</protobufVersion>
</properties>

<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.3.0.Final</version>
</extension>
</extensions>

<plugins>
<plugin>
<groupId>com.google.protobuf.tools</groupId>
<artifactId>maven-protoc-plugin</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<goals>
<goal>test-compile-javanano</goal>
</goals>
<configuration>
<protocArtifact>com.google.protobuf:protoc:${protobufVersion}:exe:${os.detected.classifier}
</protocArtifact>
<javaNanoOptions>parcelable_messages=true</javaNanoOptions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
7 changes: 7 additions & 0 deletions src/it/TEST-27/src/test/proto/test.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
syntax = "proto3";

option java_package = "test";
option java_outer_classname = "TestProtos";

message TestMessage {
}
14 changes: 14 additions & 0 deletions src/it/TEST-27/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
outputDirectory = new File(basedir, 'target/generated-test-sources/protobuf/javanano');
assert outputDirectory.exists();
assert outputDirectory.isDirectory();

generatedJavaFile = new File(outputDirectory, 'test/TestProtos.java');
assert generatedJavaFile.exists();
assert generatedJavaFile.isFile();

content = generatedJavaFile.text;
assert content.contains('package test');
assert content.contains('class Test');
assert content.contains('class TestMessage');

return true;

0 comments on commit 5e991ee

Please sign in to comment.