Skip to content

Commit 30702e7

Browse files
authored
Initial code migration (#1)
* Reformatted all source files * Separated unit and integration tests * Added maven checkstyle plugin * Got the basic build and unit tests working * Scrubbed the codebase for private keys, certificates etc. * Reformatting code according to check-style plugin conventions * Code reformatting: Fixing javadoc indentation * More reformatting: Added google check style config * Code formatting continued * Fixed all checkstyle violations; Build configured to fail on lint errors * Updated checkstyle config * Working on re-enabling the integration tests * Temporarily removing IT test cases * Extending checkstyle coverage to test sources * Cleaned up verbose test output * Adding 2 integration tests to verify the maven integration test support * Moving test only trampolines to the test/ subtree; Adding a removed method
1 parent 329f447 commit 30702e7

File tree

304 files changed

+51456
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

304 files changed

+51456
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
target/
2+
.idea/
3+
.settings/
4+
*.iml
5+
.classpath
6+
.project

checkstyle.xml

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4+
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
5+
6+
<!--
7+
Checkstyle configuration that checks the Google coding conventions from Google Java Style
8+
that can be found at https://google.github.io/styleguide/javaguide.html.
9+
10+
Checkstyle is very configurable. Be sure to read the documentation at
11+
http://checkstyle.sf.net (or in your downloaded distribution).
12+
13+
To completely disable a check, just comment it out or delete it from the file.
14+
15+
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
16+
-->
17+
18+
<module name="Checker">
19+
<property name="charset" value="UTF-8"/>
20+
21+
<property name="severity" value="error"/>
22+
23+
<property name="fileExtensions" value="java, properties, xml"/>
24+
<!-- Checks for whitespace -->
25+
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
26+
<module name="FileTabCharacter">
27+
<property name="eachLine" value="true"/>
28+
</module>
29+
30+
<module name="SuppressionCommentFilter">
31+
<property name="offCommentFormat" value="CSOFF\: ([\w\|]+)"/>
32+
<property name="onCommentFormat" value="CSON\: ([\w\|]+)"/>
33+
<property name="checkFormat" value="$1"/>
34+
</module>
35+
36+
<module name="TreeWalker">
37+
<module name="FileContentsHolder"/>
38+
<module name="OuterTypeFilename"/>
39+
<module name="IllegalTokenText">
40+
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
41+
<property name="format"
42+
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
43+
<property name="message"
44+
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
45+
</module>
46+
<module name="AvoidEscapedUnicodeCharacters">
47+
<property name="allowEscapesForControlCharacters" value="true"/>
48+
<property name="allowByTailComment" value="true"/>
49+
<property name="allowNonPrintableEscapes" value="true"/>
50+
</module>
51+
<module name="LineLength">
52+
<property name="max" value="100"/>
53+
<property name="ignorePattern"
54+
value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
55+
</module>
56+
<module name="AvoidStarImport"/>
57+
<module name="OneTopLevelClass"/>
58+
<module name="NoLineWrap"/>
59+
<module name="EmptyBlock">
60+
<property name="option" value="TEXT"/>
61+
<property name="tokens"
62+
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
63+
</module>
64+
<module name="NeedBraces"/>
65+
<module name="LeftCurly">
66+
<property name="maxLineLength" value="100"/>
67+
</module>
68+
<module name="RightCurly">
69+
<property name="id" value="RightCurlySame"/>
70+
<property name="tokens"
71+
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE"/>
72+
</module>
73+
<module name="RightCurly">
74+
<property name="id" value="RightCurlyAlone"/>
75+
<property name="option" value="alone"/>
76+
<property name="tokens"
77+
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
78+
</module>
79+
<module name="WhitespaceAround">
80+
<property name="allowEmptyConstructors" value="true"/>
81+
<property name="allowEmptyMethods" value="true"/>
82+
<property name="allowEmptyTypes" value="true"/>
83+
<property name="allowEmptyLoops" value="true"/>
84+
<message key="ws.notFollowed"
85+
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
86+
<message key="ws.notPreceded"
87+
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
88+
</module>
89+
<module name="OneStatementPerLine"/>
90+
<module name="MultipleVariableDeclarations"/>
91+
<module name="ArrayTypeStyle"/>
92+
<module name="MissingSwitchDefault"/>
93+
<module name="FallThrough"/>
94+
<module name="UpperEll"/>
95+
<module name="ModifierOrder"/>
96+
<module name="EmptyLineSeparator">
97+
<property name="allowNoEmptyLineBetweenFields" value="true"/>
98+
</module>
99+
<module name="SeparatorWrap">
100+
<property name="id" value="SeparatorWrapDot"/>
101+
<property name="tokens" value="DOT"/>
102+
<property name="option" value="nl"/>
103+
</module>
104+
<module name="SeparatorWrap">
105+
<property name="id" value="SeparatorWrapComma"/>
106+
<property name="tokens" value="COMMA"/>
107+
<property name="option" value="EOL"/>
108+
</module>
109+
<module name="PackageName">
110+
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
111+
<message key="name.invalidPattern"
112+
value="Package name ''{0}'' must match pattern ''{1}''."/>
113+
</module>
114+
<module name="TypeName">
115+
<message key="name.invalidPattern"
116+
value="Type name ''{0}'' must match pattern ''{1}''."/>
117+
</module>
118+
<module name="MemberName">
119+
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
120+
<message key="name.invalidPattern"
121+
value="Member name ''{0}'' must match pattern ''{1}''."/>
122+
</module>
123+
<module name="ParameterName">
124+
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
125+
<message key="name.invalidPattern"
126+
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
127+
</module>
128+
<module name="LocalVariableName">
129+
<property name="tokens" value="VARIABLE_DEF"/>
130+
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
131+
<message key="name.invalidPattern"
132+
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
133+
</module>
134+
<module name="ClassTypeParameterName">
135+
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
136+
<message key="name.invalidPattern"
137+
value="Class type name ''{0}'' must match pattern ''{1}''."/>
138+
</module>
139+
<module name="MethodTypeParameterName">
140+
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
141+
<message key="name.invalidPattern"
142+
value="Method type name ''{0}'' must match pattern ''{1}''."/>
143+
</module>
144+
<module name="InterfaceTypeParameterName">
145+
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
146+
<message key="name.invalidPattern"
147+
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
148+
</module>
149+
<module name="NoFinalizer"/>
150+
<module name="GenericWhitespace">
151+
<message key="ws.followed"
152+
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
153+
<message key="ws.preceded"
154+
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
155+
<message key="ws.illegalFollow"
156+
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
157+
<message key="ws.notPreceded"
158+
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
159+
</module>
160+
<module name="Indentation">
161+
<property name="basicOffset" value="2"/>
162+
<property name="braceAdjustment" value="0"/>
163+
<property name="caseIndent" value="2"/>
164+
<property name="throwsIndent" value="4"/>
165+
<property name="lineWrappingIndentation" value="4"/>
166+
<property name="arrayInitIndent" value="2"/>
167+
</module>
168+
<module name="AbbreviationAsWordInName">
169+
<property name="ignoreFinal" value="false"/>
170+
<property name="allowedAbbreviationLength" value="4"/>
171+
</module>
172+
<module name="OverloadMethodsDeclarationOrder"/>
173+
<module name="VariableDeclarationUsageDistance"/>
174+
<module name="CustomImportOrder">
175+
<property name="sortImportsInGroupAlphabetically" value="true"/>
176+
<property name="separateLineBetweenGroups" value="true"/>
177+
<property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>
178+
</module>
179+
<module name="MethodParamPad"/>
180+
<module name="ParenPad"/>
181+
<module name="OperatorWrap">
182+
<property name="option" value="NL"/>
183+
<property name="tokens"
184+
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
185+
</module>
186+
<module name="AnnotationLocation">
187+
<property name="id" value="AnnotationLocationMostCases"/>
188+
<property name="tokens"
189+
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
190+
</module>
191+
<module name="AnnotationLocation">
192+
<property name="id" value="AnnotationLocationVariables"/>
193+
<property name="tokens" value="VARIABLE_DEF"/>
194+
<property name="allowSamelineMultipleAnnotations" value="true"/>
195+
</module>
196+
<module name="NonEmptyAtclauseDescription"/>
197+
<module name="JavadocTagContinuationIndentation"/>
198+
<!--module name="SummaryJavadoc">
199+
<property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
200+
</module-->
201+
<module name="JavadocParagraph"/>
202+
<module name="AtclauseOrder">
203+
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
204+
<property name="target"
205+
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
206+
</module>
207+
<module name="JavadocMethod">
208+
<property name="scope" value="public"/>
209+
<property name="allowMissingParamTags" value="true"/>
210+
<property name="allowMissingThrowsTags" value="true"/>
211+
<property name="allowMissingReturnTag" value="true"/>
212+
<property name="minLineCount" value="2"/>
213+
<property name="allowedAnnotations" value="Override, Test"/>
214+
<property name="allowThrowsTagsForSubclasses" value="true"/>
215+
<property name="allowMissingJavadoc" value="true"/>
216+
</module>
217+
<module name="MethodName">
218+
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
219+
<message key="name.invalidPattern"
220+
value="Method name ''{0}'' must match pattern ''{1}''."/>
221+
</module>
222+
<module name="SingleLineJavadoc">
223+
<property name="ignoreInlineTags" value="false"/>
224+
</module>
225+
<module name="EmptyCatchBlock">
226+
<property name="exceptionVariableName" value="expected"/>
227+
</module>
228+
<module name="CommentsIndentation"/>
229+
</module>
230+
</module>

pom.xml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xmlns="http://maven.apache.org/POM/4.0.0"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.google.firebase</groupId>
7+
<artifactId>firebase-admin</artifactId>
8+
<version>4.1.7-SNAPSHOT</version>
9+
<packaging>jar</packaging>
10+
11+
<name>firebase-admin</name>
12+
<url>http://maven.apache.org</url>
13+
14+
<properties>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
17+
</properties>
18+
19+
<build>
20+
<plugins>
21+
<plugin>
22+
<artifactId>maven-checkstyle-plugin</artifactId>
23+
<version>2.17</version>
24+
<executions>
25+
<execution>
26+
<id>validate</id>
27+
<phase>validate</phase>
28+
<configuration>
29+
<configLocation>checkstyle.xml</configLocation>
30+
<encoding>UTF-8</encoding>
31+
<consoleOutput>true</consoleOutput>
32+
<failsOnError>true</failsOnError>
33+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
34+
</configuration>
35+
<goals>
36+
<goal>check</goal>
37+
</goals>
38+
</execution>
39+
</executions>
40+
</plugin>
41+
<plugin>
42+
<artifactId>maven-compiler-plugin</artifactId>
43+
<version>3.6.1</version>
44+
<configuration>
45+
<source>1.7</source>
46+
<target>1.7</target>
47+
</configuration>
48+
</plugin>
49+
<plugin>
50+
<artifactId>maven-surefire-plugin</artifactId>
51+
<version>2.19.1</version>
52+
<configuration>
53+
<skipTests>${skip.surefire.tests}</skipTests>
54+
</configuration>
55+
</plugin>
56+
<plugin>
57+
<artifactId>maven-failsafe-plugin</artifactId>
58+
<version>2.19.1</version>
59+
<configuration>
60+
<includes>
61+
<include>**/*IT.java</include>
62+
</includes>
63+
</configuration>
64+
<executions>
65+
<execution>
66+
<id>integration-test</id>
67+
<phase>integration-test</phase>
68+
<goals>
69+
<goal>integration-test</goal>
70+
<goal>verify</goal>
71+
</goals>
72+
</execution>
73+
</executions>
74+
</plugin>
75+
</plugins>
76+
</build>
77+
78+
<dependencies>
79+
<dependency>
80+
<groupId>com.google.api-client</groupId>
81+
<artifactId>google-api-client</artifactId>
82+
<version>1.22.0</version>
83+
</dependency>
84+
<dependency>
85+
<groupId>com.google.api-client</groupId>
86+
<artifactId>google-api-client-gson</artifactId>
87+
<version>1.22.0</version>
88+
</dependency>
89+
<dependency>
90+
<groupId>org.json</groupId>
91+
<artifactId>json</artifactId>
92+
<version>20160810</version>
93+
</dependency>
94+
<dependency>
95+
<groupId>com.google.guava</groupId>
96+
<artifactId>guava</artifactId>
97+
<version>21.0</version>
98+
</dependency>
99+
<dependency>
100+
<groupId>org.mockito</groupId>
101+
<artifactId>mockito-core</artifactId>
102+
<version>2.7.21</version>
103+
<scope>test</scope>
104+
</dependency>
105+
<dependency>
106+
<groupId>net.java.quickcheck</groupId>
107+
<artifactId>quickcheck</artifactId>
108+
<version>0.6</version>
109+
<scope>test</scope>
110+
</dependency>
111+
<dependency>
112+
<groupId>org.codehaus.jackson</groupId>
113+
<artifactId>jackson-mapper-asl</artifactId>
114+
<version>1.9.13</version>
115+
<scope>test</scope>
116+
</dependency>
117+
<dependency>
118+
<groupId>org.hamcrest</groupId>
119+
<artifactId>hamcrest-library</artifactId>
120+
<version>1.3</version>
121+
<scope>test</scope>
122+
</dependency>
123+
<dependency>
124+
<groupId>com.firebase</groupId>
125+
<artifactId>firebase-token-generator</artifactId>
126+
<version>2.0.0</version>
127+
<scope>test</scope>
128+
</dependency>
129+
<dependency>
130+
<groupId>junit</groupId>
131+
<artifactId>junit</artifactId>
132+
<version>4.12</version>
133+
<scope>test</scope>
134+
</dependency>
135+
</dependencies>
136+
</project>

0 commit comments

Comments
 (0)