Skip to content

Commit 6ea8bee

Browse files
committed
---
yaml --- r: 79 b: refs/heads/master c: 938b04d h: refs/heads/master i: 77: fe46d27 75: 40e4d27 71: 77af580 63: 096c02a v: v3
1 parent 3ff6612 commit 6ea8bee

11 files changed

Lines changed: 78 additions & 338 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 823eb9f76aea833253432af4412f403c62e2b9b5
2+
refs/heads/master: 938b04db4a2e034b976ee52abd241f51fa001ca4

trunk/.checkstyle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
4-
<fileset name="all" enabled="true" check-config-name="Copy of Google Checks" local="false">
4+
<fileset name="all" enabled="true" check-config-name="Google Checks" local="false">
55
<file-match-pattern match-pattern="." include-pattern="true"/>
66
</fileset>
77
</fileset-config>

trunk/.eclipse-pmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<eclipse-pmd xmlns="http://acanda.ch/eclipse-pmd/0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://acanda.ch/eclipse-pmd/0.8 http://acanda.ch/eclipse-pmd/eclipse-pmd-0.8.xsd">
33
<analysis enabled="true" />
44
<rulesets>
5-
<ruleset name="Project PMD settings" ref="pmd.xml" refcontext="project" />
5+
<ruleset name="Full PMD ruleset" ref="full-pmd-ruleset.xml" refcontext="project" />
66
</rulesets>
77
</eclipse-pmd>

trunk/.project

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@
3131
</arguments>
3232
</buildCommand>
3333
<buildCommand>
34-
<name>org.eclipse.m2e.core.maven2Builder</name>
34+
<name>org.eclipse.wst.validation.validationbuilder</name>
3535
<arguments>
3636
</arguments>
3737
</buildCommand>
3838
<buildCommand>
39-
<name>org.eclipse.wst.validation.validationbuilder</name>
39+
<name>ntut.csie.rleht.builder.RLBuilder</name>
4040
<arguments>
4141
</arguments>
4242
</buildCommand>
4343
<buildCommand>
44-
<name>ntut.csie.rleht.builder.RLBuilder</name>
44+
<name>ch.acanda.eclipse.pmd.builder.PMDBuilder</name>
4545
<arguments>
4646
</arguments>
4747
</buildCommand>
4848
<buildCommand>
49-
<name>ch.acanda.eclipse.pmd.builder.PMDBuilder</name>
49+
<name>org.eclipse.m2e.core.maven2Builder</name>
5050
<arguments>
5151
</arguments>
5252
</buildCommand>

trunk/.settings/org.eclipse.jdt.core.prefs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonN
88
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
99
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
1010
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
11+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
1112
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
1213
org.eclipse.jdt.core.compiler.compliance=1.7
1314
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
15+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
1416
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
1517
org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
1618
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -19,6 +21,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
1921
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
2022
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
2123
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
24+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
2225
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
2326
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
2427
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled

