Code cleanup. Added more tests.
diff --git a/com.google.eclipse.protobuf.integration.test/.classpath b/com.google.eclipse.protobuf.integration.test/.classpath
new file mode 100644
index 0000000..1013bd4
--- /dev/null
+++ b/com.google.eclipse.protobuf.integration.test/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/com.google.eclipse.protobuf.test"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/com.google.eclipse.protobuf.integration.test/.project b/com.google.eclipse.protobuf.integration.test/.project
new file mode 100644
index 0000000..8125cae
--- /dev/null
+++ b/com.google.eclipse.protobuf.integration.test/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>com.google.eclipse.protobuf.integration.test</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/com.google.eclipse.protobuf.integration.test/.settings/org.eclipse.jdt.core.prefs b/com.google.eclipse.protobuf.integration.test/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..63279bd
--- /dev/null
+++ b/com.google.eclipse.protobuf.integration.test/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Sat Oct 01 14:48:05 PDT 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/com.google.eclipse.protobuf.integration.test/META-INF/MANIFEST.MF b/com.google.eclipse.protobuf.integration.test/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..1f4ef9b
--- /dev/null
+++ b/com.google.eclipse.protobuf.integration.test/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Integration tests for com.google.eclipse.protobuf
+Bundle-SymbolicName: com.google.eclipse.protobuf.integration.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: Google Inc.
+Fragment-Host: com.google.eclipse.protobuf.ui;bundle-version="1.0.9"
+Require-Bundle: org.junit;bundle-version="4.8.1",
+ org.eclipse.xtext.junit;bundle-version="2.0.0",
+ org.eclipse.xtext.junit4;bundle-version="2.0.0",
+ org.mockito;bundle-version="1.8.5",
+ org.eclipse.core.resources;bundle-version="3.7.100"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/com.google.eclipse.protobuf.integration.test/build.properties b/com.google.eclipse.protobuf.integration.test/build.properties
new file mode 100644
index 0000000..34d2e4d
--- /dev/null
+++ b/com.google.eclipse.protobuf.integration.test/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .
diff --git a/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Descriptor_availableOptionsFor_Test.java b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Descriptor_availableOptionsFor_Test.java
new file mode 100644
index 0000000..99909ce
--- /dev/null
+++ b/com.google.eclipse.protobuf.integration.test/src/com/google/eclipse/protobuf/scoping/Descriptor_availableOptionsFor_Test.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2011 Google Inc.
+ *
+ * All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse
+ * Public License v1.0 which accompanies this distribution, and is available at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package com.google.eclipse.protobuf.scoping;
+
+import static com.google.eclipse.protobuf.junit.matchers.PropertyHasType.hasType;
+import static com.google.eclipse.protobuf.ui.Internals.injector;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+
+import java.util.*;
+
+import org.eclipse.emf.ecore.EObject;
+import org.junit.*;
+
+import com.google.eclipse.protobuf.protobuf.*;
+
+/**
+ * Tests for <code>{@link ProtoDescriptor#availableOptionsFor(EObject)}</code>.
+ *
+ * @author alruiz@google.com (Alex Ruiz)
+ */
+public class Descriptor_availableOptionsFor_Test {
+
+  private static ProtoDescriptor descriptor;
+
+  @BeforeClass public static void setUpOnce() {
+    ProtoDescriptorProvider descriptorProvider = injector().getInstance(ProtoDescriptorProvider.class);
+    descriptor = descriptorProvider.primaryDescriptor();
+  }
+
+  @Test public void should_return_all_file_options() {
+    Protobuf optionContainer = mock(Protobuf.class);
+    Map<String, Property> fileOptions = mapByName(descriptor.availableOptionsFor(optionContainer));
+    assertThat(fileOptions.get("java_package"), hasType("string"));
+    assertThat(fileOptions.get("java_outer_classname"), hasType("string"));
+    assertThat(fileOptions.get("java_multiple_files"), hasType("bool"));
+    assertThat(fileOptions.get("java_generate_equals_and_hash"), hasType("bool"));
+    assertThat(fileOptions.containsKey("optimize_for"), equalTo(true));
+    assertThat(fileOptions.get("cc_generic_services"), hasType("bool"));
+    assertThat(fileOptions.get("java_generic_services"), hasType("bool"));
+    assertThat(fileOptions.get("py_generic_services"), hasType("bool"));
+  }
+
+  private static Map<String, Property> mapByName(Collection<Property> properties) {
+    Map<String, Property> mapByName = new HashMap<String, Property>();
+    for (Property property : properties)
+      mapByName.put(property.getName(), property);
+    return mapByName;
+  }
+}