Commit 2449b73d authored by opencadc-admin's avatar opencadc-admin Committed by GitHub
Browse files

Merge pull request #2 from andamian/s1965

S1965
parents 0a5a738e dbdecc3b
......@@ -20,8 +20,10 @@ import org.apache.log4j.Logger;
import org.easymock.EasyMock;
import org.junit.Test;
import ca.nrc.cadc.ac.server.PluginFactory;
import ca.nrc.cadc.db.StandaloneContextFactory;
import ca.nrc.cadc.util.Log4jInit;
import ca.nrc.cadc.util.PropertiesReader;
public class UserServletTest
......@@ -73,8 +75,18 @@ public class UserServletTest
{
try
{
final PluginFactory piMock = EasyMock.createMock(PluginFactory.class);
EasyMock.expect(piMock.createUserPersistence()).andReturn(null).once();
StandaloneContextFactory.initJNDI();
UserServlet userServlet = new UserServlet(){
@Override
public PluginFactory getPluginFactory()
{
return piMock;
}
};
StandaloneContextFactory.initJNDI();
UserServlet userServlet = new UserServlet();
ServletConfig config = EasyMock.createMock(ServletConfig.class);
EasyMock.expect(config.getInitParameter(
UserServlet.class.getName() + ".PrivilegedX500Principals")).
......@@ -100,8 +112,18 @@ public class UserServletTest
{
try
{
final PluginFactory piMock = EasyMock.createMock(PluginFactory.class);
EasyMock.expect(piMock.createUserPersistence()).andReturn(null).once();
StandaloneContextFactory.initJNDI();
UserServlet userServlet = new UserServlet(){
@Override
public PluginFactory getPluginFactory()
{
return piMock;
}
};
StandaloneContextFactory.initJNDI();
UserServlet userServlet = new UserServlet();
ServletConfig config = EasyMock.createMock(ServletConfig.class);
EasyMock.expect(config.getInitParameter(
UserServlet.class.getName() + ".PrivilegedX500Principals")).
......@@ -127,8 +149,16 @@ public class UserServletTest
{
try
{
final PluginFactory piMock = EasyMock.createMock(PluginFactory.class);
EasyMock.expect(piMock.createUserPersistence()).andReturn(null).once();
StandaloneContextFactory.initJNDI();
UserServlet userServlet = new UserServlet();
UserServlet userServlet = new UserServlet(){
@Override
public PluginFactory getPluginFactory()
{
return piMock;
}
};
ServletConfig config = EasyMock.createMock(ServletConfig.class);
EasyMock.expect(config.getInitParameter(
UserServlet.class.getName() + ".PrivilegedX500Principals")).
......@@ -136,7 +166,7 @@ public class UserServletTest
EasyMock.expect(config.getInitParameter(
UserServlet.class.getName() + ".PrivilegedHttpPrincipals")).
andReturn("user1");
EasyMock.replay(config);
EasyMock.replay(config, piMock);
userServlet.init(config);
List<Subject> subjects = userServlet.privilegedSubjects;
Assert.assertTrue(subjects.size() == 1);
......@@ -155,7 +185,16 @@ public class UserServletTest
try
{
StandaloneContextFactory.initJNDI();
UserServlet userServlet = new UserServlet();
final PluginFactory piMock = EasyMock.createMock(PluginFactory.class);
EasyMock.expect(piMock.createUserPersistence()).andReturn(null).once();
StandaloneContextFactory.initJNDI();
UserServlet userServlet = new UserServlet(){
@Override
public PluginFactory getPluginFactory()
{
return piMock;
}
};
ServletConfig config = EasyMock.createMock(ServletConfig.class);
EasyMock.expect(config.getInitParameter(
UserServlet.class.getName() + ".PrivilegedX500Principals")).
......
#
# local authority map
#
# <base standardID> = <authority>
#ac = canfar.net
ivo://ivoa.net/std/GMS#groups-0.1 = ivo://example.net/gms
ivo://ivoa.net/std/GMS#search-0.1 = ivo://example.net/gms
ivo://ivoa.net/std/UMS#users-0.1 = ivo://example.net/gms
ivo://ivoa.net/std/UMS#reqs-0.1 = ivo://example.net/gms
ivo://ivoa.net/std/UMS#login-0.1 = ivo://example.net/gms
ivo://ivoa.net/std/UMS#modpass-0.1 = ivo://example.net/gms
ivo://ivoa.net/std/UMS#resetpass-0.1 = ivo://example.net/gms
ivo://ivoa.net/std/UMS#whoami-0.1 = ivo://example.net/gms
ivo://ivoa.net/std/CDP#delegate-1.0 = ivo://example.net/cred
ivo://ivoa.net/std/CDP#proxy-1.0 = ivo://example.net/cred
......@@ -16,23 +16,3 @@ In the system, a user is uniquely identified by one Principal (e.g. NumericPrinc
Groups represet associations of users. Groups have an owner, administive members, and actual members. Members can be groups or users.
![User Object Model](doc/AccessControl.png)
## Build and Test Dependencies
### opencadc dependencies:
- opencadc/core/cadcUtil
- opencadc/reg/cadcRegistry
### external build dependencies
- json.jar (json.org-20110818.jar)
- jdom2.jar (jdom-2.0.5.jar)
- log4j.jar (log4j-1.2.17.jar)
### external test dependencies
- xerces.jar (xerces-2_9_1)
- asm.jar (hibernate-3.2.3)
- cglib.jar (hibernate-3.2.3)
- easymock.jar (easymock-3.0.jar)
- junit.jar (junit-4.6.jar)
- objenesis.jar (objenesis-1.2.jar)
- jsonassert.jar (jsonassert-1.2.3.jar)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment