use of org.ff4j.FF4j in project ff4j by ff4j.
the class FF4jDisableAttrProcessor method isVisible.
@Override
protected boolean isVisible(Arguments arguments, Element element, String attributeName) {
final String feature = element.getAttributeValue(attributeName);
if (feature == null || feature.trim().equals("")) {
return false;
}
// getFF4j(arguments.getContext());
FF4j ff4j = new FF4j();
return !ff4j.check(feature);
}
use of org.ff4j.FF4j in project ff4j by ff4j.
the class FF4jEnableAttrProcessor method isVisible.
@Override
protected boolean isVisible(Arguments arguments, Element element, String attributeName) {
final String feature = element.getAttributeValue(attributeName);
if (feature == null || feature.trim().equals("")) {
return false;
}
// getFF4j(arguments.getContext());
FF4j ff4j = new FF4j();
return ff4j.check(feature);
}
use of org.ff4j.FF4j in project ff4j by ff4j.
the class PropertyStoreHttpTest method initializingInMemory.
/**
* Start Server Grizzly before tests on remote FeatureStore.
*/
@BeforeClass
public static void initializingInMemory() throws Exception {
// Reinit FF4J
FeatureStoreHttpTestIT.ff4j = new FF4j("test-ff4j-features.xml");
jt = new PropertyStoreHttpTestIT();
jt.setUp();
}
use of org.ff4j.FF4j in project ff4j by ff4j.
the class FlipSecurityTests method setUp.
@Before
public void setUp() throws Exception {
securityCtx = SecurityContextHolder.getContext();
// Init SpringSecurity Context
SecurityContext context = new SecurityContextImpl();
List<GrantedAuthority> listOfRoles = new ArrayList<GrantedAuthority>();
listOfRoles.add(new SimpleGrantedAuthority("ROLE_USER"));
User u1 = new User("user1", "user1", true, true, true, true, listOfRoles);
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(u1.getUsername(), u1.getPassword(), u1.getAuthorities());
token.setDetails(u1);
context.setAuthentication(token);
SecurityContextHolder.setContext(context);
// <--
ff4j = new FF4j("test-ff4j-security-spring.xml");
ff4j.setAuthorizationsManager(new SpringSecurityAuthorisationManager());
}
use of org.ff4j.FF4j in project ff4j by ff4j.
the class FlipSecurityTests2 method setUp.
@Before
public void setUp() throws Exception {
securityCtx = SecurityContextHolder.getContext();
// Init SpringSecurity Context
SecurityContext context = new SecurityContextImpl();
List<GrantedAuthority> listOfRoles = new ArrayList<GrantedAuthority>();
listOfRoles.add(new SimpleGrantedAuthority("ROLE_USER"));
User u1 = new User("user1", "user1", true, true, true, true, listOfRoles);
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(u1.getUsername(), u1.getPassword(), u1.getAuthorities());
token.setDetails(u1);
context.setAuthentication(token);
SecurityContextHolder.setContext(context);
// <--
ff4j = new FF4j("test-ff4j-security-spring.xml");
ff4j.setAuthorizationsManager(new SpringSecurityAuthorisationManager());
}
Aggregations