users@glassfish.java.net

[gf-users] org.glassfish.main.extras 4.1

From: Tomaz Majerhold <tomaz.majerhold_at_arnes.si>
Date: Wed, 04 Mar 2015 08:25:10 +0100

I'm trying to port application from GF 3.1.2 to GF 4.1 but I have
problem with Junit tests because I can't use File realm for security.

In my tests I use embedded GF 4.1 and with CommandRunner I'm adding
users to file realm, but having exception(not added) so my tests fail,
but this command is working in embedded GF 3.1.2.

code:
-------
... starting GF 4.1
...
cmdResult = cmdRunner.run("set",
"server-config.security-service.activate-default-principal-to-role-mapping=true");
LOG.info(cmdResult.getOutput());
cmdResult = cmdRunner.run("create-file-user",
                     "--echo=true",
                     "--groups=service_admin:procurator:support",
                     "--authrealmname=file",
"--passwordfile=src/test/resources/META-INF/password.txt",
                     "test");
LOG.info("create-file-user:test = "+cmdResult.getOutput());
//add user support to file realm
cmdResult = cmdRunner.run("create-file-user",
                     "--echo=true",
                     "--groups=service_admin",
                     "--authrealmname=file",
"--passwordfile=src/test/resources/META-INF/password.txt",
                     "testSupport_at_test.si");
LOG.info("create-file-user:testSupport_at_test.si = "+cmdResult.getOutput());
LOG.info("create-file-user:testSupport_at_test.si =
"+cmdResult.getFailureCause());
LOG.info("create-file-user:testSupport_at_test.si =
"+cmdResult.getExitStatus());

LOG:
------
2462 [main] INFO si.arnes.predalnik.api.server.rest.test.BaseTest -
list-file-users1 = PlainTextActionReporterSUCCESSNo monitoring data to
report.
2472 [main] INFO si.arnes.predalnik.api.server.rest.test.BaseTest -
create-file-user:test =
PlainTextActionReporterFAILUREorg.jvnet.hk2.config.UnsatisfiedDependencyException:
injection failed on
com.sun.enterprise.security.cli.CreateFileUser.userpassword with class
java.lang.StringDescription: create-file-user commandCannot find
userpassword in create-file-user command model, file a bug
2482 [main] INFO si.arnes.predalnik.api.server.rest.test.BaseTest -
create-file-user:testSupport_at_test.si =
PlainTextActionReporterFAILUREorg.jvnet.hk2.config.UnsatisfiedDependencyException:
injection failed on
com.sun.enterprise.security.cli.CreateFileUser.userpassword with class
java.lang.StringDescription: create-file-user commandCannot find
userpassword in create-file-user command model, file a bug

Any body know this issue?

Regards, Tomaz