Search in sources :

Example 16 with CustomScript

use of org.xdi.model.custom.script.model.CustomScript in project oxAuth by GluuFederation.

the class IdGenServiceTest method loadCustomScript.

@Test
public void loadCustomScript() {
    final InputStream inputStream = IdGenServiceTest.class.getResourceAsStream("/id/gen/SampleIdGenerator.py");
    try {
        final String idScript = IOUtils.toString(inputStream);
        CustomScript idCustomScript = buildIdCustomScriptEntry(idScript);
        this.idCustomScriptDn = idCustomScript.getDn();
        ldapEntryManager.persist(idCustomScript);
    } catch (IOException e) {
        throw new RuntimeException(e);
    } finally {
        IOUtils.closeQuietly(inputStream);
    }
}
Also used : CustomScript(org.xdi.model.custom.script.model.CustomScript) InputStream(java.io.InputStream) IOException(java.io.IOException) BaseComponentTest(org.xdi.oxauth.BaseComponentTest) Test(org.testng.annotations.Test)

Aggregations

CustomScript (org.xdi.model.custom.script.model.CustomScript)16 ArrayList (java.util.ArrayList)10 LdapMappingException (org.gluu.site.ldap.persistence.exception.LdapMappingException)4 SimpleCustomProperty (org.xdi.model.SimpleCustomProperty)4 AuthenticationCustomScript (org.xdi.model.custom.script.model.auth.AuthenticationCustomScript)4 CustomScriptType (org.xdi.model.custom.script.CustomScriptType)3 List (java.util.List)2 Test (org.testng.annotations.Test)2 DisplayNameEntry (org.xdi.model.DisplayNameEntry)2 SelectableEntity (org.xdi.model.SelectableEntity)2 CustomScriptConfiguration (org.xdi.model.custom.script.conf.CustomScriptConfiguration)2 BaseComponentTest (org.xdi.oxauth.BaseComponentTest)2 Filter (com.unboundid.ldap.sdk.Filter)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 HashMap (java.util.HashMap)1 Entry (java.util.Map.Entry)1 BaseExternalType (org.xdi.model.custom.script.type.BaseExternalType)1