target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testGetApplicationRolesForApplication() { List<RoleImpl> applicationRoles = coreService.getApplicationRolesForApplication(2); assertEquals(1, applicationRoles.size()); assertEquals("user", applicationRoles.get(0).getName()); }
public List<RoleImpl> getApplicationRolesForApplication(Integer applicationId) { return roleRepository.findByApplicationId(applicationId); }
CoreService { public List<RoleImpl> getApplicationRolesForApplication(Integer applicationId) { return roleRepository.findByApplicationId(applicationId); } }
CoreService { public List<RoleImpl> getApplicationRolesForApplication(Integer applicationId) { return roleRepository.findByApplicationId(applicationId); } }
CoreService { public List<RoleImpl> getApplicationRolesForApplication(Integer applicationId) { return roleRepository.findByApplicationId(applicationId); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, Str...
CoreService { public List<RoleImpl> getApplicationRolesForApplication(Integer applicationId) { return roleRepository.findByApplicationId(applicationId); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, Str...
@Test public void testGetApplicationRootFolder() { assertEquals(new File(rootPath + "/applications"), coreService.getApplicationRootFolder(environment)); }
protected File getApplicationRootFolder(Environment environment) { return PlatformProperties.get(getPlatformConfig(environment)).getApplicationDir(); }
CoreService { protected File getApplicationRootFolder(Environment environment) { return PlatformProperties.get(getPlatformConfig(environment)).getApplicationDir(); } }
CoreService { protected File getApplicationRootFolder(Environment environment) { return PlatformProperties.get(getPlatformConfig(environment)).getApplicationDir(); } }
CoreService { protected File getApplicationRootFolder(Environment environment) { return PlatformProperties.get(getPlatformConfig(environment)).getApplicationDir(); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOve...
CoreService { protected File getApplicationRootFolder(Environment environment) { return PlatformProperties.get(getPlatformConfig(environment)).getApplicationDir(); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOve...
@Test public void testFileCount() { assertTrue("fileCount(upload, 1, 2)"); assertFalse("fileCount(upload, 1, 0)"); assertFalse("fileCount(upload, 3, 2)"); }
public static boolean fileCount(List<FormUpload> fUpload, int minCount, int maxCount) { return fileCountMin(fUpload, minCount) && fileCountMax(fUpload, maxCount); }
RuleValidation { public static boolean fileCount(List<FormUpload> fUpload, int minCount, int maxCount) { return fileCountMin(fUpload, minCount) && fileCountMax(fUpload, maxCount); } }
RuleValidation { public static boolean fileCount(List<FormUpload> fUpload, int minCount, int maxCount) { return fileCountMin(fUpload, minCount) && fileCountMax(fUpload, maxCount); } RuleValidation(Request container); }
RuleValidation { public static boolean fileCount(List<FormUpload> fUpload, int minCount, int maxCount) { return fileCountMin(fUpload, minCount) && fileCountMax(fUpload, maxCount); } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validat...
RuleValidation { public static boolean fileCount(List<FormUpload> fUpload, int minCount, int maxCount) { return fileCountMin(fUpload, minCount) && fileCountMax(fUpload, maxCount); } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validat...
@Test @Ignore public void testGetApplications() { }
public List<ApplicationImpl> getApplications() { return applicationRepository.findAll(); }
CoreService { public List<ApplicationImpl> getApplications() { return applicationRepository.findAll(); } }
CoreService { public List<ApplicationImpl> getApplications() { return applicationRepository.findAll(); } }
CoreService { public List<ApplicationImpl> getApplications() { return applicationRepository.findAll(); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boolean persist,...
CoreService { public List<ApplicationImpl> getApplications() { return applicationRepository.findAll(); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boolean persist,...
@Test @Ignore public void testGetApplicationSubjects() { }
public Collection<ApplicationSubject> getApplicationSubjects(Integer applicationId, Site site) { List<ApplicationSubject> applicationSubjects = new ArrayList<>(); ApplicationImpl application = applicationRepository.findOne(applicationId); List<SubjectImpl> subjects = subjectRepository.findSubjectsForApplication(applica...
CoreService { public Collection<ApplicationSubject> getApplicationSubjects(Integer applicationId, Site site) { List<ApplicationSubject> applicationSubjects = new ArrayList<>(); ApplicationImpl application = applicationRepository.findOne(applicationId); List<SubjectImpl> subjects = subjectRepository.findSubjectsForAppli...
CoreService { public Collection<ApplicationSubject> getApplicationSubjects(Integer applicationId, Site site) { List<ApplicationSubject> applicationSubjects = new ArrayList<>(); ApplicationImpl application = applicationRepository.findOne(applicationId); List<SubjectImpl> subjects = subjectRepository.findSubjectsForAppli...
CoreService { public Collection<ApplicationSubject> getApplicationSubjects(Integer applicationId, Site site) { List<ApplicationSubject> applicationSubjects = new ArrayList<>(); ApplicationImpl application = applicationRepository.findOne(applicationId); List<SubjectImpl> subjects = subjectRepository.findSubjectsForAppli...
CoreService { public Collection<ApplicationSubject> getApplicationSubjects(Integer applicationId, Site site) { List<ApplicationSubject> applicationSubjects = new ArrayList<>(); ApplicationImpl application = applicationRepository.findOne(applicationId); List<SubjectImpl> subjects = subjectRepository.findSubjectsForAppli...
@Test public void testGetPropertiesIntegerInteger() { Iterable<PropertyImpl> properties = coreService.getProperties(1, 1); Iterator<PropertyImpl> iterator = properties.iterator(); PropertyImpl prop = iterator.next(); assertEquals("platform.site.site-1.application.manager.foo", prop.getName()); assertEquals("bar", prop....
private Page<PropertyImpl> getProperties(String prefix, Pageable pageable) { SearchQuery<PropertyImpl> query = new SearchQuery<PropertyImpl>(PropertyImpl.class); query.like("name", prefix + "%"); query.notLike("name", prefix + "%.%"); Page<PropertyImpl> page = propertyRepository.search(query, pageable); return page; }
CoreService { private Page<PropertyImpl> getProperties(String prefix, Pageable pageable) { SearchQuery<PropertyImpl> query = new SearchQuery<PropertyImpl>(PropertyImpl.class); query.like("name", prefix + "%"); query.notLike("name", prefix + "%.%"); Page<PropertyImpl> page = propertyRepository.search(query, pageable); r...
CoreService { private Page<PropertyImpl> getProperties(String prefix, Pageable pageable) { SearchQuery<PropertyImpl> query = new SearchQuery<PropertyImpl>(PropertyImpl.class); query.like("name", prefix + "%"); query.notLike("name", prefix + "%.%"); Page<PropertyImpl> page = propertyRepository.search(query, pageable); r...
CoreService { private Page<PropertyImpl> getProperties(String prefix, Pageable pageable) { SearchQuery<PropertyImpl> query = new SearchQuery<PropertyImpl>(PropertyImpl.class); query.like("name", prefix + "%"); query.notLike("name", prefix + "%.%"); Page<PropertyImpl> page = propertyRepository.search(query, pageable); r...
CoreService { private Page<PropertyImpl> getProperties(String prefix, Pageable pageable) { SearchQuery<PropertyImpl> query = new SearchQuery<PropertyImpl>(PropertyImpl.class); query.like("name", prefix + "%"); query.notLike("name", prefix + "%.%"); Page<PropertyImpl> page = propertyRepository.search(query, pageable); r...
@Test public void testGetPropertiesStringString() { Iterable<PropertyImpl> properties = coreService.getProperties("site-1", "manager"); Iterator<PropertyImpl> iterator = properties.iterator(); PropertyImpl prop = iterator.next(); assertEquals("platform.site.site-1.application.manager.foo", prop.getName()); assertEquals...
private Page<PropertyImpl> getProperties(String prefix, Pageable pageable) { SearchQuery<PropertyImpl> query = new SearchQuery<PropertyImpl>(PropertyImpl.class); query.like("name", prefix + "%"); query.notLike("name", prefix + "%.%"); Page<PropertyImpl> page = propertyRepository.search(query, pageable); return page; }
CoreService { private Page<PropertyImpl> getProperties(String prefix, Pageable pageable) { SearchQuery<PropertyImpl> query = new SearchQuery<PropertyImpl>(PropertyImpl.class); query.like("name", prefix + "%"); query.notLike("name", prefix + "%.%"); Page<PropertyImpl> page = propertyRepository.search(query, pageable); r...
CoreService { private Page<PropertyImpl> getProperties(String prefix, Pageable pageable) { SearchQuery<PropertyImpl> query = new SearchQuery<PropertyImpl>(PropertyImpl.class); query.like("name", prefix + "%"); query.notLike("name", prefix + "%.%"); Page<PropertyImpl> page = propertyRepository.search(query, pageable); r...
CoreService { private Page<PropertyImpl> getProperties(String prefix, Pageable pageable) { SearchQuery<PropertyImpl> query = new SearchQuery<PropertyImpl>(PropertyImpl.class); query.like("name", prefix + "%"); query.notLike("name", prefix + "%.%"); Page<PropertyImpl> page = propertyRepository.search(query, pageable); r...
CoreService { private Page<PropertyImpl> getProperties(String prefix, Pageable pageable) { SearchQuery<PropertyImpl> query = new SearchQuery<PropertyImpl>(PropertyImpl.class); query.like("name", prefix + "%"); query.notLike("name", prefix + "%.%"); Page<PropertyImpl> page = propertyRepository.search(query, pageable); r...
@Test @Ignore public void testGetProperty() { }
public PropertyImpl getProperty(String propertyId) { return propertyRepository.findOne(propertyId); }
CoreService { public PropertyImpl getProperty(String propertyId) { return propertyRepository.findOne(propertyId); } }
CoreService { public PropertyImpl getProperty(String propertyId) { return propertyRepository.findOne(propertyId); } }
CoreService { public PropertyImpl getProperty(String propertyId) { return propertyRepository.findOne(propertyId); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boole...
CoreService { public PropertyImpl getProperty(String propertyId) { return propertyRepository.findOne(propertyId); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boole...
@Test public void testGetSite() { SiteImpl site = coreService.getSite(1); assertNotNull(site); assertEquals(Integer.valueOf(1), site.getId()); }
public SiteImpl getSite(Integer id) { SiteImpl site = siteRepository.findOne(id); initSite(site); return site; }
CoreService { public SiteImpl getSite(Integer id) { SiteImpl site = siteRepository.findOne(id); initSite(site); return site; } }
CoreService { public SiteImpl getSite(Integer id) { SiteImpl site = siteRepository.findOne(id); initSite(site); return site; } }
CoreService { public SiteImpl getSite(Integer id) { SiteImpl site = siteRepository.findOne(id); initSite(site); return site; } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean dev...
CoreService { public SiteImpl getSite(Integer id) { SiteImpl site = siteRepository.findOne(id); initSite(site); return site; } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean dev...
@Test public void testGetSiteByName() { SiteImpl site = coreService.getSiteByName("site-1"); assertNotNull(site); assertEquals(Integer.valueOf(1), site.getId()); assertEquals("site-1", site.getName()); }
public SiteImpl getSiteByName(String name) { SiteImpl site = siteRepository.findByName(name); initSite(site); return site; }
CoreService { public SiteImpl getSiteByName(String name) { SiteImpl site = siteRepository.findByName(name); initSite(site); return site; } }
CoreService { public SiteImpl getSiteByName(String name) { SiteImpl site = siteRepository.findByName(name); initSite(site); return site; } }
CoreService { public SiteImpl getSiteByName(String name) { SiteImpl site = siteRepository.findByName(name); initSite(site); return site; } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, ...
CoreService { public SiteImpl getSiteByName(String name) { SiteImpl site = siteRepository.findByName(name); initSite(site); return site; } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, ...
@Test public void testGetSiteIds() { List<Integer> siteIds = coreService.getSiteIds(); assertEquals(2, siteIds.size()); assertEquals(Integer.valueOf(1), siteIds.get(0)); assertEquals(Integer.valueOf(4), siteIds.get(1)); }
protected List<Integer> getSiteIds() { return siteRepository.getSiteIds(); }
CoreService { protected List<Integer> getSiteIds() { return siteRepository.getSiteIds(); } }
CoreService { protected List<Integer> getSiteIds() { return siteRepository.getSiteIds(); } }
CoreService { protected List<Integer> getSiteIds() { return siteRepository.getSiteIds(); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boolean persist, boolean tempO...
CoreService { protected List<Integer> getSiteIds() { return siteRepository.getSiteIds(); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boolean persist, boolean tempO...
@Test public void testGetSites() { List<SiteImpl> sites = coreService.getSites(); assertEquals(2, sites.size()); assertEquals("site-1", sites.get(0).getName()); assertEquals("example", sites.get(1).getName()); }
public List<SiteImpl> getSites() { return siteRepository.findAll(); }
CoreService { public List<SiteImpl> getSites() { return siteRepository.findAll(); } }
CoreService { public List<SiteImpl> getSites() { return siteRepository.findAll(); } }
CoreService { public List<SiteImpl> getSites() { return siteRepository.findAll(); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boolean persist, boolean tempOverride...
CoreService { public List<SiteImpl> getSites() { return siteRepository.findAll(); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boolean persist, boolean tempOverride...
@Test public void testGetSubjectByEmail() { Subject subject = coreService.getSubjectByEmail("subject1@aiticon.de"); assertEquals(Integer.valueOf(1), subject.getId()); }
public Subject getSubjectByEmail(String email) { return subjectRepository.findByEmail(email); }
CoreService { public Subject getSubjectByEmail(String email) { return subjectRepository.findByEmail(email); } }
CoreService { public Subject getSubjectByEmail(String email) { return subjectRepository.findByEmail(email); } }
CoreService { public Subject getSubjectByEmail(String email) { return subjectRepository.findByEmail(email); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boolean per...
CoreService { public Subject getSubjectByEmail(String email) { return subjectRepository.findByEmail(email); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boolean per...
@Test public void testFileCountMin() { assertTrue("fileCountMin(upload, 1)"); assertFalse("fileCountMin(upload, 5)"); assertFalse("fileCountMin(upload, 3)"); }
public static boolean fileCountMin(List<FormUpload> fUpload, int count) { return getNumberOfFiles(fUpload) >= count; }
RuleValidation { public static boolean fileCountMin(List<FormUpload> fUpload, int count) { return getNumberOfFiles(fUpload) >= count; } }
RuleValidation { public static boolean fileCountMin(List<FormUpload> fUpload, int count) { return getNumberOfFiles(fUpload) >= count; } RuleValidation(Request container); }
RuleValidation { public static boolean fileCountMin(List<FormUpload> fUpload, int count) { return getNumberOfFiles(fUpload) >= count; } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validate(String rule); static boolean string(String s...
RuleValidation { public static boolean fileCountMin(List<FormUpload> fUpload, int count) { return getNumberOfFiles(fUpload) >= count; } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validate(String rule); static boolean string(String s...
@Test public void testGetSubjectById() { Subject subject = coreService.getSubjectById(1, false); assertEquals(Integer.valueOf(1), subject.getId()); }
public Subject getSubjectById(Integer id, boolean initialize) { SubjectImpl subject = subjectRepository.findOne(id); if (initialize) { initializeSubject(subject); } return subject; }
CoreService { public Subject getSubjectById(Integer id, boolean initialize) { SubjectImpl subject = subjectRepository.findOne(id); if (initialize) { initializeSubject(subject); } return subject; } }
CoreService { public Subject getSubjectById(Integer id, boolean initialize) { SubjectImpl subject = subjectRepository.findOne(id); if (initialize) { initializeSubject(subject); } return subject; } }
CoreService { public Subject getSubjectById(Integer id, boolean initialize) { SubjectImpl subject = subjectRepository.findOne(id); if (initialize) { initializeSubject(subject); } return subject; } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(...
CoreService { public Subject getSubjectById(Integer id, boolean initialize) { SubjectImpl subject = subjectRepository.findOne(id); if (initialize) { initializeSubject(subject); } return subject; } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(...
@Test public void testGetSubjectByName() { Subject subject = coreService.getSubjectByName("subject-1", false); assertEquals(Integer.valueOf(1), subject.getId()); }
public SubjectImpl getSubjectByName(String name, boolean initialize) { SubjectImpl subject = subjectRepository.findByName(name); if (initialize) { initializeSubject(subject); } return subject; }
CoreService { public SubjectImpl getSubjectByName(String name, boolean initialize) { SubjectImpl subject = subjectRepository.findByName(name); if (initialize) { initializeSubject(subject); } return subject; } }
CoreService { public SubjectImpl getSubjectByName(String name, boolean initialize) { SubjectImpl subject = subjectRepository.findByName(name); if (initialize) { initializeSubject(subject); } return subject; } }
CoreService { public SubjectImpl getSubjectByName(String name, boolean initialize) { SubjectImpl subject = subjectRepository.findByName(name); if (initialize) { initializeSubject(subject); } return subject; } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPla...
CoreService { public SubjectImpl getSubjectByName(String name, boolean initialize) { SubjectImpl subject = subjectRepository.findByName(name); if (initialize) { initializeSubject(subject); } return subject; } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPla...
@Test public void testGetSubjects() { List<SubjectImpl> subjects = coreService.getSubjects(); assertEquals(3, subjects.size()); assertEquals("subject-1", subjects.get(0).getName()); assertEquals("subject-2", subjects.get(1).getName()); assertEquals("subject-3", subjects.get(2).getName()); }
public List<SubjectImpl> getSubjects() { return subjectRepository.findAll(); }
CoreService { public List<SubjectImpl> getSubjects() { return subjectRepository.findAll(); } }
CoreService { public List<SubjectImpl> getSubjects() { return subjectRepository.findAll(); } }
CoreService { public List<SubjectImpl> getSubjects() { return subjectRepository.findAll(); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boolean persist, boolean tem...
CoreService { public List<SubjectImpl> getSubjects() { return subjectRepository.findAll(); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boolean persist, boolean tem...
@Test public void testLoginPrincipalWithGroup() { servletRequest.addUserRole("subject-1"); Mockito.when(environment.getServletRequest()).thenReturn(servletRequest); Principal principal = Mockito.mock(Principal.class); boolean success = coreService.login(environment, principal); assertTrue(success); Mockito.verify(envir...
public boolean login(Environment env, Principal principal) { SubjectImpl loginSubject = null; SubjectImpl subject = getSubjectByName(principal.getName(), false); if (null != subject) { if (verifySubject(UserType.GLOBAL_USER.equals(subject.getUserType()), subject, env, "{} must be a global user!")) { LOGGER.info("user {...
CoreService { public boolean login(Environment env, Principal principal) { SubjectImpl loginSubject = null; SubjectImpl subject = getSubjectByName(principal.getName(), false); if (null != subject) { if (verifySubject(UserType.GLOBAL_USER.equals(subject.getUserType()), subject, env, "{} must be a global user!")) { LOGGE...
CoreService { public boolean login(Environment env, Principal principal) { SubjectImpl loginSubject = null; SubjectImpl subject = getSubjectByName(principal.getName(), false); if (null != subject) { if (verifySubject(UserType.GLOBAL_USER.equals(subject.getUserType()), subject, env, "{} must be a global user!")) { LOGGE...
CoreService { public boolean login(Environment env, Principal principal) { SubjectImpl loginSubject = null; SubjectImpl subject = getSubjectByName(principal.getName(), false); if (null != subject) { if (verifySubject(UserType.GLOBAL_USER.equals(subject.getUserType()), subject, env, "{} must be a global user!")) { LOGGE...
CoreService { public boolean login(Environment env, Principal principal) { SubjectImpl loginSubject = null; SubjectImpl subject = getSubjectByName(principal.getName(), false); if (null != subject) { if (verifySubject(UserType.GLOBAL_USER.equals(subject.getUserType()), subject, env, "{} must be a global user!")) { LOGGE...
@Test public void testLoginGroup() { SubjectImpl authSubject = new SubjectImpl(); authSubject.setDigest(AppNGTestDataProvider.DIGEST); authSubject.setSalt(AppNGTestDataProvider.SALT); authSubject.setEmail("john@doe.org"); authSubject.setTimeZone(TimeZone.getDefault().getDisplayName()); authSubject.setLanguage(Locale.EN...
public boolean loginGroup(Environment env, AuthSubject authSubject, String password, Integer groupId) { Group group = groupRepository.getGroup(groupId); if (null != group) { if (isValidPassword(authSubject, password)) { SubjectImpl subject = new SubjectImpl(); subject.getGroups().add(group); subject.setLanguage(authSub...
CoreService { public boolean loginGroup(Environment env, AuthSubject authSubject, String password, Integer groupId) { Group group = groupRepository.getGroup(groupId); if (null != group) { if (isValidPassword(authSubject, password)) { SubjectImpl subject = new SubjectImpl(); subject.getGroups().add(group); subject.setLa...
CoreService { public boolean loginGroup(Environment env, AuthSubject authSubject, String password, Integer groupId) { Group group = groupRepository.getGroup(groupId); if (null != group) { if (isValidPassword(authSubject, password)) { SubjectImpl subject = new SubjectImpl(); subject.getGroups().add(group); subject.setLa...
CoreService { public boolean loginGroup(Environment env, AuthSubject authSubject, String password, Integer groupId) { Group group = groupRepository.getGroup(groupId); if (null != group) { if (isValidPassword(authSubject, password)) { SubjectImpl subject = new SubjectImpl(); subject.getGroups().add(group); subject.setLa...
CoreService { public boolean loginGroup(Environment env, AuthSubject authSubject, String password, Integer groupId) { Group group = groupRepository.getGroup(groupId); if (null != group) { if (isValidPassword(authSubject, password)) { SubjectImpl subject = new SubjectImpl(); subject.getGroups().add(group); subject.setLa...
@Test public void testLogin() { boolean success = coreService.login(null, environment, "subject-3", "test"); assertTrue(success); Mockito.verify(environment).setSubject(Mockito.any(SubjectImpl.class)); SubjectImpl subject = coreService.getSubjectByName("subject-3", true); assertNotNull(subject.getLastLogin()); assertFa...
public boolean login(Environment env, Principal principal) { SubjectImpl loginSubject = null; SubjectImpl subject = getSubjectByName(principal.getName(), false); if (null != subject) { if (verifySubject(UserType.GLOBAL_USER.equals(subject.getUserType()), subject, env, "{} must be a global user!")) { LOGGER.info("user {...
CoreService { public boolean login(Environment env, Principal principal) { SubjectImpl loginSubject = null; SubjectImpl subject = getSubjectByName(principal.getName(), false); if (null != subject) { if (verifySubject(UserType.GLOBAL_USER.equals(subject.getUserType()), subject, env, "{} must be a global user!")) { LOGGE...
CoreService { public boolean login(Environment env, Principal principal) { SubjectImpl loginSubject = null; SubjectImpl subject = getSubjectByName(principal.getName(), false); if (null != subject) { if (verifySubject(UserType.GLOBAL_USER.equals(subject.getUserType()), subject, env, "{} must be a global user!")) { LOGGE...
CoreService { public boolean login(Environment env, Principal principal) { SubjectImpl loginSubject = null; SubjectImpl subject = getSubjectByName(principal.getName(), false); if (null != subject) { if (verifySubject(UserType.GLOBAL_USER.equals(subject.getUserType()), subject, env, "{} must be a global user!")) { LOGGE...
CoreService { public boolean login(Environment env, Principal principal) { SubjectImpl loginSubject = null; SubjectImpl subject = getSubjectByName(principal.getName(), false); if (null != subject) { if (verifySubject(UserType.GLOBAL_USER.equals(subject.getUserType()), subject, env, "{} must be a global user!")) { LOGGE...
@Test public void testProvideApplication() throws URISyntaxException, BusinessException { RepositoryImpl repository = new RepositoryImpl(); repository.setActive(true); repository.setName("testrepo"); repository.setRepositoryMode(RepositoryMode.STABLE); repository.setRepositoryType(RepositoryType.LOCAL); URI uri = getCl...
private ApplicationImpl provideApplication(PackageArchive applicationArchive, boolean isFileBased, boolean isPrivileged, boolean isHidden, FieldProcessor fp, boolean updateHiddenAndPrivileged) throws BusinessException { ApplicationInfo applicationInfo = (ApplicationInfo) applicationArchive.getPackageInfo(); String appl...
CoreService { private ApplicationImpl provideApplication(PackageArchive applicationArchive, boolean isFileBased, boolean isPrivileged, boolean isHidden, FieldProcessor fp, boolean updateHiddenAndPrivileged) throws BusinessException { ApplicationInfo applicationInfo = (ApplicationInfo) applicationArchive.getPackageInfo(...
CoreService { private ApplicationImpl provideApplication(PackageArchive applicationArchive, boolean isFileBased, boolean isPrivileged, boolean isHidden, FieldProcessor fp, boolean updateHiddenAndPrivileged) throws BusinessException { ApplicationInfo applicationInfo = (ApplicationInfo) applicationArchive.getPackageInfo(...
CoreService { private ApplicationImpl provideApplication(PackageArchive applicationArchive, boolean isFileBased, boolean isPrivileged, boolean isHidden, FieldProcessor fp, boolean updateHiddenAndPrivileged) throws BusinessException { ApplicationInfo applicationInfo = (ApplicationInfo) applicationArchive.getPackageInfo(...
CoreService { private ApplicationImpl provideApplication(PackageArchive applicationArchive, boolean isFileBased, boolean isPrivileged, boolean isHidden, FieldProcessor fp, boolean updateHiddenAndPrivileged) throws BusinessException { ApplicationInfo applicationInfo = (ApplicationInfo) applicationArchive.getPackageInfo(...
@Test(expected = BusinessException.class) public void testReloadRepository() throws BusinessException { coreService.reloadRepository(1); }
protected void reloadRepository(Integer repositoryId) throws BusinessException { if (null != repositoryId) { RepositoryImpl repository = repoRepository.findOne(repositoryId); if (null != repository) { try { repository.reload(); } catch (Exception e) { throw new BusinessException("Unable to reload repository with ID " +...
CoreService { protected void reloadRepository(Integer repositoryId) throws BusinessException { if (null != repositoryId) { RepositoryImpl repository = repoRepository.findOne(repositoryId); if (null != repository) { try { repository.reload(); } catch (Exception e) { throw new BusinessException("Unable to reload reposito...
CoreService { protected void reloadRepository(Integer repositoryId) throws BusinessException { if (null != repositoryId) { RepositoryImpl repository = repoRepository.findOne(repositoryId); if (null != repository) { try { repository.reload(); } catch (Exception e) { throw new BusinessException("Unable to reload reposito...
CoreService { protected void reloadRepository(Integer repositoryId) throws BusinessException { if (null != repositoryId) { RepositoryImpl repository = repoRepository.findOne(repositoryId); if (null != repository) { try { repository.reload(); } catch (Exception e) { throw new BusinessException("Unable to reload reposito...
CoreService { protected void reloadRepository(Integer repositoryId) throws BusinessException { if (null != repositoryId) { RepositoryImpl repository = repoRepository.findOne(repositoryId); if (null != repository) { try { repository.reload(); } catch (Exception e) { throw new BusinessException("Unable to reload reposito...
@Test @Ignore public void testResetConnection() { }
public void resetConnection(FieldProcessor fp, Integer conId) { SiteApplication siteApplication = siteApplicationRepository.findByDatabaseConnectionId(conId); if (null != siteApplication) { String databasePrefix = getPlatform(true, false).getString(Platform.Property.DATABASE_PREFIX); databaseService.resetApplicationCon...
CoreService { public void resetConnection(FieldProcessor fp, Integer conId) { SiteApplication siteApplication = siteApplicationRepository.findByDatabaseConnectionId(conId); if (null != siteApplication) { String databasePrefix = getPlatform(true, false).getString(Platform.Property.DATABASE_PREFIX); databaseService.reset...
CoreService { public void resetConnection(FieldProcessor fp, Integer conId) { SiteApplication siteApplication = siteApplicationRepository.findByDatabaseConnectionId(conId); if (null != siteApplication) { String databasePrefix = getPlatform(true, false).getString(Platform.Property.DATABASE_PREFIX); databaseService.reset...
CoreService { public void resetConnection(FieldProcessor fp, Integer conId) { SiteApplication siteApplication = siteApplicationRepository.findByDatabaseConnectionId(conId); if (null != siteApplication) { String databasePrefix = getPlatform(true, false).getString(Platform.Property.DATABASE_PREFIX); databaseService.reset...
CoreService { public void resetConnection(FieldProcessor fp, Integer conId) { SiteApplication siteApplication = siteApplicationRepository.findByDatabaseConnectionId(conId); if (null != siteApplication) { String databasePrefix = getPlatform(true, false).getString(Platform.Property.DATABASE_PREFIX); databaseService.reset...
@Test public void testResetPassword() { AuthSubject subject = coreService.getSubjectByName("subject-3", true); String currentDigest = subject.getDigest(); String currentSalt = subject.getSalt(); SaltedDigest saltedDigest = new SaltedDigestSha1(); if (null == currentSalt) { currentSalt = saltedDigest.getSalt(); subject....
public byte[] resetPassword(AuthSubject authSubject, PasswordPolicy passwordPolicy, String email, String hash) { SubjectImpl subject = getSubjectByName(authSubject.getAuthName(), false); if (canSubjectResetPassword(subject)) { PasswordHandler passwordHandler = getPasswordHandler(authSubject); if (passwordHandler.isVali...
CoreService { public byte[] resetPassword(AuthSubject authSubject, PasswordPolicy passwordPolicy, String email, String hash) { SubjectImpl subject = getSubjectByName(authSubject.getAuthName(), false); if (canSubjectResetPassword(subject)) { PasswordHandler passwordHandler = getPasswordHandler(authSubject); if (password...
CoreService { public byte[] resetPassword(AuthSubject authSubject, PasswordPolicy passwordPolicy, String email, String hash) { SubjectImpl subject = getSubjectByName(authSubject.getAuthName(), false); if (canSubjectResetPassword(subject)) { PasswordHandler passwordHandler = getPasswordHandler(authSubject); if (password...
CoreService { public byte[] resetPassword(AuthSubject authSubject, PasswordPolicy passwordPolicy, String email, String hash) { SubjectImpl subject = getSubjectByName(authSubject.getAuthName(), false); if (canSubjectResetPassword(subject)) { PasswordHandler passwordHandler = getPasswordHandler(authSubject); if (password...
CoreService { public byte[] resetPassword(AuthSubject authSubject, PasswordPolicy passwordPolicy, String email, String hash) { SubjectImpl subject = getSubjectByName(authSubject.getAuthName(), false); if (canSubjectResetPassword(subject)) { PasswordHandler passwordHandler = getPasswordHandler(authSubject); if (password...
@Test public void testFileCountMax() { assertTrue("fileCountMax(upload, 3)"); assertFalse("fileCountMax(upload, 1)"); assertFalse("fileCountMax(upload, 0)"); }
public static boolean fileCountMax(List<FormUpload> fUpload, int count) { return getNumberOfFiles(fUpload) <= count; }
RuleValidation { public static boolean fileCountMax(List<FormUpload> fUpload, int count) { return getNumberOfFiles(fUpload) <= count; } }
RuleValidation { public static boolean fileCountMax(List<FormUpload> fUpload, int count) { return getNumberOfFiles(fUpload) <= count; } RuleValidation(Request container); }
RuleValidation { public static boolean fileCountMax(List<FormUpload> fUpload, int count) { return getNumberOfFiles(fUpload) <= count; } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validate(String rule); static boolean string(String s...
RuleValidation { public static boolean fileCountMax(List<FormUpload> fUpload, int count) { return getNumberOfFiles(fUpload) <= count; } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validate(String rule); static boolean string(String s...
@Test public void testRestoreSubject() { Subject subject = coreService.restoreSubject("subject-1"); assertTrue(subject.isAuthenticated()); assertNull(subject.getDigest()); assertNull(subject.getSalt()); }
public Subject restoreSubject(String name) { SubjectImpl subject = getSubjectByName(name, true); if (null != subject) { initAuthenticatedSubject(subject); LOGGER.trace("successfully restored subject '{}'", subject.getName()); } else { LOGGER.error("can not restore subject '{}'", name); } return subject; }
CoreService { public Subject restoreSubject(String name) { SubjectImpl subject = getSubjectByName(name, true); if (null != subject) { initAuthenticatedSubject(subject); LOGGER.trace("successfully restored subject '{}'", subject.getName()); } else { LOGGER.error("can not restore subject '{}'", name); } return subject; }...
CoreService { public Subject restoreSubject(String name) { SubjectImpl subject = getSubjectByName(name, true); if (null != subject) { initAuthenticatedSubject(subject); LOGGER.trace("successfully restored subject '{}'", subject.getName()); } else { LOGGER.error("can not restore subject '{}'", name); } return subject; }...
CoreService { public Subject restoreSubject(String name) { SubjectImpl subject = getSubjectByName(name, true); if (null != subject) { initAuthenticatedSubject(subject); LOGGER.trace("successfully restored subject '{}'", subject.getName()); } else { LOGGER.error("can not restore subject '{}'", name); } return subject; }...
CoreService { public Subject restoreSubject(String name) { SubjectImpl subject = getSubjectByName(name, true); if (null != subject) { initAuthenticatedSubject(subject); LOGGER.trace("successfully restored subject '{}'", subject.getName()); } else { LOGGER.error("can not restore subject '{}'", name); } return subject; }...
@Test public void testSaveProperties() { List<Property> props = new ArrayList<>(); PropertyImpl a = new PropertyImpl("foobaz.a", "a"); PropertyImpl b = new PropertyImpl("foobaz.b", "b"); props.add(a); props.add(b); coreService.saveProperties(new PropertyHolder("foobaz.", props)); assertEquals(a, coreService.getProperty...
protected void saveProperties(Properties properties) { Set<String> propertyNames = properties.getPropertyNames(); PropertyHolder propertyHolder = (PropertyHolder) properties; propertyNames.forEach(name -> saveProperty((PropertyImpl) propertyHolder.getProperty(name))); }
CoreService { protected void saveProperties(Properties properties) { Set<String> propertyNames = properties.getPropertyNames(); PropertyHolder propertyHolder = (PropertyHolder) properties; propertyNames.forEach(name -> saveProperty((PropertyImpl) propertyHolder.getProperty(name))); } }
CoreService { protected void saveProperties(Properties properties) { Set<String> propertyNames = properties.getPropertyNames(); PropertyHolder propertyHolder = (PropertyHolder) properties; propertyNames.forEach(name -> saveProperty((PropertyImpl) propertyHolder.getProperty(name))); } }
CoreService { protected void saveProperties(Properties properties) { Set<String> propertyNames = properties.getPropertyNames(); PropertyHolder propertyHolder = (PropertyHolder) properties; propertyNames.forEach(name -> saveProperty((PropertyImpl) propertyHolder.getProperty(name))); } Subject createSubject(SubjectImpl ...
CoreService { protected void saveProperties(Properties properties) { Set<String> propertyNames = properties.getPropertyNames(); PropertyHolder propertyHolder = (PropertyHolder) properties; propertyNames.forEach(name -> saveProperty((PropertyImpl) propertyHolder.getProperty(name))); } Subject createSubject(SubjectImpl ...
@Test public void testSaveProperty() { PropertyImpl property = coreService.saveProperty(new PropertyImpl("prop1", "value")); assertNotNull(property); assertNotNull(property.getVersion()); assertEquals("prop1", property.getId()); assertEquals("value", property.getString()); }
public PropertyImpl saveProperty(PropertyImpl property) { return propertyRepository.save(property); }
CoreService { public PropertyImpl saveProperty(PropertyImpl property) { return propertyRepository.save(property); } }
CoreService { public PropertyImpl saveProperty(PropertyImpl property) { return propertyRepository.save(property); } }
CoreService { public PropertyImpl saveProperty(PropertyImpl property) { return propertyRepository.save(property); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boole...
CoreService { public PropertyImpl saveProperty(PropertyImpl property) { return propertyRepository.save(property); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boole...
@Test @Ignore public void testShutdownSite() { }
public SiteImpl shutdownSite(Environment env, String siteName) { return shutdownSite(env, siteName, false); }
CoreService { public SiteImpl shutdownSite(Environment env, String siteName) { return shutdownSite(env, siteName, false); } }
CoreService { public SiteImpl shutdownSite(Environment env, String siteName) { return shutdownSite(env, siteName, false); } }
CoreService { public SiteImpl shutdownSite(Environment env, String siteName) { return shutdownSite(env, siteName, false); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMod...
CoreService { public SiteImpl shutdownSite(Environment env, String siteName) { return shutdownSite(env, siteName, false); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMod...
@Test @Ignore public void testSynchronizeApplicationResources() { }
protected void synchronizeApplicationResources(Environment env, Application application, boolean isFileBased) throws BusinessException { String convertDirection = ""; try { Application currentApplication = applicationRepository.findOne(application.getId()); File applicationFolder = getApplicationFolder(env, currentAppl...
CoreService { protected void synchronizeApplicationResources(Environment env, Application application, boolean isFileBased) throws BusinessException { String convertDirection = ""; try { Application currentApplication = applicationRepository.findOne(application.getId()); File applicationFolder = getApplicationFolder(en...
CoreService { protected void synchronizeApplicationResources(Environment env, Application application, boolean isFileBased) throws BusinessException { String convertDirection = ""; try { Application currentApplication = applicationRepository.findOne(application.getId()); File applicationFolder = getApplicationFolder(en...
CoreService { protected void synchronizeApplicationResources(Environment env, Application application, boolean isFileBased) throws BusinessException { String convertDirection = ""; try { Application currentApplication = applicationRepository.findOne(application.getId()); File applicationFolder = getApplicationFolder(en...
CoreService { protected void synchronizeApplicationResources(Environment env, Application application, boolean isFileBased) throws BusinessException { String convertDirection = ""; try { Application currentApplication = applicationRepository.findOne(application.getId()); File applicationFolder = getApplicationFolder(en...
@Test public void testUnlinkApplicationFromSiteIntegerString() { MigrationStatus migrationStatus = coreService.unlinkApplicationFromSite(1, 1); assertEquals(MigrationStatus.NO_DB_SUPPORTED, migrationStatus); }
protected MigrationStatus unlinkApplicationFromSite(SiteApplication siteApplication) { Site site = siteApplication.getSite(); ((SiteImpl) site).getSiteApplications().remove(siteApplication); siteApplicationRepository.delete(siteApplication); deleteApplicationPropertiesFromSite(site, siteApplication.getApplication()); D...
CoreService { protected MigrationStatus unlinkApplicationFromSite(SiteApplication siteApplication) { Site site = siteApplication.getSite(); ((SiteImpl) site).getSiteApplications().remove(siteApplication); siteApplicationRepository.delete(siteApplication); deleteApplicationPropertiesFromSite(site, siteApplication.getApp...
CoreService { protected MigrationStatus unlinkApplicationFromSite(SiteApplication siteApplication) { Site site = siteApplication.getSite(); ((SiteImpl) site).getSiteApplications().remove(siteApplication); siteApplicationRepository.delete(siteApplication); deleteApplicationPropertiesFromSite(site, siteApplication.getApp...
CoreService { protected MigrationStatus unlinkApplicationFromSite(SiteApplication siteApplication) { Site site = siteApplication.getSite(); ((SiteImpl) site).getSiteApplications().remove(siteApplication); siteApplicationRepository.delete(siteApplication); deleteApplicationPropertiesFromSite(site, siteApplication.getApp...
CoreService { protected MigrationStatus unlinkApplicationFromSite(SiteApplication siteApplication) { Site site = siteApplication.getSite(); ((SiteImpl) site).getSiteApplications().remove(siteApplication); siteApplicationRepository.delete(siteApplication); deleteApplicationPropertiesFromSite(site, siteApplication.getApp...
@Test @Ignore public void testUnsetReloadRequired() { }
public void unsetReloadRequired(SiteApplication siteApplication) { siteApplication.setReloadRequired(false); siteApplicationRepository.findOne(siteApplication.getSiteApplicationId()).setReloadRequired(false); }
CoreService { public void unsetReloadRequired(SiteApplication siteApplication) { siteApplication.setReloadRequired(false); siteApplicationRepository.findOne(siteApplication.getSiteApplicationId()).setReloadRequired(false); } }
CoreService { public void unsetReloadRequired(SiteApplication siteApplication) { siteApplication.setReloadRequired(false); siteApplicationRepository.findOne(siteApplication.getSiteApplicationId()).setReloadRequired(false); } }
CoreService { public void unsetReloadRequired(SiteApplication siteApplication) { siteApplication.setReloadRequired(false); siteApplicationRepository.findOne(siteApplication.getSiteApplicationId()).setReloadRequired(false); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformPr...
CoreService { public void unsetReloadRequired(SiteApplication siteApplication) { siteApplication.setReloadRequired(false); siteApplicationRepository.findOne(siteApplication.getSiteApplicationId()).setReloadRequired(false); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformPr...
@Test public void testUpdatePassword() throws BusinessException { SubjectImpl subject = coreService.getSubjectByName("subject-3", false); PasswordPolicy dummyPolicy = new ConfigurablePasswordPolicy() { public ValidationResult validatePassword(String username, char[] currentPassword, char[] password) { return new Valida...
public PasswordPolicy.ValidationResult updatePassword(PasswordPolicy policy, char[] currentPassword, char[] password, SubjectImpl currentSubject) { PasswordPolicy.ValidationResult validationResult = policy.validatePassword(currentSubject.getAuthName(), currentPassword, password); if (validationResult.isValid()) { Passw...
CoreService { public PasswordPolicy.ValidationResult updatePassword(PasswordPolicy policy, char[] currentPassword, char[] password, SubjectImpl currentSubject) { PasswordPolicy.ValidationResult validationResult = policy.validatePassword(currentSubject.getAuthName(), currentPassword, password); if (validationResult.isVa...
CoreService { public PasswordPolicy.ValidationResult updatePassword(PasswordPolicy policy, char[] currentPassword, char[] password, SubjectImpl currentSubject) { PasswordPolicy.ValidationResult validationResult = policy.validatePassword(currentSubject.getAuthName(), currentPassword, password); if (validationResult.isVa...
CoreService { public PasswordPolicy.ValidationResult updatePassword(PasswordPolicy policy, char[] currentPassword, char[] password, SubjectImpl currentSubject) { PasswordPolicy.ValidationResult validationResult = policy.validatePassword(currentSubject.getAuthName(), currentPassword, password); if (validationResult.isVa...
CoreService { public PasswordPolicy.ValidationResult updatePassword(PasswordPolicy policy, char[] currentPassword, char[] password, SubjectImpl currentSubject) { PasswordPolicy.ValidationResult validationResult = policy.validatePassword(currentSubject.getAuthName(), currentPassword, password); if (validationResult.isVa...
@Test @Ignore public void testUpdateSubject() { }
public SubjectImpl updateSubject(SubjectImpl subject) { return subjectRepository.save(subject); }
CoreService { public SubjectImpl updateSubject(SubjectImpl subject) { return subjectRepository.save(subject); } }
CoreService { public SubjectImpl updateSubject(SubjectImpl subject) { return subjectRepository.save(subject); } }
CoreService { public SubjectImpl updateSubject(SubjectImpl subject) { return subjectRepository.save(subject); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boolean p...
CoreService { public SubjectImpl updateSubject(SubjectImpl subject) { return subjectRepository.save(subject); } Subject createSubject(SubjectImpl subject); PropertyHolder getPlatformProperties(); PlatformProperties initPlatformConfig(java.util.Properties defaultOverrides, String rootPath, Boolean devMode, boolean p...
@Test public void testInitDatabase() throws Exception { String jdbcUrl = "jdbc:hsqldb:mem:testInitDatabase"; Properties platformProperties = getProperties(DatabaseType.HSQL, jdbcUrl, "sa", "", JDBCDriver.class.getName()); DatabaseConnection platformConnection = databaseService.initDatabase(platformProperties); StringBu...
@Transactional public DatabaseConnection initDatabase(java.util.Properties config, boolean managed, boolean setActive) { DatabaseConnection platformConnection = initDatabase(config); MigrationInfoService statusComplete = platformConnection.getMigrationInfoService(); if (setActive && statusComplete != null && null != st...
DatabaseService extends MigrationService { @Transactional public DatabaseConnection initDatabase(java.util.Properties config, boolean managed, boolean setActive) { DatabaseConnection platformConnection = initDatabase(config); MigrationInfoService statusComplete = platformConnection.getMigrationInfoService(); if (setAct...
DatabaseService extends MigrationService { @Transactional public DatabaseConnection initDatabase(java.util.Properties config, boolean managed, boolean setActive) { DatabaseConnection platformConnection = initDatabase(config); MigrationInfoService statusComplete = platformConnection.getMigrationInfoService(); if (setAct...
DatabaseService extends MigrationService { @Transactional public DatabaseConnection initDatabase(java.util.Properties config, boolean managed, boolean setActive) { DatabaseConnection platformConnection = initDatabase(config); MigrationInfoService statusComplete = platformConnection.getMigrationInfoService(); if (setAct...
DatabaseService extends MigrationService { @Transactional public DatabaseConnection initDatabase(java.util.Properties config, boolean managed, boolean setActive) { DatabaseConnection platformConnection = initDatabase(config); MigrationInfoService statusComplete = platformConnection.getMigrationInfoService(); if (setAct...
@Test public void testString() { assertTrue("string(foo)"); assertTrue("string(bar)"); assertFalse("string(foobar)"); assertTrue("string('foobar')"); }
public static boolean string(String string) { return regExp(string, EXP_STRING); }
RuleValidation { public static boolean string(String string) { return regExp(string, EXP_STRING); } }
RuleValidation { public static boolean string(String string) { return regExp(string, EXP_STRING); } RuleValidation(Request container); }
RuleValidation { public static boolean string(String string) { return regExp(string, EXP_STRING); } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validate(String rule); static boolean string(String string); static boolean captcha(Strin...
RuleValidation { public static boolean string(String string) { return regExp(string, EXP_STRING); } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validate(String rule); static boolean string(String string); static boolean captcha(Strin...
@Test public void testUserName() { Application app = Mockito.mock(Application.class); Site site = Mockito.mock(Site.class); Mockito.when(site.getId()).thenReturn(1234); Mockito.when(app.getId()).thenReturn(1234); String userName = databaseService.getUserName(site, app); Assert.assertTrue(userName.length() <= 16); }
protected String getUserName(Site site, Application application) { return "site" + site.getId() + "app" + application.getId(); }
DatabaseService extends MigrationService { protected String getUserName(Site site, Application application) { return "site" + site.getId() + "app" + application.getId(); } }
DatabaseService extends MigrationService { protected String getUserName(Site site, Application application) { return "site" + site.getId() + "app" + application.getId(); } }
DatabaseService extends MigrationService { protected String getUserName(Site site, Application application) { return "site" + site.getId() + "app" + application.getId(); } void resetApplicationConnection(SiteApplication siteApplication, String databasePrefix); @Transactional DatabaseConnection initDatabase(java.util.P...
DatabaseService extends MigrationService { protected String getUserName(Site site, Application application) { return "site" + site.getId() + "app" + application.getId(); } void resetApplicationConnection(SiteApplication siteApplication, String databasePrefix); @Transactional DatabaseConnection initDatabase(java.util.P...
@Test public void testLoginUserSucces() throws NamingException, IOException { boolean success; sitePropertyMocks.replace(LdapService.LDAP_PRINCIPAL_SCHEME, "DN"); sitePropertyMocks.put(LdapService.LDAP_USER_BASE_DN, "l=egypt"); sitePropertyMocks.put(LdapService.LDAP_ID_ATTRIBUTE, "uid"); setup("uid=aziz,l=egypt", "ligh...
public boolean loginUser(Site site, String username, char[] password) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return true; } catch (IOException | NamingException ex) { logException(lda...
LdapService { public boolean loginUser(Site site, String username, char[] password) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return true; } catch (IOException | NamingException ex) { lo...
LdapService { public boolean loginUser(Site site, String username, char[] password) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return true; } catch (IOException | NamingException ex) { lo...
LdapService { public boolean loginUser(Site site, String username, char[] password) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return true; } catch (IOException | NamingException ex) { lo...
LdapService { public boolean loginUser(Site site, String username, char[] password) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return true; } catch (IOException | NamingException ex) { lo...
@Test public void testLoginUserFailure() throws NamingException, IOException { boolean success; List<Exception> exList; Exception ex; LdapContextMock ldapContextMock; sitePropertyMocks.replace(LdapService.LDAP_PRINCIPAL_SCHEME, "SAM"); sitePropertyMocks.replace(LdapService.LDAP_DOMAIN, "egypt"); ldapContextMock = setup...
public boolean loginUser(Site site, String username, char[] password) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return true; } catch (IOException | NamingException ex) { logException(lda...
LdapService { public boolean loginUser(Site site, String username, char[] password) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return true; } catch (IOException | NamingException ex) { lo...
LdapService { public boolean loginUser(Site site, String username, char[] password) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return true; } catch (IOException | NamingException ex) { lo...
LdapService { public boolean loginUser(Site site, String username, char[] password) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return true; } catch (IOException | NamingException ex) { lo...
LdapService { public boolean loginUser(Site site, String username, char[] password) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return true; } catch (IOException | NamingException ex) { lo...
@Test public void testLoginGroupExistent() throws NamingException, IOException { List<String> searchedGroups; List<String> resultGroups; sitePropertyMocks.replace(LdapService.LDAP_PRINCIPAL_SCHEME, "UPN"); sitePropertyMocks.replace(LdapService.LDAP_DOMAIN, "egypt"); sitePropertyMocks.put(LdapService.LDAP_USER, "mondosh...
public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return getUserGroups(c...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
@Test public void testLoginGroupExistentNoGroupBaseDn() throws NamingException, IOException { List<String> searchedGroups; List<String> resultGroups; sitePropertyMocks.replace(LdapService.LDAP_PRINCIPAL_SCHEME, "UPN"); sitePropertyMocks.replace(LdapService.LDAP_DOMAIN, "egypt"); sitePropertyMocks.put(LdapService.LDAP_U...
public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return getUserGroups(c...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
@Test public void testLoginGroupExistentServiceUserDirectDN() throws NamingException, IOException { List<String> searchedGroups; List<String> resultGroups; sitePropertyMocks.replace(LdapService.LDAP_PRINCIPAL_SCHEME, "UPN"); sitePropertyMocks.replace(LdapService.LDAP_DOMAIN, "egypt"); sitePropertyMocks.put(LdapService....
public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return getUserGroups(c...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
@Test public void testLoginGroupMissing() throws NamingException, IOException { List<String> searchedGroups; List<String> resultGroups; sitePropertyMocks.replace(LdapService.LDAP_PRINCIPAL_SCHEME, "UPN"); sitePropertyMocks.replace(LdapService.LDAP_DOMAIN, "egypt"); sitePropertyMocks.put(LdapService.LDAP_USER, "mondosha...
public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return getUserGroups(c...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
LdapService { public List<String> loginGroup(Site site, String username, char[] password, SubjectImpl subject, List<String> groupNames) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return g...
@Test public void testUsersOfGroup() throws NamingException, IOException { List<SubjectImpl> resultSubjects; String[] expectSubjNames = new String[] { "aziz", "aziz' brother" }; String[] expectSubjRealNames = new String[] { "Dummy", "Dummy" }; sitePropertyMocks.replace(LdapService.LDAP_PRINCIPAL_SCHEME, "UPN"); sitePro...
public List<SubjectImpl> getMembersOfGroup(Site site, String groupName) { List<SubjectImpl> subjects = new ArrayList<>(); String serviceUser = site.getProperties().getString(LDAP_USER); char[] servicePassword = site.getProperties().getString(LDAP_PASSWORD).toCharArray(); LdapCredentials ldapCredentials = new LdapCreden...
LdapService { public List<SubjectImpl> getMembersOfGroup(Site site, String groupName) { List<SubjectImpl> subjects = new ArrayList<>(); String serviceUser = site.getProperties().getString(LDAP_USER); char[] servicePassword = site.getProperties().getString(LDAP_PASSWORD).toCharArray(); LdapCredentials ldapCredentials = ...
LdapService { public List<SubjectImpl> getMembersOfGroup(Site site, String groupName) { List<SubjectImpl> subjects = new ArrayList<>(); String serviceUser = site.getProperties().getString(LDAP_USER); char[] servicePassword = site.getProperties().getString(LDAP_PASSWORD).toCharArray(); LdapCredentials ldapCredentials = ...
LdapService { public List<SubjectImpl> getMembersOfGroup(Site site, String groupName) { List<SubjectImpl> subjects = new ArrayList<>(); String serviceUser = site.getProperties().getString(LDAP_USER); char[] servicePassword = site.getProperties().getString(LDAP_PASSWORD).toCharArray(); LdapCredentials ldapCredentials = ...
LdapService { public List<SubjectImpl> getMembersOfGroup(Site site, String groupName) { List<SubjectImpl> subjects = new ArrayList<>(); String serviceUser = site.getProperties().getString(LDAP_USER); char[] servicePassword = site.getProperties().getString(LDAP_PASSWORD).toCharArray(); LdapCredentials ldapCredentials = ...
@Test public void testLoginUserStartTls() throws NamingException, IOException { boolean success; sitePropertyMocks.replace(LdapService.LDAP_PRINCIPAL_SCHEME, "DN"); sitePropertyMocks.put(LdapService.LDAP_USER_BASE_DN, "l=egypt"); sitePropertyMocks.put(LdapService.LDAP_ID_ATTRIBUTE, "uid"); sitePropertyMocks.put(LdapSer...
public boolean loginUser(Site site, String username, char[] password) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return true; } catch (IOException | NamingException ex) { logException(lda...
LdapService { public boolean loginUser(Site site, String username, char[] password) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return true; } catch (IOException | NamingException ex) { lo...
LdapService { public boolean loginUser(Site site, String username, char[] password) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return true; } catch (IOException | NamingException ex) { lo...
LdapService { public boolean loginUser(Site site, String username, char[] password) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return true; } catch (IOException | NamingException ex) { lo...
LdapService { public boolean loginUser(Site site, String username, char[] password) { LdapCredentials ldapCredentials = new LdapCredentials(site, username, password, false); TlsAwareLdapContext ctx = null; try { ctx = new TlsAwareLdapContext(ldapCredentials); return true; } catch (IOException | NamingException ex) { lo...
@Test public void testSign() throws IOException { byte[] cert = FileUtils.readFileToByteArray(certFile); byte[] key = FileUtils.readFileToByteArray(getFile("cert/appng-dev.pem")); Path repoPath = getFile("zip").toPath(); SignatureWrapper signRepo = Signer.signRepo(repoPath, new SignerConfig("Local", "a local test repos...
public static SignatureWrapper signRepo(Path repoPath, SignerConfig config) throws SigningException { String missingKey = config.hasMissingKey(); if (missingKey != null) throw new SigningException(ErrorType.SIGN, String.format("Missing configuration key '%s' in SignerConfig.", missingKey)); LOGGER.info("Signing reposit...
Signer { public static SignatureWrapper signRepo(Path repoPath, SignerConfig config) throws SigningException { String missingKey = config.hasMissingKey(); if (missingKey != null) throw new SigningException(ErrorType.SIGN, String.format("Missing configuration key '%s' in SignerConfig.", missingKey)); LOGGER.info("Signin...
Signer { public static SignatureWrapper signRepo(Path repoPath, SignerConfig config) throws SigningException { String missingKey = config.hasMissingKey(); if (missingKey != null) throw new SigningException(ErrorType.SIGN, String.format("Missing configuration key '%s' in SignerConfig.", missingKey)); LOGGER.info("Signin...
Signer { public static SignatureWrapper signRepo(Path repoPath, SignerConfig config) throws SigningException { String missingKey = config.hasMissingKey(); if (missingKey != null) throw new SigningException(ErrorType.SIGN, String.format("Missing configuration key '%s' in SignerConfig.", missingKey)); LOGGER.info("Signin...
Signer { public static SignatureWrapper signRepo(Path repoPath, SignerConfig config) throws SigningException { String missingKey = config.hasMissingKey(); if (missingKey != null) throw new SigningException(ErrorType.SIGN, String.format("Missing configuration key '%s' in SignerConfig.", missingKey)); LOGGER.info("Signin...
@Test public void testCaptcha() { assertFalse("captcha(bar, SESSION.foobar)"); assertFalse("captcha(bar, SESSION['foobar'])"); assertTrue("captcha(5, SESSION.foobar)"); assertTrue("captcha(5, SESSION['foobar'])"); }
public static boolean captcha(String value, String result) { return StringUtils.equals(value, result); }
RuleValidation { public static boolean captcha(String value, String result) { return StringUtils.equals(value, result); } }
RuleValidation { public static boolean captcha(String value, String result) { return StringUtils.equals(value, result); } RuleValidation(Request container); }
RuleValidation { public static boolean captcha(String value, String result) { return StringUtils.equals(value, result); } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validate(String rule); static boolean string(String string); static...
RuleValidation { public static boolean captcha(String value, String result) { return StringUtils.equals(value, result); } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validate(String rule); static boolean string(String string); static...
@Test(expected = SigningException.class) public void testVerfiyInvalidSignature() throws IOException { ValidatorConfig config = new ValidatorConfig(); config.setSigningCert(FileUtils.readFileToByteArray(certFile), SigningAlgorithm.SHA512withRSA); Signer.getRepoValidator(config, FileUtils.readFileToByteArray(indexFile),...
public static Signer getRepoValidator(ValidatorConfig config, byte[] indexFileData, byte[] signatureData) throws SigningException { return getRepoValidator(config, indexFileData, signatureData, null); }
Signer { public static Signer getRepoValidator(ValidatorConfig config, byte[] indexFileData, byte[] signatureData) throws SigningException { return getRepoValidator(config, indexFileData, signatureData, null); } }
Signer { public static Signer getRepoValidator(ValidatorConfig config, byte[] indexFileData, byte[] signatureData) throws SigningException { return getRepoValidator(config, indexFileData, signatureData, null); } private Signer(ValidatorConfig config); }
Signer { public static Signer getRepoValidator(ValidatorConfig config, byte[] indexFileData, byte[] signatureData) throws SigningException { return getRepoValidator(config, indexFileData, signatureData, null); } private Signer(ValidatorConfig config); static Signer getRepoValidator(ValidatorConfig config, byte[] index...
Signer { public static Signer getRepoValidator(ValidatorConfig config, byte[] indexFileData, byte[] signatureData) throws SigningException { return getRepoValidator(config, indexFileData, signatureData, null); } private Signer(ValidatorConfig config); static Signer getRepoValidator(ValidatorConfig config, byte[] index...
@Test public void testValidPassword() { subject.setDigest(BCRYPT_DIGEST); PasswordHandler handler = new BCryptPasswordHandler(subject); assertTrue(handler.isValidPassword(PASSWORD)); }
public boolean isValidPassword(String password) { boolean isValid = BCrypt.checkpw(password, authSubject.getDigest()); return isValid; }
BCryptPasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { boolean isValid = BCrypt.checkpw(password, authSubject.getDigest()); return isValid; } }
BCryptPasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { boolean isValid = BCrypt.checkpw(password, authSubject.getDigest()); return isValid; } BCryptPasswordHandler(AuthSubject authSubject); }
BCryptPasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { boolean isValid = BCrypt.checkpw(password, authSubject.getDigest()); return isValid; } BCryptPasswordHandler(AuthSubject authSubject); void applyPassword(String password); boolean isValidPassword(String password); Strin...
BCryptPasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { boolean isValid = BCrypt.checkpw(password, authSubject.getDigest()); return isValid; } BCryptPasswordHandler(AuthSubject authSubject); void applyPassword(String password); boolean isValidPassword(String password); Strin...
@Test public void testInvalidPassword() { subject.setDigest(BCRYPT_DIGEST.substring(0, BCRYPT_DIGEST.length() - 1)); PasswordHandler handler = new BCryptPasswordHandler(subject); assertFalse(handler.isValidPassword(PASSWORD)); }
public boolean isValidPassword(String password) { boolean isValid = BCrypt.checkpw(password, authSubject.getDigest()); return isValid; }
BCryptPasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { boolean isValid = BCrypt.checkpw(password, authSubject.getDigest()); return isValid; } }
BCryptPasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { boolean isValid = BCrypt.checkpw(password, authSubject.getDigest()); return isValid; } BCryptPasswordHandler(AuthSubject authSubject); }
BCryptPasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { boolean isValid = BCrypt.checkpw(password, authSubject.getDigest()); return isValid; } BCryptPasswordHandler(AuthSubject authSubject); void applyPassword(String password); boolean isValidPassword(String password); Strin...
BCryptPasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { boolean isValid = BCrypt.checkpw(password, authSubject.getDigest()); return isValid; } BCryptPasswordHandler(AuthSubject authSubject); void applyPassword(String password); boolean isValidPassword(String password); Strin...
@Test public void testIsValidPasswordResetDigest() { testIsValidPasswordResetDigest(new BCryptPasswordHandler(subject)); }
public boolean isValidPasswordResetDigest(String digest) { String expectedDigest = new SaltedDigestSha1().getDigest(authSubject.getEmail(), authSubject.getSalt()); return expectedDigest.equals(digest); }
BCryptPasswordHandler implements PasswordHandler { public boolean isValidPasswordResetDigest(String digest) { String expectedDigest = new SaltedDigestSha1().getDigest(authSubject.getEmail(), authSubject.getSalt()); return expectedDigest.equals(digest); } }
BCryptPasswordHandler implements PasswordHandler { public boolean isValidPasswordResetDigest(String digest) { String expectedDigest = new SaltedDigestSha1().getDigest(authSubject.getEmail(), authSubject.getSalt()); return expectedDigest.equals(digest); } BCryptPasswordHandler(AuthSubject authSubject); }
BCryptPasswordHandler implements PasswordHandler { public boolean isValidPasswordResetDigest(String digest) { String expectedDigest = new SaltedDigestSha1().getDigest(authSubject.getEmail(), authSubject.getSalt()); return expectedDigest.equals(digest); } BCryptPasswordHandler(AuthSubject authSubject); void applyPasswor...
BCryptPasswordHandler implements PasswordHandler { public boolean isValidPasswordResetDigest(String digest) { String expectedDigest = new SaltedDigestSha1().getDigest(authSubject.getEmail(), authSubject.getSalt()); return expectedDigest.equals(digest); } BCryptPasswordHandler(AuthSubject authSubject); void applyPasswor...
@Test public void test() { String digest = DigestUtil.getDigest(username, sharedSecret); boolean isValid = new DigestValidator(digest,60).validate(sharedSecret); Assert.assertTrue("digest must be valid", isValid); }
public boolean validate(String sharedSecret) { if (!errors && setClientDate() && validateTimestamp() && validateHashedPart(sharedSecret)) { LOGGER.info("Digest successfully validated."); return true; } LOGGER.error("Digest validation failed."); return false; }
DigestValidator { public boolean validate(String sharedSecret) { if (!errors && setClientDate() && validateTimestamp() && validateHashedPart(sharedSecret)) { LOGGER.info("Digest successfully validated."); return true; } LOGGER.error("Digest validation failed."); return false; } }
DigestValidator { public boolean validate(String sharedSecret) { if (!errors && setClientDate() && validateTimestamp() && validateHashedPart(sharedSecret)) { LOGGER.info("Digest successfully validated."); return true; } LOGGER.error("Digest validation failed."); return false; } DigestValidator(String digest); DigestVa...
DigestValidator { public boolean validate(String sharedSecret) { if (!errors && setClientDate() && validateTimestamp() && validateHashedPart(sharedSecret)) { LOGGER.info("Digest successfully validated."); return true; } LOGGER.error("Digest validation failed."); return false; } DigestValidator(String digest); DigestVa...
DigestValidator { public boolean validate(String sharedSecret) { if (!errors && setClientDate() && validateTimestamp() && validateHashedPart(sharedSecret)) { LOGGER.info("Digest successfully validated."); return true; } LOGGER.error("Digest validation failed."); return false; } DigestValidator(String digest); DigestVa...
@Test public void testInvalid() { String digest = DigestUtil.getDigest(username, sharedSecret); boolean isValid = new DigestValidator(digest).validate("jinfizz"); Assert.assertFalse("digest must invalid", isValid); }
public boolean validate(String sharedSecret) { if (!errors && setClientDate() && validateTimestamp() && validateHashedPart(sharedSecret)) { LOGGER.info("Digest successfully validated."); return true; } LOGGER.error("Digest validation failed."); return false; }
DigestValidator { public boolean validate(String sharedSecret) { if (!errors && setClientDate() && validateTimestamp() && validateHashedPart(sharedSecret)) { LOGGER.info("Digest successfully validated."); return true; } LOGGER.error("Digest validation failed."); return false; } }
DigestValidator { public boolean validate(String sharedSecret) { if (!errors && setClientDate() && validateTimestamp() && validateHashedPart(sharedSecret)) { LOGGER.info("Digest successfully validated."); return true; } LOGGER.error("Digest validation failed."); return false; } DigestValidator(String digest); DigestVa...
DigestValidator { public boolean validate(String sharedSecret) { if (!errors && setClientDate() && validateTimestamp() && validateHashedPart(sharedSecret)) { LOGGER.info("Digest successfully validated."); return true; } LOGGER.error("Digest validation failed."); return false; } DigestValidator(String digest); DigestVa...
DigestValidator { public boolean validate(String sharedSecret) { if (!errors && setClientDate() && validateTimestamp() && validateHashedPart(sharedSecret)) { LOGGER.info("Digest successfully validated."); return true; } LOGGER.error("Digest validation failed."); return false; } DigestValidator(String digest); DigestVa...
@Test public void testGenerate() { for (int i = 0; i < 1000; i++) { String password = passwordPolicy.generatePassword(); assertValid(password); } }
public String generatePassword() { return random(6, LOWERCASE + UPPERCASE) + random(1, NUMBER) + random(1, PUNCT); }
DefaultPasswordPolicy implements PasswordPolicy { public String generatePassword() { return random(6, LOWERCASE + UPPERCASE) + random(1, NUMBER) + random(1, PUNCT); } }
DefaultPasswordPolicy implements PasswordPolicy { public String generatePassword() { return random(6, LOWERCASE + UPPERCASE) + random(1, NUMBER) + random(1, PUNCT); } @Deprecated DefaultPasswordPolicy(); @Deprecated DefaultPasswordPolicy(String regEx, String errorMessageKey); }
DefaultPasswordPolicy implements PasswordPolicy { public String generatePassword() { return random(6, LOWERCASE + UPPERCASE) + random(1, NUMBER) + random(1, PUNCT); } @Deprecated DefaultPasswordPolicy(); @Deprecated DefaultPasswordPolicy(String regEx, String errorMessageKey); @Override void configure(Properties platf...
DefaultPasswordPolicy implements PasswordPolicy { public String generatePassword() { return random(6, LOWERCASE + UPPERCASE) + random(1, NUMBER) + random(1, PUNCT); } @Deprecated DefaultPasswordPolicy(); @Deprecated DefaultPasswordPolicy(String regEx, String errorMessageKey); @Override void configure(Properties platf...
@Test public void testComplexRegex() { String expression = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)" + "(?=.*[" + "\\x21-\\x2f" + "\\x3A-\\x40" + "\\x5b-\\x60" + "\\x7b-\\x7e" + "])" + "[\\x21-\\x7e]" + "{8,}$"; PasswordPolicy policy = new DefaultPasswordPolicy(expression, "dummy"); Assert.assertFalse(policy.isValidPassword("...
public boolean isValidPassword(char[] password) { return pattern.matcher(new String(password)).matches(); }
DefaultPasswordPolicy implements PasswordPolicy { public boolean isValidPassword(char[] password) { return pattern.matcher(new String(password)).matches(); } }
DefaultPasswordPolicy implements PasswordPolicy { public boolean isValidPassword(char[] password) { return pattern.matcher(new String(password)).matches(); } @Deprecated DefaultPasswordPolicy(); @Deprecated DefaultPasswordPolicy(String regEx, String errorMessageKey); }
DefaultPasswordPolicy implements PasswordPolicy { public boolean isValidPassword(char[] password) { return pattern.matcher(new String(password)).matches(); } @Deprecated DefaultPasswordPolicy(); @Deprecated DefaultPasswordPolicy(String regEx, String errorMessageKey); @Override void configure(Properties platformConfig...
DefaultPasswordPolicy implements PasswordPolicy { public boolean isValidPassword(char[] password) { return pattern.matcher(new String(password)).matches(); } @Deprecated DefaultPasswordPolicy(); @Deprecated DefaultPasswordPolicy(String regEx, String errorMessageKey); @Override void configure(Properties platformConfig...
@Test public void testSavePassword() { PasswordHandler handler = new Sha1PasswordHandler(subject); handler.applyPassword(PASSWORD); Assert.assertNotNull(subject.getDigest()); Assert.assertTrue(!subject.getDigest().startsWith(BCryptPasswordHandler.getPrefix())); Assert.assertNotNull(subject.getSalt()); }
public void applyPassword(String password) { String salt = saltedDigest.getSalt(); String digest = saltedDigest.getDigest(password, salt); authSubject.setSalt(salt); authSubject.setDigest(digest); authSubject.setPasswordLastChanged(new Date()); }
Sha1PasswordHandler implements PasswordHandler { public void applyPassword(String password) { String salt = saltedDigest.getSalt(); String digest = saltedDigest.getDigest(password, salt); authSubject.setSalt(salt); authSubject.setDigest(digest); authSubject.setPasswordLastChanged(new Date()); } }
Sha1PasswordHandler implements PasswordHandler { public void applyPassword(String password) { String salt = saltedDigest.getSalt(); String digest = saltedDigest.getDigest(password, salt); authSubject.setSalt(salt); authSubject.setDigest(digest); authSubject.setPasswordLastChanged(new Date()); } Sha1PasswordHandler(Auth...
Sha1PasswordHandler implements PasswordHandler { public void applyPassword(String password) { String salt = saltedDigest.getSalt(); String digest = saltedDigest.getDigest(password, salt); authSubject.setSalt(salt); authSubject.setDigest(digest); authSubject.setPasswordLastChanged(new Date()); } Sha1PasswordHandler(Auth...
Sha1PasswordHandler implements PasswordHandler { public void applyPassword(String password) { String salt = saltedDigest.getSalt(); String digest = saltedDigest.getDigest(password, salt); authSubject.setSalt(salt); authSubject.setDigest(digest); authSubject.setPasswordLastChanged(new Date()); } Sha1PasswordHandler(Auth...
@Test public void testValidPassword() { subject.setDigest(SHA1_DIGEST); subject.setSalt(SHA1_SALT); PasswordHandler handler = new Sha1PasswordHandler(subject); assertTrue(handler.isValidPassword(PASSWORD)); }
public boolean isValidPassword(String password) { String digest = saltedDigest.getDigest(password, authSubject.getSalt()); return digest.equals(authSubject.getDigest()); }
Sha1PasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { String digest = saltedDigest.getDigest(password, authSubject.getSalt()); return digest.equals(authSubject.getDigest()); } }
Sha1PasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { String digest = saltedDigest.getDigest(password, authSubject.getSalt()); return digest.equals(authSubject.getDigest()); } Sha1PasswordHandler(AuthSubject authSubject); }
Sha1PasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { String digest = saltedDigest.getDigest(password, authSubject.getSalt()); return digest.equals(authSubject.getDigest()); } Sha1PasswordHandler(AuthSubject authSubject); void applyPassword(String password); boolean isValidP...
Sha1PasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { String digest = saltedDigest.getDigest(password, authSubject.getSalt()); return digest.equals(authSubject.getDigest()); } Sha1PasswordHandler(AuthSubject authSubject); void applyPassword(String password); boolean isValidP...
@Test public void testEmail() { assertTrue("email('mm@aiticon.de')"); assertTrue("email('_mm@aiticon.de')"); assertFalse("email('mm@aiticon')"); assertFalse("email('@aiticon.de')"); }
public static boolean email(String string) { return regExp(string, EMAIL_PATTERN); }
RuleValidation { public static boolean email(String string) { return regExp(string, EMAIL_PATTERN); } }
RuleValidation { public static boolean email(String string) { return regExp(string, EMAIL_PATTERN); } RuleValidation(Request container); }
RuleValidation { public static boolean email(String string) { return regExp(string, EMAIL_PATTERN); } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validate(String rule); static boolean string(String string); static boolean captcha(Str...
RuleValidation { public static boolean email(String string) { return regExp(string, EMAIL_PATTERN); } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validate(String rule); static boolean string(String string); static boolean captcha(Str...
@Test public void testInvalidPassword() { subject.setDigest(SHA1_DIGEST.substring(1)); subject.setSalt(SHA1_SALT); PasswordHandler handler = new Sha1PasswordHandler(subject); assertFalse(handler.isValidPassword(PASSWORD)); }
public boolean isValidPassword(String password) { String digest = saltedDigest.getDigest(password, authSubject.getSalt()); return digest.equals(authSubject.getDigest()); }
Sha1PasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { String digest = saltedDigest.getDigest(password, authSubject.getSalt()); return digest.equals(authSubject.getDigest()); } }
Sha1PasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { String digest = saltedDigest.getDigest(password, authSubject.getSalt()); return digest.equals(authSubject.getDigest()); } Sha1PasswordHandler(AuthSubject authSubject); }
Sha1PasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { String digest = saltedDigest.getDigest(password, authSubject.getSalt()); return digest.equals(authSubject.getDigest()); } Sha1PasswordHandler(AuthSubject authSubject); void applyPassword(String password); boolean isValidP...
Sha1PasswordHandler implements PasswordHandler { public boolean isValidPassword(String password) { String digest = saltedDigest.getDigest(password, authSubject.getSalt()); return digest.equals(authSubject.getDigest()); } Sha1PasswordHandler(AuthSubject authSubject); void applyPassword(String password); boolean isValidP...
@Test public void testGetPasswordResetDigest() { subject.setSalt(SHA1_SALT); subject.setEmail(EMAIL); PasswordHandler handler = new Sha1PasswordHandler(subject); String digest = handler.calculatePasswordResetDigest(); Assert.assertEquals(SHA1_SALT, subject.getSalt()); Assert.assertEquals(SHA1_PW_RESET_DIGEST, digest); ...
public String calculatePasswordResetDigest() { return saltedDigest.getDigest(authSubject.getEmail(), authSubject.getSalt()); }
Sha1PasswordHandler implements PasswordHandler { public String calculatePasswordResetDigest() { return saltedDigest.getDigest(authSubject.getEmail(), authSubject.getSalt()); } }
Sha1PasswordHandler implements PasswordHandler { public String calculatePasswordResetDigest() { return saltedDigest.getDigest(authSubject.getEmail(), authSubject.getSalt()); } Sha1PasswordHandler(AuthSubject authSubject); }
Sha1PasswordHandler implements PasswordHandler { public String calculatePasswordResetDigest() { return saltedDigest.getDigest(authSubject.getEmail(), authSubject.getSalt()); } Sha1PasswordHandler(AuthSubject authSubject); void applyPassword(String password); boolean isValidPassword(String password); String calculatePas...
Sha1PasswordHandler implements PasswordHandler { public String calculatePasswordResetDigest() { return saltedDigest.getDigest(authSubject.getEmail(), authSubject.getSalt()); } Sha1PasswordHandler(AuthSubject authSubject); void applyPassword(String password); boolean isValidPassword(String password); String calculatePas...
@Test public void testIsValidPasswordResetDigest() { testIsValidPasswordResetDigest(new Sha1PasswordHandler(subject)); }
public boolean isValidPasswordResetDigest(String digest) { return calculatePasswordResetDigest().equals(digest); }
Sha1PasswordHandler implements PasswordHandler { public boolean isValidPasswordResetDigest(String digest) { return calculatePasswordResetDigest().equals(digest); } }
Sha1PasswordHandler implements PasswordHandler { public boolean isValidPasswordResetDigest(String digest) { return calculatePasswordResetDigest().equals(digest); } Sha1PasswordHandler(AuthSubject authSubject); }
Sha1PasswordHandler implements PasswordHandler { public boolean isValidPasswordResetDigest(String digest) { return calculatePasswordResetDigest().equals(digest); } Sha1PasswordHandler(AuthSubject authSubject); void applyPassword(String password); boolean isValidPassword(String password); String calculatePasswordResetDi...
Sha1PasswordHandler implements PasswordHandler { public boolean isValidPasswordResetDigest(String digest) { return calculatePasswordResetDigest().equals(digest); } Sha1PasswordHandler(AuthSubject authSubject); void applyPassword(String password); boolean isValidPassword(String password); String calculatePasswordResetDi...
@Test public void testPasswords() { String username = "johndoe"; String currentPassword = "test"; assertFirstError(AllowedCharacterRule.ERROR_CODE, username, currentPassword, "TEst12!!ß"); assertFirstError(WhitespaceRule.ERROR_CODE, username, currentPassword, "TEst12!! "); assertFirstError(UsernameRule.ERROR_CODE, user...
@Override public ValidationResult validatePassword(String username, char[] currentPassword, char[] password) { PasswordData passwordData = null; if (null == username) { passwordData = new PasswordData(new String(password)); } else { List<Reference> references = new ArrayList<>(); if (null != currentPassword) { referenc...
ConfigurablePasswordPolicy implements PasswordPolicy { @Override public ValidationResult validatePassword(String username, char[] currentPassword, char[] password) { PasswordData passwordData = null; if (null == username) { passwordData = new PasswordData(new String(password)); } else { List<Reference> references = new...
ConfigurablePasswordPolicy implements PasswordPolicy { @Override public ValidationResult validatePassword(String username, char[] currentPassword, char[] password) { PasswordData passwordData = null; if (null == username) { passwordData = new PasswordData(new String(password)); } else { List<Reference> references = new...
ConfigurablePasswordPolicy implements PasswordPolicy { @Override public ValidationResult validatePassword(String username, char[] currentPassword, char[] password) { PasswordData passwordData = null; if (null == username) { passwordData = new PasswordData(new String(password)); } else { List<Reference> references = new...
ConfigurablePasswordPolicy implements PasswordPolicy { @Override public ValidationResult validatePassword(String username, char[] currentPassword, char[] password) { PasswordData passwordData = null; if (null == username) { passwordData = new PasswordData(new String(password)); } else { List<Reference> references = new...
@Test public void testSessionCreated() { sessionListener.sessionCreated(new HttpSessionEvent(session1)); addRequest(session1); addRequest(session1); Assert.assertEquals(2, ((Session) session1.getAttribute(SessionListener.META_DATA)).getRequests()); }
public void sessionCreated(HttpSessionEvent event) { createSession(event.getSession()); }
SessionListener implements ServletContextListener, HttpSessionListener, ServletRequestListener { public void sessionCreated(HttpSessionEvent event) { createSession(event.getSession()); } }
SessionListener implements ServletContextListener, HttpSessionListener, ServletRequestListener { public void sessionCreated(HttpSessionEvent event) { createSession(event.getSession()); } }
SessionListener implements ServletContextListener, HttpSessionListener, ServletRequestListener { public void sessionCreated(HttpSessionEvent event) { createSession(event.getSession()); } void contextInitialized(ServletContextEvent sce); void contextDestroyed(ServletContextEvent sce); void sessionCreated(HttpSessionEve...
SessionListener implements ServletContextListener, HttpSessionListener, ServletRequestListener { public void sessionCreated(HttpSessionEvent event) { createSession(event.getSession()); } void contextInitialized(ServletContextEvent sce); void contextDestroyed(ServletContextEvent sce); void sessionCreated(HttpSessionEve...
@Test public void testSessionDestroyed() { sessionListener.sessionCreated(new HttpSessionEvent(session1)); addRequest(session1); sessionListener.sessionCreated(new HttpSessionEvent(session2)); addRequest(session2); sessionListener.sessionDestroyed(new HttpSessionEvent(session1)); Assert.assertNull(session1.getAttribute...
public void sessionDestroyed(HttpSessionEvent event) { HttpSession httpSession = event.getSession(); Environment env = DefaultEnvironment.get(httpSession); if (env.isSubjectAuthenticated()) { ApplicationContext ctx = env.getAttribute(Scope.PLATFORM, Platform.Environment.CORE_PLATFORM_CONTEXT); ctx.getBean(CoreService.c...
SessionListener implements ServletContextListener, HttpSessionListener, ServletRequestListener { public void sessionDestroyed(HttpSessionEvent event) { HttpSession httpSession = event.getSession(); Environment env = DefaultEnvironment.get(httpSession); if (env.isSubjectAuthenticated()) { ApplicationContext ctx = env.ge...
SessionListener implements ServletContextListener, HttpSessionListener, ServletRequestListener { public void sessionDestroyed(HttpSessionEvent event) { HttpSession httpSession = event.getSession(); Environment env = DefaultEnvironment.get(httpSession); if (env.isSubjectAuthenticated()) { ApplicationContext ctx = env.ge...
SessionListener implements ServletContextListener, HttpSessionListener, ServletRequestListener { public void sessionDestroyed(HttpSessionEvent event) { HttpSession httpSession = event.getSession(); Environment env = DefaultEnvironment.get(httpSession); if (env.isSubjectAuthenticated()) { ApplicationContext ctx = env.ge...
SessionListener implements ServletContextListener, HttpSessionListener, ServletRequestListener { public void sessionDestroyed(HttpSessionEvent event) { HttpSession httpSession = event.getSession(); Environment env = DefaultEnvironment.get(httpSession); if (env.isSubjectAuthenticated()) { ApplicationContext ctx = env.ge...
@Test public void testAttachmentWebService() { when(base.request.getServletPath()).thenReturn("/services/manager/application1/webservice/foobar"); try { AttachmentWebservice attachmentWebservice = getAttachmentWebservice("attachment webservice call", "test.txt"); base.provider.registerBean("foobar", attachmentWebservic...
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testAttachmentWebServiceNoFile() { when(base.request.getServletPath()).thenReturn("/services/manager/application1/webservice/foobar"); try { AttachmentWebservice attachmentWebservice = getAttachmentWebservice("attachment webservice call", "test.txt"); base.provider.registerBean("foobar", attachmentWeb...
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testWebservice() { prepareWebserice(HttpMethod.GET); try { doGet(base.request, base.response); Assert.assertEquals("GET webservice call", new String(base.out.toByteArray())); } catch (Exception e) { fail(e); } }
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testWebservicePut() { prepareWebserice(HttpMethod.PUT); try { doPut(base.request, base.response); Assert.assertEquals("PUT webservice call", new String(base.out.toByteArray())); } catch (Exception e) { fail(e); } }
@Override protected void doPut(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("PUT not allowed for {}", servletRequest.getServletPath()); servletResponse....
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doPut(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("PUT not all...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doPut(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("PUT not all...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doPut(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("PUT not all...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doPut(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("PUT not all...
@Test public void testEquals() { assertTrue("equals('a','a')"); assertTrue("equals('b','b')"); assertFalse("equals('a','A')"); assertFalse("equals('a',' A')"); }
public static boolean equals(String string1, String string2) { return StringUtils.equals(string1, string2); }
RuleValidation { public static boolean equals(String string1, String string2) { return StringUtils.equals(string1, string2); } }
RuleValidation { public static boolean equals(String string1, String string2) { return StringUtils.equals(string1, string2); } RuleValidation(Request container); }
RuleValidation { public static boolean equals(String string1, String string2) { return StringUtils.equals(string1, string2); } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validate(String rule); static boolean string(String string); s...
RuleValidation { public static boolean equals(String string1, String string2) { return StringUtils.equals(string1, string2); } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validate(String rule); static boolean string(String string); s...
@Test public void testWebserviceDelete() { prepareWebserice(HttpMethod.DELETE); try { doDelete(base.request, base.response); Assert.assertEquals("DELETE webservice call", new String(base.out.toByteArray())); } catch (Exception e) { fail(e); } }
@Override protected void doDelete(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("DELETE not allowed for {}", servletRequest.getServletPath()); servletRes...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doDelete(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("DELETE n...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doDelete(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("DELETE n...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doDelete(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("DELETE n...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doDelete(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("DELETE n...
@Test public void testMonitoring() { prepareMonitoring("/health"); try { doGet(base.request, base.response); String actual = new String(base.out.toByteArray()); Mockito.verify(base.response).setContentType(HttpHeaders.CONTENT_TYPE_APPLICATION_JSON); Assert.assertTrue(actual.contains("\"name\" : \"manager\"")); Assert.a...
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testMonitoringSystem() { prepareMonitoring("/health/system"); try { doGet(base.request, base.response); String actual = new String(base.out.toByteArray()); Assert.assertTrue(actual.contains("java.runtime.name")); Assert.assertTrue(actual.contains("java.runtime.version")); } catch (Exception e) { fail(...
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testMonitoringEnv() { prepareMonitoring("/health/environment"); try { doGet(base.request, base.response); String actual = new String(base.out.toByteArray()); if (OperatingSystem.isLinux()) { Assert.assertTrue(actual.contains("LANG")); Assert.assertTrue(actual.contains("USER")); } else if (OperatingSys...
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testStaticFromRepository() { when(base.request.getServletPath()).thenReturn("/assets/test.txt"); try { doGet(base.request, base.response); String actual = new String(base.out.toByteArray()); Assert.assertEquals("/repository/manager/www/assets/test.txt", actual); } catch (Exception e) { fail(e); } }
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testStatic() { when(base.request.getServletPath()).thenReturn("/test.txt"); try { doGet(base.request, base.response); String actual = new String(base.out.toByteArray()); Assert.assertEquals("/test.txt", actual); } catch (Exception e) { fail(e); } }
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testStaticPut() { when(base.request.getServletPath()).thenReturn("/test.txt"); try { doPut(base.request, base.response); Assert.assertEquals(0, base.out.toByteArray().length); Mockito.verify(base.response).sendError(HttpStatus.FORBIDDEN.value()); } catch (Exception e) { fail(e); } }
@Override protected void doPut(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("PUT not allowed for {}", servletRequest.getServletPath()); servletResponse....
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doPut(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("PUT not all...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doPut(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("PUT not all...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doPut(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("PUT not all...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doPut(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("PUT not all...
@Test public void testStaticDelete() { when(base.request.getServletPath()).thenReturn("/test.txt"); try { doDelete(base.request, base.response); Assert.assertEquals(0, base.out.toByteArray().length); Mockito.verify(base.response).sendError(HttpStatus.FORBIDDEN.value()); } catch (Exception e) { fail(e); } }
@Override protected void doDelete(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("DELETE not allowed for {}", servletRequest.getServletPath()); servletRes...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doDelete(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("DELETE n...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doDelete(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("DELETE n...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doDelete(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("DELETE n...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doDelete(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (isServiceRequest(servletRequest)) { doGet(servletRequest, servletResponse); } else { LOGGER.debug("DELETE n...
@Test public void testTemplate() { when(base.request.getServletPath()).thenReturn("/template/assets/test.txt"); try { doGet(base.request, base.response); String actual = new String(base.out.toByteArray()); Assert.assertEquals("/repository/manager/www/template/assets/test.txt", actual); } catch (Exception e) { fail(e); ...
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testTemplateWithTemplateInPath() { when(base.request.getServletPath()).thenReturn("/template/resources/template/test.txt"); try { doGet(base.request, base.response); String actual = new String(base.out.toByteArray()); Assert.assertEquals("/repository/manager/www/template/resources/template/test.txt", ...
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testRegExp() { assertTrue("regExp('abc','[a-z]+')"); assertFalse("regExp('abc','[a-z]{4,}')"); }
public static boolean regExp(String string, String regex) { return string.matches(regex); }
RuleValidation { public static boolean regExp(String string, String regex) { return string.matches(regex); } }
RuleValidation { public static boolean regExp(String string, String regex) { return string.matches(regex); } RuleValidation(Request container); }
RuleValidation { public static boolean regExp(String string, String regex) { return string.matches(regex); } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validate(String rule); static boolean string(String string); static boolean capt...
RuleValidation { public static boolean regExp(String string, String regex) { return string.matches(regex); } RuleValidation(Request container); Map<String, List<FormUpload>> getFileParams(Map<String, List<FormUpload>> formUploads); boolean validate(String rule); static boolean string(String string); static boolean capt...
@Test public void testTemplateResourceFromApplication() { when(base.request.getServletPath()).thenReturn("/template_dummy-application/test.txt"); try { doGet(base.request, base.response); String actual = new String(base.out.toByteArray()); Assert.assertEquals("/WEB-INF/cache/platform/manager/dummy-application/resources...
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testDoc() { String rootPath = base.platformProperties.getString("platform.platformRootPath"); String wwwRootPath = rootPath + File.separator + "repository" + File.separator + "manager" + File.separator + "www"; String realPath = new File(new File("").getAbsoluteFile(), wwwRootPath).getAbsolutePath(); ...
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testErrorPage() { when(base.request.getServletPath()).thenReturn("/errorpage"); try { doGet(base.request, base.response); verify(base.request).getRequestDispatcher("/de/fehler.jsp"); verify(base.request).setAttribute(RequestHandler.FORWARDED, Boolean.TRUE); verify(base.dispatcher).forward(base.request...
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testErrorDoc() { when(base.request.getServletPath()).thenReturn("/errorpage"); try { when(base.request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI)).thenReturn("/de/foobar"); doGet(base.request, base.response); verify(base.request).getRequestDispatcher("/de/fehler.jsp"); verify(base.request).setA...
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testRoot() { when(base.request.getServletPath()).thenReturn(""); try { doGet(base.request, base.response); verify(base.response).setStatus(301); verify(base.response).setHeader(HttpHeaders.LOCATION, "/de/index"); } catch (Exception e) { Assert.fail(e.getMessage()); } }
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testRootWithPath() { when(base.request.getServletPath()).thenReturn("/de"); try { doGet(base.request, base.response); verify(base.response).setStatus(301); verify(base.response).setHeader(HttpHeaders.LOCATION, "/de/index"); } catch (Exception e) { Assert.fail(e.getMessage()); } }
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testDocNoSite() { when(base.request.getServerName()).thenReturn("localhost"); when(base.request.getServletPath()).thenReturn("/de"); try { doGet(base.request, base.response); verify(base.response).getStatus(); } catch (Exception e) { Assert.fail(e.getMessage()); } }
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testJsp() throws ServletException { jspHandler = Mockito.mock(JspHandler.class); when(base.request.getServletPath()).thenReturn("/foo/bar.jsp"); try { when(base.request.getAttribute(RequestHandler.FORWARDED)).thenReturn(Boolean.TRUE); doGet(base.request, base.response); verify(jspHandler).handle(Mocki...
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testStaticForSite() { when(base.request.getServletPath()).thenReturn("/de/test.pdf"); try { doGet(base.request, base.response); Assert.assertEquals("/repository/manager/www/de/test.pdf", new String(base.out.toByteArray())); } catch (Exception e) { Assert.fail(e.getMessage()); } }
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testStaticNoSite() { when(base.request.getServerName()).thenReturn("localhost"); when(base.request.getServletPath()).thenReturn("/repository/manager/www/de/test.txt"); try { doGet(base.request, base.response); Assert.assertEquals("/repository/manager/www/de/test.txt", new String(base.out.toByteArray()...
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testSize() { assertTrue("size(foo,3)"); assertFalse("size(foo,4)"); assertTrue("size(multifoo,4)"); assertFalse("size(multifoo,5)"); assertFalse("size(multibar,5)"); }
private static int size(Object item) { if (null == item) { return 0; } if (Collection.class.isAssignableFrom(item.getClass())) { return ((Collection<?>) item).size(); } if (CharSequence.class.isAssignableFrom(item.getClass())) { return ((CharSequence) item).length(); } throw new UnsupportedOperationException("can not i...
RuleValidation { private static int size(Object item) { if (null == item) { return 0; } if (Collection.class.isAssignableFrom(item.getClass())) { return ((Collection<?>) item).size(); } if (CharSequence.class.isAssignableFrom(item.getClass())) { return ((CharSequence) item).length(); } throw new UnsupportedOperationExc...
RuleValidation { private static int size(Object item) { if (null == item) { return 0; } if (Collection.class.isAssignableFrom(item.getClass())) { return ((Collection<?>) item).size(); } if (CharSequence.class.isAssignableFrom(item.getClass())) { return ((CharSequence) item).length(); } throw new UnsupportedOperationExc...
RuleValidation { private static int size(Object item) { if (null == item) { return 0; } if (Collection.class.isAssignableFrom(item.getClass())) { return ((Collection<?>) item).size(); } if (CharSequence.class.isAssignableFrom(item.getClass())) { return ((CharSequence) item).length(); } throw new UnsupportedOperationExc...
RuleValidation { private static int size(Object item) { if (null == item) { return 0; } if (Collection.class.isAssignableFrom(item.getClass())) { return ((Collection<?>) item).size(); } if (CharSequence.class.isAssignableFrom(item.getClass())) { return ((CharSequence) item).length(); } throw new UnsupportedOperationExc...
@Test public void testHead() throws IOException, ServletException { when(base.request.getServletPath()).thenReturn("/test.txt"); doHead(base.request, base.response); Assert.assertEquals(0, base.out.size()); }
protected void doHead(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { doGet(request, wrapResponseForHeadRequest(response)); }
Controller extends DefaultServlet implements ContainerServlet { protected void doHead(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { doGet(request, wrapResponseForHeadRequest(response)); } }
Controller extends DefaultServlet implements ContainerServlet { protected void doHead(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { doGet(request, wrapResponseForHeadRequest(response)); } Controller(); }
Controller extends DefaultServlet implements ContainerServlet { protected void doHead(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { doGet(request, wrapResponseForHeadRequest(response)); } Controller(); void serveResource(HttpServletRequest request, HttpServletResponse ...
Controller extends DefaultServlet implements ContainerServlet { protected void doHead(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { doGet(request, wrapResponseForHeadRequest(response)); } Controller(); void serveResource(HttpServletRequest request, HttpServletResponse ...
@Test public void testLoadingPage() { Mockito.when(base.ctx.getAttribute(PlatformStartup.APPNG_STARTED)).thenReturn(false); when(base.request.getServletPath()).thenReturn("/dummy"); try { doGet(base.request, base.response); String actual = new String(base.out.toByteArray()); Assert.assertEquals(new String(loadingScreen...
@Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servletResponse.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value()); ser...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
Controller extends DefaultServlet implements ContainerServlet { @Override protected void doGet(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (!Boolean.TRUE.equals(servletRequest.getServletContext().getAttribute(PlatformStartup.APPNG_STARTED))) { servle...
@Test public void testIsException() { String servletPath = "/foo/bar/lore/ipsum"; Assert.assertFalse(PageCacheFilter.isException("/foo/me", servletPath)); Assert.assertTrue(PageCacheFilter.isException(servletPath, servletPath)); Assert.assertTrue(PageCacheFilter.isException("/foo/bar/lore/", servletPath)); Assert.asser...
static boolean isException(String exceptionsProp, String servletPath) { if (null != exceptionsProp) { Set<String> exceptions = new HashSet<>(Arrays.asList(exceptionsProp.split(StringUtils.LF))); for (String e : exceptions) { if (servletPath.startsWith(e.trim())) { return true; } } } return false; }
PageCacheFilter implements javax.servlet.Filter { static boolean isException(String exceptionsProp, String servletPath) { if (null != exceptionsProp) { Set<String> exceptions = new HashSet<>(Arrays.asList(exceptionsProp.split(StringUtils.LF))); for (String e : exceptions) { if (servletPath.startsWith(e.trim())) { retur...
PageCacheFilter implements javax.servlet.Filter { static boolean isException(String exceptionsProp, String servletPath) { if (null != exceptionsProp) { Set<String> exceptions = new HashSet<>(Arrays.asList(exceptionsProp.split(StringUtils.LF))); for (String e : exceptions) { if (servletPath.startsWith(e.trim())) { retur...
PageCacheFilter implements javax.servlet.Filter { static boolean isException(String exceptionsProp, String servletPath) { if (null != exceptionsProp) { Set<String> exceptions = new HashSet<>(Arrays.asList(exceptionsProp.split(StringUtils.LF))); for (String e : exceptions) { if (servletPath.startsWith(e.trim())) { retur...
PageCacheFilter implements javax.servlet.Filter { static boolean isException(String exceptionsProp, String servletPath) { if (null != exceptionsProp) { Set<String> exceptions = new HashSet<>(Arrays.asList(exceptionsProp.split(StringUtils.LF))); for (String e : exceptions) { if (servletPath.startsWith(e.trim())) { retur...
@Test public void testGetExpireAfterSeconds() { Integer defaultCacheTime = Integer.valueOf(1800); Integer oneMin = Integer.valueOf(60); Integer tenMins = Integer.valueOf(600); Integer oneHour = Integer.valueOf(3600); Properties cachingTimes = new Properties(); String servletPath = "/foo/bar/lore/ipsum"; Integer expireA...
static Integer getExpireAfterSeconds(Properties cachingTimes, boolean antStylePathMatching, String servletPath, Integer defaultValue) { if (null != cachingTimes && !cachingTimes.isEmpty()) { if (antStylePathMatching) { for (Object path : cachingTimes.keySet()) { AntPathMatcher matcher = new AntPathMatcher(); if (matche...
PageCacheFilter implements javax.servlet.Filter { static Integer getExpireAfterSeconds(Properties cachingTimes, boolean antStylePathMatching, String servletPath, Integer defaultValue) { if (null != cachingTimes && !cachingTimes.isEmpty()) { if (antStylePathMatching) { for (Object path : cachingTimes.keySet()) { AntPath...
PageCacheFilter implements javax.servlet.Filter { static Integer getExpireAfterSeconds(Properties cachingTimes, boolean antStylePathMatching, String servletPath, Integer defaultValue) { if (null != cachingTimes && !cachingTimes.isEmpty()) { if (antStylePathMatching) { for (Object path : cachingTimes.keySet()) { AntPath...
PageCacheFilter implements javax.servlet.Filter { static Integer getExpireAfterSeconds(Properties cachingTimes, boolean antStylePathMatching, String servletPath, Integer defaultValue) { if (null != cachingTimes && !cachingTimes.isEmpty()) { if (antStylePathMatching) { for (Object path : cachingTimes.keySet()) { AntPath...
PageCacheFilter implements javax.servlet.Filter { static Integer getExpireAfterSeconds(Properties cachingTimes, boolean antStylePathMatching, String servletPath, Integer defaultValue) { if (null != cachingTimes && !cachingTimes.isEmpty()) { if (antStylePathMatching) { for (Object path : cachingTimes.keySet()) { AntPath...
@Test public void testGetExpireAfterSecondsAntStyle() { Integer defaultCacheTime = Integer.valueOf(1800); Integer oneMin = Integer.valueOf(60); Integer tenMins = Integer.valueOf(600); Integer oneHour = Integer.valueOf(3600); Properties cachingTimes = new Properties(); String servletPath = "/foo/bar/lore/ipsum"; Integer...
static Integer getExpireAfterSeconds(Properties cachingTimes, boolean antStylePathMatching, String servletPath, Integer defaultValue) { if (null != cachingTimes && !cachingTimes.isEmpty()) { if (antStylePathMatching) { for (Object path : cachingTimes.keySet()) { AntPathMatcher matcher = new AntPathMatcher(); if (matche...
PageCacheFilter implements javax.servlet.Filter { static Integer getExpireAfterSeconds(Properties cachingTimes, boolean antStylePathMatching, String servletPath, Integer defaultValue) { if (null != cachingTimes && !cachingTimes.isEmpty()) { if (antStylePathMatching) { for (Object path : cachingTimes.keySet()) { AntPath...
PageCacheFilter implements javax.servlet.Filter { static Integer getExpireAfterSeconds(Properties cachingTimes, boolean antStylePathMatching, String servletPath, Integer defaultValue) { if (null != cachingTimes && !cachingTimes.isEmpty()) { if (antStylePathMatching) { for (Object path : cachingTimes.keySet()) { AntPath...
PageCacheFilter implements javax.servlet.Filter { static Integer getExpireAfterSeconds(Properties cachingTimes, boolean antStylePathMatching, String servletPath, Integer defaultValue) { if (null != cachingTimes && !cachingTimes.isEmpty()) { if (antStylePathMatching) { for (Object path : cachingTimes.keySet()) { AntPath...
PageCacheFilter implements javax.servlet.Filter { static Integer getExpireAfterSeconds(Properties cachingTimes, boolean antStylePathMatching, String servletPath, Integer defaultValue) { if (null != cachingTimes && !cachingTimes.isEmpty()) { if (antStylePathMatching) { for (Object path : cachingTimes.keySet()) { AntPath...
@Test public void testReplace() { Assert.assertEquals("<a href=\"/de/index\">", doReplace("<a href=\"/de/index.jsp\">")); Assert.assertEquals("<a href=\"/de/seite\">", doReplace("<a href=\"/en/page.jsp\">")); Assert.assertEquals("url='/de/seite'", doReplace("url='/en/page.jsp'")); Assert.assertEquals("url='/de/foo' '/e...
protected String doReplace(List<RedirectRule> redirectRules, String sourcePath, String domain, String jspExtension, String content) { long startTime = System.currentTimeMillis(); int numRules = 0; if (null != redirectRules) { numRules = redirectRules.size(); for (RedirectRule rule : redirectRules) { content = rule.appl...
JspExtensionFilter implements Filter { protected String doReplace(List<RedirectRule> redirectRules, String sourcePath, String domain, String jspExtension, String content) { long startTime = System.currentTimeMillis(); int numRules = 0; if (null != redirectRules) { numRules = redirectRules.size(); for (RedirectRule rule...
JspExtensionFilter implements Filter { protected String doReplace(List<RedirectRule> redirectRules, String sourcePath, String domain, String jspExtension, String content) { long startTime = System.currentTimeMillis(); int numRules = 0; if (null != redirectRules) { numRules = redirectRules.size(); for (RedirectRule rule...
JspExtensionFilter implements Filter { protected String doReplace(List<RedirectRule> redirectRules, String sourcePath, String domain, String jspExtension, String content) { long startTime = System.currentTimeMillis(); int numRules = 0; if (null != redirectRules) { numRules = redirectRules.size(); for (RedirectRule rule...
JspExtensionFilter implements Filter { protected String doReplace(List<RedirectRule> redirectRules, String sourcePath, String domain, String jspExtension, String content) { long startTime = System.currentTimeMillis(); int numRules = 0; if (null != redirectRules) { numRules = redirectRules.size(); for (RedirectRule rule...
@Test public void testStripJsp() { assertUnchanged("<a href=\"/de/index\">"); assertUnchanged("<a href=\"/de/seite\">"); assertUnchanged("/de/foobar.jsp"); Assert.assertEquals("<a href=\"/de/foo\">", doReplace("<a href=\"/de/foo.jsp\">")); Assert.assertEquals("'/en/bar'", doReplace("'/en/bar.jsp'")); Assert.assertEqual...
protected String doReplace(List<RedirectRule> redirectRules, String sourcePath, String domain, String jspExtension, String content) { long startTime = System.currentTimeMillis(); int numRules = 0; if (null != redirectRules) { numRules = redirectRules.size(); for (RedirectRule rule : redirectRules) { content = rule.appl...
JspExtensionFilter implements Filter { protected String doReplace(List<RedirectRule> redirectRules, String sourcePath, String domain, String jspExtension, String content) { long startTime = System.currentTimeMillis(); int numRules = 0; if (null != redirectRules) { numRules = redirectRules.size(); for (RedirectRule rule...
JspExtensionFilter implements Filter { protected String doReplace(List<RedirectRule> redirectRules, String sourcePath, String domain, String jspExtension, String content) { long startTime = System.currentTimeMillis(); int numRules = 0; if (null != redirectRules) { numRules = redirectRules.size(); for (RedirectRule rule...
JspExtensionFilter implements Filter { protected String doReplace(List<RedirectRule> redirectRules, String sourcePath, String domain, String jspExtension, String content) { long startTime = System.currentTimeMillis(); int numRules = 0; if (null != redirectRules) { numRules = redirectRules.size(); for (RedirectRule rule...
JspExtensionFilter implements Filter { protected String doReplace(List<RedirectRule> redirectRules, String sourcePath, String domain, String jspExtension, String content) { long startTime = System.currentTimeMillis(); int numRules = 0; if (null != redirectRules) { numRules = redirectRules.size(); for (RedirectRule rule...
@Test public void testReplaceDomain() { assertUnchanged("<a href=\"" + domain + "/de/seite\">"); assertUnchanged("<a href=\"" + domain + "/de/foo\">"); assertUnchanged("http: assertUnchanged("'http: Assert.assertEquals("url='" + domain + "/de/seite'", doReplace("url='" + domain + "/en/page.jsp'")); Assert.assertEquals(...
protected String doReplace(List<RedirectRule> redirectRules, String sourcePath, String domain, String jspExtension, String content) { long startTime = System.currentTimeMillis(); int numRules = 0; if (null != redirectRules) { numRules = redirectRules.size(); for (RedirectRule rule : redirectRules) { content = rule.appl...
JspExtensionFilter implements Filter { protected String doReplace(List<RedirectRule> redirectRules, String sourcePath, String domain, String jspExtension, String content) { long startTime = System.currentTimeMillis(); int numRules = 0; if (null != redirectRules) { numRules = redirectRules.size(); for (RedirectRule rule...
JspExtensionFilter implements Filter { protected String doReplace(List<RedirectRule> redirectRules, String sourcePath, String domain, String jspExtension, String content) { long startTime = System.currentTimeMillis(); int numRules = 0; if (null != redirectRules) { numRules = redirectRules.size(); for (RedirectRule rule...
JspExtensionFilter implements Filter { protected String doReplace(List<RedirectRule> redirectRules, String sourcePath, String domain, String jspExtension, String content) { long startTime = System.currentTimeMillis(); int numRules = 0; if (null != redirectRules) { numRules = redirectRules.size(); for (RedirectRule rule...
JspExtensionFilter implements Filter { protected String doReplace(List<RedirectRule> redirectRules, String sourcePath, String domain, String jspExtension, String content) { long startTime = System.currentTimeMillis(); int numRules = 0; if (null != redirectRules) { numRules = redirectRules.size(); for (RedirectRule rule...
@Test public void testSystem() throws Exception { SiteImpl site = getSite(); PathInfo path = getPath(site, "/health/system"); DefaultEnvironment env = getEnv(); MockHttpServletResponse resp = new MockHttpServletResponse(); monitoringHandler.handle(getRequest(ctx), resp, env, site, path); String content = resp.getConten...
public void handle(HttpServletRequest servletRequest, HttpServletResponse servletResponse, Environment env, Site site, PathInfo pathInfo) throws ServletException, IOException { servletResponse.addHeader(HttpHeaders.WWW_AUTHENTICATE, BASIC_REALM); if (isAuthenticated(env, servletRequest)) { String pathsegment = pathInfo...
MonitoringHandler implements RequestHandler { public void handle(HttpServletRequest servletRequest, HttpServletResponse servletResponse, Environment env, Site site, PathInfo pathInfo) throws ServletException, IOException { servletResponse.addHeader(HttpHeaders.WWW_AUTHENTICATE, BASIC_REALM); if (isAuthenticated(env, se...
MonitoringHandler implements RequestHandler { public void handle(HttpServletRequest servletRequest, HttpServletResponse servletResponse, Environment env, Site site, PathInfo pathInfo) throws ServletException, IOException { servletResponse.addHeader(HttpHeaders.WWW_AUTHENTICATE, BASIC_REALM); if (isAuthenticated(env, se...
MonitoringHandler implements RequestHandler { public void handle(HttpServletRequest servletRequest, HttpServletResponse servletResponse, Environment env, Site site, PathInfo pathInfo) throws ServletException, IOException { servletResponse.addHeader(HttpHeaders.WWW_AUTHENTICATE, BASIC_REALM); if (isAuthenticated(env, se...
MonitoringHandler implements RequestHandler { public void handle(HttpServletRequest servletRequest, HttpServletResponse servletResponse, Environment env, Site site, PathInfo pathInfo) throws ServletException, IOException { servletResponse.addHeader(HttpHeaders.WWW_AUTHENTICATE, BASIC_REALM); if (isAuthenticated(env, se...