Hi Robin,

First it seems that you are using OpenJDK and I'm not sure that all
features, especially regarding security extensions, are functional.

LscConfiguration.getSecurity() is trying to return the lsc>security node of
the XML configuration. It failed with a graceful error instead of this NPE
but you can simply bypass this bug by adding the following node.

  <security>
    <encryption>
      <algorithm>AES</algorithm>
      <strength>128</strength>
    </encryption>
  </security>

Regarding the test that is failing inside Eclipse, go to the Run menu and
choose the "Debug configurations" option. It will open a window in which
you will have to choose the corresponding JUnit test. Go in the Arguments
tab and switch to the Other value at the bottom of the window for the
"Working directory" argument. Click on the Workspace button and choose
target/test-classes sub directory. It should find the corresponding etc sub
directory that is required to read the lsc.xml. You may still have some
troubles with the following expression, so please reply with the
corresponding value :

this.getClass().**getClassLoader().getResource("**.")

Regards,
-- 
Sebastien BAHLOUL
IAM / Security specialist
Ldap Synchronization Connector : http://lsc-project.org
Blog : http://sbahloul.wordpress.com/



2012/2/14 Robin Garner <[email protected]>

> I'm currently trying to chase down a bug in SymmetricEncryption, and find
> that I can't run the unit test in Eclipse.
>
> The first problem is that the path for creating a temporary key isn't
> valid,
>
>  String tmpKeyPath = new File(this.getClass().**
> getClassLoader().getResource("**.").getFile(), "lsc-key.tmp").**
> getAbsolutePath();
>
> In my configuration, this path becomes
>
> /home/rgarner/workspace/lsc-**core/file:/usr/lib/jvm/java-6-**
> openjdk/jre/lib/ext/pulse-**java.jar!/lsc-key.tmp
>
> which of course doesn't work.  I can see the intent of the code as it
> stands, but is there perhaps a better way to do it that will work with
> eclipse ?
>
>
> If I work around this issue, the next error is:
>
> Feb 14 13:47:43 - ERROR - ! /home/rgarner/workspace/lsc-**
> core/etc/lsc.xml.isFile()
> Feb 14 13:47:43 - ERROR - ! new File(lscConfigurationPath,
> PROPERTIES_FILENAME).isFile()
> Feb 14 13:47:43 - ERROR - Defined configuration location
> (/home/rgarner/workspace/lsc-**core/etc) points to a non existing LSC
> configured instance. LSC configuration loading will fail !
>
> evidently when unit tests are run from maven, there's a setup task that
> provides configuration.  Would it be possible to add an @Before[Class]
> method to provide missing setup if needed ?  Or are there some jvm
> parameters to add ? If so, where is the configuration done - I'm having
> trouble chasing this down through the maven config.
>
> BTW, the underlying error I'm chasing down is an NPE in SecurityUtilsTest
> - LscConfiguration.getSecurity() returns null, because it's not configured
> ?  Or because the config doesn't parse correctly ? Not sure.
>
> Thanks,
> Robin
> ______________________________**______________________________**___
> Ldap Synchronization Connector (LSC) - http://lsc-project.org
>
> lsc-dev mailing list
> [email protected]
> http://lists.lsc-project.org/**listinfo/lsc-dev<http://lists.lsc-project.org/listinfo/lsc-dev>
>
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-dev mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-dev

Reply via email to