}
org = OrganizationFactory.init(env);
+ if(org==null) {
+ throw new OrganizationException("Organization MUST be defined for Batch");
+ }
org.setTestMode(dryRun);
// Special names to allow behaviors beyond normal rules
public static class Data implements Bytification {
- public static String user;
- public static String delegate;
- public static Date expires;
+ public String user;
+ public String delegate;
+ public Date expires;
@Override
public ByteBuffer bytify() throws IOException {
String realm = env.getProperty(Config.AAF_DEFAULT_REALM,"people.osaaf.org");
defaultOrg = cnst.newInstance(env,realm);
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException | SecurityException | IllegalArgumentException | InvocationTargetException e) {
- throw new OrganizationException("At least one Organization must be defined",e);
+ env.warn().log("Not Organization Moduled linked in",e);
}
}
if (defaultOrg == null) {
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
import org.onap.aaf.auth.org.OrganizationException;
import org.onap.aaf.auth.org.OrganizationFactory;
protected AbsService<ENV,TRANS> service;
- public AbsServiceStarter(final AbsService<ENV,TRANS> service, boolean noexit) {
+ public AbsServiceStarter(final AbsService<ENV,TRANS> service) {
this.service = service;
try {
OrganizationFactory.init(service.env);
} catch (OrganizationException e) {
service.access.log(e, "Missing defined Organization Plugins");
- if(!noexit) {
- System.exit(3);
- }
+ System.exit(3);
}
// do_register - this is used for specialty Debug Situations. Developer can create an Instance for a remote system
// for Debugging purposes without fear that real clients will start to call your debug instance
private boolean secure;
public JettyServiceStarter(final AbsService<ENV,TRANS> service) throws OrganizationException {
- super(service,false);
+ super(service);
secure = true;
}
@SuppressWarnings("static-access")
@Test
- public void testInit() {
- try {
- organizationFactory.init(bEnv);
- Assert.fail("Expect an exception");
- } catch (OrganizationException e) {
- Assert.assertEquals("At least one Organization must be defined", e.getMessage());
- }
+ public void testInit() throws OrganizationException {
+ Assert.assertEquals(null, organizationFactory.init(bEnv));
}
@SuppressWarnings("static-access") //TODO:Fix this once real input is available AAF-111
package org.onap.aaf.auth.server.test;
-import static org.junit.Assert.*;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
+import javax.servlet.Filter;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.onap.aaf.auth.env.AuthzTrans;
-import org.onap.aaf.auth.env.AuthzTransFilter;
-import org.onap.aaf.auth.local.AbsData;
-import org.onap.aaf.auth.local.DataFile;
-import org.onap.aaf.auth.local.TextIndex;
import org.onap.aaf.auth.rserv.RServlet;
import org.onap.aaf.auth.server.AbsService;
import org.onap.aaf.auth.server.AbsServiceStarter;
-import org.onap.aaf.auth.server.test.JU_AbsService;
import org.onap.aaf.cadi.Access;
+import org.onap.aaf.cadi.Access.Level;
import org.onap.aaf.cadi.CadiException;
import org.onap.aaf.cadi.LocatorException;
import org.onap.aaf.cadi.PropAccess;
-import org.onap.aaf.cadi.Access.Level;
import org.onap.aaf.cadi.config.Config;
import org.onap.aaf.cadi.register.Registrant;
import org.onap.aaf.misc.env.impl.BasicEnv;
-import org.onap.aaf.auth.local.AbsData.Iter;
-import org.onap.aaf.auth.local.AbsData.Reuse;
-
-import junit.framework.Assert;
-
-import static org.junit.Assert.*;
-import static org.mockito.Matchers.*;
-import static org.mockito.Mockito.*;
-
-import java.io.BufferedWriter;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.PrintStream;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.security.Principal;
-
-import javax.servlet.Filter;
public class JU_AbsServiceStarter {
private class AbsServiceStarterStub extends AbsServiceStarter {
public AbsServiceStarterStub(AbsService service) {
- super(service, true);
+ super(service);
// TODO Auto-generated constructor stub
}
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.Comparator;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
String inputOption = cr.getEntry();
if (inputOption == null) {
String message = selectCredFromList(lcd, false);
- String[] variables = buildVariables(lcd);
+ Object[] variables = buildVariables(lcd);
return Result.err(Status.ERR_ChoiceNeeded, message, variables);
} else {
entry = Integer.parseInt(inputOption) - 1;
String inputOption = cr.getEntry();
if (inputOption == null) {
String message = selectCredFromList(rlcd.value, true);
- String[] variables = buildVariables(rlcd.value);
+ Object[] variables = buildVariables(rlcd.value);
return Result.err(Status.ERR_ChoiceNeeded, message, variables);
} else {
try {
Error err = new Error();
err.setMessageId(msgID);
// AT&T Restful Error Format requires numbers "%" placements
- err.setText(Vars.convert(holder, text, var));
+ err.setText(Vars.convert(holder, text, (Object[])var));
for (String s : var) {
err.getVariables().add(s);
}
# For local builds, set PREFIX=
PREFIX="$DOCKER_REPOSITORY/"
NAMESPACE=onap
+USER=aaf
# HOSTNAME=aaf.osaaf.org