trunk/full-pmd-ruleset.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
name="full-pmd-ruleset"
5+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
6+
<description>Full 5.1.1 PMD rule set</description>
7+
<rule ref="rulesets/java/android.xml"/>
8+
<rule ref="rulesets/java/basic.xml"/>
9+
<rule ref="rulesets/ecmascript/basic.xml"/>
10+
<rule ref="rulesets/jsp/basic-jsf.xml"/>
11+
<rule ref="rulesets/jsp/basic.xml"/>
12+
<rule ref="rulesets/vm/basic.xml"/>
13+
<rule ref="rulesets/xml/basic.xml"/>
14+
<rule ref="rulesets/java/braces.xml"/>
15+
<rule ref="rulesets/ecmascript/braces.xml"/>
16+
<rule ref="rulesets/java/clone.xml"/>
17+
<rule ref="rulesets/plsql/codesize.xml"/>
18+
<rule ref="rulesets/java/codesize.xml"/>
19+
<rule ref="rulesets/java/comments.xml"/>
20+
<rule ref="rulesets/java/controversial.xml"/>
21+
<rule ref="rulesets/java/coupling.xml"/>
22+
<rule ref="rulesets/java/design.xml"/>
23+
<rule ref="rulesets/java/empty.xml"/>
24+
<rule ref="rulesets/java/basic.xml"/>
25+
<rule ref="rulesets/java/finalizers.xml"/>
26+
<rule ref="rulesets/java/imports.xml"/>
27+
<rule ref="rulesets/java/j2ee.xml"/>
28+
<rule ref="rulesets/java/junit.xml"/>
29+
<rule ref="rulesets/java/logging-jakarta-commons.xml"/>
30+
<rule ref="rulesets/java/logging-java.xml"/>
31+
<rule ref="rulesets/java/javabeans.xml"/>
32+
<rule ref="rulesets/java/migrating.xml"/>
33+
<rule ref="rulesets/java/naming.xml"/>
34+
<rule ref="rulesets/java/optimizations.xml"/>
35+
<rule ref="rulesets/plsql/dates.xml"/>
36+
<rule ref="rulesets/java/sunsecure.xml"/>
37+
<rule ref="rulesets/java/strictexception.xml"/>
38+
<rule ref="rulesets/java/strings.xml"/>
39+
<rule ref="rulesets/plsql/TomKytesDespair.xml"/>
40+
<rule ref="rulesets/ecmascript/unnecessary.xml"/>
41+
<rule ref="rulesets/java/unnecessary.xml"/>
42+
<rule ref="rulesets/java/basic.xml"/>
43+
<rule ref="rulesets/ecmascript/unnecessary.xml"/>
44+
<rule ref="rulesets/java/unusedcode.xml"/>
45+
<rule ref="rulesets/xsl/xpath.xml"/>
46+
</ruleset>

trunk/pmd.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
<rule ref="rulesets/java/basic.xml/CollapsibleIfStatements"/>
8181
<rule ref="rulesets/vm/basic.xml/CollapsibleIfStatements"/>
8282
<rule ref="rulesets/java/comments.xml/CommentContent"/>
83+
<rule ref="rulesets/java/comments.xml/CommentRequired"/>
8384
<rule ref="rulesets/java/comments.xml/CommentSize"/>
8485
<rule ref="rulesets/java/design.xml/CompareObjectsWithEquals"/>
8586
<rule ref="rulesets/java/design.xml/ConfusingTernary"/>
@@ -182,6 +183,7 @@
182183
<rule ref="rulesets/java/coupling.xml/LawOfDemeter"/>
183184
<rule ref="rulesets/java/j2ee.xml/LocalHomeNamingConvention"/>
184185
<rule ref="rulesets/java/j2ee.xml/LocalInterfaceSessionNamingConvention"/>
186+
<rule ref="rulesets/java/optimizations.xml/LocalVariableCouldBeFinal"/>
185187
<rule ref="rulesets/java/logging-java.xml/LoggerIsNotStaticFinal"/>
186188
<rule ref="rulesets/java/design.xml/LogicInversion"/>
187189
<rule ref="rulesets/java/migrating.xml/LongInstantiation"/>
@@ -331,4 +333,4 @@
331333
<rule ref="rulesets/java/naming.xml/VariableNamingConventions"/>
332334
<rule ref="rulesets/java/braces.xml/WhileLoopsMustUseBraces"/>
333335
<rule ref="rulesets/ecmascript/braces.xml/WhileLoopsMustUseBraces"/>
334-
</ruleset>
336+
</ruleset>

