use of org.wso2.carbon.identity.functions.library.mgt.model.FunctionLibrary in project carbon-identity-framework by wso2.
the class FunctionLibraryDAOImplTest method getFunctionLibrary.
@Test(dataProvider = "getFunctionLibraryDataProvider")
public void getFunctionLibrary(Object functionLibrary, String tenantDomain) throws SQLException, FunctionLibraryManagementException {
try (Connection connection = DAOUtils.getConnection(DB_NAME)) {
FunctionLibraryDAO functionLibraryDAO = new FunctionLibraryDAOImpl();
addFunctionLibraries(functionLibraryDAO, Collections.singletonList(functionLibrary), tenantDomain);
when(IdentityDatabaseUtil.getDBConnection(false)).thenReturn(connection);
assertTrue(functionLibraryDAO.getFunctionLibrary(((FunctionLibrary) functionLibrary).getFunctionLibraryName(), tenantDomain) != null, "Failed to retrieve script library");
// Clean after test
deleteFunctionLibraries(functionLibraryDAO, Collections.singletonList(functionLibrary), tenantDomain);
}
}
use of org.wso2.carbon.identity.functions.library.mgt.model.FunctionLibrary in project carbon-identity-framework by wso2.
the class FunctionLibraryDAOImplTest method deleteFunctionLibrary.
@DataProvider(name = "deleteFunctionLibraryData")
public Object[][] deleteFunctionLibrary() {
FunctionLibrary functionLibrary10 = new FunctionLibrary();
functionLibrary10.setFunctionLibraryName("sample10");
functionLibrary10.setDescription("sample10");
functionLibrary10.setFunctionLibraryScript("samplefunction10");
FunctionLibrary functionLibrary11 = new FunctionLibrary();
functionLibrary11.setFunctionLibraryName("sample11");
functionLibrary11.setDescription("sample11");
functionLibrary11.setFunctionLibraryScript("samplefunction11");
return new Object[][] { { functionLibrary10, SAMPLE_TENANT_DOMAIN }, { functionLibrary11, SAMPLE_TENANT_DOMAIN2 } };
}
use of org.wso2.carbon.identity.functions.library.mgt.model.FunctionLibrary in project carbon-identity-framework by wso2.
the class FunctionLibraryDAOImplTest method isFunctionLibraryExistsData.
@DataProvider(name = "isFunctionLibraryExistsDataProvider")
public Object[][] isFunctionLibraryExistsData() {
FunctionLibrary functionLibrary14 = new FunctionLibrary();
functionLibrary14.setFunctionLibraryName("sample14");
functionLibrary14.setDescription("sample14");
functionLibrary14.setFunctionLibraryScript("samplefunction14");
FunctionLibrary functionLibrary15 = new FunctionLibrary();
functionLibrary15.setFunctionLibraryName("sample15");
functionLibrary15.setDescription("sample15");
functionLibrary15.setFunctionLibraryScript("samplefunction15");
return new Object[][] { { functionLibrary14, SAMPLE_TENANT_DOMAIN }, { functionLibrary15, SAMPLE_TENANT_DOMAIN2 } };
}
use of org.wso2.carbon.identity.functions.library.mgt.model.FunctionLibrary in project carbon-identity-framework by wso2.
the class FunctionLibraryDAOImplTest method updateFunctionLibraryData.
@DataProvider(name = "updateFunctionLibraryDataProvider")
public Object[][] updateFunctionLibraryData() {
FunctionLibrary functionLibrary12 = new FunctionLibrary();
functionLibrary12.setFunctionLibraryName("sample12");
functionLibrary12.setDescription("sample12");
functionLibrary12.setFunctionLibraryScript("samplefunction12");
FunctionLibrary functionLibrary13 = new FunctionLibrary();
functionLibrary13.setFunctionLibraryName("sample13");
functionLibrary13.setDescription("sample13");
functionLibrary13.setFunctionLibraryScript("samplefunction13");
return new Object[][] { { functionLibrary12, SAMPLE_TENANT_DOMAIN }, { functionLibrary13, SAMPLE_TENANT_DOMAIN2 } };
}
use of org.wso2.carbon.identity.functions.library.mgt.model.FunctionLibrary in project product-is by wso2.
the class FunctionLibraryManagementTestCase method testGetFunctionLibrary.
@Test(alwaysRun = true, description = "Test getting a Function Library")
public void testGetFunctionLibrary() {
String functionLibraryName = "TestFunctionLibrary";
try {
FunctionLibrary functionLibrary = functionLibraryManagementServiceClient.getFunctionLibrary(functionLibraryName);
Assert.assertEquals(functionLibrary.getFunctionLibraryName(), functionLibraryName, "Failed to retrieve a function library");
} catch (AxisFault axisFault) {
Assert.fail("Error while trying to retrieve a function library", axisFault);
}
}
Aggregations