Add acceptance IT test example for (based on) new PluginDaemonTest class

Very simple IT test using the new PluginDaemonTest base class. Referring
to amended build.md Documentation for how to run it using either
standalone or gerrit tree mode. Does *not* run using mvn.

Remove dummy CookbookTest that is no longer needed. Make '*IT' test
class/file name suffix explicit in BUCK and pom files. Doing so until
'*' and '*Test' become necessary again, if ever adding '*Test' class(es)
back.

Change-Id: I7a34fbbcfc13b92983b49cf169b958a9ae0ddb34
diff --git a/BUCK b/BUCK
index 081ad6f..5966d34 100644
--- a/BUCK
+++ b/BUCK
@@ -19,12 +19,12 @@
 
 java_test(
   name = 'cookbook_tests',
-  srcs = glob(['src/test/java/**/*.java']),
+  srcs = glob(['src/test/java/**/*IT.java']),
   labels = ['cookbook-plugin'],
   source_under_test = [':cookbook-plugin__plugin'],
-  deps = [
+  deps = GERRIT_PLUGIN_API + [
     ':cookbook-plugin__plugin',
-    '//lib:junit',
+    '//lib:truth',
   ],
 )
 
diff --git a/lib/BUCK b/lib/BUCK
new file mode 100644
index 0000000..1b47c6c
--- /dev/null
+++ b/lib/BUCK
@@ -0,0 +1,26 @@
+include_defs('//bucklets/maven_jar.bucklet')
+
+maven_jar(
+  name = 'guava',
+  id = 'com.google.guava:guava:19.0-rc1',
+  sha1 = '0364538ac107b8943a1f4d68ac50f1b0421bb983',
+  license = 'Apache2.0',
+)
+
+maven_jar(
+  name = 'junit',
+  id = 'junit:junit:4.11',
+  sha1 = '4e031bb61df09069aeb2bffb4019e7a5034a4ee0',
+  license = 'DO_NOT_DISTRIBUTE',
+)
+
+maven_jar(
+  name = 'truth',
+  id = 'com.google.truth:truth:0.27',
+  sha1 = 'bd17774d2dc0fffa884d42c07d2537e86c67acd6',
+  license = 'DO_NOT_DISTRIBUTE',
+  exported_deps = [
+    ':guava',
+    ':junit',
+  ],
+)
diff --git a/src/main/resources/Documentation/build.md b/src/main/resources/Documentation/build.md
index 0fc79fc..2379943 100644
--- a/src/main/resources/Documentation/build.md
+++ b/src/main/resources/Documentation/build.md
@@ -30,7 +30,6 @@
 
 To build the plugin, issue the following command:
 
-
 ```
   buck build plugin
 ```
@@ -41,6 +40,12 @@
   buck-out/gen/cookbook-plugin/cookbook-plugin.jar
 ```
 
+To execute the tests run:
+
+```
+  buck test
+```
+
 Build in Gerrit tree
 --------------------
 
@@ -63,6 +68,12 @@
   ./tools/eclipse/project.py
 ```
 
+To execute the tests run:
+
+```
+  buck test --include cookbook-plugin
+```
+
 Note that for compatibility reasons a Maven build is provided, but is considered
 to be deprecated and will be removed in a future version of this plugin.
 
diff --git a/src/test/java/com/googlesource/gerrit/plugins/cookbook/CookbookIT.java b/src/test/java/com/googlesource/gerrit/plugins/cookbook/CookbookIT.java
new file mode 100644
index 0000000..4c5bf0e
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/cookbook/CookbookIT.java
@@ -0,0 +1,32 @@
+// Copyright (C) 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.googlesource.gerrit.plugins.cookbook;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import com.google.gerrit.acceptance.NoHttpd;
+import com.google.gerrit.acceptance.PluginDaemonTest;
+
+import org.junit.Test;
+
+@NoHttpd
+public class CookbookIT extends PluginDaemonTest {
+
+  @Test
+  public void printTest() throws Exception {
+    assertThat(sshSession.exec("cookbook print")).isEqualTo("Hello world!\n");
+    assertThat(sshSession.hasError()).isFalse();
+  }
+}
diff --git a/src/test/java/com/googlesource/gerrit/plugins/cookbook/CookbookTest.java b/src/test/java/com/googlesource/gerrit/plugins/cookbook/CookbookTest.java
deleted file mode 100644
index d6376ae..0000000
--- a/src/test/java/com/googlesource/gerrit/plugins/cookbook/CookbookTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (C) 2014 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.plugins.cookbook;
-
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class CookbookTest {
-  @Test
-  public void cookbookTest() {
-    // Dummy test, only used to make sure the cookbook plugin gets compiled
-    // when running `buck test`, thus highlighting any compilation errors.
-    assertTrue(true);
-  }
-}