trunk/pom.xml

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -102,86 +102,13 @@
102102
</pluginRepositories>
103103
<build>
104104
<plugins>
105-
<plugin>
106-
<artifactId>maven-antrun-plugin</artifactId>
107-
<version>1.8</version>
108-
<executions>
109-
<execution>
110-
<id>before-integration-test</id>
111-
<phase>pre-integration-test</phase>
112-
<configuration>
113-
<target>
114-
<property name="test_classpath" refid="maven.test.classpath"/>
115-
<java classname="com.google.gcloud.datastore.LocalGcdHelper">
116-
<arg value="START"/>
117-
<classpath>
118-
<pathelement path="${test_classpath}" />
119-
</classpath>
120-
</java>
121-
</target>
122-
</configuration>
123-
<goals>
124-
<goal>run</goal>
125-
</goals>
126-
</execution>
127-
<execution>
128-
<id>after-integration-test</id>
129-
<phase>post-integration-test</phase>
130-
<configuration>
131-
<target>
132-
<property name="test_classpath" refid="maven.test.classpath"/>
133-
<java classname="com.google.gcloud.datastore.LocalGcdHelper">
134-
<arg value="STOP"/>
135-
<classpath>
136-
<pathelement path="${test_classpath}" />
137-
</classpath>
138-
</java>
139-
</target>
140-
</configuration>
141-
<goals>
142-
<goal>run</goal>
143-
</goals>
144-
</execution>
145-
</executions>
146-
</plugin>
147-
<plugin>
148-
<groupId>org.apache.maven.plugins</groupId>
149-
<artifactId>maven-surefire-plugin</artifactId>
150-
<version>2.18.1</version>
151-
<configuration>
152-
<excludes>
153-
<exclude>**/*IntegrationTest.java</exclude>
154-
</excludes>
155-
</configuration>
156-
</plugin>
157-
<plugin>
158-
<groupId>org.apache.maven.plugins</groupId>
159-
<artifactId>maven-failsafe-plugin</artifactId>
160-
<version>2.18.1</version>
161-
<configuration>
162-
<excludes>
163-
<exclude>none</exclude>
164-
</excludes>
165-
<includes>
166-
<include>**/*IntegrationTest.java</include>
167-
</includes>
168-
</configuration>
169-
<executions>
170-
<execution>
171-
<goals>
172-
<goal>integration-test</goal>
173-
<goal>verify</goal>
174-
</goals>
175-
</execution>
176-
</executions>
177-
</plugin>
178105
<plugin>
179106
<artifactId>maven-jar-plugin</artifactId>
180107
<version>2.5</version>
181108
</plugin>
182109
<plugin>
183110
<artifactId>maven-compiler-plugin</artifactId>
184-
<version>3.1</version>
111+
<version>3.2</version>
185112
<configuration>
186113
<source>1.7</source>
187114
<target>1.7</target>

trunk/src/main/java/com/google/gcloud/ExceptionHandler.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.google.common.collect.ImmutableList;
99
import com.google.common.collect.ImmutableSet;
1010
import com.google.common.collect.Sets;
11-
import com.google.gcloud.ExceptionHandler.Interceptor.RetryResult;
1211

