lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r417265 [6/6] - in /lucene/java/trunk/contrib/gdata-server: ./ lib/ src/java/ src/java/org/apache/lucene/gdata/server/ src/java/org/apache/lucene/gdata/server/registry/ src/java/org/apache/lucene/gdata/servlet/ src/java/org/apache/lucene/gd...
Date Mon, 26 Jun 2006 18:14:55 GMT
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=417265&r1=417264&r2=417265&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 Mon Jun 26 11:14:53 2006
@@ -1,247 +1,387 @@
-package org.apache.lucene.gdata.storage.lucenestorage; 
- 
-import java.io.IOException; 
-import java.util.Date; 
- 
-import junit.framework.TestCase; 
- 
-import org.apache.lucene.analysis.standard.StandardAnalyzer; 
-import org.apache.lucene.gdata.server.FeedNotFoundException; 
-import org.apache.lucene.gdata.server.registry.FeedInstanceConfigurator; 
-import org.apache.lucene.gdata.server.registry.GDataServerRegistry; 
-import org.apache.lucene.gdata.server.registry.RegistryBuilder; 
-import org.apache.lucene.gdata.storage.StorageException; 
-import org.apache.lucene.gdata.storage.lucenestorage.StorageCoreController; 
-import org.apache.lucene.gdata.storage.lucenestorage.StorageEntryWrapper; 
-import org.apache.lucene.gdata.storage.lucenestorage.StorageModifier; 
-import org.apache.lucene.gdata.storage.lucenestorage.StorageQuery; 
-import org.apache.lucene.gdata.storage.lucenestorage.StorageEntryWrapper.StorageOperation; 
-import org.apache.lucene.gdata.storage.lucenestorage.util.ReferenceCounter; 
-import org.apache.lucene.index.IndexWriter; 
-import org.apache.lucene.index.Term; 
-import org.apache.lucene.search.Hits; 
-import org.apache.lucene.search.IndexSearcher; 
-import org.apache.lucene.search.Query; 
-import org.apache.lucene.search.TermQuery; 
-import org.apache.lucene.store.Directory; 
-import org.apache.lucene.store.RAMDirectory; 
- 
-import com.google.gdata.data.BaseEntry; 
-import com.google.gdata.data.DateTime; 
-import com.google.gdata.data.Entry; 
-import com.google.gdata.data.ExtensionProfile; 
-import com.google.gdata.data.Feed; 
-import com.google.gdata.data.PlainTextConstruct; 
-import com.google.gdata.data.TextConstruct; 
-import com.google.gdata.data.TextContent; 
-import com.google.gdata.util.ParseException; 
- 
-public class TestStorageModifier extends TestCase { 
-    private StorageModifier modifier; 
-    private int count = 1; 
-    
-    private ExtensionProfile profile; 
-    private  Directory dir; 
- 
-    
-    private static String feedId = "myFeed"; 
-   
-    protected void setUp() throws Exception { 
-        FeedInstanceConfigurator configurator = new FeedInstanceConfigurator(); 
-        configurator.setFeedType(Feed.class); 
-        configurator.setFeedId(feedId); 
-        configurator.setExtensionProfileClass(ExtensionProfile.class); 
-        GDataServerRegistry.getRegistry().registerFeed(configurator); 
-        dir = new RAMDirectory(); 
-        this.profile = new ExtensionProfile(); 
-        IndexWriter writer; 
-         
-        writer = new IndexWriter(dir,new StandardAnalyzer(),true); 
-        writer.close(); 
-        modifier = StorageCoreController.getStorageCoreController(dir).getStorageModifier(); 
-         
+package org.apache.lucene.gdata.storage.lucenestorage;
+
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+import org.apache.lucene.gdata.data.GDataAccount;
+import org.apache.lucene.gdata.data.ServerBaseEntry;
+import org.apache.lucene.gdata.data.ServerBaseFeed;
+import org.apache.lucene.gdata.server.registry.ComponentType;
+import org.apache.lucene.gdata.server.registry.GDataServerRegistry;
+import org.apache.lucene.gdata.server.registry.ProvidedService;
+import org.apache.lucene.gdata.storage.StorageController;
+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.index.Term;
+import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.Hits;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.store.Directory;
+
+import com.google.gdata.data.BaseEntry;
+import com.google.gdata.data.DateTime;
+import com.google.gdata.data.Entry;
+import com.google.gdata.data.PlainTextConstruct;
+import com.google.gdata.data.TextContent;
+import com.google.gdata.util.ParseException;
+
+public class TestStorageModifier extends TestCase {
+    private StorageModifier modifier;
+
+    private int count = 1;
+
+    private ProvidedService configurator;
+
+    private Directory dir;
+
+    private StorageCoreController controller;
+
+    private static String feedId = "myFeed";
+
+    private static String username = "simon";
+
+    private static String password = "test";
+    private static String service = "myService";
+
+    protected void setUp() throws Exception {
+        GDataServerRegistry.getRegistry().registerComponent(
+                StorageCoreController.class);
+        this.configurator = new ProvidedServiceStub();
+        GDataServerRegistry.getRegistry().registerService(this.configurator);
+        this.controller = (StorageCoreController) GDataServerRegistry
+                .getRegistry().lookup(StorageController.class,
+                        ComponentType.STORAGECONTROLLER);
+        this.modifier = this.controller.getStorageModifier();
+        this.dir = this.controller.getDirectory();
+
+    }
+
+    protected void tearDown() throws Exception {
+        this.count = 1;
+        // destroy all resources
+        GDataServerRegistry.getRegistry().destroy();// TODO remove dependency
+                                                    // here
+
+    }
+
+    /*
+     * Test method for
+     * 'org.apache.lucene.storage.lucenestorage.StorageModifier.updateEntry(StroageEntryWrapper)'
+     */
+    public void testUpdateEntry() throws IOException, InterruptedException,
+            ParseException, StorageException {
+        testInsertEntry();
+        for (int i = 1; i < this.count; i++) {
+            Entry e = new Entry();
+            e.setId("" + i);
+            String insertString = "Hello world" + i;
+            e.setTitle(new PlainTextConstruct(insertString));
+            ServerBaseEntry en = getServerEntry(e);
+            StorageEntryWrapper wrapper = new StorageEntryWrapper(en,
+                    StorageOperation.UPDATE);
+            this.modifier.updateEntry(wrapper);
+            ReferenceCounter<StorageQuery> innerQuery = this.controller
+                    .getStorageQuery();
+            BaseEntry fetchedEntry = innerQuery.get().singleEntryQuery("" + i,
+                    feedId, this.configurator);
+            assertEquals("updated Title:", insertString, fetchedEntry
+                    .getTitle().getPlainText());
+        }
+        // double updates
+        for (int i = 1; i < this.count; i++) {
+            Entry e = new Entry();
+            e.setId("" + i);
+            String insertString = "Hello world" + i;
+            e.setTitle(new PlainTextConstruct(insertString));
+            ServerBaseEntry en = getServerEntry(e);
+            StorageEntryWrapper wrapper = new StorageEntryWrapper(en,
+                    StorageOperation.UPDATE);
+            this.modifier.updateEntry(wrapper);
+
+            e = new Entry();
+            e.setId("" + i);
+            insertString = "Foo Bar" + i;
+            e.setTitle(new PlainTextConstruct(insertString));
+            en = getServerEntry(e);
+            wrapper = new StorageEntryWrapper(en,
+                    StorageOperation.UPDATE);
+            this.modifier.updateEntry(wrapper);
+
+            ReferenceCounter<StorageQuery> innerQuery = this.controller
+                    .getStorageQuery();
+
+            BaseEntry fetchedEntry = innerQuery.get().singleEntryQuery("" + i,
+                    feedId, this.configurator);
+            assertEquals("updated Title:", insertString, fetchedEntry
+                    .getTitle().getPlainText());
+        }
+
+    }
+
+    /*
+     * Test method for
+     * 'org.apache.lucene.storage.lucenestorage.StorageModifier.insertEntry(StroageEntryWrapper)'
+     */
+    public void testInsertEntry() throws IOException, InterruptedException,
+            ParseException, StorageException {
+
+        Thread a = getRunnerThread(this.count);
+        a.start();
+
+        Thread b = getRunnerThread((this.count += 10));
+        b.start();
+        a.join();
+        for (int i = 1; i < this.count; i++) {
+            ReferenceCounter<StorageQuery> innerQuery = this.controller
+                    .getStorageQuery();
+            BaseEntry e = innerQuery.get().singleEntryQuery("" + i, feedId,
+                    this.configurator);
+            assertEquals("get entry for id" + i, "" + i, e.getId());
+
+        }
+        b.join();
+        ReferenceCounter<StorageQuery> query = this.controller
+                .getStorageQuery();
+
+        this.count += 10;
+        for (int i = 1; i < this.count; i++) {
+            BaseEntry e = query.get().singleEntryQuery("" + i, feedId,
+                    this.configurator);
+            assertEquals("get entry for id" + i, "" + i, e.getId());
+        }
+
+        BaseEntry e = query.get().singleEntryQuery("" + this.count, feedId,
+                this.configurator);
+        assertNull("not entry for ID", e);
+        query.decrementRef();
+
+    }
+
+    /*
+     * Test method for
+     * 'org.apache.lucene.storage.lucenestorage.StorageModifier.deleteEntry(String)'
+     */
+    public void testDeleteEntry() throws IOException, InterruptedException,
+            ParseException, StorageException {
+        testInsertEntry();
+        for (int i = 1; i < this.count; i++) {
+            if (i % 2 == 0 || i < 10) {
+                ServerBaseEntry entry = new ServerBaseEntry();
+                entry.setId("" + i);
+                entry.setFeedId(feedId);
+                this.modifier.deleteEntry(new StorageEntryWrapper(entry,StorageOperation.DELETE));
+            }
+            ReferenceCounter<StorageQuery> query = this.controller
+                    .getStorageQuery();
+            if (i % 2 == 0 || i < 10) {
+                assertNull(query.get().singleEntryQuery("" + i, feedId,
+                        this.configurator));
+            } else
+                assertEquals("" + i, query.get().singleEntryQuery("" + i,
+                        feedId, this.configurator).getId());
+            query.decrementRef();
+        }
+
+        this.controller.forceWrite();
+        IndexSearcher searcher = new IndexSearcher(this.dir);
+
+        for (int i = 1; i < this.count; i++) {
+            Query luceneQuery = new TermQuery(new Term(
+                    StorageEntryWrapper.FIELD_ENTRY_ID, "" + i));
+            Hits hits = searcher.search(luceneQuery);
+            if (i % 2 == 0 || i < 10) {
+
+                assertEquals(0, hits.length());
+            } else
+                assertEquals(1, hits.length());
+        }
+        searcher.close();
+
+    }
+
+    public void testSaveUser() throws StorageException, IOException {
+
+        GDataAccount user = new GDataAccount();
+        user.setName(username);
+        user.setPassword(password);
+        StorageAccountWrapper wrapper = new StorageAccountWrapper(user);
+        this.modifier.createAccount(wrapper);
+        IndexSearcher searcher = new IndexSearcher(this.dir);
+        Query q = new TermQuery(new Term(StorageAccountWrapper.FIELD_ACCOUNTNAME,
+                username));
+        Hits h = searcher.search(q);
+        assertEquals("length == 1", 1, h.length());
+        GDataAccount storedUser = StorageAccountWrapper.buildEntity(h.doc(0));
+        assertTrue(storedUser.equals(user));
+        searcher.close();
+    }
+
+    public void testDeleteUser() throws StorageException, IOException {
+        testSaveUser();
+        this.modifier.deleteAccount(username);
+        IndexSearcher searcher = new IndexSearcher(this.dir);
+        Query q = new TermQuery(new Term(StorageAccountWrapper.FIELD_ACCOUNTNAME,
+                username));
+        Hits h = searcher.search(q);
+        assertEquals("length == 0", 0, h.length());
+        searcher.close();
+    }
+
+    public void testUpdateUser() throws StorageException, IOException {
+        testSaveUser();
+        GDataAccount user = new GDataAccount();
+        user.setName(username);
+        user.setPassword("newPass");
+        StorageAccountWrapper wrapper = new StorageAccountWrapper(user);
+        this.modifier.updateAccount(wrapper);
+        IndexSearcher searcher = new IndexSearcher(this.dir);
+        Query q = new TermQuery(new Term(StorageAccountWrapper.FIELD_ACCOUNTNAME,
+                username));
+        Hits h = searcher.search(q);
+        assertEquals("length == 1", 1, h.length());
+        GDataAccount storedUser = StorageAccountWrapper.buildEntity(h.doc(0));
+        assertTrue(storedUser.equals(user));
+
+        assertFalse(storedUser.getPassword().equals(password));
+        searcher.close();
+    }
+
+    public void testSaveFeed() throws IOException, StorageException {
+        String title = "myTitle";
+        ServerBaseFeed feed = new ServerBaseFeed();
+        feed.setId(feedId);
+        feed.setTitle(new PlainTextConstruct(title));
+        feed.setServiceType(service);
+        feed.setServiceConfig(this.configurator);
+        StorageFeedWrapper wrapper = new StorageFeedWrapper(feed,username);
+        this.modifier.createFeed(wrapper);
+        
+        IndexSearcher searcher = new IndexSearcher(this.dir);
+        Query q = new TermQuery(new Term(StorageFeedWrapper.FIELD_FEED_ID,
+                feedId));
+        Hits h = searcher.search(q);
+        assertEquals("length == 1", 1, h.length());
+        searcher.close();
         
-    } 
- 
-    protected void tearDown() throws Exception { 
-        this.count = 1; 
-        // destroy all resources 
-        GDataServerRegistry.getRegistry().destroy();//TODO remove dependency here 
-         
-    } 
- 
-    /* 
-     * Test method for 
-     * 'org.apache.lucene.storage.lucenestorage.StorageModifier.StorageModifier(Directory, 
-     * int)' 
-     */ 
-    public void testStorageModifier() { 
- 
-    } 
- 
-    /* 
-     * Test method for 
-     * 'org.apache.lucene.storage.lucenestorage.StorageModifier.updateEntry(StroageEntryWrapper)' 
-     */ 
-    public void testUpdateEntry() throws IOException, InterruptedException, FeedNotFoundException, ParseException, StorageException { 
-        testInsertEntry(); 
-        for(int i = 1; i < this.count; i++){ 
-            Entry e = new Entry(); 
-            e.setId(""+i); 
-            String insertString = "Hello world"+i; 
-            e.setTitle(new PlainTextConstruct(insertString)); 
-            StorageEntryWrapper wrapper = new StorageEntryWrapper(e,feedId,StorageOperation.UPDATE,this.profile); 
-            this.modifier.updateEntry(wrapper); 
-            ReferenceCounter<StorageQuery> innerQuery = StorageCoreController.getStorageCoreController().getStorageQuery(); 
-            BaseEntry fetchedEntry = innerQuery.get().singleEntryQuery(""+i,feedId,this.profile); 
-            assertEquals("updated Title:",insertString,fetchedEntry.getTitle().getPlainText());             
-        } 
-        // double updates 
-        for(int i = 1; i < this.count; i++){ 
-            Entry e = new Entry(); 
-            e.setId(""+i); 
-            String insertString = "Hello world"+i; 
-            e.setTitle(new PlainTextConstruct(insertString)); 
-            StorageEntryWrapper wrapper = new StorageEntryWrapper(e,feedId,StorageOperation.UPDATE,this.profile); 
-            this.modifier.updateEntry(wrapper); 
-             
-            e = new Entry(); 
-            e.setId(""+i); 
-            insertString = "Foo Bar"+i; 
-            e.setTitle(new PlainTextConstruct(insertString)); 
-            wrapper = new StorageEntryWrapper(e,feedId,StorageOperation.UPDATE,this.profile); 
-            this.modifier.updateEntry(wrapper); 
-             
-            ReferenceCounter<StorageQuery> innerQuery = StorageCoreController.getStorageCoreController().getStorageQuery(); 
-             
-            BaseEntry fetchedEntry = innerQuery.get().singleEntryQuery(""+i,feedId,this.profile); 
-            assertEquals("updated Title:",insertString,fetchedEntry.getTitle().getPlainText());             
-        } 
- 
-         
-         
-    } 
- 
-    /* 
-     * Test method for 
-     * 'org.apache.lucene.storage.lucenestorage.StorageModifier.insertEntry(StroageEntryWrapper)' 
-     */ 
-    public void testInsertEntry() throws IOException, InterruptedException, FeedNotFoundException, ParseException, StorageException { 
+    }
+
+    public void testDeleteFeed() throws IOException, StorageException {
+        testSaveFeed();
+        Entry e = new Entry();
+        e.setTitle(new PlainTextConstruct("hello world"));
+        ServerBaseEntry entry = new ServerBaseEntry(e);
+        entry.setFeedId(feedId);
+        entry.setId("testme");
+        entry.setServiceConfig(this.configurator);
+        StorageEntryWrapper entryWrapper = new StorageEntryWrapper(entry,StorageOperation.INSERT);
+        this.modifier.insertEntry(entryWrapper);
+        this.modifier.forceWrite();
+        this.modifier.deleteFeed(feedId);
+        IndexSearcher searcher = new IndexSearcher(this.dir);
+        Query q = new TermQuery(new Term(StorageFeedWrapper.FIELD_FEED_ID,
+                feedId));
+        Query q1 = new TermQuery(new Term(StorageEntryWrapper.FIELD_FEED_REFERENCE,
+                feedId));
+        BooleanQuery boolQuery = new BooleanQuery();
+        boolQuery.add(q,BooleanClause.Occur.SHOULD);
+        boolQuery.add(q1,BooleanClause.Occur.SHOULD);
+        Hits h = searcher.search(boolQuery);
+        assertEquals("length == 0", 0, h.length());
+        searcher.close();
         
-        Thread a = getRunnerThread(this.count); 
-        a.start(); 
-         
-        Thread b = getRunnerThread((this.count+=10)); 
-        b.start(); 
-        a.join(); 
-        for (int i = 1; i < this.count ; i++) { 
-            ReferenceCounter<StorageQuery> innerQuery = StorageCoreController.getStorageCoreController().getStorageQuery(); 
-            BaseEntry e = innerQuery.get().singleEntryQuery(""+i,feedId,this.profile); 
-            assertEquals("get entry for id"+i,""+i,e.getId()); 
-             
-             
-        } 
-        b.join(); 
-        ReferenceCounter<StorageQuery> query = StorageCoreController.getStorageCoreController().getStorageQuery(); 
-         
-        this.count+=10; 
-        for (int i = 1; i < this.count ; i++) { 
-            BaseEntry e = query.get().singleEntryQuery(""+i,feedId,this.profile); 
-            assertEquals("get entry for id"+i,""+i,e.getId()); 
-        } 
         
-        BaseEntry e = query.get().singleEntryQuery(""+this.count,feedId,this.profile); 
-        assertNull("not entry for ID",e); 
-        query.decrementRef(); 
-         
-    } 
- 
-    /* 
-     * Test method for 
-     * 'org.apache.lucene.storage.lucenestorage.StorageModifier.deleteEntry(String)' 
-     */ 
-    public void testDeleteEntry() throws IOException, InterruptedException, FeedNotFoundException, ParseException, StorageException { 
-        testInsertEntry(); 
-        for (int i = 1; i < this.count ; i++) { 
-            if(i%2 == 0 || i< 10){ 
-                this.modifier.deleteEntry(""+i,feedId); 
-            } 
-            ReferenceCounter<StorageQuery> query = StorageCoreController.getStorageCoreController().getStorageQuery(); 
-            if(i%2 == 0 || i< 10){ 
-                assertNull(query.get().singleEntryQuery(""+i,feedId,this.profile)); 
-            } 
-            else 
-                assertEquals(""+i,query.get().singleEntryQuery(""+i,feedId,this.profile).getId()); 
-            query.decrementRef(); 
-        } 
-         
-        StorageCoreController.getStorageCoreController().forceWrite(); 
-        IndexSearcher searcher = new IndexSearcher(this.dir); 
-         
-        for (int i = 1; i < this.count ; i++) { 
-            Query luceneQuery = new TermQuery(new Term(StorageEntryWrapper.FIELD_ENTRY_ID,""+i)); 
-            Hits hits = searcher.search(luceneQuery); 
-            if(i%2 == 0 || i< 10){ 
-                 
-                assertEquals(0,hits.length()); 
-            } 
-            else 
-                assertEquals(1,hits.length()); 
-        } 
-        searcher.close(); 
-         
-    } 
-     
-     
-    private Thread getRunnerThread(int idIndex){ 
-        Thread t = new Thread(new Runner(idIndex)); 
-        return t; 
-    } 
-     
-    private class Runner implements Runnable{ 
-        private int idIndex; 
-        public Runner(int idIndex){ 
-            this.idIndex = idIndex; 
-        } 
-        public void run() { 
-            for (int i = idIndex; i < idIndex+10; i++) { 
-               
-                BaseEntry e = buildEntry(""+i); 
-                try { 
-                StorageEntryWrapper wrapper = new StorageEntryWrapper(e,feedId,StorageOperation.INSERT,new ExtensionProfile()); 
-                modifier.insertEntry(wrapper); 
-                } catch (Exception e1) { 
-                     
-                    e1.printStackTrace(); 
-                } 
-            
-                 
-                 
-     
-            } 
-          
-                             
-        }//end run 
-         
-        private BaseEntry buildEntry(String id){ 
-            Entry e = new Entry(); 
-            e.setId(id); 
-            e.setTitle(new PlainTextConstruct("Monty Python")); 
-             
-            e.setPublished(DateTime.now()); 
-             
-            e.setUpdated(DateTime.now()); 
-            String content = "1st soldier with a keen interest in birds: Who goes there?" + 
-                    "King Arthur: It is I, Arthur, son of Uther Pendragon, from the castle of Camelot. King of the Britons, defeater of the Saxons, Sovereign of all England!" + 
-                    "1st soldier with a keen interest in birds: Pull the other one!" + 
-                    "King Arthur: I am, and this is my trusty servant Patsy. We have ridden the length and breadth of the land in search of knights who will join me in my court at Camelot. I must speak with your lord and master." + 
-                    "1st soldier with a keen interest in birds: What? Ridden on a horse?" + 
-                    "King Arthur: Yes!"; 
-            e.setContent(new TextContent(new PlainTextConstruct(content))); 
-            e.setSummary(new PlainTextConstruct("The Holy Grail")); 
-            return e; 
-        } 
-         
-    } 
- 
-} 
+        
+    }
+
+    /**
+     * @throws IOException
+     * @throws StorageException
+     */
+    public void testUpdateFeed() throws IOException, StorageException {
+        testSaveFeed();
+        ServerBaseFeed feed = new ServerBaseFeed();
+        String title = "myTitle";
+        String newusername = "doug";
+        feed.setTitle(new PlainTextConstruct(title));
+        feed.setId(feedId);
+        feed.setServiceType(service);
+        feed.setServiceConfig(this.configurator);
+        StorageFeedWrapper wrapper = new StorageFeedWrapper(feed,newusername);
+        this.modifier.updateFeed(wrapper);
+        IndexSearcher searcher = new IndexSearcher(this.dir);
+        Query q = new TermQuery(new Term(StorageFeedWrapper.FIELD_FEED_ID,
+                feedId));
+        Hits h = searcher.search(q);
+        assertEquals("length == 1", 1, h.length());
+        assertTrue(h.doc(0).get(StorageFeedWrapper.FIELD_ACCOUNTREFERENCE).equals(newusername));
+        searcher.close();
+
+    }
+
+    private Thread getRunnerThread(int idIndex) {
+        Thread t = new Thread(new Runner(idIndex));
+        return t;
+    }
+
+    private class Runner implements Runnable {
+        private int idIndex;
+
+        public Runner(int idIndex) {
+            this.idIndex = idIndex;
+        }
+
+        public void run() {
+            for (int i = idIndex; i < idIndex + 10; i++) {
+
+                BaseEntry e = buildEntry("" + i);
+                try {
+                    ServerBaseEntry en = new ServerBaseEntry(e);
+                    en.setFeedId(feedId);
+                    en.setServiceConfig(configurator);
+                    StorageEntryWrapper wrapper = new StorageEntryWrapper(en,
+                            StorageOperation.INSERT);
+                    modifier.insertEntry(wrapper);
+                } catch (Exception e1) {
+
+                    e1.printStackTrace();
+                }
+
+            }
+
+        }// end run
+
+        private BaseEntry buildEntry(String id) {
+            Entry e = new Entry();
+            e.setId(id);
+            e.setTitle(new PlainTextConstruct("Monty Python"));
+
+            e.setPublished(DateTime.now());
+
+            e.setUpdated(DateTime.now());
+            String content = "1st soldier with a keen interest in birds: Who goes there?"
+                    + "King Arthur: It is I, Arthur, son of Uther Pendragon, from the castle of Camelot. King of the Britons, defeater of the Saxons, Sovereign of all England!"
+                    + "1st soldier with a keen interest in birds: Pull the other one!"
+                    + "King Arthur: I am, and this is my trusty servant Patsy. We have ridden the length and breadth of the land in search of knights who will join me in my court at Camelot. I must speak with your lord and master."
+                    + "1st soldier with a keen interest in birds: What? Ridden on a horse?"
+                    + "King Arthur: Yes!";
+            e.setContent(new TextContent(new PlainTextConstruct(content)));
+            e.setSummary(new PlainTextConstruct("The Holy Grail"));
+            return e;
+        }
+
+    }
+    
+    private ServerBaseEntry getServerEntry(BaseEntry e){
+        ServerBaseEntry en = new ServerBaseEntry(e);
+        en.setFeedId(feedId);
+        en.setServiceConfig(this.configurator);
+        return en;
+    }
+
+}

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=417265&r1=417264&r2=417265&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 Mon Jun 26 11:14:53 2006
@@ -1,175 +1,266 @@
-package org.apache.lucene.gdata.storage.lucenestorage; 
- 
-import java.io.IOException; 
-import java.util.ArrayList; 
-import java.util.List; 
- 
-import junit.framework.TestCase; 
- 
-import org.apache.lucene.analysis.standard.StandardAnalyzer; 
-import org.apache.lucene.gdata.server.FeedNotFoundException; 
-import org.apache.lucene.gdata.server.registry.FeedInstanceConfigurator; 
-import org.apache.lucene.gdata.server.registry.GDataServerRegistry; 
-import org.apache.lucene.gdata.server.registry.RegistryBuilder; 
-import org.apache.lucene.gdata.storage.StorageException; 
-import org.apache.lucene.gdata.storage.lucenestorage.StorageCoreController; 
-import org.apache.lucene.gdata.storage.lucenestorage.StorageEntryWrapper; 
-import org.apache.lucene.gdata.storage.lucenestorage.StorageModifier; 
-import org.apache.lucene.gdata.storage.lucenestorage.StorageQuery; 
-import org.apache.lucene.gdata.storage.lucenestorage.StorageEntryWrapper.StorageOperation; 
-import org.apache.lucene.gdata.storage.lucenestorage.util.ReferenceCounter; 
-import org.apache.lucene.index.IndexWriter; 
-import org.apache.lucene.store.Directory; 
-import org.apache.lucene.store.RAMDirectory; 
- 
-import com.google.gdata.data.BaseEntry; 
-import com.google.gdata.data.DateTime; 
-import com.google.gdata.data.Entry; 
-import com.google.gdata.data.ExtensionProfile; 
-import com.google.gdata.data.Feed; 
-import com.google.gdata.util.ParseException; 
- 
-public class TestStorageQuery extends TestCase { 
-    private StorageModifier modifier; 
-    private int count = 30; 
-    private ReferenceCounter<StorageQuery> query; 
-    private ExtensionProfile profile; 
- 
-    private  Directory dir; 
-    private static String feedId = "myFeed"; 
-    protected void setUp() throws Exception { 
-        FeedInstanceConfigurator configurator = new FeedInstanceConfigurator(); 
-        configurator.setFeedType(Feed.class); 
-        configurator.setFeedId(feedId); 
-        configurator.setExtensionProfileClass(ExtensionProfile.class); 
-        GDataServerRegistry.getRegistry().registerFeed(configurator); 
-        this.profile = new ExtensionProfile(); 
-        this.dir = new RAMDirectory(); 
-        IndexWriter writer; 
-        writer = new IndexWriter(this.dir,new StandardAnalyzer(),true); 
-        writer.close(); 
-        this.modifier = StorageCoreController.getStorageCoreController(this.dir).getStorageModifier(); 
-        insertEntries(this.count); 
-        this.query = StorageCoreController.getStorageCoreController().getStorageQuery(); 
+package org.apache.lucene.gdata.storage.lucenestorage;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.lucene.gdata.data.GDataAccount;
+import org.apache.lucene.gdata.data.ServerBaseEntry;
+import org.apache.lucene.gdata.data.ServerBaseFeed;
+import org.apache.lucene.gdata.server.registry.ComponentType;
+import org.apache.lucene.gdata.server.registry.GDataServerRegistry;
+import org.apache.lucene.gdata.server.registry.ProvidedService;
+import org.apache.lucene.gdata.storage.StorageController;
+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.store.Directory;
+
+import com.google.gdata.data.BaseEntry;
+import com.google.gdata.data.BaseFeed;
+import com.google.gdata.data.DateTime;
+import com.google.gdata.data.Entry;
+import com.google.gdata.util.ParseException;
+
+public class TestStorageQuery extends TestCase {
+    private StorageModifier modifier;
+    private int count = 30;
+    private ReferenceCounter<StorageQuery> query;
+    private ProvidedService configurator;
+    private StorageCoreController controller;
+    private  Directory dir;
+    private static String feedId = "myFeed";
+    private static String accountName = "simon";
+    private static String service = ProvidedServiceStub.SERVICE_NAME;
+    protected void setUp() throws Exception {
+        GDataServerRegistry.getRegistry().registerComponent(StorageCoreController.class);
+        this.configurator = new ProvidedServiceStub();
+        
+        
+        GDataServerRegistry.getRegistry().registerService(this.configurator);
+        this.controller = (StorageCoreController)GDataServerRegistry.getRegistry().lookup(StorageController.class,ComponentType.STORAGECONTROLLER);
+        this.modifier = this.controller.getStorageModifier();
+        this.dir = this.controller.getDirectory();        
+        ServerBaseFeed feed = new ServerBaseFeed();
+        feed.setId(feedId);
+        feed.setServiceType(service);
+        feed.setServiceConfig(this.configurator);
+        
+        StorageFeedWrapper wrapper = new StorageFeedWrapper(feed,accountName);
+        this.modifier.createFeed(wrapper);
+        insertEntries(this.count);
+        this.query = this.controller.getStorageQuery();
+        
        
-         
-         
-    } 
-     
-     
-    public void insertEntries(int count) throws IOException,InterruptedException, StorageException{ 
-        List<StorageEntryWrapper> tempList = new ArrayList<StorageEntryWrapper>(); 
-        for (int i = 0; i <= count ; i++) { 
-            Entry entry = new Entry(); 
-            entry.setId(""+i); 
-             
-            entry.setUpdated(new DateTime(System.currentTimeMillis(),0)); 
-            StorageEntryWrapper wrapper = new StorageEntryWrapper(entry,feedId,StorageOperation.INSERT,this.profile); 
-            tempList.add(i,wrapper); 
-            
-            // force different timestamps --> DateTime 2006-06-05T13:37:55.724Z 
-            Thread.sleep(50); 
-           
-        } 
-        for (StorageEntryWrapper entry : tempList) { 
-            this.modifier.insertEntry(entry); 
-        } 
-         
-         
-         
-         
-    } 
- 
-    protected void tearDown() throws Exception { 
-        this.query.decrementRef(); 
-        GDataServerRegistry.getRegistry().destroy();//TODO remove dependency here 
-    } 
- 
-    /* 
-     * Test method for 'org.apache.lucene.storage.lucenestorage.StorageQuery.feedQuery(String, int, int)' 
-     */ 
-    public void testFeedQuery() throws IOException, FeedNotFoundException, ParseException, StorageException { 
-        FeedQueryHelper(this.query); 
-        StorageCoreController.getStorageCoreController().forceWrite(); 
-        ReferenceCounter<StorageQuery> queryAssureWritten = StorageCoreController.getStorageCoreController().getStorageQuery(); 
-        
-        assertNotSame(queryAssureWritten,this.query); 
-        FeedQueryHelper(queryAssureWritten); 
-        queryAssureWritten.decrementRef(); 
-    } 
-    private void FeedQueryHelper(ReferenceCounter<StorageQuery> currentQuery) throws IOException, FeedNotFoundException, ParseException{ 
-        List<BaseEntry> entryList = currentQuery.get().getLatestFeedQuery(feedId,25,1,this.profile); 
-         
-        assertTrue("listSize: "+entryList.size(),entryList.size() == 25); 
-         
-        BaseEntry tempEntry = null; 
-        for (BaseEntry entry : entryList) { 
+        
+        
+    }
+    
+    
+    /**
+     * @param entrycount
+     * @throws IOException
+     * @throws InterruptedException
+     * @throws StorageException
+     */
+    public void insertEntries(int entrycount) throws IOException,InterruptedException, StorageException{
+        List<StorageEntryWrapper> tempList = new ArrayList<StorageEntryWrapper>();
+        for (int i = 0; i <= entrycount ; i++) {
+            ServerBaseEntry entry = new ServerBaseEntry(new Entry());
+            entry.setId(""+i);
+            entry.setServiceConfig(this.configurator);
+            entry.setUpdated(new DateTime(System.currentTimeMillis(),0));
+            entry.setFeedId(feedId);
+            StorageEntryWrapper wrapper = new StorageEntryWrapper(entry,StorageOperation.INSERT);
+            tempList.add(i,wrapper);
            
-            assertNotNull("entry",entry); 
-            if(tempEntry != null){ 
-                assertTrue(tempEntry.getUpdated().compareTo(entry.getUpdated())>=0) ; 
-                tempEntry = entry; 
-            }else 
-                tempEntry = entry; 
-             
-        } 
-        // test sub retrieve sublist 
-        int offset = 15; 
-        int resultCount = 5;  
-        List<BaseEntry> entrySubList = currentQuery.get().getLatestFeedQuery(feedId,resultCount,offset,this.profile); 
-         
-        assertTrue("listSize: "+entrySubList.size(),entrySubList.size() == resultCount); 
-        offset--; 
-        for (BaseEntry entry : entrySubList) { 
-             
-            assertEquals(entry.getId(),entryList.get(offset).getId()); 
-            offset++; 
-             
-        } 
-         
-         
-         
-    } 
- 
-    /* 
-     * Test method for 'org.apache.lucene.storage.lucenestorage.StorageQuery.singleEntryQuery(String, String)' 
-     */ 
-    public void testSingleEntryQuery() throws FeedNotFoundException, ParseException, IOException { 
-        for (int i = 1; i <= this.count; i++) { 
-            BaseEntry entry = this.query.get().singleEntryQuery(""+i,feedId,this.profile); 
-            assertEquals(""+i,entry.getId()); 
-        } 
-         
-    } 
- 
-    /* 
-     * Test method for 'org.apache.lucene.storage.lucenestorage.StorageQuery.entryQuery(List<String>, String)' 
-     */ 
-    public void testEntryQuery() throws FeedNotFoundException, ParseException, IOException, StorageException { 
-        entryQueryHelper(this.query); 
-        StorageCoreController.getStorageCoreController().forceWrite(); 
-        ReferenceCounter<StorageQuery> queryAssureWritten = StorageCoreController.getStorageCoreController().getStorageQuery(); 
-        
-        assertNotSame(queryAssureWritten,query); 
-        entryQueryHelper(queryAssureWritten); 
-        queryAssureWritten.decrementRef(); 
-    } 
-     
+            // force different timestamps --> DateTime 2006-06-05T13:37:55.724Z
+            Thread.sleep(10);
+          
+        }
+        for (StorageEntryWrapper entry : tempList) {
+            this.modifier.insertEntry(entry);
+        }
+        
+        
+        
+        
+    }
+
+    protected void tearDown() throws Exception {
+        this.query.decrementRef();
+        GDataServerRegistry.getRegistry().destroy();
+    }
+    
+    /*
+     *  
+     */
+    public void testAccountNameQuery() throws IOException, StorageException{
+        ReferenceCounter<StorageQuery> query = this.controller.getStorageQuery();
+        assertEquals(accountName,query.get().getAccountNameForFeedId(feedId));
+        assertNull(query.get().getAccountNameForFeedId("someId"));
+    }
+
+    /*
+     * Test method for 'org.apache.lucene.storage.lucenestorage.StorageQuery.feedQuery(String, int, int)'
+     */
+    public void testFeedQuery() throws IOException,  ParseException, StorageException {
+        feedQueryHelper(this.query);
+        this.controller.forceWrite();
+        ReferenceCounter<StorageQuery> queryAssureWritten = this.controller.getStorageQuery();
+       
+        assertNotSame(queryAssureWritten,this.query);
+        feedQueryHelper(queryAssureWritten);
+        queryAssureWritten.decrementRef();
+    }
+    private void feedQueryHelper(ReferenceCounter<StorageQuery> currentQuery) throws IOException,  ParseException{
+       BaseFeed feed = currentQuery.get().getLatestFeedQuery(feedId,25,1,this.configurator);
+       List<BaseEntry> entryList = feed.getEntries(); 
+        assertTrue("listSize: "+entryList.size(),entryList.size() == 25);
+        
+        BaseEntry tempEntry = null;
+        for (BaseEntry entry : entryList) {
+          
+            assertNotNull("entry",entry);
+            if(tempEntry != null){
+                assertTrue(tempEntry.getUpdated().compareTo(entry.getUpdated())>=0) ;
+                tempEntry = entry;
+            }else
+                tempEntry = entry;
+            
+        }
+        // test sub retrieve sublist
+        int offset = 15;
+        int resultCount = 5; 
+        feed = currentQuery.get().getLatestFeedQuery(feedId,resultCount,offset,this.configurator);
+        List<BaseEntry> entrySubList = feed.getEntries();
+        
+        assertTrue("listSize: "+entrySubList.size(),entrySubList.size() == resultCount);
+        offset--;
+        for (BaseEntry entry : entrySubList) {
+            
+            assertEquals(entry.getId(),entryList.get(offset).getId());
+            offset++;
+            
+        }
+        
+        
+        
+    }
+
+    /*
+     * Test method for 'org.apache.lucene.storage.lucenestorage.StorageQuery.singleEntryQuery(String, String)'
+     */
+    public void testSingleEntryQuery() throws  ParseException, IOException {
+        for (int i = 1; i <= this.count; i++) {
+            BaseEntry entry = this.query.get().singleEntryQuery(""+i,feedId,this.configurator);
+            assertEquals(""+i,entry.getId());
+        }
+        
+    }
+
+    /*
+     * Test method for 'org.apache.lucene.storage.lucenestorage.StorageQuery.entryQuery(List<String>, String)'
+     */
+    public void testEntryQuery() throws  ParseException, IOException, StorageException {
+        entryQueryHelper(this.query);
+        this.controller.forceWrite();
+        ReferenceCounter<StorageQuery> queryAssureWritten = this.controller.getStorageQuery();
+       
+        assertNotSame(queryAssureWritten,query);
+        entryQueryHelper(queryAssureWritten);
+        queryAssureWritten.decrementRef();
+    }
+    public void testGetUser() throws StorageException, IOException{
+        this.modifier.forceWrite();
+        GDataAccount user = new GDataAccount();
+        user.setName("simon");
+        user.setPassword("pass");
+        user.setAuthorname("simon willnauer");
+        user.setAuthorMail("simon@apache.org");
+        user.setAuthorLink(new URL("http://www.apache.org"));
+        
+       
      
-    private void entryQueryHelper(ReferenceCounter<StorageQuery> currentQuery) throws IOException, FeedNotFoundException, ParseException{ 
-         
-        List<String> entryIdList = new ArrayList<String>(); 
-        for (int i = 1; i <= this.count; i++) { 
-           entryIdList.add(""+i); 
-        } 
-        List<BaseEntry> entryList = currentQuery.get().entryQuery(entryIdList,feedId,this.profile); 
-        assertEquals(entryIdList.size(),entryList.size()); 
-        List<String> entryIdCompare = new ArrayList<String>(); 
-        for (BaseEntry entry : entryList) { 
-            entryIdCompare.add(entry.getId()); 
-        } 
-        assertTrue(entryIdList.containsAll(entryIdCompare)); 
-         
-    } 
- 
-} 
+        this.modifier.createAccount(new StorageAccountWrapper(user));
+        GDataAccount queriedUser = this.query.get().getUser("simon");
+        assertNull(queriedUser);
+        ReferenceCounter<StorageQuery> tempQuery = this.controller.getStorageQuery();
+        queriedUser = tempQuery.get().getUser("simon");
+        assertTrue(queriedUser.equals(user));
+        assertTrue(queriedUser.getAuthorMail().equals(user.getAuthorMail()));
+        assertTrue(queriedUser.getAuthorLink().equals(user.getAuthorLink()));
+        assertTrue(queriedUser.getAuthorname().equals(user.getAuthorname()));
+        assertTrue(queriedUser.getPassword().equals(user.getPassword()));
+    }
+    
+    public void testIsEntryStored() throws IOException{
+        
+      assertTrue(this.query.get().isEntryStored(""+(this.count-1),feedId));
+      assertFalse(this.query.get().isEntryStored("someOther",feedId));
+      this.modifier.forceWrite();
+      assertTrue(this.query.get().isEntryStored(""+(this.count-1),feedId));
+      this.query = this.controller.getStorageQuery();
+      assertTrue(this.query.get().isEntryStored(""+(this.count-1),feedId));
+      assertFalse(this.query.get().isEntryStored("someOther",feedId));
+    }
+    
+    public void testGetEntryLastModied() throws IOException, StorageException{
+        ServerBaseEntry entry = new ServerBaseEntry(new Entry());
+        entry.setId("test");
+        entry.setServiceConfig(this.configurator);
+        entry.setUpdated(new DateTime(System.currentTimeMillis(),0));
+        entry.setFeedId(feedId);
+        StorageEntryWrapper wrapper = new StorageEntryWrapper(entry,StorageOperation.INSERT);
+        
+        this.modifier.insertEntry(wrapper);
+        assertEquals(entry.getUpdated().getValue(),this.query.get().getEntryLastModified("test",feedId));
+        this.modifier.forceWrite();
+        assertEquals(entry.getUpdated().getValue(),this.query.get().getEntryLastModified("test",feedId));
+        this.query = this.controller.getStorageQuery();
+        assertEquals(entry.getUpdated().getValue(),this.query.get().getEntryLastModified("test",feedId));
+        try{
+        this.query.get().getEntryLastModified("some",feedId);
+        fail("exception expected");
+        }catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    
+    public void testGetFeedLastModified() throws StorageException, IOException{
+        ServerBaseEntry entry = new ServerBaseEntry(new Entry());
+        entry.setId("test");
+        entry.setServiceConfig(this.configurator);
+        entry.setUpdated(new DateTime(System.currentTimeMillis(),0));
+        entry.setFeedId(feedId);
+        StorageEntryWrapper wrapper = new StorageEntryWrapper(entry,StorageOperation.INSERT);
+        this.modifier.insertEntry(wrapper);
+        assertEquals(entry.getUpdated().getValue(),this.query.get().getFeedLastModified(feedId));
+        this.modifier.forceWrite();
+        assertEquals(entry.getUpdated().getValue(),this.query.get().getFeedLastModified(feedId));
+        this.query = this.controller.getStorageQuery();
+        assertEquals(entry.getUpdated().getValue(),this.query.get().getFeedLastModified(feedId));
+    }
+    private void entryQueryHelper(ReferenceCounter<StorageQuery> currentQuery) throws IOException,  ParseException{
+        
+        List<String> entryIdList = new ArrayList<String>();
+        for (int i = 1; i <= this.count; i++) {
+           entryIdList.add(""+i);
+        }
+        List<BaseEntry> entryList = currentQuery.get().entryQuery(entryIdList,feedId,this.configurator);
+        assertEquals(entryIdList.size(),entryList.size());
+        List<String> entryIdCompare = new ArrayList<String>();
+        for (BaseEntry entry : entryList) {
+            entryIdCompare.add(entry.getId());
+        }
+        assertTrue(entryIdList.containsAll(entryIdCompare));
+        
+    }
+    
+    
+
+}

Modified: lucene/java/trunk/contrib/gdata-server/webroot/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/gdata-server/webroot/WEB-INF/web.xml?rev=417265&r1=417264&r2=417265&view=diff
==============================================================================
--- lucene/java/trunk/contrib/gdata-server/webroot/WEB-INF/web.xml (original)
+++ lucene/java/trunk/contrib/gdata-server/webroot/WEB-INF/web.xml Mon Jun 26 11:14:53 2006
@@ -1,24 +1,57 @@
-<?xml version="1.0" encoding="UTF-8"?> 
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee" 
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd" 
-    version="2.4"> 
-    <display-name>Lucene GData - Server</display-name> 
-    <description> 
-        Server-side implementation of the GData protocol based on Apache 
-        - Lucene 
-    </description> 
-    <listener> 
-        <listener-class> org.apache.lucene.gdata.server.registry.RegistryContextListener</listener-class> 
-    </listener> 
-    <servlet> 
-        <servlet-name>ControllerServlet</servlet-name> 
-        <servlet-class> 
-            org.apache.lucene.gdata.servlet.RequestControllerServlet 
-        </servlet-class> 
-    </servlet> 
-    <servlet-mapping> 
-        <servlet-name>ControllerServlet</servlet-name> 
-        <url-pattern>/*</url-pattern> 
-    </servlet-mapping> 
-</web-app> 
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd"
+	version="2.4">
+	<display-name>Lucene GData - Server</display-name>
+	<description>
+		Server-side implementation of the GData protocol based on Apache
+		- Lucene
+	</description>
+	<listener>
+		<listener-class>
+			org.apache.lucene.gdata.server.registry.RegistryContextListener
+		</listener-class>
+	</listener>
+	<servlet>
+		<servlet-name>ControllerServlet</servlet-name>
+		<servlet-class>
+			org.apache.lucene.gdata.servlet.RequestControllerServlet
+		</servlet-class>
+	</servlet>
+	<servlet-mapping>
+		<servlet-name>ControllerServlet</servlet-name>
+		<url-pattern>/*</url-pattern>
+	</servlet-mapping>
+	<servlet>
+		<servlet-name>AuthenticationServlet</servlet-name>
+		<servlet-class>
+			org.apache.lucene.gdata.servlet.AuthenticationServlet
+		</servlet-class>
+	</servlet>
+	<servlet-mapping>
+		<servlet-name>AuthenticationServlet</servlet-name>
+		<url-pattern>/accounts/ClientLogin</url-pattern>
+	</servlet-mapping>
+	<servlet>
+		<servlet-name>FeedAdminServlet</servlet-name>
+		<servlet-class>
+			org.apache.lucene.gdata.servlet.FeedAdministrationServlet
+		</servlet-class>
+	</servlet>
+	<servlet-mapping>
+		<servlet-name>FeedAdminServlet</servlet-name>
+		<url-pattern>/admin/feed</url-pattern>
+	</servlet-mapping>
+	<servlet>
+		<servlet-name>AccountAdminServlet</servlet-name>
+		<servlet-class>
+			org.apache.lucene.gdata.servlet.AccountAdministrationServlet
+		</servlet-class>
+	</servlet>
+	<servlet-mapping>
+		<servlet-name>AccountAdminServlet</servlet-name>
+		<url-pattern>/admin/account</url-pattern>
+	</servlet-mapping>
+
+</web-app>
\ No newline at end of file



Mime
View raw message