Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

Added missing test in TestPluginSystem + missing Apache License Header on a couple of files

Julien Niochefd28cd7a0cae
diff --git a/ivy/ivy.xml b/ivy/ivy.xml
index 32427a8a5..55c344efa 100644
--- a/ivy/ivy.xml
+++ b/ivy/ivy.xml
@@ -52,8 +52,6 @@
rev="3.1" conf="*->master" />
<dependency org="commons-codec" name="commons-codec" rev="1.3"
conf="*->default" />
- <dependency org="commons-codec" name="commons-codec" rev="1.3"
- conf="*->default" />
<dependency org="org.apache.hadoop" name="hadoop-core" rev="0.20.2"
conf="*->default">
diff --git a/src/java/org/apache/nutch/plugin/Pluggable.java b/src/java/org/apache/nutch/plugin/Pluggable.java
index 9970f6ae4..4d3f8b11a 100644
--- a/src/java/org/apache/nutch/plugin/Pluggable.java
+++ b/src/java/org/apache/nutch/plugin/Pluggable.java
@@ -16,5 +16,16 @@
*/
package org.apache.nutch.plugin;
+/**
+ * Defines the capability of a class to be plugged into Nutch.
+ * This is a common interface that must be implemented by all
+ * Nutch Extension Points.
+ *
+ * @author J&eacute;r&ocirc;me Charron
+ *
+ * @see <a href="http://wiki.apache.org/nutch/AboutPlugins">About Plugins</a>
+ * @see <a href="package-summary.html#package_description">
+ * plugin package description</a>
+ */
public interface Pluggable {
}
diff --git a/src/test/org/apache/nutch/plugin/TestPluginSystem.java b/src/test/org/apache/nutch/plugin/TestPluginSystem.java
index 768ed9481..8df826171 100644
--- a/src/test/org/apache/nutch/plugin/TestPluginSystem.java
+++ b/src/test/org/apache/nutch/plugin/TestPluginSystem.java
@@ -29,7 +29,10 @@ import java.util.Properties;
import junit.framework.TestCase;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.mapred.JobConf;
import org.apache.nutch.util.NutchConfiguration;
+import org.apache.nutch.util.NutchJob;
+import org.apache.nutch.util.NutchJobConf;
/**
* Unit tests for the plugin system
@@ -95,6 +98,22 @@ public class TestPluginSystem extends TestCase {
}
}
+ public void testRepositoryCache() {
+ Configuration config = NutchConfiguration.create();
+ PluginRepository repo = PluginRepository.get(config);
+ JobConf job = new NutchJobConf(config);
+ PluginRepository repo1 = PluginRepository.get(job);
+ assertTrue(repo == repo1);
+ // now construct a config without UUID
+ config = new Configuration();
+ config.addResource("nutch-default.xml");
+ config.addResource("nutch-site.xml");
+ repo = PluginRepository.get(config);
+ job = new NutchJobConf(config);
+ repo1 = PluginRepository.get(job);
+ assertTrue(repo1 != repo);
+ }
+
/**
*
*/
diff --git a/src/test/org/apache/nutch/util/TestEncodingDetector.java b/src/test/org/apache/nutch/util/TestEncodingDetector.java
index f0d5c08b9..bf06a8c68 100644
--- a/src/test/org/apache/nutch/util/TestEncodingDetector.java
+++ b/src/test/org/apache/nutch/util/TestEncodingDetector.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.nutch.util;
import java.io.UnsupportedEncodingException;