summaryrefslogtreecommitdiffstats
path: root/base/common/test/com/netscape/cmscore/dbs
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-03-24 02:27:47 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-03-26 11:43:54 -0500
commit621d9e5c413e561293d7484b93882d985b3fe15f (patch)
tree638f3d75761c121d9a8fb50b52a12a6686c5ac5c /base/common/test/com/netscape/cmscore/dbs
parent40d3643b8d91886bf210aa27f711731c81a11e49 (diff)
downloadpki-621d9e5c413e561293d7484b93882d985b3fe15f.tar.gz
pki-621d9e5c413e561293d7484b93882d985b3fe15f.tar.xz
pki-621d9e5c413e561293d7484b93882d985b3fe15f.zip
Removed unnecessary pki folder.
Previously the source code was located inside a pki folder. This folder was created during svn migration and is no longer needed. This folder has now been removed and the contents have been moved up one level. Ticket #131
Diffstat (limited to 'base/common/test/com/netscape/cmscore/dbs')
-rw-r--r--base/common/test/com/netscape/cmscore/dbs/CertRecordListTest.java87
-rw-r--r--base/common/test/com/netscape/cmscore/dbs/DBRegistryDefaultStub.java79
-rw-r--r--base/common/test/com/netscape/cmscore/dbs/DBRegistryTest.java175
-rw-r--r--base/common/test/com/netscape/cmscore/dbs/DBSSessionDefaultStub.java79
-rw-r--r--base/common/test/com/netscape/cmscore/dbs/DBSubsystemDefaultStub.java172
-rw-r--r--base/common/test/com/netscape/cmscore/dbs/DBVirtualListDefaultStub.java87
-rw-r--r--base/common/test/com/netscape/cmscore/dbs/RequestRecordDefaultStub.java44
7 files changed, 723 insertions, 0 deletions
diff --git a/base/common/test/com/netscape/cmscore/dbs/CertRecordListTest.java b/base/common/test/com/netscape/cmscore/dbs/CertRecordListTest.java
new file mode 100644
index 000000000..d3177f62c
--- /dev/null
+++ b/base/common/test/com/netscape/cmscore/dbs/CertRecordListTest.java
@@ -0,0 +1,87 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// (C) 2007 Red Hat, Inc.
+// All rights reserved.
+// --- END COPYRIGHT BLOCK ---
+package com.netscape.cmscore.dbs;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import com.netscape.certsrv.base.EBaseException;
+import com.netscape.certsrv.dbs.IElementProcessor;
+import com.netscape.certsrv.dbs.certdb.ICertRecord;
+import com.netscape.cmscore.test.CMSBaseTestCase;
+
+public class CertRecordListTest extends CMSBaseTestCase {
+
+ public CertRecordListTest(String name) {
+ super(name);
+ }
+
+ public void cmsTestSetUp() {
+ }
+
+ public void cmsTestTearDown() {
+ }
+
+ public static Test suite() {
+ return new TestSuite(CertRecordListTest.class);
+ }
+
+ public void testProcessCertRecordsUsesSize() throws EBaseException {
+ DBVirtualListStub<ICertRecord> dbList = new DBVirtualListStub<ICertRecord>();
+ dbList.size = 5;
+
+ CertRecordList certList = new CertRecordList(dbList);
+
+ assertEquals(5, dbList.size);
+ assertEquals(0, dbList.getElementAtCallCount);
+ assertEquals(0, dbList.lastIndexGetElementAtCalledWith);
+
+ certList.processCertRecords(0, 4, new ElementProcessorStub());
+
+ assertEquals(8, dbList.size);
+ assertEquals(8, dbList.getElementAtCallCount);
+ assertEquals(7, dbList.lastIndexGetElementAtCalledWith);
+ }
+
+ public class DBVirtualListStub<T> extends DBVirtualListDefaultStub<T> {
+ public int size = 0;
+ public int getElementAtCallCount = 0;
+ public int lastIndexGetElementAtCalledWith = 0;
+
+ public T getElementAt(int index) {
+ getElementAtCallCount++;
+ lastIndexGetElementAtCalledWith = index;
+
+ // This simulates the size changing in the middle of
+ // processing
+ if (index == 3) {
+ size = 8;
+ }
+ return null;
+ }
+
+ public int getSize() {
+ return size;
+ }
+ }
+
+ public class ElementProcessorStub implements IElementProcessor {
+ public void process(Object o) throws EBaseException {
+ }
+ }
+}
diff --git a/base/common/test/com/netscape/cmscore/dbs/DBRegistryDefaultStub.java b/base/common/test/com/netscape/cmscore/dbs/DBRegistryDefaultStub.java
new file mode 100644
index 000000000..9635129f4
--- /dev/null
+++ b/base/common/test/com/netscape/cmscore/dbs/DBRegistryDefaultStub.java
@@ -0,0 +1,79 @@
+package com.netscape.cmscore.dbs;
+
+import netscape.ldap.LDAPAttributeSet;
+
+import com.netscape.certsrv.base.EBaseException;
+import com.netscape.certsrv.base.IConfigStore;
+import com.netscape.certsrv.base.ISubsystem;
+import com.netscape.certsrv.dbs.EDBException;
+import com.netscape.certsrv.dbs.IDBAttrMapper;
+import com.netscape.certsrv.dbs.IDBDynAttrMapper;
+import com.netscape.certsrv.dbs.IDBObj;
+import com.netscape.certsrv.dbs.IDBRegistry;
+import com.netscape.certsrv.dbs.IFilterConverter;
+
+/**
+ * A default stub ojbect for tests to extend.
+ */
+public class DBRegistryDefaultStub implements IDBRegistry {
+
+ public void registerObjectClass(String className, String ldapNames[]) throws EDBException {
+ }
+
+ public boolean isObjectClassRegistered(String className) {
+ return false;
+ }
+
+ public void registerAttribute(String ufName, IDBAttrMapper mapper) throws EDBException {
+ }
+
+ public boolean isAttributeRegistered(String ufName) {
+ return false;
+ }
+
+ public void registerDynamicMapper(IDBDynAttrMapper mapper) {
+ }
+
+ public String getFilter(String filter) throws EBaseException {
+ return null;
+ }
+
+ public String getFilter(String filter, IFilterConverter c) throws EBaseException {
+ return null;
+ }
+
+ public void mapObject(IDBObj parent, String name, Object obj, LDAPAttributeSet attrs) throws EBaseException {
+ }
+
+ public String[] getLDAPAttributes(String attrs[]) throws EBaseException {
+ return new String[0];
+ }
+
+ public LDAPAttributeSet createLDAPAttributeSet(IDBObj obj) throws EBaseException {
+ return null;
+ }
+
+ public IDBObj createObject(LDAPAttributeSet attrs) throws EBaseException {
+ return null;
+ }
+
+ public String getId() {
+ return null;
+ }
+
+ public void setId(String id) throws EBaseException {
+ }
+
+ public void init(ISubsystem owner, IConfigStore config) throws EBaseException {
+ }
+
+ public void startup() throws EBaseException {
+ }
+
+ public void shutdown() {
+ }
+
+ public IConfigStore getConfigStore() {
+ return null;
+ }
+}
diff --git a/base/common/test/com/netscape/cmscore/dbs/DBRegistryTest.java b/base/common/test/com/netscape/cmscore/dbs/DBRegistryTest.java
new file mode 100644
index 000000000..c74f66ba1
--- /dev/null
+++ b/base/common/test/com/netscape/cmscore/dbs/DBRegistryTest.java
@@ -0,0 +1,175 @@
+package com.netscape.cmscore.dbs;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Enumeration;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import netscape.ldap.LDAPAttribute;
+import netscape.ldap.LDAPAttributeSet;
+
+import com.netscape.certsrv.base.EBaseException;
+import com.netscape.certsrv.dbs.EDBException;
+import com.netscape.certsrv.dbs.IDBObj;
+import com.netscape.certsrv.dbs.IDBRegistry;
+import com.netscape.certsrv.request.IRequestRecord;
+import com.netscape.cmscore.request.DBDynAttrMapperDefaultStub;
+import com.netscape.cmscore.test.CMSBaseTestCase;
+import com.netscape.cmscore.test.TestHelper;
+
+public class DBRegistryTest extends CMSBaseTestCase {
+
+ DBSubsystemStub db;
+ DBRegistry registry;
+ DBDynAttrMapperStub extAttrMapper;
+ RequestRecordStub requestRecordStub = new RequestRecordStub();
+
+ public DBRegistryTest(String name) {
+ super(name);
+ }
+
+ public void cmsTestSetUp() {
+ db = new DBSubsystemStub();
+ registry = new DBRegistry();
+ db.registry = registry;
+
+ // Emulate the registration of mappers.
+ // Normally RequestRepository calls RequestRecord.register() as part
+ // of a long chain of initialization calls.
+ extAttrMapper = new DBDynAttrMapperStub();
+ try {
+ registry.registerObjectClass(requestRecordStub.getClass().getName(),
+ new String[] { "ocvalue" });
+ registry.registerAttribute(IRequestRecord.ATTR_EXT_DATA, extAttrMapper);
+ registry.registerAttribute(IRequestRecord.ATTR_SOURCE_ID,
+ new StringMapper("sourceIdOut"));
+ registry.registerDynamicMapper(extAttrMapper);
+ } catch (EDBException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void cmsTestTearDown() {
+ }
+
+ public static Test suite() {
+ return new TestSuite(DBRegistryTest.class);
+ }
+
+ public void testMapObject() throws EBaseException {
+ assertFalse(extAttrMapper.mapObjectCalled);
+ registry.mapObject(null, IRequestRecord.ATTR_EXT_DATA, null,
+ new LDAPAttributeSet());
+ assertTrue(extAttrMapper.mapObjectCalled);
+ }
+
+ public void testGetLDAPAttributesForExtData() throws EBaseException {
+ String inAttrs[] = new String[] {
+ "extData-foo",
+ "extData-foo12",
+ "EXTDATA-bar;baz",
+ IRequestRecord.ATTR_SOURCE_ID
+ };
+ String outAttrs[] = registry.getLDAPAttributes(inAttrs);
+
+ assertTrue(TestHelper.contains(outAttrs, inAttrs[0]));
+ assertTrue(TestHelper.contains(outAttrs, inAttrs[1]));
+ assertTrue(TestHelper.contains(outAttrs, inAttrs[2]));
+ assertTrue(TestHelper.contains(outAttrs, "sourceIdOut"));
+
+ try {
+ registry.getLDAPAttributes(new String[] { "badattr" });
+ fail("Should not be able to map badattr");
+ } catch (EBaseException e) { /* good */
+ }
+ }
+
+ public void testCreateLDAPAttributeSet() throws EBaseException {
+ assertFalse(extAttrMapper.mapObjectCalled);
+
+ registry.createLDAPAttributeSet(requestRecordStub);
+ assertTrue(requestRecordStub.getCalled);
+ assertEquals(requestRecordStub.getCalledWith,
+ IRequestRecord.ATTR_EXT_DATA);
+
+ // This asserts that mapObject() is called and makes it down to the
+ // extDataDynAttrMapper.mapObjectToLDAPAttributeSet() call.
+ assertTrue(extAttrMapper.mapObjectCalled);
+ }
+
+ public void testCreateObject() throws EBaseException {
+ LDAPAttributeSet attrs = new LDAPAttributeSet();
+ attrs.add(new LDAPAttribute("objectclass", "ocvalue"));
+ attrs.add(new LDAPAttribute("extdata-foo"));
+
+ assertFalse(extAttrMapper.mapLDAPAttrsCalled);
+
+ registry.createObject(attrs);
+
+ assertTrue(extAttrMapper.mapLDAPAttrsCalled);
+ }
+
+ class DBSubsystemStub extends DBSubsystemDefaultStub {
+ DBRegistry registry;
+
+ public IDBRegistry getRegistry() {
+ return registry;
+ }
+ }
+
+ class DBDynAttrMapperStub extends DBDynAttrMapperDefaultStub {
+ boolean mapObjectCalled = false;
+ Object mapObjectCalledWithObject = null;
+ boolean mapLDAPAttrsCalled = false;
+
+ public boolean supportsLDAPAttributeName(String attrName) {
+ return (attrName != null) &&
+ attrName.toLowerCase().startsWith("extdata-");
+ }
+
+ public void mapLDAPAttributeSetToObject(LDAPAttributeSet attrs, String name, IDBObj parent)
+ throws EBaseException {
+ mapLDAPAttrsCalled = true;
+ }
+
+ public void mapObjectToLDAPAttributeSet(IDBObj parent, String name,
+ Object obj,
+ LDAPAttributeSet attrs)
+ throws EBaseException {
+ mapObjectCalled = true;
+ mapObjectCalledWithObject = obj;
+ }
+ }
+
+}
+
+/*
+ * This class is purposefully placed outside the test because
+ * DBRegistry.createObject() calls Class.newInstance() to create
+ * this stub. This fails if the class is nested.
+ */
+class RequestRecordStub extends RequestRecordDefaultStub {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 2155124580267335995L;
+
+ String[] attrs = new String[] { IRequestRecord.ATTR_EXT_DATA };
+
+ boolean getCalled = false;
+ String getCalledWith = null;
+ boolean getSerializedAttrNamesCalled = false;
+
+ public Object get(String name) {
+ getCalled = true;
+ getCalledWith = name;
+ return "foo";
+ }
+
+ public Enumeration<String> getSerializableAttrNames() {
+ getSerializedAttrNamesCalled = true;
+ return Collections.enumeration(Arrays.asList(attrs));
+ }
+}
diff --git a/base/common/test/com/netscape/cmscore/dbs/DBSSessionDefaultStub.java b/base/common/test/com/netscape/cmscore/dbs/DBSSessionDefaultStub.java
new file mode 100644
index 000000000..09a2e1498
--- /dev/null
+++ b/base/common/test/com/netscape/cmscore/dbs/DBSSessionDefaultStub.java
@@ -0,0 +1,79 @@
+package com.netscape.cmscore.dbs;
+
+import netscape.ldap.LDAPSearchResults;
+
+import com.netscape.certsrv.base.EBaseException;
+import com.netscape.certsrv.base.ISubsystem;
+import com.netscape.certsrv.dbs.EDBException;
+import com.netscape.certsrv.dbs.IDBObj;
+import com.netscape.certsrv.dbs.IDBSSession;
+import com.netscape.certsrv.dbs.IDBSearchResults;
+import com.netscape.certsrv.dbs.IDBVirtualList;
+import com.netscape.certsrv.dbs.ModificationSet;
+
+/**
+ * A default stub ojbect for tests to extend.
+ */
+public class DBSSessionDefaultStub implements IDBSSession {
+
+ public ISubsystem getDBSubsystem() {
+ return null;
+ }
+
+ public void close() throws EDBException {
+ }
+
+ public void add(String name, IDBObj obj) throws EBaseException {
+ }
+
+ public IDBObj read(String name) throws EBaseException {
+ return null;
+ }
+
+ public IDBObj read(String name, String attrs[]) throws EBaseException {
+ return null;
+ }
+
+ public void delete(String name) throws EBaseException {
+ }
+
+ public void modify(String name, ModificationSet mods) throws EBaseException {
+ }
+
+ public IDBSearchResults search(String base, String filter) throws EBaseException {
+ return null;
+ }
+
+ public IDBSearchResults search(String base, String filter, int maxSize) throws EBaseException {
+ return null;
+ }
+
+ public IDBSearchResults search(String base, String filter, int maxSize, int timeLimit) throws EBaseException {
+ return null;
+ }
+
+ public IDBSearchResults search(String base, String filter, String attrs[]) throws EBaseException {
+ return null;
+ }
+
+ public <T> IDBVirtualList<T> createVirtualList(String base, String filter, String attrs[]) throws EBaseException {
+ return null;
+ }
+
+ public LDAPSearchResults persistentSearch(String base, String filter, String attrs[]) throws EBaseException {
+ return null;
+ }
+
+ public void abandon(LDAPSearchResults results) throws EBaseException {
+ }
+
+ public <T> IDBVirtualList<T> createVirtualList(String base, String filter, String attrs[], String sortKey, int pageSize)
+ throws EBaseException {
+ return null;
+ }
+
+ public <T> IDBVirtualList<T> createVirtualList(String base, String filter, String attrs[], String startFrom,
+ String sortKey, int pageSize) throws EBaseException {
+ return null;
+ }
+}
diff --git a/base/common/test/com/netscape/cmscore/dbs/DBSubsystemDefaultStub.java b/base/common/test/com/netscape/cmscore/dbs/DBSubsystemDefaultStub.java
new file mode 100644
index 000000000..fe19159d5
--- /dev/null
+++ b/base/common/test/com/netscape/cmscore/dbs/DBSubsystemDefaultStub.java
@@ -0,0 +1,172 @@
+package com.netscape.cmscore.dbs;
+
+import java.math.BigInteger;
+
+import netscape.ldap.LDAPConnection;
+
+import com.netscape.certsrv.base.EBaseException;
+import com.netscape.certsrv.base.IConfigStore;
+import com.netscape.certsrv.base.ISubsystem;
+import com.netscape.certsrv.dbs.EDBException;
+import com.netscape.certsrv.dbs.IDBRegistry;
+import com.netscape.certsrv.dbs.IDBSSession;
+import com.netscape.certsrv.dbs.IDBSubsystem;
+
+/**
+ * A default stub ojbect for tests to extend.
+ */
+public class DBSubsystemDefaultStub implements IDBSubsystem {
+
+ public String getBaseDN() {
+ return null;
+ }
+
+ public IDBRegistry getRegistry() {
+ return null;
+ }
+
+ public IDBSSession createSession() throws EDBException {
+ return null;
+ }
+
+ public boolean enableSerialNumberRecovery() {
+ return false;
+ }
+
+ public void setNextSerialConfig(BigInteger serial) throws EBaseException {
+ }
+
+ public BigInteger getNextSerialConfig() {
+ return null;
+ }
+
+ public void setMaxSerialConfig(String serial) throws EBaseException {
+ }
+
+ public String getMinSerialConfig() {
+ return null;
+ }
+
+ public String getMaxSerialConfig() {
+ return null;
+ }
+
+ public String getMinRequestConfig() {
+ return null;
+ }
+
+ public String getMaxRequestConfig() {
+ return null;
+ }
+
+ public void returnConn(LDAPConnection conn) {
+ }
+
+ public String getId() {
+ return null;
+ }
+
+ public void setId(String id) throws EBaseException {
+ }
+
+ public void init(ISubsystem owner, IConfigStore config) throws EBaseException {
+ }
+
+ public void startup() throws EBaseException {
+ }
+
+ public void shutdown() {
+ }
+
+ public IConfigStore getConfigStore() {
+ return null;
+ }
+
+ @Override
+ public void setMaxSerialConfig(int repo, String serial)
+ throws EBaseException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setMinSerialConfig(int repo, String serial)
+ throws EBaseException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setNextMaxSerialConfig(int repo, String serial)
+ throws EBaseException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setNextMinSerialConfig(int repo, String serial)
+ throws EBaseException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public String getMinSerialConfig(int repo) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getMaxSerialConfig(int repo) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getNextMaxSerialConfig(int repo) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getNextMinSerialConfig(int repo) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getLowWaterMarkConfig(int repo) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getIncrementConfig(int repo) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getNextRange(int repo) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean hasRangeConflict(int repo) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean getEnableSerialMgmt() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public void setEnableSerialMgmt(boolean value) throws EBaseException {
+ // TODO Auto-generated method stub
+
+ }
+}
diff --git a/base/common/test/com/netscape/cmscore/dbs/DBVirtualListDefaultStub.java b/base/common/test/com/netscape/cmscore/dbs/DBVirtualListDefaultStub.java
new file mode 100644
index 000000000..d674bd6a6
--- /dev/null
+++ b/base/common/test/com/netscape/cmscore/dbs/DBVirtualListDefaultStub.java
@@ -0,0 +1,87 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// (C) 2007 Red Hat, Inc.
+// All rights reserved.
+// --- END COPYRIGHT BLOCK ---
+package com.netscape.cmscore.dbs;
+
+import com.netscape.certsrv.base.EBaseException;
+import com.netscape.certsrv.dbs.IDBVirtualList;
+import com.netscape.certsrv.dbs.IElementProcessor;
+
+/**
+ * A default stub ojbect for tests to extend.
+ * This class helps test avoid the problem of test stubs having to
+ * implement a new stub method every time the interface changes.
+ * It also makes the tests clearer by not cluttered them with empty methods.
+ *
+ * Do not put any behaviour in this class.
+ */
+public class DBVirtualListDefaultStub<T> implements IDBVirtualList<T> {
+
+ public void setPageSize(int size) {
+ }
+
+ public void setSortKey(String sortKey) throws EBaseException {
+ }
+
+ public void setSortKey(String[] sortKeys) throws EBaseException {
+ }
+
+ public int getSize() {
+ return 0;
+ }
+
+ public int getSizeBeforeJumpTo() {
+ return 0;
+ }
+
+ public int getSizeAfterJumpTo() {
+ return 0;
+ }
+
+ public int getCurrentIndex() {
+ return 0;
+ }
+
+ public boolean getPage(int first) {
+ return false;
+ }
+
+ public boolean getPage(String text) {
+ return false;
+ }
+
+ public T getElementAt(int index) {
+ return null;
+ }
+
+ public T getJumpToElementAt(int i) {
+ return null;
+ }
+
+ public void processElements(int startidx, int endidx, IElementProcessor ep)
+ throws EBaseException {
+ }
+
+ public int getSelectedIndex() {
+ return 0;
+ }
+
+ public int getFirstIndex() {
+ return 0;
+ }
+
+}
diff --git a/base/common/test/com/netscape/cmscore/dbs/RequestRecordDefaultStub.java b/base/common/test/com/netscape/cmscore/dbs/RequestRecordDefaultStub.java
new file mode 100644
index 000000000..1814c90d6
--- /dev/null
+++ b/base/common/test/com/netscape/cmscore/dbs/RequestRecordDefaultStub.java
@@ -0,0 +1,44 @@
+package com.netscape.cmscore.dbs;
+
+import java.util.Enumeration;
+
+import com.netscape.certsrv.base.EBaseException;
+import com.netscape.certsrv.dbs.IDBObj;
+import com.netscape.certsrv.request.IRequestRecord;
+import com.netscape.certsrv.request.RequestId;
+
+/**
+ * Default stub for RequestRecord tests.
+ */
+public class RequestRecordDefaultStub implements IRequestRecord, IDBObj {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3486144284074519531L;
+
+ public RequestId getRequestId() {
+ return null;
+ }
+
+ public Enumeration<String> getAttrNames() {
+ return null;
+ }
+
+ public Object get(String name) {
+ return null;
+ }
+
+ public void set(String name, Object o) {
+ }
+
+ public void delete(String name) throws EBaseException {
+ }
+
+ public Enumeration<String> getElements() {
+ return null;
+ }
+
+ public Enumeration<String> getSerializableAttrNames() {
+ return null;
+ }
+}