Author: jnioche
Date: Fri Jul 23 14:54:08 2010
New Revision: 967119
URL: http://svn.apache.org/viewvc?rev=967119&view=rev
Log:
Added missing test in TestPluginSystem + missing Apache License Header on a
couple of files
Modified:
nutch/branches/nutchbase/ivy/ivy.xml
nutch/branches/nutchbase/src/java/org/apache/nutch/plugin/Pluggable.java
nutch/branches/nutchbase/src/test/org/apache/nutch/plugin/TestPluginSystem.java
nutch/branches/nutchbase/src/test/org/apache/nutch/util/TestEncodingDetector.java
Modified: nutch/branches/nutchbase/ivy/ivy.xml
URL:
http://svn.apache.org/viewvc/nutch/branches/nutchbase/ivy/ivy.xml?rev=967119&r1=967118&r2=967119&view=diff
==============================================================================
--- nutch/branches/nutchbase/ivy/ivy.xml (original)
+++ nutch/branches/nutchbase/ivy/ivy.xml Fri Jul 23 14:54:08 2010
@@ -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">
Modified:
nutch/branches/nutchbase/src/java/org/apache/nutch/plugin/Pluggable.java
URL:
http://svn.apache.org/viewvc/nutch/branches/nutchbase/src/java/org/apache/nutch/plugin/Pluggable.java?rev=967119&r1=967118&r2=967119&view=diff
==============================================================================
--- nutch/branches/nutchbase/src/java/org/apache/nutch/plugin/Pluggable.java
(original)
+++ nutch/branches/nutchbase/src/java/org/apache/nutch/plugin/Pluggable.java
Fri Jul 23 14:54:08 2010
@@ -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érô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 {
}
Modified:
nutch/branches/nutchbase/src/test/org/apache/nutch/plugin/TestPluginSystem.java
URL:
http://svn.apache.org/viewvc/nutch/branches/nutchbase/src/test/org/apache/nutch/plugin/TestPluginSystem.java?rev=967119&r1=967118&r2=967119&view=diff
==============================================================================
---
nutch/branches/nutchbase/src/test/org/apache/nutch/plugin/TestPluginSystem.java
(original)
+++
nutch/branches/nutchbase/src/test/org/apache/nutch/plugin/TestPluginSystem.java
Fri Jul 23 14:54:08 2010
@@ -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 Te
}
}
+ 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);
+ }
+
/**
*
*/
Modified:
nutch/branches/nutchbase/src/test/org/apache/nutch/util/TestEncodingDetector.java
URL:
http://svn.apache.org/viewvc/nutch/branches/nutchbase/src/test/org/apache/nutch/util/TestEncodingDetector.java?rev=967119&r1=967118&r2=967119&view=diff
==============================================================================
---
nutch/branches/nutchbase/src/test/org/apache/nutch/util/TestEncodingDetector.java
(original)
+++
nutch/branches/nutchbase/src/test/org/apache/nutch/util/TestEncodingDetector.java
Fri Jul 23 14:54:08 2010
@@ -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;