lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r430568 [8/8] - in /lucene/java/trunk/contrib/gdata-server: ./ lib/ src/java/org/apache/lucene/gdata/data/ src/java/org/apache/lucene/gdata/search/ src/java/org/apache/lucene/gdata/search/analysis/ src/java/org/apache/lucene/gdata/search/co...
Date Thu, 10 Aug 2006 22:32:47 GMT
Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/db4o/TestDb4oStorage.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/db4o/TestDb4oStorage.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/db4o/TestDb4oStorage.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/db4o/TestDb4oStorage.java Thu Aug 10 15:32:40 2006
@@ -1,7 +1,21 @@
+/** 
+ * Copyright 2004 The Apache Software Foundation 
+ * 
+ * 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 org.apache.lucene.gdata.storage.db4o;
 
-import java.io.IOException;
-import java.io.StringWriter;
+import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -26,9 +40,7 @@
 import com.google.gdata.data.BaseEntry;
 import com.google.gdata.data.BaseFeed;
 import com.google.gdata.data.DateTime;
-import com.google.gdata.data.ExtensionProfile;
 import com.google.gdata.data.PlainTextConstruct;
-import com.google.gdata.util.common.xml.XmlWriter;
 
 public class TestDb4oStorage extends TestCase {
     private static final String FEEDID = "myFeed";
@@ -61,6 +73,8 @@
         this.controller.getStorage().close();
         this.controller.visiteDestroy();
         this.controller.destroy();
+        File dbFile = new File("test.yap");
+        assertTrue(dbFile.delete());
     }
 
     private void clearDB() {
@@ -78,8 +92,7 @@
         return this.controller.releaseContainer();
     }
 
-
-
+   
     /*
      * Test method for
      * 'org.apache.lucene.gdata.storage.db4o.DB4oStorage.storeEntry(ServerBaseEntry)'
@@ -94,6 +107,33 @@
         } catch (StorageException e) {
             //
         }
+
+        try {
+
+            storage.storeEntry(null);
+            fail("entry is null");
+        } catch (StorageException e) {
+            //
+        }
+        ServerBaseEntry exEntry = new ServerBaseEntry();
+        exEntry.setFeedId("some");
+        try {
+
+            storage.storeEntry(exEntry);
+            fail("entry id is null");
+        } catch (StorageException e) {
+            //
+        }
+        exEntry.setId("someID");
+        exEntry.setFeedId(null);
+        try {
+
+            storage.storeEntry(exEntry);
+            fail("feed id is null");
+        } catch (StorageException e) {
+            //
+        }
+
         storeServerBaseFeed();
         ServerBaseEntry e = createServerBaseEntry();
         storage.storeEntry(e);
@@ -106,13 +146,14 @@
         query.descend("id").constrain(e.getId());
         ObjectSet resultSet = query.execute();
         assertEquals(1, resultSet.size());
-        BaseEntry storedEntry = (BaseEntry)resultSet.next();
-        assertEquals("1",storedEntry.getVersionId());
+        BaseEntry storedEntry = (BaseEntry) resultSet.next();
+        assertEquals("1", storedEntry.getVersionId());
 
         ServerBaseFeed bFeed = new ServerBaseFeed();
         bFeed.setItemsPerPage(25);
         bFeed.setId(FEEDID);
         bFeed.setStartIndex(1);
+        bFeed.setServiceType(SERVICENAME);
         BaseFeed<BaseFeed, BaseEntry> feed = storage.getFeed(bFeed);
         assertEquals(2, feed.getEntries().size());
         assertEquals(e.getId(), feed.getEntries().get(1).getId()); // last post
@@ -133,13 +174,41 @@
         ObjectContainer container = getContainer();
         storeServerBaseFeed();
         Storage storage = this.controller.getStorage();
+        
+        try {
+
+            storage.deleteEntry(null);
+            fail("entry is null");
+        } catch (StorageException e) {
+            //
+        }
+        ServerBaseEntry exEntry = new ServerBaseEntry();
+        exEntry.setFeedId("some");
+        try {
+
+            storage.deleteEntry(exEntry);
+            fail("entry id is null");
+        } catch (StorageException e) {
+            //
+        }
+        exEntry.setId("someID");
+        exEntry.setFeedId(null);
+        try {
+
+            storage.storeEntry(exEntry);
+            fail("feed id is null");
+        } catch (StorageException e) {
+            //
+        }
+        
+        
         ServerBaseEntry e = createServerBaseEntry();
         storage.storeEntry(e);
         ServerBaseEntry e1 = createServerBaseEntry();
         storage.storeEntry(e1);
 
         storage.deleteEntry(e);
-        
+
         container.close();
         container = getContainer();
         Query query = container.query();
@@ -158,7 +227,12 @@
         } catch (Exception ex) {
             // TODO: handle exception
         }
-
+        try {
+            storage.deleteEntry(null);
+            fail("entry id is null");
+        } catch (Exception ex) {
+            // TODO: handle exception
+        }
         storage = this.controller.getStorage();
         storage.deleteEntry(e1);
         container.close();
@@ -186,16 +260,14 @@
 
         storage.storeEntry(concuEntry);
         storage.close();
-        concuEntry.acceptGetVersionVisitor(getMonitorVisitor(monitor,reached));
-
+        concuEntry.acceptGetVersionVisitor(getMonitorVisitor(monitor, reached));
 
         Thread t1 = getDelThread(controller, concuEntry, false);
 
         Thread t2 = getDelThread(controller, concuEntry, true);
         t1.start();
         /*
-         * Wait active -- not nice but works fine here
-         * wait until thread parked
+         * Wait active -- not nice but works fine here wait until thread parked
          */
 
         while (true) {
@@ -208,8 +280,8 @@
         t2.start();
         t2.join(800);
         /*
-         * Wait active -- not nice but works fine here
-         * wake up the waiting thread
+         * Wait active -- not nice but works fine here wake up the waiting
+         * thread
          */
         while (true) {
             synchronized (monitor) {
@@ -221,28 +293,30 @@
         t1.join(300);
         if (fail)
             fail("thread failed -- see stacktrace");
-        
+
         container.close();
 
     }
-    
-    private Visitor getMonitorVisitor(final Object monitor, final AtomicBoolean reached){
+
+    private Visitor getMonitorVisitor(final Object monitor,
+            final AtomicBoolean reached) {
         /*
-         * The executing thread stops at a defined position while holding the semaphore inside the storageImpl
+         * The executing thread stops at a defined position while holding the
+         * semaphore inside the storageImpl
          */
-        return new Visitor(){
-          public void execute(Object[] o){
-            synchronized (monitor) {
-            try {
-                reached.set(true);
-                monitor.wait();
-                reached.set(false);
-              
-            } catch (InterruptedException e) {
-                //                   
-            }
+        return new Visitor() {
+            public void execute(Object[] o) {
+                synchronized (monitor) {
+                    try {
+                        reached.set(true);
+                        monitor.wait();
+                        reached.set(false);
+
+                    } catch (InterruptedException e) {
+                        //                   
+                    }
+                }
             }
-          }
         };
     }
 
@@ -269,6 +343,35 @@
     public void testUpdateEntry() throws StorageException, InterruptedException {
         storeServerBaseFeed();
         Storage storage = this.controller.getStorage();
+        ServerBaseEntry exEntry = new ServerBaseEntry();
+        
+
+        try {
+
+            storage.updateEntry(null);
+            fail("entry is null");
+        } catch (StorageException e) {
+            //
+        }
+
+        try {
+
+            storage.updateEntry(exEntry);
+            fail("entry id is null");
+        } catch (StorageException e) {
+            //
+        }
+        exEntry.setId("someID");
+        try {
+
+            storage.updateEntry(exEntry);
+            fail("feed id is null");
+        } catch (StorageException e) {
+            //
+        }
+        
+        
+        
         ServerBaseEntry e = createServerBaseEntry();
         ServerBaseEntry e1 = createServerBaseEntry();
         try {
@@ -296,12 +399,12 @@
         BaseEntry result = (BaseEntry) resultSet.next();
         assertEquals("new", result.getTitle().getPlainText());
         assertEquals("2", result.getVersionId());
-        
-        
+
         ServerBaseFeed bFeed = new ServerBaseFeed();
         bFeed.setItemsPerPage(25);
         bFeed.setId(FEEDID);
         bFeed.setStartIndex(1);
+        bFeed.setServiceType(SERVICENAME);
         storage = this.controller.getStorage();
         BaseFeed<BaseFeed, BaseEntry> feed = storage.getFeed(bFeed);
 
@@ -336,16 +439,14 @@
 
         storage.storeEntry(concuEntry);
         storage.close();
-        concuEntry.acceptGetEntryVisitor(getMonitorVisitor(monitor,reached));
-
+        concuEntry.acceptGetEntryVisitor(getMonitorVisitor(monitor, reached));
 
         Thread t1 = getUpdThread(controller, concuEntry, false);
 
         Thread t2 = getUpdThread(controller, concuEntry, true);
         t1.start();
         /*
-         * Wait active -- not nice but works fine here
-         * wait until thread parked
+         * Wait active -- not nice but works fine here wait until thread parked
          */
 
         while (true) {
@@ -358,8 +459,8 @@
         t2.start();
         t2.join(800);
         /*
-         * Wait active -- not nice but works fine here
-         * wake up the waiting thread
+         * Wait active -- not nice but works fine here wake up the waiting
+         * thread
          */
         while (true) {
             synchronized (monitor) {
@@ -384,6 +485,14 @@
         ServerBaseFeed feed = new ServerBaseFeed();
         feed.setItemsPerPage(25);
         feed.setStartIndex(1);
+        feed.setServiceType(SERVICENAME);
+        try{
+        storage.getFeed(feed);
+        fail("feedid is null");
+        }catch (StorageException e) {
+            // 
+        }
+        
         feed.setId(FEEDID);
         BaseFeed result = storage.getFeed(feed);
         assertNotNull(result);
@@ -460,11 +569,19 @@
     public void testGetEntry() throws StorageException {
         storeServerBaseFeed();
         Storage storage = this.controller.getStorage();
+        ServerBaseEntry exEntry = createServerBaseEntry();
+        exEntry.setId(null);
+        try{
+        storage.getEntry(exEntry);
+        fail("id is null");
+        }catch (StorageException e) {
+
+        }
         ServerBaseEntry e = createServerBaseEntry();
         storage.storeEntry(e);
         ServerBaseEntry e1 = createServerBaseEntry();
         storage.storeEntry(e1);
-
+        
         storage = this.controller.getStorage();
         BaseEntry result = storage.getEntry(e);
         assertNotNull(result);
@@ -541,7 +658,8 @@
         account.setName("simon");
         account.setPassword("newPass");
         storage.updateAccount(account);
-
+        container.close();
+        container = getContainer();
         q = container.query();
         q.constrain(GDataAccount.class);
         q.descend("name").constrain(account.getName());
@@ -570,7 +688,8 @@
         assertEquals(1, set.size());
 
         storage.deleteAccount(account.getName());
-
+        container.close();
+        container = getContainer();
         q = container.query();
         q.constrain(GDataAccount.class);
         q.descend("name").constrain(account.getName());
@@ -636,9 +755,7 @@
      * 'org.apache.lucene.gdata.storage.db4o.DB4oStorage.deleteFeed(String)'
      */
     public void testDeleteFeed() throws StorageException {
-    
 
-    
         ServerBaseFeed feed = new ServerBaseFeed();
         feed.setId(FEEDID);
         GDataAccount account = new GDataAccount();
@@ -653,7 +770,7 @@
         conf.setName(SERVICENAME);
         feed.setServiceConfig(conf);
         storage.storeFeed(feed, ACCOUNTNAME);
-    
+
         storage.deleteFeed(FEEDID);
         container = getContainer();
         Query query = container.query();
@@ -719,7 +836,7 @@
         container.set(account);
         container.commit();
         container.close();
-       
+
         Storage storage = this.controller.getStorage();
         assertNotNull(storage.getAccount(ACCOUNTNAME));
         assertEquals(account.getPassword(), storage.getAccount(ACCOUNTNAME)
@@ -763,9 +880,12 @@
         feedU.setServiceConfig(conf);
         feedU.setId(FEEDID);
         feedU.setTitle(new PlainTextConstruct("someText"));
+        feedU.setServiceType(SERVICENAME);
+
         storage.updateFeed(feedU, ACCOUNTNAME);
         ServerBaseFeed requestFeed = new ServerBaseFeed();
         requestFeed.setId(FEEDID);
+        requestFeed.setServiceType(SERVICENAME);
         assertNotNull(storage.getFeed(requestFeed));
         assertEquals(feedU.getTitle(), storage.getFeed(requestFeed).getTitle());
         try {
@@ -807,7 +927,7 @@
         return e;
     }
 
-    private void storeServerBaseFeed() {
+    private ServerBaseFeed storeServerBaseFeed() {
         ServerBaseFeed f = new ServerBaseFeed();
         ProvidedServiceConfig conf = new ProvidedServiceConfig();
         conf.setName(SERVICENAME);
@@ -820,7 +940,7 @@
         con.commit();
 
         con.close();
-
+        return f;
     }
 
     static class Runner implements Runnable {
@@ -874,4 +994,47 @@
 
         }
     }
+
+    public void testFeedLastModified() {
+        ServerBaseFeed feed = storeServerBaseFeed();
+        Storage s = this.controller.getStorage();
+        assertEquals(feed.getUpdated().getValue(), s
+                .getFeedLastModified(FEEDID).longValue());
+        try {
+            s.getFeedLastModified(null);
+            fail("id is null");
+        } catch (StorageException e) {
+
+        }
+        try {
+            s.getFeedLastModified("someOtherid");
+            fail("no such feed");
+        } catch (StorageException e) {
+
+        }
+
+    }
+
+    public void testEntryLastModified() {
+        ServerBaseFeed feed = storeServerBaseFeed();
+        Storage s = this.controller.getStorage();
+        ServerBaseEntry en = createServerBaseEntry();
+        s.storeEntry(en);
+        assertEquals(en.getUpdated().getValue(), s.getEntryLastModified(
+                en.getId(), FEEDID).longValue());
+        try {
+            s.getEntryLastModified(null, null);
+            fail("id is null");
+        } catch (StorageException e) {
+
+        }
+        try {
+            s.getEntryLastModified("someOtherid", "notinstorage");
+            fail("no such Entry");
+        } catch (StorageException e) {
+
+        }
+
+    }
+
 }

Added: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/db4o/TestObjectServerDecorator.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/db4o/TestObjectServerDecorator.java?rev=430568&view=auto
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/db4o/TestObjectServerDecorator.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/db4o/TestObjectServerDecorator.java Thu Aug 10 15:32:40 2006
@@ -0,0 +1,59 @@
+/** 
+ * Copyright 2004 The Apache Software Foundation 
+ * 
+ * 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 org.apache.lucene.gdata.storage.db4o;
+
+import java.io.File;
+import java.lang.reflect.Proxy;
+
+import com.db4o.Db4o;
+import com.db4o.ObjectContainer;
+import com.db4o.ObjectServer;
+
+import junit.framework.TestCase;
+
+public class TestObjectServerDecorator extends TestCase {
+    ObjectServer decorator;
+    ObjectServer actualServer;
+    String dbFile = "test.yap";
+    protected void setUp() throws Exception {
+        decorator = (ObjectServer) Proxy.newProxyInstance(this.getClass().getClassLoader(),new Class[]{ObjectServer.class},new ObjectServerDecorator("u","p","127.0.0.1",10101));
+        actualServer= Db4o.openServer(dbFile,10101);
+        actualServer.grantAccess("u","p");
+        
+    }
+
+    protected void tearDown() throws Exception {
+        actualServer.close();
+        File dbF = new File(dbFile);
+        assertTrue(dbF.delete());
+        
+    }
+
+    /*
+     * Test method for 'org.apache.lucene.gdata.storage.db4o.ObjectServerDecorator.invoke(Object, Method, Object[])'
+     */
+    public void testInvoke() {
+        assertFalse(this.decorator.close());
+        assertNull(this.decorator.ext());
+        assertEquals(0,this.decorator.hashCode());
+        ObjectContainer container = this.decorator.openClient(); 
+        assertNotNull(container);
+        assertTrue(this.decorator.openClient()instanceof ObjectContainer);
+        container.close();
+        
+    }
+
+}

Propchange: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/db4o/TestObjectServerDecorator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/db4o/TestObjectServerDecorator.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/StorageCoreControllerStub.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/StorageCoreControllerStub.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/StorageCoreControllerStub.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/StorageCoreControllerStub.java Thu Aug 10 15:32:40 2006
@@ -23,12 +23,10 @@
 import org.apache.lucene.gdata.server.registry.ComponentType;
 import org.apache.lucene.gdata.storage.IDGenerator;
 import org.apache.lucene.gdata.storage.Storage;
-import org.apache.lucene.gdata.storage.StorageController;
 import org.apache.lucene.gdata.storage.StorageException;
-import org.apache.lucene.gdata.storage.lucenestorage.util.ReferenceCounter;
+import org.apache.lucene.gdata.utils.ReferenceCounter;
 import org.apache.lucene.index.IndexModifier;
 import org.apache.lucene.store.Directory;
-import org.apache.lucene.store.RAMDirectory;
 
 /**
  * @author Simon Willnauer

Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestModifiedEntryFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestModifiedEntryFilter.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestModifiedEntryFilter.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestModifiedEntryFilter.java Thu Aug 10 15:32:40 2006
@@ -9,8 +9,8 @@
 import org.apache.lucene.analysis.standard.StandardAnalyzer; 
 import org.apache.lucene.document.Document; 
 import org.apache.lucene.document.Field; 
-import org.apache.lucene.gdata.storage.lucenestorage.ModifiedEntryFilter; 
 import org.apache.lucene.gdata.storage.lucenestorage.StorageEntryWrapper; 
+import org.apache.lucene.gdata.utils.ModifiedEntryFilter;
 import org.apache.lucene.index.IndexReader; 
 import org.apache.lucene.index.IndexWriter; 
 import org.apache.lucene.index.Term; 
@@ -55,11 +55,15 @@
         Hits hits = s.search(q); 
         assertEquals(2,hits.length()); 
          
-        hits = s.search(q,new ModifiedEntryFilter(this.excludeList.toArray(new String[0]))); 
+        hits = s.search(q,new ModifiedEntryFilter(this.excludeList.toArray(new String[0]),StorageEntryWrapper.FIELD_ENTRY_ID)); 
         assertEquals(1,hits.length()); 
         this.excludeList.add("2"); 
  
-        hits = s.search(q,new ModifiedEntryFilter(this.excludeList.toArray(new String[0]))); 
+        hits = s.search(q,new ModifiedEntryFilter(this.excludeList.toArray(new String[0]),StorageEntryWrapper.FIELD_ENTRY_ID)); 
+        assertEquals(0,hits.length());
+        this.excludeList.add(null);
+        this.excludeList.add("5"); 
+        hits = s.search(q,new ModifiedEntryFilter(this.excludeList.toArray(new String[0]),StorageEntryWrapper.FIELD_ENTRY_ID)); 
         assertEquals(0,hits.length()); 
          
     } 

Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestSingelHostConcurrencyLock.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestSingelHostConcurrencyLock.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestSingelHostConcurrencyLock.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestSingelHostConcurrencyLock.java Thu Aug 10 15:32:40 2006
@@ -1,3 +1,18 @@
+/** 
+ * Copyright 2004 The Apache Software Foundation 
+ * 
+ * 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 org.apache.lucene.gdata.storage.lucenestorage;
 
 import org.apache.lucene.gdata.storage.lucenestorage.SingleHostConcurrentStorageLock.ConcurrencyException;

Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageBuffer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageBuffer.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageBuffer.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageBuffer.java Thu Aug 10 15:32:40 2006
@@ -1,3 +1,18 @@
+/** 
+ * Copyright 2004 The Apache Software Foundation 
+ * 
+ * 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 org.apache.lucene.gdata.storage.lucenestorage;
 
 import java.io.IOException;

Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageImplementation.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageImplementation.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageImplementation.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageImplementation.java Thu Aug 10 15:32:40 2006
@@ -1,3 +1,18 @@
+/** 
+ * Copyright 2004 The Apache Software Foundation 
+ * 
+ * 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 org.apache.lucene.gdata.storage.lucenestorage;
 
 import java.util.concurrent.atomic.AtomicBoolean;

Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageModifier.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageModifier.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageModifier.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageModifier.java Thu Aug 10 15:32:40 2006
@@ -1,3 +1,18 @@
+/** 
+ * Copyright 2004 The Apache Software Foundation 
+ * 
+ * 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 org.apache.lucene.gdata.storage.lucenestorage;
 
 import java.io.IOException;
@@ -10,8 +25,8 @@
 import org.apache.lucene.gdata.server.registry.ProvidedService;
 import org.apache.lucene.gdata.storage.StorageException;
 import org.apache.lucene.gdata.storage.lucenestorage.StorageEntryWrapper.StorageOperation;
-import org.apache.lucene.gdata.storage.lucenestorage.util.ReferenceCounter;
 import org.apache.lucene.gdata.utils.ProvidedServiceStub;
+import org.apache.lucene.gdata.utils.ReferenceCounter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;

Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageQuery.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageQuery.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/TestStorageQuery.java Thu Aug 10 15:32:40 2006
@@ -1,3 +1,18 @@
+/** 
+ * Copyright 2004 The Apache Software Foundation 
+ * 
+ * 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 org.apache.lucene.gdata.storage.lucenestorage;
 
 import java.io.IOException;
@@ -13,8 +28,8 @@
 import org.apache.lucene.gdata.server.registry.ProvidedService;
 import org.apache.lucene.gdata.storage.StorageException;
 import org.apache.lucene.gdata.storage.lucenestorage.StorageEntryWrapper.StorageOperation;
-import org.apache.lucene.gdata.storage.lucenestorage.util.ReferenceCounter;
 import org.apache.lucene.gdata.utils.ProvidedServiceStub;
+import org.apache.lucene.gdata.utils.ReferenceCounter;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
 

Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/recover/TestRecoverController.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/recover/TestRecoverController.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/recover/TestRecoverController.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/recover/TestRecoverController.java Thu Aug 10 15:32:40 2006
@@ -1,3 +1,18 @@
+/** 
+ * Copyright 2004 The Apache Software Foundation 
+ * 
+ * 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 org.apache.lucene.gdata.storage.lucenestorage.recover;
 
 import java.io.File;
@@ -96,7 +111,9 @@
     
     
     private void createCorruptedFile() throws IOException{
-        FileWriter writer = new FileWriter(new File(this.recDir,"somefile.rec"));
+        File file = new File(this.recDir,"somefile.rec");
+        file.deleteOnExit();
+        FileWriter writer = new FileWriter(file);
         writer.write("someString\nSomeOtherString");
         writer.close();
     }

Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/recover/TestRecoverWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/recover/TestRecoverWriter.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/recover/TestRecoverWriter.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/recover/TestRecoverWriter.java Thu Aug 10 15:32:40 2006
@@ -1,3 +1,18 @@
+/** 
+ * Copyright 2004 The Apache Software Foundation 
+ * 
+ * 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 org.apache.lucene.gdata.storage.lucenestorage.recover;
 
 import java.io.IOException;

Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/recover/TestRevocerReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/recover/TestRevocerReader.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/recover/TestRevocerReader.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/storage/lucenestorage/recover/TestRevocerReader.java Thu Aug 10 15:32:40 2006
@@ -1,3 +1,18 @@
+/** 
+ * Copyright 2004 The Apache Software Foundation 
+ * 
+ * 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 org.apache.lucene.gdata.storage.lucenestorage.recover;
 
 import java.io.BufferedReader;

Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/ProvidedServiceStub.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/ProvidedServiceStub.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/ProvidedServiceStub.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/ProvidedServiceStub.java Thu Aug 10 15:32:40 2006
@@ -1,5 +1,21 @@
+/**
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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 org.apache.lucene.gdata.utils;
 
+import org.apache.lucene.gdata.search.config.IndexSchema;
 import org.apache.lucene.gdata.server.registry.ProvidedService;
 
 import com.google.gdata.data.Entry;
@@ -9,6 +25,7 @@
 public class ProvidedServiceStub implements ProvidedService {
 
     public static final String SERVICE_NAME = "service";
+    private IndexSchema indexSchema;
 
     public ProvidedServiceStub() {
         super();
@@ -36,6 +53,14 @@
     }
 
     public void destroy() {
+    }
+    public void setIndexSchema(IndexSchema schema){
+        this.indexSchema = schema;
+        this.indexSchema.setName(SERVICE_NAME);
+    }
+    public IndexSchema getIndexSchema() {
+        
+        return this.indexSchema;
     }
 
 }

Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/ServiceFactoryStub.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/ServiceFactoryStub.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/ServiceFactoryStub.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/ServiceFactoryStub.java Thu Aug 10 15:32:40 2006
@@ -16,12 +16,15 @@
 
 package org.apache.lucene.gdata.utils;
 
+import org.apache.lucene.gdata.server.GDataRequest;
 import org.apache.lucene.gdata.server.Service;
 import org.apache.lucene.gdata.server.ServiceFactory;
 import org.apache.lucene.gdata.server.administration.AdminService;
 import org.apache.lucene.gdata.server.registry.Component;
 import org.apache.lucene.gdata.server.registry.ComponentType;
 
+
+
 /**
  * @author Simon Willnauer
  *
@@ -44,7 +47,7 @@
      * @see org.apache.lucene.gdata.server.ServiceFactory#getService()
      */
     @Override
-    public Service getService() {
+    public Service getService(GDataRequest request) {
         
         return service;
     }

Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/TestDateFormater.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/TestDateFormater.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/TestDateFormater.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/TestDateFormater.java Thu Aug 10 15:32:40 2006
@@ -1,3 +1,18 @@
+/** 
+ * Copyright 2004 The Apache Software Foundation 
+ * 
+ * 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 org.apache.lucene.gdata.utils;
 
 import java.text.ParseException;

Added: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/TestReflectionUtils.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/TestReflectionUtils.java?rev=430568&view=auto
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/TestReflectionUtils.java (added)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/TestReflectionUtils.java Thu Aug 10 15:32:40 2006
@@ -0,0 +1,119 @@
+/** 
+ * Copyright 2004 The Apache Software Foundation 
+ * 
+ * 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 org.apache.lucene.gdata.utils;
+
+import org.apache.lucene.gdata.search.analysis.PlainTextStrategy;
+import org.apache.lucene.gdata.search.config.IndexSchemaField;
+import org.apache.lucene.gdata.utils.ReflectionUtils.ReflectionException;
+import org.apache.lucene.search.RangeQuery;
+
+import junit.framework.TestCase;
+
+public class TestReflectionUtils extends TestCase {
+
+    /*
+     * Test method for 'org.apache.lucene.gdata.utils.ReflectionUtils.implementsType(Class, Class)'
+     */
+    public void testImplementsType() {
+
+    }
+
+    /*
+     * Test method for 'org.apache.lucene.gdata.utils.ReflectionUtils.extendsType(Class, Class)'
+     */
+    public void testExtendsType() {
+        assertTrue(ReflectionUtils.isTypeOf(Integer.class,Number.class));
+        assertFalse(ReflectionUtils.isTypeOf(null,CharSequence.class));
+    }
+
+    /*
+     * Test method for 'org.apache.lucene.gdata.utils.ReflectionUtils.isTypeOf(Class, Class)'
+     */
+    public void testIsTypeOf() {
+        assertTrue(ReflectionUtils.isTypeOf(String.class,CharSequence.class));
+        assertTrue(ReflectionUtils.isTypeOf(Integer.class,Number.class));
+        assertFalse(ReflectionUtils.isTypeOf(Integer.class,CharSequence.class));
+        assertFalse(ReflectionUtils.isTypeOf(null,CharSequence.class));
+        assertFalse(ReflectionUtils.isTypeOf(Integer.class,null));
+
+    }
+
+    /*
+     * Test method for 'org.apache.lucene.gdata.utils.ReflectionUtils.getDefaultInstance(Class<T>) <T>'
+     */
+    public void testGetDefaultInstance() {
+        assertEquals(new String(),ReflectionUtils.getDefaultInstance(String.class));
+        try{
+        ReflectionUtils.getDefaultInstance(Integer.class);
+        fail("can not create instance");
+        }catch (ReflectionException e) {
+            
+        }
+        try{
+            ReflectionUtils.getDefaultInstance(null);
+            fail("can not create instance");
+            }catch (ReflectionException e) {
+                
+            }
+    }
+
+    /*
+     * Test method for 'org.apache.lucene.gdata.utils.ReflectionUtils.canCreateInstance(Class)'
+     */
+    public void testCanCreateInstance() {
+        assertTrue(ReflectionUtils.canCreateInstance(String.class));
+        assertFalse(ReflectionUtils.canCreateInstance(Integer.class));
+        assertFalse(ReflectionUtils.canCreateInstance(Integer.TYPE));
+        assertFalse(ReflectionUtils.canCreateInstance(null));
+        
+        
+        
+    }
+
+    /*
+     * Test method for 'org.apache.lucene.gdata.utils.ReflectionUtils.getPrimitiveWrapper(Class)'
+     */
+    public void testGetPrimitiveWrapper() {
+        
+        assertEquals(Integer.class,ReflectionUtils.getPrimitiveWrapper(Integer.TYPE));
+        assertEquals(Long.class,ReflectionUtils.getPrimitiveWrapper(Long.TYPE));
+        assertEquals(Float.class,ReflectionUtils.getPrimitiveWrapper(Float.TYPE));
+        assertEquals(Byte.class,ReflectionUtils.getPrimitiveWrapper(Byte.TYPE));
+        assertEquals(Double.class,ReflectionUtils.getPrimitiveWrapper(Double.TYPE));
+        assertEquals(Short.class,ReflectionUtils.getPrimitiveWrapper(Short.TYPE));
+        assertEquals(Boolean.class,ReflectionUtils.getPrimitiveWrapper(Boolean.TYPE));
+        try {
+        ReflectionUtils.getPrimitiveWrapper(null);
+        fail("type is null");
+        }catch (ReflectionException e) {
+            
+        }
+        try {
+            ReflectionUtils.getPrimitiveWrapper(String.class);
+            fail("type is not a primitive");
+            }catch (ReflectionException e) {
+                
+            }
+        
+    }
+    
+    public void testHasdesiredconstructor(){
+        assertFalse(ReflectionUtils.hasDesiredConstructor(PlainTextStrategy.class, new Class[]{IndexSchemaField.class}));
+        assertFalse(ReflectionUtils.hasDesiredConstructor(PlainTextStrategy.class, new Class[]{}));
+        assertTrue(ReflectionUtils.hasDesiredConstructor(String.class, new Class[]{String.class}));
+    }
+
+}

Propchange: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/TestReflectionUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/TestReflectionUtils.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/TestSimpleObjectPool.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/TestSimpleObjectPool.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/TestSimpleObjectPool.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/TestSimpleObjectPool.java Thu Aug 10 15:32:40 2006
@@ -1,3 +1,19 @@
+/** 
+ * Copyright 2004 The Apache Software Foundation 
+ * 
+ * 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 permissi/**
+ * 
+ */
+
 package org.apache.lucene.gdata.utils;
 
 import java.util.ArrayList;

Modified: lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/Visitor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/Visitor.java?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/Visitor.java (original)
+++ lucene/java/trunk/contrib/gdata-server/src/test/org/apache/lucene/gdata/utils/Visitor.java Thu Aug 10 15:32:40 2006
@@ -1,5 +1,24 @@
+/** 
+ * Copyright 2004 The Apache Software Foundation 
+ * 
+ * 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 org.apache.lucene.gdata.utils;
 
+/**
+ * @author Simon Willnauer
+ *
+ */
 public interface Visitor {
     public void execute(Object[] objects);
 }

Modified: lucene/java/trunk/contrib/gdata-server/webroot/WEB-INF/classes/gdata-config.xml
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/webroot/WEB-INF/classes/gdata-config.xml?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/webroot/WEB-INF/classes/gdata-config.xml (original)
+++ lucene/java/trunk/contrib/gdata-server/webroot/WEB-INF/classes/gdata-config.xml Thu Aug 10 15:32:40 2006
@@ -6,8 +6,78 @@
 		<extension-profile>
 			com.google.gdata.data.ExtensionProfile
 		</extension-profile>
+		<index-schema defaultSearchField="content">
+			<index useTimedIndexer="true" indexerIdleTime="120" optimizeAfterCommit="5" commitAfterDocuments="10">
+				<defaultAnalyzer>
+					org.apache.lucene.analysis.standard.StandardAnalyzer
+				</defaultAnalyzer>
+				<indexLocation>/tmp</indexLocation>
+				<useCompoundFile>true</useCompoundFile>
+				<mergeFactor>10</mergeFactor>
+				<maxBufferedDocs>1000</maxBufferedDocs>
+				<maxMergeDocs>2147483647</maxMergeDocs>
+				<maxFieldLength>10000</maxFieldLength>
+			</index>
+
+			<field name="title" boost="2.0" type="text">
+				<path>/entry/title</path>
+				<analyzer>
+					org.apache.lucene.analysis.standard.StandardAnalyzer
+				</analyzer>
+			</field>
+			<field name="summary" boost="2.0" type="text">
+				<path>/entry/summary</path>
+				<analyzer>
+					org.apache.lucene.analysis.standard.StandardAnalyzer
+				</analyzer>
+			</field>
+			<field name="content" boost="2.0" type="text">
+				<path>/entry/summary</path>
+				<analyzer>
+					org.apache.lucene.analysis.StopAnalyzer
+				</analyzer>
+			</field>
+			<mixed name="content" boost="1.0">
+				<path>/entry/content</path>
+				<contenttype>/entry/content/@type</contenttype>
+				<analyzer>
+					org.apache.lucene.analysis.StopAnalyzer
+				</analyzer>
+				<store>YES</store>
+				<index>TOKENIZED</index>
+			</mixed>
+			<field name="author" boost="1.0" type="text">
+				<path>/entry/author/name</path>
+				<analyzer>
+					org.apache.lucene.analysis.standard.StandardAnalyzer
+				</analyzer>
+			</field>
+			<field name="author" boost="1.0" type="text">
+				<path>/entry/author/email</path>
+				<analyzer>
+					org.apache.lucene.analysis.standard.StandardAnalyzer
+				</analyzer>
+			</field>
+			<field name="updated" boost="1.0" type="gdatadate">
+				<path>/entry/updated</path>
+			</field>
+			<field name="category" boost="1.0" type="category">
+				<path>/entry/category/</path>
+			</field>
+			<!-- custom field configuration -->
+			<!-- <custom name="custom">
+				<path>/path</path>
+				<field-class>
+				org.apache.lucene.gdata.search.analysis.ExtendContentStrategy
+				</field-class>
+				<analyzer>
+				org.apache.lucene.analysis.SimpleAnalyzer
+				</analyzer>
+				</custom>
+			-->
+		</index-schema>
 	</service>
-	<service name="calendar" poolSize="20" public="true">
+	<service name="eventfeed" poolSize="20" public="true">
 		<feed-class>
 			com.google.gdata.data.extensions.EventFeed
 		</feed-class>
@@ -17,24 +87,87 @@
 		<extension-profile>
 			com.google.gdata.data.ExtensionProfile
 		</extension-profile>
+		<index-schema defaultSearchField="content">
+
+			<index useTimedIndexer="true" indexerIdleTime="120" optimizeAfterCommit="5" commitAfterDocuments="10">
+				<defaultAnalyzer>
+					org.apache.lucene.analysis.StandardAnalyzer
+				</defaultAnalyzer>
+				<indexLocation>/tmp/</indexLocation>
+				<useCompoundFile>false</useCompoundFile>
+				<mergeFactor>10</mergeFactor>
+				<maxBufferedDocs>1000</maxBufferedDocs>
+				<maxMergeDocs>10000</maxMergeDocs>
+				<maxFieldLength>10000</maxFieldLength>
+			</index>
+			<field name="title" boost="2.0" type="text">
+				<path>/entry/title</path>
+				<analyzer>
+					org.apache.lucene.analysis.SimpleAnalyzer
+				</analyzer>
+			</field>
+			<field name="summary" boost="2.0" type="text">
+				<path>/entry/summary</path>
+				<analyzer>
+					org.apache.lucene.analysis.SimpleAnalyzer
+				</analyzer>
+			</field>
+			<mixed name="content" boost="1.0">
+				<path>/entry/content</path>
+				<contenttype>/entry/content/@type</contenttype>
+				<analyzer>
+					org.apache.lucene.analysis.StopAnalyzer
+				</analyzer>
+				<store>YES</store>
+				<index>TOKENIZED</index>
+			</mixed>
+			<field name="author" boost="1.0" type="text">
+				<path>/entry/author/name</path>
+				<analyzer>
+					org.apache.lucene.analysis.StopAnalyzer
+				</analyzer>
+			</field>
+			<field name="author" boost="1.0" type="text">
+				<path>/entry/author/email</path>
+				<analyzer>
+					org.apache.lucene.analysis.KeywordAnalyzer
+				</analyzer>
+			</field>
+			<field name="updated" boost="1.0" type="gdatadate">
+				<path>/entry/updated</path>
+			</field>
+			<field name="category" boost="1.0" type="category">
+				<path>/entry/category</path>
+			</field>
+		</index-schema>
 	</service>
+	
 	<server-components>
 		<component>
 			<class>
-				org.apache.lucene.gdata.storage.lucenestorage.StorageCoreController
+				org.apache.lucene.gdata.storage.db4o.DB4oController
 			</class>
 			<configuration>
-				<property name="bufferSize">20</property>
-				<property name="optimizeInterval">20</property>
-				<property name="persistFactor">20</property>
-				<property name="directory">/tmp/storage</property>
-				<property name="recover">true</property>
-	            <property name="keepRecoveredFiles">false</property>
+				<property name="runAsServer">true</property>
+				<property name="port">0</property>
+				<property name="host">localhost</property>
+				<property name="filePath">
+					/tmp/
+				</property>
+				<property name="containerPoolSize">10</property>
+				<property name="user">entw_apache</property>
+				<property name="password">Eh2aSZ</property>
+				<property name="useWeakReferences">true</property>
 			</configuration>
 		</component>
 		<component>
 			<class>
 				org.apache.lucene.gdata.servlet.handler.DefaultRequestHandlerFactory
+			</class>
+		</component>
+		<component>
+			<class>
+				org.apache.lucene.gdata.search.index.IndexController
 			</class>
 		</component>
 		<component>

Modified: lucene/java/trunk/contrib/gdata-server/webroot/WEB-INF/classes/gdata-config.xsd
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/webroot/WEB-INF/classes/gdata-config.xsd?rev=430568&r1=430567&r2=430568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/webroot/WEB-INF/classes/gdata-config.xsd (original)
+++ lucene/java/trunk/contrib/gdata-server/webroot/WEB-INF/classes/gdata-config.xsd Thu Aug 10 15:32:40 2006
@@ -1,10 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
-
 	<xs:element name="feed-class" type="xs:string" />
 	<xs:element name="entry-class" type="xs:string" />
 	<xs:element name="extension-profile" type="xs:string" />
 	<xs:element name="class" type="xs:string" />
+	<xs:annotation>
+		<xs:documentation xml:lang="en">
+			This Schema defines the configuration for the
+			gdata-config.xml file.
+		</xs:documentation>
+	</xs:annotation>
+
 
 	<xs:element name="property">
 		<xs:complexType mixed="true">
@@ -12,15 +18,6 @@
 		</xs:complexType>
 	</xs:element>
 
-	<xs:element name="configuration">
-		<xs:complexType>
-			<xs:sequence>
-				<xs:element ref="property" minOccurs="1"
-					maxOccurs="unbounded" />
-			</xs:sequence>
-		</xs:complexType>
-	</xs:element>
-
 	<xs:element name="service">
 		<xs:complexType>
 			<xs:sequence>
@@ -30,6 +27,8 @@
 					minOccurs="1" />
 				<xs:element ref="extension-profile" maxOccurs="1"
 					minOccurs="1" />
+				<xs:element ref="index-schema" maxOccurs="1"
+					minOccurs="1" />
 			</xs:sequence>
 			<xs:attribute name="name" type="xs:string" use="required" />
 			<xs:attribute name="public" type="xs:boolean" />
@@ -37,6 +36,17 @@
 				use="required" />
 		</xs:complexType>
 	</xs:element>
+	<xs:element name="configuration">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="property" minOccurs="1"
+					maxOccurs="unbounded" />
+			</xs:sequence>
+		</xs:complexType>
+
+	</xs:element>
+
+
 
 	<xs:element name="component">
 		<xs:complexType>
@@ -55,6 +65,10 @@
 					maxOccurs="unbounded" />
 			</xs:sequence>
 		</xs:complexType>
+		<xs:unique name="component-class">
+			<xs:selector xpath="component" />
+			<xs:field xpath="class" />
+		</xs:unique>
 	</xs:element>
 
 	<xs:element name="gdata">
@@ -66,5 +80,164 @@
 					minOccurs="1" />
 			</xs:sequence>
 		</xs:complexType>
+		<xs:unique name="service-name">
+			<xs:selector xpath="service" />
+			<xs:field xpath="@name" />
+		</xs:unique>
+
+	</xs:element>
+
+
+	<!-- Index / Search -->
+	<!-- field boost -->
+	<xs:simpleType name="boostType">
+		<xs:restriction base="xs:decimal">
+			<xs:minExclusive value="0.0" />
+			<xs:fractionDigits value="3" />
+		</xs:restriction>
+	</xs:simpleType>
+
+	<!-- all possible Field.Store constants -->
+	<xs:simpleType name="storeType">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="YES" />
+			<xs:enumeration value="NO" />
+			<xs:enumeration value="COMPRESS" />
+		</xs:restriction>
+	</xs:simpleType>
+	<!-- all possible Field.Index constants -->
+	<xs:simpleType name="indexType">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="TOKENIZED" />
+			<xs:enumeration value="UN_TOKENIZED" />
+			<xs:enumeration value="NO" />
+			<xs:enumeration value="NO_NORMS" />
+		</xs:restriction>
+	</xs:simpleType>
+
+	<!-- 
+	This type correspond to  
+	org.apache.lucene.gdata.search.config.IndexSchemaField$ContentType
+	-->
+	<xs:simpleType name="fieldType">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="html" />
+			<xs:enumeration value="xhtml" />
+			<xs:enumeration value="gdatadate" />
+			<xs:enumeration value="category" />
+			<xs:enumeration value="keyword" />
+			<xs:enumeration value="text" />
+		</xs:restriction>
+	</xs:simpleType>
+<!-- type of fields see: org.apache.lucene.gdata.search.config.IndexSchemaField -->
+	<xs:group name="fields">
+		<xs:choice>
+			<xs:element ref="field" />
+			<xs:element ref="custom" />
+			<xs:element ref="mixed" />
+
+		</xs:choice>
+	</xs:group>
+	<!-- index configuration see: org.apache.lucene.gdata.search.config.IndexSchema -->
+	<xs:element name="index">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="defaultAnalyzer" type="xs:string"
+					maxOccurs="1" minOccurs="1" />
+				<xs:element name="indexLocation" type="xs:string"
+					maxOccurs="1" minOccurs="1" />
+				<xs:element name="useCompoundFile" type="xs:boolean"
+					maxOccurs="1" />
+				<xs:element name="mergeFactor" type="xs:unsignedInt"
+					maxOccurs="1" />
+				<xs:element name="maxBufferedDocs" type="xs:unsignedInt"
+					maxOccurs="1" />
+				<xs:element name="maxMergeDocs" type="xs:unsignedInt"
+					maxOccurs="1" />
+				<xs:element name="maxFieldLength" type="xs:unsignedInt"
+					maxOccurs="1" />
+			</xs:sequence>
+			<xs:attribute name="useTimedIndexer" type="xs:boolean"
+				use="required" />
+			<xs:attribute name="indexerIdleTime" type="xs:unsignedLong" />
+			<xs:attribute name="optimizeAfterCommit" type="xs:unsignedInt" use="required"/>
+			<xs:attribute name="commitAfterDocuments" type="xs:unsignedInt" use="required"/>
+		</xs:complexType>
+	</xs:element>
+
+<!-- index configuration see: org.apache.lucene.gdata.search.config.IndexSchema -->
+	<xs:element name="index-schema">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="index" maxOccurs="1" minOccurs="1" />
+				<xs:group ref="fields" maxOccurs="unbounded"
+					minOccurs="1" />
+			</xs:sequence>
+
+			<xs:attribute name="defaultSearchField" type="xs:string"
+				use="required" />
+
+		</xs:complexType>
 	</xs:element>
+
+	<xs:element name="field">
+		<xs:complexType>
+			<xs:all>
+				<xs:element name="path" type="xs:string" maxOccurs="1"
+					minOccurs="1" />
+				<xs:element name="analyzer" type="xs:string"
+					maxOccurs="1" minOccurs="0" />
+				<xs:element name="index" type="indexType" maxOccurs="1"
+					minOccurs="0" />
+				<xs:element name="store" type="storeType" maxOccurs="1"
+					minOccurs="0" />
+			</xs:all>
+			<xs:attribute name="name" type="xs:string" use="required" />
+			<xs:attribute name="boost" type="boostType" />
+			<xs:attribute name="type" type="fieldType" use="required" />
+		</xs:complexType>
+
+	</xs:element>
+
+	<xs:element name="custom">
+		<xs:complexType>
+			<xs:all>
+				<xs:element name="path" type="xs:string" maxOccurs="1"
+					minOccurs="1" />
+				<xs:element name="field-class" type="xs:string"
+					maxOccurs="1" minOccurs="1" />
+				<xs:element name="analyzer" type="xs:string"
+					maxOccurs="1" minOccurs="0" />
+				<xs:element name="index" type="indexType" maxOccurs="1"
+					minOccurs="0" />
+				<xs:element name="store" type="storeType" maxOccurs="1"
+					minOccurs="0" />
+			</xs:all>
+			<xs:attribute name="name" type="xs:string" use="required" />
+			<xs:attribute name="boost" type="boostType" />
+		</xs:complexType>
+
+	</xs:element>
+
+	<xs:element name="mixed">
+		<xs:complexType>
+			<xs:all>
+				<xs:element name="path" type="xs:string" maxOccurs="1"
+					minOccurs="1" />
+				<xs:element name="contenttype" type="xs:string"
+					maxOccurs="1" minOccurs="1" />
+				<xs:element name="analyzer" type="xs:string"
+					maxOccurs="1" minOccurs="0" />
+				<xs:element name="index" type="indexType" maxOccurs="1"
+					minOccurs="0" />
+				<xs:element name="store" type="storeType" maxOccurs="1"
+					minOccurs="0" />
+			</xs:all>
+			<xs:attribute name="name" type="xs:string" use="required" />
+			<xs:attribute name="boost" type="boostType" />
+		</xs:complexType>
+
+	</xs:element>
+
+
 </xs:schema>



Mime
View raw message