private static boolean compareClassloadingConfigurations( AppServerClassLoading actual, AppServerClassLoading expected) { if ((actual != null) && (expected != null)) { return actual .getEnvironments() .getEnvironments() .stream() .filter( env -> expected .getEnvironments() .getEnvironments() .stream() .filter( expectedEnv -> (expectedEnv.getName().equals(env.getName().trim()) && expectedEnv .getClasspath() .equals(env.getClasspath().trim()))) .count() == 1) .count() == expected.getEnvironments().getEnvironments().size(); } else { return (actual == null) && (expected == null); } }
private static AppServerClassLoading prepareClassLoaderEnv() { AppServerClassLoading classloadingEnvironments = new AppServerClassLoading(); AppServerClassLoading.Environment cxf = new AppServerClassLoading.Environment(); cxf.setName(Constants.CXF_ENV_NAME); cxf.setClasspath(Constants.CXF_ENV_CLASSPATH); List<AppServerClassLoading.Environment> envList = new ArrayList<>(); envList.add(cxf); envList.forEach( environment -> environment.setClasspath(STRING_SUB.replace(environment.getClasspath()))); envList.forEach( environment -> environment.setClasspath( StrSubstitutor.replaceSystemProperties(environment.getClasspath()))); AppServerClassLoading.Environments environments = new AppServerClassLoading.Environments(); environments.setEnvironments(envList); classloadingEnvironments.setEnvironments(environments); return classloadingEnvironments; }