summaryrefslogtreecommitdiffstats
path: root/pki/base/common/test/com/netscape/cmscore/dbs
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2011-12-07 16:58:12 -0500
committerAde Lee <alee@redhat.com>2011-12-07 16:58:12 -0500
commit32150d3ee32f8ac27118af7c792794b538c78a2f (patch)
tree52dd96f664a6fa51be25b28b6f10adc5f2c9f660 /pki/base/common/test/com/netscape/cmscore/dbs
parentf05d58a46795553beb8881039cc922974b40db34 (diff)
downloadpki-32150d3ee32f8ac27118af7c792794b538c78a2f.tar.gz
pki-32150d3ee32f8ac27118af7c792794b538c78a2f.tar.xz
pki-32150d3ee32f8ac27118af7c792794b538c78a2f.zip
Formatting
Formatted project according to eclipse project settings
Diffstat (limited to 'pki/base/common/test/com/netscape/cmscore/dbs')
-rw-r--r--pki/base/common/test/com/netscape/cmscore/dbs/CertRecordListTest.java3
-rw-r--r--pki/base/common/test/com/netscape/cmscore/dbs/DBRegistryDefaultStub.java19
-rw-r--r--pki/base/common/test/com/netscape/cmscore/dbs/DBRegistryTest.java42
-rw-r--r--pki/base/common/test/com/netscape/cmscore/dbs/DBSSessionDefaultStub.java25
-rw-r--r--pki/base/common/test/com/netscape/cmscore/dbs/DBSubsystemDefaultStub.java178
-rw-r--r--pki/base/common/test/com/netscape/cmscore/dbs/DBVirtualListDefaultStub.java12
6 files changed, 144 insertions, 135 deletions
diff --git a/pki/base/common/test/com/netscape/cmscore/dbs/CertRecordListTest.java b/pki/base/common/test/com/netscape/cmscore/dbs/CertRecordListTest.java
index 3fd6a96fd..699a924d0 100644
--- a/pki/base/common/test/com/netscape/cmscore/dbs/CertRecordListTest.java
+++ b/pki/base/common/test/com/netscape/cmscore/dbs/CertRecordListTest.java
@@ -40,7 +40,7 @@ public class CertRecordListTest extends CMSBaseTestCase {
return new TestSuite(CertRecordListTest.class);
}
- public void testProcessCertRecordsUsesSize() throws EBaseException {
+ public void testProcessCertRecordsUsesSize() throws EBaseException {
DBVirtualListStub dbList = new DBVirtualListStub();
dbList.size = 5;
@@ -57,7 +57,6 @@ public class CertRecordListTest extends CMSBaseTestCase {
assertEquals(7, dbList.lastIndexGetElementAtCalledWith);
}
-
public class DBVirtualListStub extends DBVirtualListDefaultStub {
public int size = 0;
public int getElementAtCallCount = 0;
diff --git a/pki/base/common/test/com/netscape/cmscore/dbs/DBRegistryDefaultStub.java b/pki/base/common/test/com/netscape/cmscore/dbs/DBRegistryDefaultStub.java
index 2095e1624..bb8236d79 100644
--- a/pki/base/common/test/com/netscape/cmscore/dbs/DBRegistryDefaultStub.java
+++ b/pki/base/common/test/com/netscape/cmscore/dbs/DBRegistryDefaultStub.java
@@ -17,15 +17,16 @@ import com.netscape.certsrv.dbs.IFilterConverter;
*/
public class DBRegistryDefaultStub implements IDBRegistry {
-
- public void registerObjectClass(String className, String ldapNames[]) throws EDBException {
+ 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 void registerAttribute(String ufName, IDBAttrMapper mapper)
+ throws EDBException {
}
public boolean isAttributeRegistered(String ufName) {
@@ -39,18 +40,21 @@ public class DBRegistryDefaultStub implements IDBRegistry {
return null;
}
- public String getFilter(String filter, IFilterConverter c) throws EBaseException {
+ 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 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 {
+ public LDAPAttributeSet createLDAPAttributeSet(IDBObj obj)
+ throws EBaseException {
return null;
}
@@ -65,7 +69,8 @@ public class DBRegistryDefaultStub implements IDBRegistry {
public void setId(String id) throws EBaseException {
}
- public void init(ISubsystem owner, IConfigStore config) throws EBaseException {
+ public void init(ISubsystem owner, IConfigStore config)
+ throws EBaseException {
}
public void startup() throws EBaseException {
diff --git a/pki/base/common/test/com/netscape/cmscore/dbs/DBRegistryTest.java b/pki/base/common/test/com/netscape/cmscore/dbs/DBRegistryTest.java
index 7b4681e5a..c33dbbafb 100644
--- a/pki/base/common/test/com/netscape/cmscore/dbs/DBRegistryTest.java
+++ b/pki/base/common/test/com/netscape/cmscore/dbs/DBRegistryTest.java
@@ -39,9 +39,11 @@ public class DBRegistryTest extends CMSBaseTestCase {
// 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.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);
@@ -64,13 +66,9 @@ public class DBRegistryTest extends CMSBaseTestCase {
assertTrue(extAttrMapper.mapObjectCalled);
}
- public void testGetLDAPAttributesForExtData() throws EBaseException {
- String inAttrs[] = new String[] {
- "extData-foo",
- "extData-foo12",
- "EXTDATA-bar;baz",
- IRequestRecord.ATTR_SOURCE_ID
- };
+ 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]));
@@ -79,9 +77,10 @@ public class DBRegistryTest extends CMSBaseTestCase {
assertTrue(TestHelper.contains(outAttrs, "sourceIdOut"));
try {
- registry.getLDAPAttributes(new String[] {"badattr"});
+ registry.getLDAPAttributes(new String[] { "badattr" });
fail("Should not be able to map badattr");
- } catch (EBaseException e) { /* good */ }
+ } catch (EBaseException e) { /* good */
+ }
}
public void testCreateLDAPAttributeSet() throws EBaseException {
@@ -109,7 +108,6 @@ public class DBRegistryTest extends CMSBaseTestCase {
assertTrue(extAttrMapper.mapLDAPAttrsCalled);
}
-
class DBSubsystemStub extends DBSubsystemDefaultStub {
DBRegistry registry;
@@ -118,25 +116,23 @@ public class DBRegistryTest extends CMSBaseTestCase {
}
}
-
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-");
+ return (attrName != null)
+ && attrName.toLowerCase().startsWith("extdata-");
}
- public void mapLDAPAttributeSetToObject(LDAPAttributeSet attrs, String name, IDBObj parent) throws EBaseException {
+ 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 {
+ Object obj, LDAPAttributeSet attrs) throws EBaseException {
mapObjectCalled = true;
mapObjectCalledWithObject = obj;
}
@@ -146,10 +142,10 @@ public class DBRegistryTest extends CMSBaseTestCase {
/*
* 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.
+ * DBRegistry.createObject() calls Class.newInstance() to create this stub. This
+ * fails if the class is nested.
*/
- class RequestRecordStub extends RequestRecordDefaultStub {
+class RequestRecordStub extends RequestRecordDefaultStub {
/**
*
diff --git a/pki/base/common/test/com/netscape/cmscore/dbs/DBSSessionDefaultStub.java b/pki/base/common/test/com/netscape/cmscore/dbs/DBSSessionDefaultStub.java
index aef21db14..d7c5a94ab 100644
--- a/pki/base/common/test/com/netscape/cmscore/dbs/DBSSessionDefaultStub.java
+++ b/pki/base/common/test/com/netscape/cmscore/dbs/DBSSessionDefaultStub.java
@@ -40,35 +40,44 @@ public class DBSSessionDefaultStub implements IDBSSession {
public void modify(String name, ModificationSet mods) throws EBaseException {
}
- public IDBSearchResults search(String base, String filter) throws EBaseException {
+ public IDBSearchResults search(String base, String filter)
+ throws EBaseException {
return null;
}
- public IDBSearchResults search(String base, String filter, int maxSize) throws EBaseException {
+ 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 {
+ 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 {
+ public IDBSearchResults search(String base, String filter, String attrs[])
+ throws EBaseException {
return null;
}
- public IDBVirtualList createVirtualList(String base, String filter, String attrs[]) throws EBaseException {
+ public IDBVirtualList createVirtualList(String base, String filter,
+ String attrs[]) throws EBaseException {
return null;
}
- public LDAPSearchResults persistentSearch(String base, String filter, String attrs[]) throws EBaseException {
+ public LDAPSearchResults persistentSearch(String base, String filter,
+ String attrs[]) throws EBaseException {
return null;
}
- public IDBVirtualList createVirtualList(String base, String filter, String attrs[], String sortKey, int pageSize) throws EBaseException {
+ public IDBVirtualList createVirtualList(String base, String filter,
+ String attrs[], String sortKey, int pageSize) throws EBaseException {
return null;
}
- public IDBVirtualList createVirtualList(String base, String filter, String attrs[], String startFrom, String sortKey, int pageSize) throws EBaseException {
+ public IDBVirtualList createVirtualList(String base, String filter,
+ String attrs[], String startFrom, String sortKey, int pageSize)
+ throws EBaseException {
return null;
}
}
diff --git a/pki/base/common/test/com/netscape/cmscore/dbs/DBSubsystemDefaultStub.java b/pki/base/common/test/com/netscape/cmscore/dbs/DBSubsystemDefaultStub.java
index 68f24d505..9f1a87ae8 100644
--- a/pki/base/common/test/com/netscape/cmscore/dbs/DBSubsystemDefaultStub.java
+++ b/pki/base/common/test/com/netscape/cmscore/dbs/DBSubsystemDefaultStub.java
@@ -17,7 +17,6 @@ import com.netscape.certsrv.dbs.IDBSubsystem;
*/
public class DBSubsystemDefaultStub implements IDBSubsystem {
-
public String getBaseDN() {
return null;
}
@@ -70,7 +69,8 @@ public class DBSubsystemDefaultStub implements IDBSubsystem {
public void setId(String id) throws EBaseException {
}
- public void init(ISubsystem owner, IConfigStore config) throws EBaseException {
+ public void init(ISubsystem owner, IConfigStore config)
+ throws EBaseException {
}
public void startup() throws EBaseException {
@@ -83,91 +83,91 @@ public class DBSubsystemDefaultStub implements IDBSubsystem {
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
-
- }
+ @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/pki/base/common/test/com/netscape/cmscore/dbs/DBVirtualListDefaultStub.java b/pki/base/common/test/com/netscape/cmscore/dbs/DBVirtualListDefaultStub.java
index 45fda77db..294ae1dfd 100644
--- a/pki/base/common/test/com/netscape/cmscore/dbs/DBVirtualListDefaultStub.java
+++ b/pki/base/common/test/com/netscape/cmscore/dbs/DBVirtualListDefaultStub.java
@@ -22,11 +22,11 @@ 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.
- *
+ * 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 implements IDBVirtualList {
@@ -73,7 +73,7 @@ public class DBVirtualListDefaultStub implements IDBVirtualList {
}
public void processElements(int startidx, int endidx, IElementProcessor ep)
- throws EBaseException {
+ throws EBaseException {
}
public int getSelectedIndex() {