1312
import java.io.Serializable;
1413
import java.lang.reflect.Method;
@@ -140,10 +139,10 @@ static final class RetryInfo implements Serializable {
140139

141140
private static final long serialVersionUID = -4264634837841455974L;
142141
private final Class<? extends Exception> exception;
143-
private final RetryResult retry;
142+
private final Interceptor.RetryResult retry;
144143
private final Set<RetryInfo> children = Sets.newHashSet();
145144

146-
RetryInfo(Class<? extends Exception> exception, RetryResult retry) {
145+
RetryInfo(Class<? extends Exception> exception, Interceptor.RetryResult retry) {
147146
this.exception = checkNotNull(exception);
148147
this.retry = retry;
149148
}
@@ -174,10 +173,10 @@ private ExceptionHandler(Builder builder) {
174173
Sets.intersection(retriableExceptions, nonRetriableExceptions).isEmpty(),
175174
"Same exception was found in both retriable and non-retriable sets");
176175
for (Class<? extends Exception> exception : retriableExceptions) {
177-
addToRetryInfos(retryInfos, new RetryInfo(exception, RetryResult.RETRY));
176+
addToRetryInfos(retryInfos, new RetryInfo(exception, Interceptor.RetryResult.RETRY));
178177
}
179178
for (Class<? extends Exception> exception : nonRetriableExceptions) {
180-
addToRetryInfos(retryInfos, new RetryInfo(exception, RetryResult.ABORT));
179+
addToRetryInfos(retryInfos, new RetryInfo(exception, Interceptor.RetryResult.ABORT));
181180
}
182181
}
183182

@@ -242,13 +241,14 @@ public Set<Class<? extends Exception>> getNonRetriableExceptions() {
242241

243242
boolean shouldRetry(Exception ex) {
244243
for (Interceptor interceptor : interceptors) {
245-
RetryResult retryResult = interceptor.shouldRetry(ex);
244+
Interceptor.RetryResult retryResult = interceptor.shouldRetry(ex);
246245
if (retryResult != null) {
247246
return retryResult.booleanValue();
248247
}
249248
}
250249
RetryInfo retryInfo = findMostSpecificRetryInfo(retryInfos, ex.getClass());
251-
RetryResult retryResult = retryInfo == null ? RetryResult.ABORT : retryInfo.retry;
250+
Interceptor.RetryResult retryResult =
251+
retryInfo == null ? Interceptor.RetryResult.ABORT : retryInfo.retry;
252252
for (Interceptor interceptor : interceptors) {
253253
retryResult = firstNonNull(interceptor.shouldRetry(ex, retryResult), retryResult);
254254
}

trunk/src/test/java/com/google/gcloud/datastore/DatastoreServiceIntegrationTest.java renamed to trunk/src/test/java/com/google/gcloud/datastore/DatastoreServiceTest.java

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,21 @@
1717
import com.google.gcloud.datastore.StructuredQuery.PropertyFilter;
1818

1919
import org.easymock.EasyMock;
20-
import org.junit.After;
2120
import org.junit.Before;
2221
import org.junit.Test;
2322
import org.junit.runner.RunWith;
2423
import org.junit.runners.JUnit4;
2524

26-
import java.io.IOException;
2725
import java.util.Collections;
2826
import java.util.HashMap;
2927
import java.util.Iterator;
3028
import java.util.List;
3129
import java.util.Map;
3230

3331
@RunWith(JUnit4.class)
34-
public class DatastoreServiceIntegrationTest {
32+
public class DatastoreServiceTest {
3533

36-
private static final String DATASET = LocalGcdHelper.DEFAULT_DATASET;
34+
private static final String DATASET = "dataset1";
3735
private static final String KIND1 = "kind1";
3836
private static final String KIND2 = "kind2";
3937
private static final NullValue NULL_VALUE = NullValue.of();
@@ -72,16 +70,19 @@ public class DatastoreServiceIntegrationTest {
7270
private DatastoreServiceOptions options;
7371
private DatastoreService datastore;
7472
private DatastoreHelper helper;
75-
private LocalGcdHelper gcdHelper;
7673

7774
@Before
78-
public void setUp() throws IOException, InterruptedException {
79-
if (!LocalGcdHelper.isActive(DATASET)) {
80-
gcdHelper = LocalGcdHelper.start(DATASET);
81-
}
75+
public void setUp() {
76+
// TODO(ozarov): document that this test depends on a local gcd running.
77+
// Unfortunately, the gcd tool is not bundled with the cloud SDK and need
78+
// to be downloaded independently from
79+
// https://cloud.google.com/datastore/docs/tools/devserver (b/16372095).
80+
// To start the gcd run:
81+
// gcd.sh create dataset1; gcd.sh start dataset1
82+
// We should have an option to start the gcd from maven/ant.
8283
options = DatastoreServiceOptions.builder()
8384
.dataset(DATASET)
84-
.host("http://localhost:" + LocalGcdHelper.PORT)
85+
.host("http://localhost:8080")
8586
.build();
8687
datastore = DatastoreServiceFactory.getDefault(options);
8788
helper = DatastoreHelper.createFor(datastore);
@@ -90,13 +91,6 @@ public void setUp() throws IOException, InterruptedException {
9091
datastore.add(ENTITY1, ENTITY2);
9192
}
9293

93-
@After
94-
public void tearDown() throws IOException, InterruptedException {
95-
if (gcdHelper != null) {
96-
gcdHelper.stop();
97-
}
98-
}
99-
10094
@Test
10195
public void testGetOptions() {
10296
assertSame(options, datastore.options());

0 commit comments

Comments
 (0)