Skip to content

Instantly share code, notes, and snippets.

View rtannenbaum's full-sized avatar

Rachel Tannenbaum rtannenbaum

View GitHub Profile
jar -tf /usr/local/google/home/rtannenbaum/github/data-transfer-project/distributions/demo-server/build/libs/demo-server-all.jar | grep .properties
org/apache/http/client/version.properties
org/bouncycastle/x509/CertPathReviewerMessages.properties
org/bouncycastle/x509/CertPathReviewerMessages_de.properties
org/apache/http/version.properties
org/apache/log4j/lf5/config/defaultconfig.properties
log4j.properties
org/apache/axis/i18n/resource.properties
org/apache/axis/i18n/resource_ja.properties
org/apache/axis/utils/tcpmon.properties
@Provides
@Singleton
ApiSettings getApiSettings() {
// TODO: currently, any setting in both a base and env config will be overridden by the last
// definition. e.g. a setting in api.yaml and env/api.yaml will take the definition in
// env/api.yaml. Determine whether this is intended behavior.
try {
ImmutableList<String> settingsFiles = ImmutableList.<String>builder()
.add(API_SETTINGS_PATH)
.add(ENV_API_SETTINGS_PATH)
@rtannenbaum
rtannenbaum / AutoValue_Item.java
Created April 2, 2014 17:43
AutoValue generated source code
@javax.annotation.Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_Item extends Item {
private final String sku;
private final String barcode;
private final boolean backup;
private final boolean removed;
private final int external_srr_reservation_id;
private final int external_rb_reservation_id;
AutoValue_Item(
@rtannenbaum
rtannenbaum / pom.xml
Created April 1, 2014 20:25
Maven compiler plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>
@rtannenbaum
rtannenbaum / pom.xml
Created April 1, 2014 20:24
Maven annotation processor plugin
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.0.5</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
@rtannenbaum
rtannenbaum / pom.xml
Last active August 29, 2015 13:57
Maven auto-value dependency
<dependency>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
</dependency>
@rtannenbaum
rtannenbaum / ItemTest.java
Last active August 29, 2015 13:57
Serialization unit tests
public class ItemTest {
private static ObjectMapper MAPPER = new ObjectMapperFactory().build();
private Item item = Item.create("AB123_S", "038678561125", false, true, 0, 1);
@Test
public void testJsonSerialization() throws IOException {
String json = MAPPER.writeValueAsString(item);
assertEquals(jsonFixture("fixtures/Item.json"), json);
}
@rtannenbaum
rtannenbaum / Item.json
Last active August 29, 2015 13:57
Item.json
{
"sku":"AB123_S",
"barcode":"038678561125",
"backup":false,
"removed":true,
"external_srr_reservation_id":0,
"external_rb_reservation_id":1
}
@rtannenbaum
rtannenbaum / Item.java
Created April 1, 2014 20:21
Jackson serialization
@AutoValue
public abstract class Item
{
@JsonCreator
public static Item create(
@JsonProperty("sku") String sku,
@JsonProperty("barcode") String barcode,
@JsonProperty("backup") boolean backup,
@JsonProperty("removed") boolean removed,
@rtannenbaum
rtannenbaum / Item.java
Created April 1, 2014 20:19
"mutable" fields
@AutoValue
public abstract class Item
{
public static Item create(String sku, String barcode, boolean backup, boolean removed,
int external_srr, int external_rb) {
return new AutoValue_Item(sku, barcode, backup, removed, external_srr, external_rb);
}
public abstract String sku();