[phiz] 2 new revisions pushed by michal.kotelba@esacinc.com on 2015-01-22 21:11 GMT

8 views
Skip to first unread message

ph...@googlecode.com

unread,
Jan 22, 2015, 4:12:06 PM1/22/15
to phiz-de...@googlegroups.com
2 new revisions:

Revision: 40754e71296a
Branch: default
Author: Michal Kotelba <michal....@esacinc.com>
Date: Tue Jan 20 22:42:18 2015 UTC
Log: - Further supports PHIZ-24....
https://code.google.com/p/phiz/source/detail?r=40754e71296a

Revision: a94ac374455c
Branch: default
Author: Michal Kotelba <michal....@esacinc.com>
Date: Thu Jan 22 06:01:46 2015 UTC
Log: - Supports PHIZ-25....
https://code.google.com/p/phiz/source/detail?r=a94ac374455c

==============================================================================
Revision: 40754e71296a
Branch: default
Author: Michal Kotelba <michal....@esacinc.com>
Date: Tue Jan 20 22:42:18 2015 UTC
Log: - Further supports PHIZ-24.
- Implemented Spring + Hibernate + C3P0 based persistent destination
registry.
- Implemented HyperSQL-based persistence layer testing.
- Updated Maven dependency versions to newest releases.
https://code.google.com/p/phiz/source/detail?r=40754e71296a

Added:

/phiz-core/src/main/java/gov/hhs/onc/phiz/beans/factory/EmbeddedPlaceholderResolver.java

/phiz-core/src/main/java/gov/hhs/onc/phiz/beans/factory/impl/EmbeddedPlaceholderResolverImpl.java
/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/PhizDao.java
/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/PhizDataAccessor.java
/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/PhizDataService.java
/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/PhizEntity.java
/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/impl/AbstractPhizDao.java

/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/impl/AbstractPhizDataAccessor.java

/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/impl/AbstractPhizDataService.java

/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/impl/AbstractPhizEntity.java

/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/impl/AbstractPhizVarcharType.java

/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/impl/PhizLocalSessionFactoryBean.java
/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/impl/UriType.java

/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/PhizDestinationDao.java

/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/impl/PhizDestinationDaoImpl.java

/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/impl/PhizDestinationRegistryImpl.java
/phiz-core/src/main/resources/META-INF/phiz/ehcache/ehcache-phiz.xml
/phiz-core/src/main/resources/META-INF/phiz/spring/spring-phiz-data-db.xml
/phiz-core/src/test/java/gov/hhs/onc/phiz/test/impl/PhizHsqlServer.java

/phiz-core/src/test/java/gov/hhs/onc/phiz/test/impl/PlaceholderResourceDatabasePopulator.java
/phiz-core/src/test/resources/META-INF/phiz/db/db-init-phiz-data.sql
/phiz-core/src/test/resources/META-INF/phiz/db/db-init-phiz-schema.sql
/phiz-core/src/test/resources/META-INF/phiz/db/db-init-phiz.sql
Deleted:

/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/impl/StaticDestinationRegistry.java
Modified:
/phiz-core/pom.xml
/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/PhizDestination.java

/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/PhizDestinationRegistry.java

/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/impl/PhizDestinationImpl.java
/phiz-core/src/main/resources/META-INF/phiz/phiz.properties
/phiz-core/src/test/resources/META-INF/phiz/phiz-test.properties
/phiz-core/src/test/resources/META-INF/phiz/spring/spring-phiz-test.xml
/phiz-parent/pom.xml
/phiz-tools/pom.xml
/phiz-web-core/pom.xml

/phiz-web-core/src/test/java/gov/hhs/onc/phiz/web/test/impl/PhizSoapUiTestCaseRunner.java
/phiz-web-parent/pom.xml
/phiz-web-portal/pom.xml
/phiz-web-ws/pom.xml

=======================================
--- /dev/null
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/beans/factory/EmbeddedPlaceholderResolver.java
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,9 @@
+package gov.hhs.onc.phiz.beans.factory;
+
+import org.springframework.beans.factory.InitializingBean;
+
+public interface EmbeddedPlaceholderResolver extends InitializingBean {
+ public String resolvePlaceholders(String str);
+
+ public String resolvePlaceholders(String str, boolean asPropName);
+}
=======================================
--- /dev/null
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/beans/factory/impl/EmbeddedPlaceholderResolverImpl.java
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,46 @@
+package gov.hhs.onc.phiz.beans.factory.impl;
+
+import gov.hhs.onc.phiz.beans.factory.EmbeddedPlaceholderResolver;
+import java.util.Objects;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.config.BeanExpressionContext;
+import org.springframework.beans.factory.config.BeanExpressionResolver;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import
org.springframework.beans.factory.config.PlaceholderConfigurerSupport;
+import org.springframework.stereotype.Component;
+
+@Component("embeddedPlaceholderResolverImpl")
+public class EmbeddedPlaceholderResolverImpl implements
EmbeddedPlaceholderResolver {
+ @Autowired
+ private ConfigurableBeanFactory beanFactory;
+
+ private BeanExpressionResolver beanExprResolver;
+ private BeanExpressionContext beanExprContext;
+
+ @Override
+ public String resolvePlaceholders(String str) {
+ return this.resolvePlaceholders(str, false);
+ }
+
+ @Override
+ public String resolvePlaceholders(String str, boolean asPropName) {
+ if (asPropName) {
+ String strResolving =
PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_PREFIX + str +
PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_SUFFIX, strResolved =
+ this.beanFactory.resolveEmbeddedValue(strResolving);
+
+ if (!strResolved.equals(strResolving)) {
+ str = strResolved;
+ }
+ } else {
+ str = this.beanFactory.resolveEmbeddedValue(str);
+ }
+
+ return Objects.toString(this.beanExprResolver.evaluate(str,
this.beanExprContext), null);
+ }
+
+ @Override
+ public void afterPropertiesSet() throws Exception {
+ this.beanExprResolver =
this.beanFactory.getBeanExpressionResolver();
+ this.beanExprContext = new BeanExpressionContext(this.beanFactory,
null);
+ }
+}
=======================================
--- /dev/null
+++ /phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/PhizDao.java Tue Jan
20 22:42:18 2015 UTC
@@ -0,0 +1,6 @@
+package gov.hhs.onc.phiz.data.db;
+
+import java.io.Serializable;
+
+public interface PhizDao<T extends Serializable, U extends PhizEntity<T>>
extends PhizDataAccessor<T, U> {
+}
=======================================
--- /dev/null
+++ /phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/PhizDataAccessor.java
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,17 @@
+package gov.hhs.onc.phiz.data.db;
+
+import java.io.Serializable;
+import java.util.List;
+import javax.annotation.Nullable;
+import org.hibernate.criterion.Criterion;
+
+public interface PhizDataAccessor<T extends Serializable, U extends
PhizEntity<T>> {
+ public void save(U entity);
+
+ public List<U> findAll();
+
+ public List<U> findByCriteria(Criterion ... criterions);
+
+ @Nullable
+ public U findById(T id);
+}
=======================================
--- /dev/null
+++ /phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/PhizDataService.java
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,6 @@
+package gov.hhs.onc.phiz.data.db;
+
+import java.io.Serializable;
+
+public interface PhizDataService<T extends Serializable, U extends
PhizEntity<T>, V extends PhizDao<T, U>> extends PhizDataAccessor<T, U> {
+}
=======================================
--- /dev/null
+++ /phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/PhizEntity.java Tue
Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,9 @@
+package gov.hhs.onc.phiz.data.db;
+
+import java.io.Serializable;
+
+public interface PhizEntity<T extends Serializable> {
+ public T getId();
+
+ public void setId(T id);
+}
=======================================
--- /dev/null
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/impl/AbstractPhizDao.java
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,58 @@
+package gov.hhs.onc.phiz.data.db.impl;
+
+import com.github.sebhoss.warnings.CompilerWarnings;
+import gov.hhs.onc.phiz.data.db.PhizDao;
+import gov.hhs.onc.phiz.data.db.PhizEntity;
+import java.io.Serializable;
+import java.util.List;
+import javax.annotation.Nullable;
+import org.hibernate.Criteria;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.criterion.Criterion;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public abstract class AbstractPhizDao<T extends Serializable, U extends
PhizEntity<T>> extends AbstractPhizDataAccessor<T, U> implements PhizDao<T,
U> {
+ @Autowired
+ protected SessionFactory sessionFactory;
+
+ protected Class<? extends U> entityImplClass;
+
+ protected AbstractPhizDao(Class<T> idClass, Class<U> entityClass,
Class<? extends U> entityImplClass) {
+ super(idClass, entityClass);
+
+ this.entityImplClass = entityImplClass;
+ }
+
+ @Override
+ public void save(U entity) {
+ this.getSession().save(entity);
+ }
+
+ @Override
+ public List<U> findAll() {
+ return this.findByCriteria();
+ }
+
+ @Override
+ @SuppressWarnings({ CompilerWarnings.UNCHECKED })
+ public List<U> findByCriteria(Criterion ... criterions) {
+ Criteria criteria =
this.getSession().createCriteria(this.entityImplClass);
+
+ for (Criterion criterion : criterions) {
+ criteria.add(criterion);
+ }
+
+ return ((List<U>) criteria.list());
+ }
+
+ @Nullable
+ @Override
+ public U findById(T id) {
+ return
this.entityClass.cast(this.getSession().get(this.entityImplClass, id));
+ }
+
+ protected Session getSession() {
+ return this.sessionFactory.getCurrentSession();
+ }
+}
=======================================
--- /dev/null
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/impl/AbstractPhizDataAccessor.java
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,15 @@
+package gov.hhs.onc.phiz.data.db.impl;
+
+import gov.hhs.onc.phiz.data.db.PhizEntity;
+import gov.hhs.onc.phiz.data.db.PhizDataAccessor;
+import java.io.Serializable;
+
+public abstract class AbstractPhizDataAccessor<T extends Serializable, U
extends PhizEntity<T>> implements PhizDataAccessor<T, U> {
+ protected Class<T> idClass;
+ protected Class<U> entityClass;
+
+ protected AbstractPhizDataAccessor(Class<T> idClass, Class<U>
entityClass) {
+ this.idClass = idClass;
+ this.entityClass = entityClass;
+ }
+}
=======================================
--- /dev/null
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/impl/AbstractPhizDataService.java
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,43 @@
+package gov.hhs.onc.phiz.data.db.impl;
+
+import gov.hhs.onc.phiz.data.db.PhizDao;
+import gov.hhs.onc.phiz.data.db.PhizDataService;
+import gov.hhs.onc.phiz.data.db.PhizEntity;
+import java.io.Serializable;
+import java.util.List;
+import javax.annotation.Nullable;
+import org.hibernate.criterion.Criterion;
+import org.springframework.transaction.annotation.Transactional;
+
+@Transactional(readOnly = true)
+public abstract class AbstractPhizDataService<T extends Serializable, U
extends PhizEntity<T>, V extends PhizDao<T, U>> extends
AbstractPhizDataAccessor<T, U>
+ implements PhizDataService<T, U, V> {
+ protected V dao;
+
+ protected AbstractPhizDataService(Class<T> idClass, Class<U>
entityClass, V dao) {
+ super(idClass, entityClass);
+
+ this.dao = dao;
+ }
+
+ @Override
+ @Transactional(readOnly = false)
+ public void save(U entity) {
+ this.dao.save(entity);
+ }
+
+ @Override
+ public List<U> findAll() {
+ return this.dao.findAll();
+ }
+
+ @Override
+ public List<U> findByCriteria(Criterion ... criterions) {
+ return this.dao.findByCriteria(criterions);
+ }
+
+ @Nullable
+ public U findById(T id) {
+ return this.dao.findById(id);
+ }
+}
=======================================
--- /dev/null
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/impl/AbstractPhizEntity.java
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,27 @@
+package gov.hhs.onc.phiz.data.db.impl;
+
+import gov.hhs.onc.phiz.data.db.PhizEntity;
+import java.io.Serializable;
+import javax.persistence.Access;
+import javax.persistence.AccessType;
+import javax.persistence.MappedSuperclass;
+import javax.persistence.Transient;
+import org.hibernate.annotations.Proxy;
+
+@Access(AccessType.PROPERTY)
+@MappedSuperclass
+@Proxy(lazy = false)
+public abstract class AbstractPhizEntity<T extends Serializable>
implements PhizEntity<T> {
+ protected T id;
+
+ @Override
+ @Transient
+ public T getId() {
+ return this.id;
+ }
+
+ @Override
+ public void setId(T id) {
+ this.id = id;
+ }
+}
=======================================
--- /dev/null
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/impl/AbstractPhizVarcharType.java
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,93 @@
+package gov.hhs.onc.phiz.data.db.impl;
+
+import java.util.function.Function;
+import javax.annotation.Nullable;
+import org.apache.commons.lang3.ClassUtils;
+import org.hibernate.dialect.Dialect;
+import org.hibernate.type.AbstractSingleColumnStandardBasicType;
+import org.hibernate.type.DiscriminatorType;
+import org.hibernate.type.StringType;
+import org.hibernate.type.descriptor.WrapperOptions;
+import org.hibernate.type.descriptor.java.AbstractTypeDescriptor;
+import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
+import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor;
+
+public abstract class AbstractPhizVarcharType<T> extends
AbstractSingleColumnStandardBasicType<T> implements DiscriminatorType<T> {
+ protected abstract static class AbstractPhizStringTypeDescriptor<T>
extends AbstractTypeDescriptor<T> {
+ protected Function<String, T> fromStrFunc;
+ protected Function<T, String> toStrFunc;
+
+ private final static long serialVersionUID = 0L;
+
+ protected AbstractPhizStringTypeDescriptor(Class<T> typeClass,
Function<String, T> fromStrFunc, Function<T, String> toStrFunc) {
+ super(typeClass);
+
+ this.fromStrFunc = fromStrFunc;
+ this.toStrFunc = toStrFunc;
+ }
+
+ @Override
+ public String toString(T value) {
+ return this.toStrFunc.apply(value);
+ }
+
+ @Override
+ public T fromString(String str) {
+ return this.fromStrFunc.apply(str);
+ }
+
+ @Nullable
+ @Override
+ public <X> X unwrap(@Nullable T value, Class<X>
unwrappedTypeClass, WrapperOptions wrapperOpts) {
+ if (value == null) {
+ return null;
+ } else if (ClassUtils.isAssignable(unwrappedTypeClass,
String.class)) {
+ return unwrappedTypeClass.cast(this.toString(value));
+ } else {
+ throw unknownUnwrap(unwrappedTypeClass);
+ }
+ }
+
+ @Nullable
+ @Override
+ public <X> T wrap(@Nullable X unwrappedValue, WrapperOptions
wrapperOpts) {
+ if (unwrappedValue == null) {
+ return null;
+ } else if (unwrappedValue instanceof String) {
+ return this.fromString(((String) unwrappedValue));
+ } else {
+ throw unknownWrap(unwrappedValue.getClass());
+ }
+ }
+ }
+
+ protected Class<T> typeClass;
+
+ private final static long serialVersionUID = 0L;
+
+ protected AbstractPhizVarcharType(Class<T> typeClass,
JavaTypeDescriptor<T> javaTypeDesc) {
+ super(VarcharTypeDescriptor.INSTANCE, javaTypeDesc);
+
+ this.typeClass = typeClass;
+ }
+
+ @Override
+ public T stringToObject(String str) throws Exception {
+ return this.fromString(str);
+ }
+
+ @Override
+ public String objectToSQLString(T value, Dialect dialect) throws
Exception {
+ return StringType.INSTANCE.objectToSQLString(this.toString(value),
dialect);
+ }
+
+ @Override
+ public String getName() {
+ return this.typeClass.getSimpleName().toLowerCase();
+ }
+
+ @Override
+ protected boolean registerUnderJavaType() {
+ return true;
+ }
+}
=======================================
--- /dev/null
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/impl/PhizLocalSessionFactoryBean.java
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,24 @@
+package gov.hhs.onc.phiz.data.db.impl;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.hibernate.SessionFactory;
+import org.hibernate.type.BasicType;
+import org.springframework.orm.hibernate4.LocalSessionFactoryBean;
+import org.springframework.orm.hibernate4.LocalSessionFactoryBuilder;
+
+public class PhizLocalSessionFactoryBean extends LocalSessionFactoryBean {
+ private Set<BasicType> basicTypes = new HashSet<>();
+
+ @Override
+ protected SessionFactory
buildSessionFactory(LocalSessionFactoryBuilder sessionFactoryBuilder) {
+
this.basicTypes.forEach(sessionFactoryBuilder::registerTypeOverride);
+
+ return super.buildSessionFactory(sessionFactoryBuilder);
+ }
+
+ public void setBasicTypes(Set<BasicType> basicTypes) {
+ this.basicTypes.clear();
+ this.basicTypes.addAll(basicTypes);
+ }
+}
=======================================
--- /dev/null
+++ /phiz-core/src/main/java/gov/hhs/onc/phiz/data/db/impl/UriType.java Tue
Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,23 @@
+package gov.hhs.onc.phiz.data.db.impl;
+
+import java.net.URI;
+import org.springframework.stereotype.Component;
+
+@Component("basicTypeUri")
+public class UriType extends AbstractPhizVarcharType<URI> {
+ private static class UriTypeDescriptor extends
AbstractPhizStringTypeDescriptor<URI> {
+ private final static UriTypeDescriptor INSTANCE = new
UriTypeDescriptor();
+
+ private final static long serialVersionUID = 0L;
+
+ private UriTypeDescriptor() {
+ super(URI.class, URI::create, Object::toString);
+ }
+ }
+
+ private final static long serialVersionUID = 0L;
+
+ public UriType() {
+ super(URI.class, UriTypeDescriptor.INSTANCE);
+ }
+}
=======================================
--- /dev/null
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/PhizDestinationDao.java
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,6 @@
+package gov.hhs.onc.phiz.destination;
+
+import gov.hhs.onc.phiz.data.db.PhizDao;
+
+public interface PhizDestinationDao extends PhizDao<String,
PhizDestination> {
+}
=======================================
--- /dev/null
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/impl/PhizDestinationDaoImpl.java
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,13 @@
+package gov.hhs.onc.phiz.destination.impl;
+
+import gov.hhs.onc.phiz.data.db.impl.AbstractPhizDao;
+import gov.hhs.onc.phiz.destination.PhizDestination;
+import gov.hhs.onc.phiz.destination.PhizDestinationDao;
+import org.springframework.stereotype.Repository;
+
+@Repository("destDaoImpl")
+public class PhizDestinationDaoImpl extends AbstractPhizDao<String,
PhizDestination> implements PhizDestinationDao {
+ public PhizDestinationDaoImpl() {
+ super(String.class, PhizDestination.class,
PhizDestinationImpl.class);
+ }
+}
=======================================
--- /dev/null
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/impl/PhizDestinationRegistryImpl.java
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,16 @@
+package gov.hhs.onc.phiz.destination.impl;
+
+import gov.hhs.onc.phiz.data.db.impl.AbstractPhizDataService;
+import gov.hhs.onc.phiz.destination.PhizDestination;
+import gov.hhs.onc.phiz.destination.PhizDestinationDao;
+import gov.hhs.onc.phiz.destination.PhizDestinationRegistry;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service("destRegImpl")
+public class PhizDestinationRegistryImpl extends
AbstractPhizDataService<String, PhizDestination, PhizDestinationDao>
implements PhizDestinationRegistry {
+ @Autowired
+ public PhizDestinationRegistryImpl(PhizDestinationDao dao) {
+ super(String.class, PhizDestination.class, dao);
+ }
+}
=======================================
--- /dev/null
+++ /phiz-core/src/main/resources/META-INF/phiz/ehcache/ehcache-phiz.xml
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ehcache
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">
+
+
<!--====================================================================================================
+ = CACHE: DESTINATIONS
+
=====================================================================================================-->
+ <cache
+ name="gov.hhs.onc.phiz.destination.impl.PhizDestinationImpl"
+ logging="true"
+ maxElementsInMemory="100"
+ statistics="true"
+ timeToLiveSeconds="300"/>
+</ehcache>
=======================================
--- /dev/null
+++
/phiz-core/src/main/resources/META-INF/phiz/spring/spring-phiz-data-db.xml
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:beans="http://www.springframework.org/schema/beans"
+ xmlns:c="http://www.springframework.org/schema/c"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:p="http://www.springframework.org/schema/p"
+ xmlns:task="http://www.springframework.org/schema/task"
+ xmlns:tx="http://www.springframework.org/schema/tx"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
+ http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
+ http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task.xsd
+ http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
+ http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd">
+
+
<!--====================================================================================================
+ = BEAN POST PROCESSORS
+
=====================================================================================================-->
+ <beans:bean
class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
+
+
<!--====================================================================================================
+ = DATA SOURCES
+
=====================================================================================================-->
+ <beans:bean id="dataSrc" class="javax.sql.DataSource" abstract="true"/>
+
+ <beans:bean id="dataSrcPooled"
class="com.mchange.v2.c3p0.ComboPooledDataSource" parent="dataSrc"
abstract="true"
+ p:acquireIncrement="1"
+ p:initialPoolSize="0"
+ p:maxIdleTime="#{
T(com.mchange.v2.c3p0.impl.C3P0Defaults).maxIdleTime() }"
+ p:maxPoolSize="#{
T(com.mchange.v2.c3p0.impl.C3P0Defaults).maxPoolSize() }"
+ p:minPoolSize="1"/>
+
+ <!--suppress SpringPlaceholdersInspection -->
+ <beans:bean id="dataSrcHub" parent="dataSrcPooled"
destroy-method="close"
+ p:driverClass="${phiz.data.db.jdbc.driver.class.name}"
+ p:jdbcUrl="${phiz.data.db.jdbc.url}"
+ p:password="${phiz.data.db.user.hub.pass}"
+ p:user="${phiz.data.db.user.hub.name}"/>
+
+
<!--====================================================================================================
+ = HIBERNATE SESSION FACTORIES
+
=====================================================================================================-->
+ <beans:bean id="hibernateSessionFactory"
class="org.hibernate.SessionFactory" abstract="true"/>
+
+ <beans:bean id="hibernateSessionFactoryBase"
class="gov.hhs.onc.phiz.data.db.impl.PhizLocalSessionFactoryBean"
parent="hibernateSessionFactory"
+ abstract="true"
+ p:packagesToScan="gov.hhs.onc.phiz">
+ <beans:property name="basicTypes">
+ <beans:set>
+ <beans:ref bean="basicTypeUri"/>
+ </beans:set>
+ </beans:property>
+ <beans:property name="hibernateProperties">
+ <beans:props>
+ <beans:prop key="#{
T(org.hibernate.cache.ehcache.AbstractEhcacheRegionFactory).NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME
}">
+ META-INF/phiz/ehcache/ehcache-phiz.xml
+ </beans:prop>
+ <beans:prop key="#{
T(org.hibernate.cfg.AvailableSettings).CACHE_REGION_FACTORY }">
+ #{
T(org.hibernate.cache.ehcache.EhCacheRegionFactory).name }
+ </beans:prop>
+ <!--suppress SpringPlaceholdersInspection -->
+ <beans:prop key="#{
T(org.hibernate.cfg.AvailableSettings).DIALECT
}">${phiz.data.db.hibernate.dialect}</beans:prop>
+ <beans:prop key="#{
T(org.hibernate.cfg.AvailableSettings).SHOW_SQL }">true</beans:prop>
+ </beans:props>
+ </beans:property>
+ </beans:bean>
+
+ <beans:bean id="hibernateSessionFactoryHub"
parent="hibernateSessionFactoryBase"
+ p:dataSource-ref="dataSrcHub"/>
+
+
<!--====================================================================================================
+ = TRANSACTION MANAGERS
+
=====================================================================================================-->
+ <beans:bean id="txManagerHibernate"
class="org.springframework.orm.hibernate4.HibernateTransactionManager"
parent="txManager" abstract="true"
+ p:nestedTransactionAllowed="true"
+ p:rollbackOnCommitFailure="true"
+ p:validateExistingTransaction="true"/>
+
+ <beans:bean id="txManagerHibernateHub" parent="txManagerHibernate"
+ p:sessionFactory-ref="hibernateSessionFactoryHub"/>
+
+
<!--====================================================================================================
+ = TRANSACTIONS
+
=====================================================================================================-->
+ <tx:annotation-driven transaction-manager="txManagerHibernateHub"/>
+</beans:beans>
=======================================
--- /dev/null
+++ /phiz-core/src/test/java/gov/hhs/onc/phiz/test/impl/PhizHsqlServer.java
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,75 @@
+package gov.hhs.onc.phiz.test.impl;
+
+import java.io.File;
+import org.hsqldb.server.Server;
+import org.hsqldb.server.ServerConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.util.ResourceUtils;
+
+public class PhizHsqlServer extends Server implements InitializingBean {
+ private final static String DB_PATH_FORMAT_STR =
ResourceUtils.FILE_URL_PREFIX + "%s;user=%s;password=%s";
+
+ private final static Logger LOGGER =
LoggerFactory.getLogger(PhizHsqlServer.class);
+
+ private File dir;
+ private String user;
+ private String pass;
+
+ public boolean isRunning() {
+ return (this.getState() == ServerConstants.SERVER_STATE_ONLINE);
+ }
+
+ @Override
+ public void afterPropertiesSet() throws Exception {
+ this.setDatabasePath(0, String.format(DB_PATH_FORMAT_STR,
this.dir.getPath(), this.user, this.pass));
+ }
+
+ @Override
+ protected void printStackTrace(Throwable throwable) {
+ LOGGER.error(String.format("HyperSQL server (id=%s) error stack
trace:", this.serverId), throwable);
+ }
+
+ @Override
+ protected void printError(String msg) {
+ LOGGER.error(msg);
+ }
+
+ @Override
+ protected void print(String msg) {
+ LOGGER.trace(msg);
+ }
+
+ public String getDatabaseName() {
+ return this.getDatabaseName(0, true);
+ }
+
+ public void setDatabaseName(String dbName) {
+ this.setDatabaseName(0, dbName);
+ }
+
+ public File getDirectory() {
+ return this.dir;
+ }
+
+ public void setDirectory(File dir) {
+ this.dir = dir;
+ }
+
+ public String getPassword() {
+ return this.pass;
+ }
+
+ public void setPassword(String pass) {
+ this.pass = pass;
+ }
+
+ public String getUser() {
+ return this.user;
+ }
+
+ public void setUser(String user) {
+ this.user = user;
+ }
+}
=======================================
--- /dev/null
+++
/phiz-core/src/test/java/gov/hhs/onc/phiz/test/impl/PlaceholderResourceDatabasePopulator.java
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,57 @@
+package gov.hhs.onc.phiz.test.impl;
+
+import gov.hhs.onc.phiz.beans.factory.EmbeddedPlaceholderResolver;
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.sql.Connection;
+import java.util.stream.Stream;
+import org.apache.commons.io.IOUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.ByteArrayResource;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.support.EncodedResource;
+import org.springframework.jdbc.datasource.init.CannotReadScriptException;
+import org.springframework.jdbc.datasource.init.DatabasePopulator;
+import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
+import org.springframework.jdbc.datasource.init.ScriptException;
+
+public class PlaceholderResourceDatabasePopulator implements
DatabasePopulator {
+ @Autowired
+ private EmbeddedPlaceholderResolver embeddedPlaceholderResolver;
+
+ private Resource[] scripts;
+ private Charset scriptEnc;
+
+ @Override
+ public void populate(Connection conn) throws ScriptException {
+ new ResourceDatabasePopulator(false, false, this.scriptEnc.name(),
Stream
+ .of(this.scripts)
+ .map(
+ script -> {
+ EncodedResource encScript = new
EncodedResource(script, this.scriptEnc);
+
+ try {
+ return new
ByteArrayResource(this.embeddedPlaceholderResolver.resolvePlaceholders(
+ IOUtils.toString(encScript.getInputStream(),
this.scriptEnc)).getBytes(this.scriptEnc));
+ } catch (IOException e) {
+ throw new CannotReadScriptException(encScript, e);
+ }
+ }).toArray(Resource[]::new)).populate(conn);
+ }
+
+ public Charset getScriptEncoding() {
+ return this.scriptEnc;
+ }
+
+ public void setScriptEncoding(Charset scriptEnc) {
+ this.scriptEnc = scriptEnc;
+ }
+
+ public Resource[] getScripts() {
+ return this.scripts;
+ }
+
+ public void setScripts(Resource[] scripts) {
+ this.scripts = scripts;
+ }
+}
=======================================
--- /dev/null
+++ /phiz-core/src/test/resources/META-INF/phiz/db/db-init-phiz-data.sql
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,10 @@
+/*==============================================================================
+= TABLE: DESTINATIONS
+==============================================================================*/
+insert into destinations (
+ dest_id,
+ dest_uri
+) values (
+ '${phiz.dest.iis.dev.id}',
+ '${phiz.dest.iis.dev.uri}'
+);
=======================================
--- /dev/null
+++ /phiz-core/src/test/resources/META-INF/phiz/db/db-init-phiz-schema.sql
Tue Jan 20 22:42:18 2015 UTC
@@ -0,0 +1,7 @@
+/*==============================================================================
+= TABLE: DESTINATIONS
+==============================================================================*/
+create table destinations (
+ dest_id varchar(128) not null primary key,
+ dest_uri varchar(1024) not null
+);
=======================================
--- /dev/null
+++ /phiz-core/src/test/resources/META-INF/phiz/db/db-init-phiz.sql Tue Jan
20 22:42:18 2015 UTC
@@ -0,0 +1,9 @@
+/*==============================================================================
+= DATABASE SETTINGS
+==============================================================================*/
+set database sql syntax PGS true;
+
+/*==============================================================================
+= FILES SETTINGS
+==============================================================================*/
+set files nio true;
=======================================
---
/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/impl/StaticDestinationRegistry.java
Fri Jan 9 08:17:07 2015 UTC
+++ /dev/null
@@ -1,31 +0,0 @@
-package gov.hhs.onc.phiz.destination.impl;
-
-import gov.hhs.onc.phiz.destination.PhizDestination;
-import gov.hhs.onc.phiz.destination.PhizDestinationRegistry;
-import java.net.URI;
-import javax.annotation.Nullable;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-
-@Service("destRegStatic")
-public class StaticDestinationRegistry implements InitializingBean,
PhizDestinationRegistry {
- @Value("${phiz.dest.iis.dev.id}")
- private String iisDevDestId;
-
- @Value("${phiz.dest.iis.dev.uri}")
- private URI iisDevDestUri;
-
- private PhizDestination iisDevDest;
-
- @Nullable
- @Override
- public PhizDestination findById(String id) {
- return (id.equals(this.iisDevDestId) ? this.iisDevDest : null);
- }
-
- @Override
- public void afterPropertiesSet() throws Exception {
- this.iisDevDest = new PhizDestinationImpl(this.iisDevDestId,
this.iisDevDestUri);
- }
-}
=======================================
--- /phiz-core/pom.xml Fri Jan 9 08:17:07 2015 UTC
+++ /phiz-core/pom.xml Tue Jan 20 22:42:18 2015 UTC
@@ -69,6 +69,10 @@
<artifactId>spring-crypto-utils</artifactId>
</dependency>
<dependency>
+ <groupId>com.mchange</groupId>
+ <artifactId>c3p0</artifactId>
+ </dependency>
+ <dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
</dependency>
@@ -157,6 +161,10 @@
<artifactId>hibernate-ehcache</artifactId>
</dependency>
<dependency>
+ <groupId>org.postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
@@ -222,6 +230,11 @@
</dependency>
<!-- Test dependencies (inherited) -->
<dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
=======================================
---
/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/PhizDestination.java
Fri Jan 9 01:16:51 2015 UTC
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/PhizDestination.java
Tue Jan 20 22:42:18 2015 UTC
@@ -1,12 +1,9 @@
package gov.hhs.onc.phiz.destination;

+import gov.hhs.onc.phiz.data.db.PhizEntity;
import java.net.URI;

-public interface PhizDestination {
- public String getId();
-
- public void setId(String id);
-
+public interface PhizDestination extends PhizEntity<String> {
public URI getUri();

public void setUri(URI uri);
=======================================
---
/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/PhizDestinationRegistry.java
Fri Jan 9 01:16:51 2015 UTC
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/PhizDestinationRegistry.java
Tue Jan 20 22:42:18 2015 UTC
@@ -1,8 +1,6 @@
package gov.hhs.onc.phiz.destination;

-import javax.annotation.Nullable;
+import gov.hhs.onc.phiz.data.db.PhizDataService;

-public interface PhizDestinationRegistry {
- @Nullable
- public PhizDestination findById(String id);
+public interface PhizDestinationRegistry extends PhizDataService<String,
PhizDestination, PhizDestinationDao> {
}
=======================================
---
/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/impl/PhizDestinationImpl.java
Fri Jan 9 01:16:51 2015 UTC
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/destination/impl/PhizDestinationImpl.java
Tue Jan 20 22:42:18 2015 UTC
@@ -1,10 +1,21 @@
package gov.hhs.onc.phiz.destination.impl;

+import gov.hhs.onc.phiz.data.db.impl.AbstractPhizEntity;
import gov.hhs.onc.phiz.destination.PhizDestination;
import java.net.URI;
+import javax.persistence.Cacheable;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import org.hibernate.annotations.Cache;
+import org.hibernate.annotations.CacheConcurrencyStrategy;

-public class PhizDestinationImpl implements PhizDestination {
- private String id;
+@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
+@Cacheable
+@Entity(name = "dest")
+@Table(name = "destinations")
+public class PhizDestinationImpl extends AbstractPhizEntity<String>
implements PhizDestination {
private URI uri;

public PhizDestinationImpl() {
@@ -15,16 +26,14 @@
this.uri = uri;
}

+ @Column(name = "dest_id", nullable = false)
+ @Id
@Override
public String getId() {
- return this.id;
- }
-
- @Override
- public void setId(String id) {
- this.id = id;
+ return super.getId();
}

+ @Column(name = "dest_uri", nullable = false)
@Override
public URI getUri() {
return this.uri;
=======================================
--- /phiz-core/src/main/resources/META-INF/phiz/phiz.properties Fri Jan 9
08:17:07 2015 UTC
+++ /phiz-core/src/main/resources/META-INF/phiz/phiz.properties Tue Jan 20
22:42:18 2015 UTC
@@ -38,6 +38,37 @@
phiz.crypto.cred.ca.root.subject.cn=phiz_ca_root
phiz.crypto.cred.ca.subject.cn=phiz_ca

+#================================================================================
+# DATA
+#================================================================================
+phiz.data.dir=var
+
+#================================================================================
+# DATA DATABASE
+#================================================================================
+phiz.data.db.host=localhost
+phiz.data.db.name=phiz
+phiz.data.db.port=5432
+phiz.data.db.query.validation=select 1
+
+#================================================================================
+# DATA DATABASE: JDBC
+#================================================================================
+phiz.data.db.jdbc.driver.class.name=#{ T(org.postgresql.Driver).name }
+phiz.data.db.jdbc.protocol=postgresql
+phiz.data.db.jdbc.url=jdbc:${phiz.data.db.jdbc.protocol}://${phiz.data.db.host}:${phiz.data.db.port}/${phiz.data.db.name}
+
+#================================================================================
+# DATA DATABASE: HIBERNATE
+#================================================================================
+phiz.data.db.hibernate.dialect=#{
T(org.hibernate.dialect.PostgreSQL9Dialect).name }
+
+#================================================================================
+# DATA DATABASE: USERS
+#================================================================================
+phiz.data.db.user.hub.name=hub
+phiz.data.db.user.hub.pass=hubpass
+

#================================================================================
# DESTINATION: DEVELOPMENT IIS

#================================================================================
=======================================
--- /phiz-core/src/test/resources/META-INF/phiz/phiz-test.properties Fri
Jan 9 01:16:51 2015 UTC
+++ /phiz-core/src/test/resources/META-INF/phiz/phiz-test.properties Tue
Jan 20 22:42:18 2015 UTC
@@ -16,6 +16,31 @@
phiz.crypto.store.ca.entry.ca.root.pass=${phiz.crypto.store.ca.pass}
phiz.crypto.store.ca.entry.ca.alias=${phiz.crypto.cred.ca.subject.cn}
phiz.crypto.store.ca.entry.ca.pass=${phiz.crypto.store.ca.pass}
+
+#================================================================================
+# DATA DATABASE
+#================================================================================
+phiz.data.db.dir=${phiz.data.dir}/db/${phiz.data.db.name}
+phiz.data.db.port=19001
+
+#================================================================================
+# DATA DATABASE: JDBC
+#================================================================================
+phiz.data.db.jdbc.driver.class.name=#{ T(org.hsqldb.jdbc.JDBCDriver).name }
+phiz.data.db.jdbc.protocol=hsqldb:hsql
+
+#================================================================================
+# DATA DATABASE: HIBERNATE
+#================================================================================
+phiz.data.db.hibernate.dialect=#{
T(org.hibernate.dialect.HSQLDialect).name }
+
+#================================================================================
+# DATA DATABASE: USERS
+#================================================================================
+phiz.data.db.user.admin.name=admin
+phiz.data.db.user.admin.pass=adminpass
+phiz.data.db.user.hub.name=${phiz.data.db.user.admin.name}
+phiz.data.db.user.hub.pass=${phiz.data.db.user.admin.pass}


#================================================================================
# RABBITMQ
=======================================
--- /phiz-core/src/test/resources/META-INF/phiz/spring/spring-phiz-test.xml
Thu Dec 25 10:17:46 2014 UTC
+++ /phiz-core/src/test/resources/META-INF/phiz/spring/spring-phiz-test.xml
Tue Jan 20 22:42:18 2015 UTC
@@ -175,4 +175,53 @@
</beans:map>
</beans:property>
</beans:bean>
+
+
<!--====================================================================================================
+ = DATABASE SERVERS
+
=====================================================================================================-->
+ <beans:bean id="dbServer"
class="gov.hhs.onc.phiz.test.impl.PhizHsqlServer" abstract="true"
+ p:daemon="true"/>
+
+ <!--suppress SpringPlaceholdersInspection -->
+ <beans:bean id="dbServerHub" parent="dbServer" destroy-method="stop"
init-method="start"
+ p:address="${phiz.data.db.host}"
+ p:databaseName="${phiz.data.db.name}"
+ p:directory="${phiz.data.db.dir}"
+ p:password="${phiz.data.db.user.admin.pass}"
+ p:port="${phiz.data.db.port}"
+ p:user="${phiz.data.db.user.admin.name}"/>
+
+
<!--====================================================================================================
+ = DATABASE POPULATORS
+
=====================================================================================================-->
+ <beans:bean id="dbPopulator"
class="org.springframework.jdbc.datasource.init.DatabasePopulator"
abstract="true"/>
+
+ <beans:bean id="dbPopulatorPlaceholderResource"
class="gov.hhs.onc.phiz.test.impl.PlaceholderResourceDatabasePopulator"
parent="dbPopulator" abstract="true"
+ p:scriptEncoding-ref="charsetUtf8"/>
+
+
<!--====================================================================================================
+ = DATA SOURCE INITIALIZERS
+
=====================================================================================================-->
+ <beans:bean id="dataSrcInit"
class="org.springframework.jdbc.datasource.init.DataSourceInitializer"
abstract="true"/>
+
+ <beans:bean id="dataSrcInitHub" parent="dataSrcInit"
depends-on="dbServerHub"
+ p:dataSource-ref="dataSrcHub">
+ <beans:property name="databasePopulator">
+ <beans:bean parent="dbPopulatorPlaceholderResource">
+ <beans:property name="scripts">
+ <beans:array>
+
<beans:value>classpath*:META-INF/phiz/db/db-init-phiz.sql</beans:value>
+
<beans:value>classpath*:META-INF/phiz/db/db-init-phiz-schema.sql</beans:value>
+
<beans:value>classpath*:META-INF/phiz/db/db-init-phiz-data.sql</beans:value>
+ </beans:array>
+ </beans:property>
+ </beans:bean>
+ </beans:property>
+ </beans:bean>
+
+
<!--====================================================================================================
+ = HIBERNATE SESSION FACTORIES
+
=====================================================================================================-->
+ <beans:bean id="hibernateSessionFactoryHub"
parent="hibernateSessionFactoryBase" depends-on="dataSrcInitHub"
+ p:dataSource-ref="dataSrcHub"/>
</beans:beans>
=======================================
--- /phiz-parent/pom.xml Fri Jan 9 08:17:07 2015 UTC
+++ /phiz-parent/pom.xml Tue Jan 20 22:42:18 2015 UTC
@@ -151,6 +151,11 @@
<version>1.3.6</version>
</dependency>
<dependency>
+ <groupId>com.mchange</groupId>
+ <artifactId>c3p0</artifactId>
+ <version>0.9.5</version>
+ </dependency>
+ <dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.2.8</version>
@@ -321,12 +326,12 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
- <version>4.3.7.Final</version>
+ <version>4.3.8.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
- <version>4.3.7.Final</version>
+ <version>4.3.8.Final</version>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
@@ -345,24 +350,29 @@
<version>0.9.1</version>
</dependency>
<dependency>
+ <groupId>org.postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>9.3-1102-jdbc41</version>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
- <version>1.7.9</version>
+ <version>1.7.10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
- <version>1.7.9</version>
+ <version>1.7.10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
- <version>1.7.9</version>
+ <version>1.7.10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <version>1.7.9</version>
+ <version>1.7.10</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
@@ -389,12 +399,12 @@
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-amqp</artifactId>
- <version>1.4.1.RELEASE</version>
+ <version>1.4.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId>
- <version>1.4.1.RELEASE</version>
+ <version>1.4.2.RELEASE</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
@@ -405,7 +415,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
- <version>1.2.0.RELEASE</version>
+ <version>1.2.1.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -422,9 +432,15 @@
</dependency>
<!-- Test dependencies -->
<dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>2.3.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>6.8.8</version>
+ <version>6.8.17</version>
<scope>test</scope>
</dependency>
</dependencies>
=======================================
--- /phiz-tools/pom.xml Thu Dec 18 15:30:39 2014 UTC
+++ /phiz-tools/pom.xml Tue Jan 20 22:42:18 2015 UTC
@@ -132,6 +132,11 @@
</dependency>
<!-- Test dependencies (inherited) -->
<dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
=======================================
--- /phiz-web-core/pom.xml Fri Jan 9 08:17:07 2015 UTC
+++ /phiz-web-core/pom.xml Tue Jan 20 22:42:18 2015 UTC
@@ -206,6 +206,11 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
=======================================
---
/phiz-web-core/src/test/java/gov/hhs/onc/phiz/web/test/impl/PhizSoapUiTestCaseRunner.java
Fri Jan 9 08:17:07 2015 UTC
+++
/phiz-web-core/src/test/java/gov/hhs/onc/phiz/web/test/impl/PhizSoapUiTestCaseRunner.java
Tue Jan 20 22:42:18 2015 UTC
@@ -20,7 +20,7 @@
import com.eviware.soapui.model.testsuite.LoadTest;
import com.eviware.soapui.support.types.StringToObjectMap;
import com.github.sebhoss.warnings.CompilerWarnings;
-import java.util.Objects;
+import gov.hhs.onc.phiz.beans.factory.EmbeddedPlaceholderResolver;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
@@ -29,16 +29,13 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.config.BeanExpressionContext;
-import org.springframework.beans.factory.config.ConfigurableBeanFactory;
-import
org.springframework.beans.factory.config.PlaceholderConfigurerSupport;

@SuppressWarnings({ CompilerWarnings.DEPRECATION })
public class PhizSoapUiTestCaseRunner extends SoapUIProTestCaseRunner {
private final static String SPRING_REF_PROP_NAME_PREFIX =
PropertyExpansion.SCOPE_PREFIX + "Spring" +
PropertyExpansion.PROPERTY_SEPARATOR;

@Autowired
- private ConfigurableBeanFactory beanFactory;
+ private EmbeddedPlaceholderResolver embeddedPlaceholderResolver;

private SSLParameters sslParams;
private SSLSocketFactory sslSocketFactory;
@@ -145,22 +142,11 @@

@Override
protected void initProjectProperties(WsdlProject project) {
- PropertyExpander
- .getDefaultExpander()
- .addResolver(
- (propExpContext, propName, globalOverride) -> {
- if (!StringUtils.startsWith(propName,
SPRING_REF_PROP_NAME_PREFIX)) {
- return null;
- }
-
- String propNameResolving =
-
(PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_PREFIX + (propName =
StringUtils.removeStart(propName, SPRING_REF_PROP_NAME_PREFIX)) +
PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_SUFFIX), propNameResolved =
-
this.beanFactory.resolveEmbeddedValue(propNameResolving);
-
- return Objects.toString(
-
this.beanFactory.getBeanExpressionResolver().evaluate((!propNameResolved.equals(propNameResolving) ?
propNameResolved : propName),
- new BeanExpressionContext(this.beanFactory,
null)), null);
- });
+ PropertyExpander.getDefaultExpander().addResolver(
+ (propExpContext, propName, globalOverride) -> {
+ return (StringUtils.startsWith(propName,
SPRING_REF_PROP_NAME_PREFIX) ?
this.embeddedPlaceholderResolver.resolvePlaceholders(
+ StringUtils.removeStart(propName,
SPRING_REF_PROP_NAME_PREFIX), true) : null);
+ });

super.initProjectProperties(project);
}
=======================================
--- /phiz-web-parent/pom.xml Fri Jan 9 08:17:07 2015 UTC
+++ /phiz-web-parent/pom.xml Tue Jan 20 22:42:18 2015 UTC
@@ -126,19 +126,19 @@
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
- <version>8.0.15</version>
+ <version>8.0.17</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-el</artifactId>
- <version>8.0.15</version>
+ <version>8.0.17</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-logging-log4j</artifactId>
- <version>8.0.15</version>
+ <version>8.0.17</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -183,7 +183,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
- <version>1.2.0.RELEASE</version>
+ <version>1.2.1.RELEASE</version>
<scope>provided</scope>
<exclusions>
<exclusion>
=======================================
--- /phiz-web-portal/pom.xml Fri Jan 9 01:16:51 2015 UTC
+++ /phiz-web-portal/pom.xml Tue Jan 20 22:42:18 2015 UTC
@@ -240,6 +240,11 @@
</dependency>
<!-- Test dependencies (inherited) -->
<dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
=======================================
--- /phiz-web-ws/pom.xml Fri Jan 9 08:17:07 2015 UTC
+++ /phiz-web-ws/pom.xml Tue Jan 20 22:42:18 2015 UTC
@@ -271,6 +271,11 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<scope>test</scope>

==============================================================================
Revision: a94ac374455c
Branch: default
Author: Michal Kotelba <michal....@esacinc.com>
Date: Thu Jan 22 06:01:46 2015 UTC
Log: - Supports PHIZ-25.
- Implemented Debian package maintenence scripts for all Debian package
artifact generating (sub-)projects.
- Refactored embedded Tomcat + AspectJ load time weaving configuration to
utilize Tomcat 8's instrumentation support (the Spring-specific approach no
longer works).
- Cleaned up / improved Maven + Groovy project build configurations.
https://code.google.com/p/phiz/source/detail?r=a94ac374455c

Added:

/phiz-core/src/main/java/gov/hhs/onc/phiz/beans/factory/impl/PropertiesPropertyResolver.java
/phiz-core/src/main/java/gov/hhs/onc/phiz/utils/PhizStringUtils.java
/phiz-core/src/main/resources/META-INF/aop.xml
/phiz-core/src/main/scripts/groovy/phiz-process-properties.groovy

/phiz-core/src/main/scripts/groovy/phiz-process-resources-app-scripts.groovy
/phiz-core/src/main/scripts/groovy/phiz-process-resources.groovy
/phiz-core/src/main/scripts/groovy/phiz-process-sources-ws.groovy
/phiz-core/src/test/scripts/groovy/phiz-process-test-deb-it.groovy
/phiz-core/src/test/scripts/groovy/phiz-process-test-rabbitmq-it.groovy
/phiz-core/src/test/scripts/groovy/phiz-process-test-resources-it.groovy
/phiz-tools/src/main/deb/control/postinst
/phiz-tools/src/main/deb/control/postrm
/phiz-tools/src/main/deb/control/preinst
/phiz-tools/src/main/deb/control/prerm
/phiz-tools/src/main/deb/data/etc/logrotate.d/phiz-tools.logrotate
/phiz-web-portal/src/main/deb/control/postinst
/phiz-web-portal/src/main/deb/control/postrm
/phiz-web-portal/src/main/deb/control/preinst
/phiz-web-portal/src/main/deb/control/prerm

/phiz-web-portal/src/main/deb/data/etc/logrotate.d/phiz-web-portal.logrotate

/phiz-web-portal/src/main/deb/data/etc/phiz-web-portal/catalina-phiz-web-portal.policy
/phiz-web-ws/src/main/deb/data/etc/logrotate.d/phiz-web-ws.logrotate
/phiz-web-ws/src/main/deb/data/etc/phiz-web-ws/catalina-phiz-web-ws.policy
Deleted:
/phiz-core/src/main/scripts/groovy/phiz-app-process-scripts.groovy
/phiz-core/src/main/scripts/groovy/phiz-ws-process-sources.groovy
/phiz-core/src/test/scripts/groovy/phiz-test-pre-it-process-deb.groovy
/phiz-core/src/test/scripts/groovy/phiz-test-pre-it-process-files.groovy
/phiz-core/src/test/scripts/groovy/phiz-test-pre-it-process-rabbitmq.groovy
/phiz-web-core/src/main/resources/META-INF/aop.xml
Modified:
/phiz-core/pom.xml
/phiz-core/src/main/cxf/logback-phiz-cxf-codegen.xml

/phiz-core/src/main/java/gov/hhs/onc/phiz/beans/factory/EmbeddedPlaceholderResolver.java

/phiz-core/src/main/java/gov/hhs/onc/phiz/beans/factory/impl/EmbeddedPlaceholderResolverImpl.java
/phiz-core/src/main/java/gov/hhs/onc/phiz/context/impl/PhizApplication.java

/phiz-core/src/main/resources/META-INF/phiz/logback/logback-phiz-include.xml
/phiz-parent/pom.xml
/phiz-tools/pom.xml
/phiz-tools/src/main/deb/control/control
/phiz-web-core/pom.xml

/phiz-web-core/src/main/java/gov/hhs/onc/phiz/web/tomcat/impl/PhizTomcatEmbeddedServletContainerFactory.java
/phiz-web-core/src/main/resources/META-INF/phiz/spring/spring-phiz-web.xml
/phiz-web-parent/pom.xml
/phiz-web-portal/pom.xml
/phiz-web-ws/pom.xml
/phiz-web-ws/src/main/deb/control/control
/phiz-web-ws/src/main/deb/control/postinst
/phiz-web-ws/src/main/deb/control/postrm
/phiz-web-ws/src/main/deb/control/preinst
/phiz-web-ws/src/main/deb/control/prerm

=======================================
--- /dev/null
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/beans/factory/impl/PropertiesPropertyResolver.java
Thu Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,52 @@
+package gov.hhs.onc.phiz.beans.factory.impl;
+
+import com.github.sebhoss.warnings.CompilerWarnings;
+import java.util.Properties;
+import javax.annotation.Nullable;
+import org.springframework.core.env.AbstractPropertyResolver;
+
+public class PropertiesPropertyResolver extends AbstractPropertyResolver {
+ private Properties props;
+
+ public PropertiesPropertyResolver(Properties props) {
+ this.props = props;
+ }
+
+ @Nullable
+ @Override
+ @SuppressWarnings({ CompilerWarnings.UNCHECKED })
+ public <T> Class<T> getPropertyAsClass(String propName, Class<T>
propValueClass) {
+ T propValue = this.getProperty(propName, propValueClass);
+
+ return ((propValue != null) ? ((Class<T>) propValue.getClass()) :
null);
+ }
+
+ @Nullable
+ @Override
+ public String getProperty(String propName) {
+ return this.getProperty(propName, String.class);
+ }
+
+ @Nullable
+ @Override
+ public <T> T getProperty(String propName, Class<T> propValueClass) {
+ boolean propValueAssignable;
+ Object propValue;
+
+ return ((this.containsProperty(propName)
+ && ((propValueAssignable =
propValueClass.isAssignableFrom(String.class)) ||
this.conversionService.canConvert(String.class, propValueClass)) &&
((propValue =
+ this.getProperty(propName)) != null)) ? (propValueAssignable ?
propValueClass.cast(propValue) : this.conversionService.convert(propValue,
+ propValueClass)) : null);
+ }
+
+ @Override
+ public boolean containsProperty(String propName) {
+ return this.props.containsKey(propName);
+ }
+
+ @Nullable
+ @Override
+ protected String getPropertyAsRawString(String propName) {
+ return this.props.getProperty(propName);
+ }
+}
=======================================
--- /dev/null
+++ /phiz-core/src/main/java/gov/hhs/onc/phiz/utils/PhizStringUtils.java
Thu Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,22 @@
+package gov.hhs.onc.phiz.utils;
+
+import javax.annotation.Nullable;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.ObjectUtils;
+import org.springframework.util.StringUtils;
+
+public final class PhizStringUtils {
+ public final static String TOKEN_DELIMS = ",; \t\n";
+
+ private PhizStringUtils() {
+ }
+
+ public static String[] tokenize(@Nullable String str) {
+ return tokenize(str, null);
+ }
+
+ public static String[] tokenize(@Nullable String str, @Nullable String
defaultStr) {
+ return
ObjectUtils.defaultIfNull(StringUtils.tokenizeToStringArray(ObjectUtils.defaultIfNull(str,
defaultStr), TOKEN_DELIMS),
+ ArrayUtils.EMPTY_STRING_ARRAY);
+ }
+}
=======================================
--- /dev/null
+++ /phiz-core/src/main/resources/META-INF/aop.xml Thu Jan 22 06:01:46 2015
UTC
@@ -0,0 +1,4 @@
+<!DOCTYPE aspectj
PUBLIC "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
+<aspectj>
+ <weaver options="-warn:none -Xset:weaveJavaxPackages=true"/>
+</aspectj>
=======================================
--- /dev/null
+++ /phiz-core/src/main/scripts/groovy/phiz-process-properties.groovy Thu
Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,64 @@
+import gov.hhs.onc.phiz.beans.factory.impl.EmbeddedPlaceholderResolverImpl
+import gov.hhs.onc.phiz.beans.factory.impl.PropertiesPropertyResolver
+import java.util.stream.Collectors
+import java.util.stream.Stream
+import org.apache.commons.lang3.StringUtils
+import org.apache.commons.lang3.tuple.ImmutablePair
+import org.springframework.beans.factory.support.DefaultListableBeanFactory
+import org.springframework.boot.bind.PropertySourceUtils
+import
org.springframework.context.expression.StandardBeanExpressionResolver
+import org.springframework.core.env.StandardEnvironment
+import org.springframework.core.io.DefaultResourceLoader
+import org.springframework.core.io.support.PropertiesLoaderUtils
+import org.springframework.core.io.support.ResourcePatternResolver
+import org.springframework.core.io.support.ResourcePatternUtils
+import org.springframework.format.support.FormattingConversionService
+import org.springframework.util.StringValueResolver
+
+def pluginContextMap =
session.getPluginContext(mojoExecution.mojoDescriptor.pluginDescriptor,
project)
+
+def resourcePatternResolver =
ResourcePatternUtils.getResourcePatternResolver(new DefaultResourceLoader())
+pluginContextMap.put("resourcePatternResolver", resourcePatternResolver)
+
+def env = new StandardEnvironment()
+pluginContextMap.put("env", env)
+
+def convService = new FormattingConversionService()
+pluginContextMap.put("convService", convService)
+
+def props = new Properties()
+props.putAll(PropertySourceUtils.getSubProperties(env.getPropertySources(),
StringUtils.EMPTY))
+pluginContextMap.put("props", props)
+
+Stream.concat(Stream.of(resourcePatternResolver.getResources("${ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX}META-INF/phiz/phiz*-test.properties")),
+
Stream.of(resourcePatternResolver.getResources("${ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX}META-INF/phiz/phiz*.properties")))
+ .flatMap{
+ def loadedProps = PropertiesLoaderUtils.loadProperties(it)
+
+ return loadedProps.stringPropertyNames().stream().map{ new
ImmutablePair<>(it, loadedProps.getProperty(it, null)) }
+ }.forEach{ props.putIfAbsent(it.key, it.value) }
+
+def propResolver = new PropertiesPropertyResolver(props)
+propResolver.conversionService = convService
+propResolver.placeholderPrefix = "@{"
+pluginContextMap.put("propResolver", propResolver)
+
+def beanFactory = new DefaultListableBeanFactory()
+beanFactory.addEmbeddedValueResolver(new StringValueResolver() {
+ @Override
+ def String resolveStringValue(String str) {
+ return propResolver.resolveRequiredPlaceholders(str)
+ }
+})
+beanFactory.setBeanExpressionResolver(new StandardBeanExpressionResolver())
+pluginContextMap.put("beanFactory", beanFactory)
+
+def propPlaceholderResolver = new EmbeddedPlaceholderResolverImpl()
+propPlaceholderResolver.setBeanFactory(beanFactory)
+propPlaceholderResolver.afterPropertiesSet()
+pluginContextMap.put("propPlaceholderResolver", propPlaceholderResolver)
+
+def resolvedProps = new Properties()
+resolvedProps.putAll(props.stringPropertyNames().stream().collect(Collectors.toMap({
it
},
+ { propPlaceholderResolver.resolvePlaceholders(props.getProperty(it))
})))
+pluginContextMap.put("resolvedProps", resolvedProps)
=======================================
--- /dev/null
+++
/phiz-core/src/main/scripts/groovy/phiz-process-resources-app-scripts.groovy
Thu Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,18 @@
+ant.fileset(dir: "${project.properties["project.build.appassemblerDaemonsJswDirectory"]}/bin",
erroronmissingdir:
false, includes: project.artifactId).each{
+ it.file.write(it.file.text
+ .replaceFirst(~/\n\[\s+\-f\s+".BASEDIR"\/bin\/setenv\-\$\{APP_NAME\}\.sh\s+\]/,
+ "\n[ -f \"\\\${BASEDIR}/../../../etc/default/\\\${APP_NAME}\"
] && . \"\\\${BASEDIR}/../../../etc/default/\\\${APP_NAME}\"\n\$0")
+ .replaceFirst(~/(\n)#(RUN_AS_USER=)(\n)/, { it[1] + it[2] +
project.artifactId + it[3] + "RUN_AS_GROUP=" + project.artifactId + it[3] })
+ )
+}
+
+ant.fileset(dir: "${project.properties["project.build.appassemblerProgramsDirectory"]}/bin",
erroronmissingdir:
false,
+ includes: "${project.artifactId}-*").each{
+ it.file.write(it.file.text
+ .replaceFirst(~/^(#!\/bin\/sh\n)(?:#[^\n]*\n)+/, "\$1\nAPP_NAME=\"${it.file.name}\"")
+ .replaceFirst(~/\n\[\s+\-f\s+".BASEDIR"\/bin\/setenv\-\$\{APP_NAME\}\.sh\s+\]/,
+ "\n[ -f \"\\\${BASEDIR}/../../../etc/default/\\\${APP_NAME}\"
] && . \"\\\${BASEDIR}/../../../etc/default/\\\${APP_NAME}\"\n\$0")
+ .replaceFirst(~/(\nexec\s+".JAVACMD"\s+.JAVA_OPTS)([^\n]+)(\s+\\\n)/,
{
it[1] + it[2].replaceAll(~/\s+([^\s]+)/, " \\\\\n \$1") + it[3] })
+ .replaceAll(~/(\s+\-D)(app\.[a-z]+)/, "\$1phiz.\$2")
+ )
+}
=======================================
--- /dev/null
+++ /phiz-core/src/main/scripts/groovy/phiz-process-resources.groovy Thu
Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,13 @@
+import gov.hhs.onc.phiz.utils.PhizStringUtils
+
+def propPlaceholderResolver =
session.getPluginContext(mojoExecution.mojoDescriptor.pluginDescriptor,
project).get("propPlaceholderResolver")
+
+(ant.fileset(dir: dir) {
+ PhizStringUtils.tokenize(includes).each{
+ ant.include(name: it)
+ }
+
+ PhizStringUtils.tokenize(excludes).each{
+ ant.exclude(name: it)
+ }
+}).each {
it.file.write(propPlaceholderResolver.resolvePlaceholders(it.file.text)) }
=======================================
--- /dev/null
+++ /phiz-core/src/main/scripts/groovy/phiz-process-sources-ws.groovy Thu
Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,8 @@
+ant.fileset(dir:
project.properties["project.build.cxfGeneratedSourceDirectory"],
includes: "**/*.java").each{
+ if (it.file.name ==~ /^(package\-info|IIS[a-zA-Z]*Service)\.java$/) {
+ it.file.delete()
+ } else if (it.file.name ==~ /^((JAXBContext|Object)Factory)\.java$/) {
+
it.file.write(it.file.text.replaceFirst(~/(\npublic\s+class\s+[a-zA-Z]+\s+)/,
+ "\n@SuppressWarnings({
com.github.sebhoss.warnings.CompilerWarnings.RAWTYPES,
com.github.sebhoss.warnings.CompilerWarnings.UNCHECKED })\$1"))
+ }
+}
=======================================
--- /dev/null
+++ /phiz-core/src/test/scripts/groovy/phiz-process-test-deb-it.groovy Thu
Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,57 @@
+import java.nio.file.Files
+import java.nio.file.Paths
+import org.apache.commons.compress.archivers.ar.ArArchiveInputStream
+import org.apache.commons.compress.archivers.tar.TarArchiveInputStream
+import
org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream
+import org.apache.commons.io.IOUtils
+
+def debFileFileset = ant.fileset(dir: project.build.directory,
erroronmissingdir: false, includes: "${project.artifactId}_*.deb")
+
+if (debFileFileset.size() == 0) {
+ return
+}
+
+def debFileArchiveInStream = null
+def debFileArchiveEntry
+def debDataFileName = "data.tar.gz"
+def debDataFileArchiveInStream = null
+def debDataFileArchiveEntry
+def testDebDataDirPath =
Paths.get(project.properties["project.build.testDebDataDirectory"])
+def testDebDataEntryPath
+
+try {
+ debFileArchiveInStream = new
ArArchiveInputStream(debFileFileset[0].file.newInputStream())
+
+ while ((debFileArchiveEntry = debFileArchiveInStream.nextArEntry) !=
null) {
+ if (debFileArchiveEntry.name == debDataFileName) {
+ break
+ }
+ }
+
+ debDataFileArchiveInStream = new TarArchiveInputStream(new
GzipCompressorInputStream(new
ByteArrayInputStream(debFileArchiveInStream.bytes)))
+
+ while ((debDataFileArchiveEntry =
debDataFileArchiveInStream.nextTarEntry) != null) {
+ testDebDataEntryPath =
testDebDataDirPath.resolve(debDataFileArchiveEntry.name)
+
+ if (debDataFileArchiveEntry.symbolicLink) {
+ Files.createSymbolicLink(testDebDataEntryPath,
Paths.get(debDataFileArchiveEntry.linkName))
+ } else if (debDataFileArchiveEntry.directory) {
+ Files.createDirectories(testDebDataEntryPath)
+ } else if (debDataFileArchiveEntry.isFile()) {
+ testDebDataEntryPath.bytes =
IOUtils.toByteArray(debDataFileArchiveInStream,
debDataFileArchiveInStream.available())
+
+ if (((debDataFileArchiveEntry.mode & 0x111) - 0xff - 1) > 0) {
+ testDebDataEntryPath.toFile().setExecutable(true, false)
+ }
+ }
+ }
+} finally{
+ debFileArchiveInStream?.close()
+ debDataFileArchiveInStream?.close()
+}
+
+def testConfSslDirPath = Paths.get(project.build.directory, "surefire-ssl")
+
+ant.mkdir(dir: testConfSslDirPath.toFile())
+
+Files.createSymbolicLink(Paths.get(project.properties["project.build.testDebConfDataDirectory"], "ssl"),
testConfSslDirPath)
=======================================
--- /dev/null
+++ /phiz-core/src/test/scripts/groovy/phiz-process-test-rabbitmq-it.groovy
Thu Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,162 @@
+import gov.hhs.onc.phiz.crypto.ssl.PhizTlsVersions
+import java.nio.file.Paths
+import org.apache.commons.lang3.StringUtils
+import org.apache.maven.artifact.Artifact
+import org.apache.maven.artifact.DefaultArtifact
+import org.apache.maven.artifact.handler.DefaultArtifactHandler
+import
org.springframework.beans.factory.config.PlaceholderConfigurerSupport
+import org.springframework.core.io.FileSystemResource
+import org.springframework.core.io.support.PropertiesLoaderUtils
+import org.springframework.util.PropertyPlaceholderHelper
+
+def pluginContextMap =
session.getPluginContext(mojoExecution.mojoDescriptor.pluginDescriptor,
project)
+def resolvedProps = pluginContextMap.get("resolvedProps")
+def localRepo = project.projectBuildingRequest.localRepository
+
+def rabbitMqServerArtifact = new
DefaultArtifact("com.rabbitmq", "rabbitmq-server-generic-unix", "3.4.2",
Artifact.SCOPE_TEST, "tar.gz", StringUtils.EMPTY,
+ new DefaultArtifactHandler())
+def rabbitMqServerArtifactLocalRepoFile = new
File(localRepo.basedir, "${localRepo.pathOf(rabbitMqServerArtifact)}.${rabbitMqServerArtifact.type}")
+def rabbitMqServerArtifactFileName
= "${rabbitMqServerArtifact.artifactId}-${rabbitMqServerArtifact.version}.${rabbitMqServerArtifact.type}"
+def rabbitMqServerArtifactUrl
= "http://www.rabbitmq.com/releases/rabbitmq-server/current/${rabbitMqServerArtifactFileName}"
+
+def testItRabbitMqDir = new
File(project.properties["project.build.itDirectory"], "rabbitmq")
+
+if (!testItRabbitMqDir.exists()) {
+ return
+}
+
+def testItRabbitMqServerArtifactFile = new File(testItRabbitMqDir,
rabbitMqServerArtifactFileName)
+
+testItRabbitMqDir.mkdirs()
+
+if (!rabbitMqServerArtifactLocalRepoFile.exists()) {
+ ant.get(src: rabbitMqServerArtifactUrl, dest:
testItRabbitMqServerArtifactFile)
+
+ ant.exec(executable: "mvn", failonerror: true) {
+ ant.arg(value: "-q")
+ ant.arg(value: "install:install-file")
+ ant.arg(value: "-DgroupId=${rabbitMqServerArtifact.groupId}")
+ ant.arg(value: "-DartifactId=${rabbitMqServerArtifact.artifactId}")
+ ant.arg(value: "-Dversion=${rabbitMqServerArtifact.version}")
+ ant.arg(value: "-Dpackaging=${rabbitMqServerArtifact.type}")
+ ant.arg(value: "-DgeneratePom=true")
+ ant.arg(value: "-Dfile=${testItRabbitMqServerArtifactFile}")
+ }
+}
+
+ant.untar(src: rabbitMqServerArtifactLocalRepoFile, dest:
testItRabbitMqDir, compression: "gzip") {
+ ant.cutdirsmapper(dirs: 1)
+}
+
+def rabbitMqAdminExecArtifact = new
DefaultArtifact("com.rabbitmq", "rabbitmq-admin", "3.4.2",
Artifact.SCOPE_TEST, "py", StringUtils.EMPTY,
+ new DefaultArtifactHandler())
+def rabbitMqAdminExecArtifactLocalRepoFile = new
File(localRepo.basedir, "${localRepo.pathOf(rabbitMqAdminExecArtifact)}.${rabbitMqServerArtifact.type}")
+def rabbitMqAdminExecArtifactUrl
= "http://hg.rabbitmq.com/rabbitmq-management/raw-file/rabbitmq_v3_4_2/bin/rabbitmqadmin"
+
+def testItRabbitMqSbinDir = new File(testItRabbitMqDir, "sbin")
+def testItRabbitMqAdminExecFile = new
File(testItRabbitMqSbinDir, "rabbitmqadmin")
+def testItRabbitMqControlExecFile = new
File(testItRabbitMqSbinDir, "rabbitmqctl")
+def testItRabbitMqServerExecFile = new
File(testItRabbitMqSbinDir, "rabbitmq-server")
+
+if (!rabbitMqAdminExecArtifactLocalRepoFile.exists()) {
+ ant.get(src: rabbitMqAdminExecArtifactUrl, dest:
testItRabbitMqAdminExecFile)
+
+ ant.exec(executable: "mvn", failonerror: true) {
+ ant.arg(value: "-q")
+ ant.arg(value: "install:install-file")
+ ant.arg(value: "-DgroupId=${rabbitMqAdminExecArtifact.groupId}")
+
ant.arg(value: "-DartifactId=${rabbitMqAdminExecArtifact.artifactId}")
+ ant.arg(value: "-Dversion=${rabbitMqAdminExecArtifact.version}")
+ ant.arg(value: "-Dpackaging=${rabbitMqAdminExecArtifact.type}")
+ ant.arg(value: "-DgeneratePom=true")
+ ant.arg(value: "-Dfile=${testItRabbitMqAdminExecFile}")
+ }
+} else {
+ ant.copy(src: rabbitMqAdminExecArtifactLocalRepoFile, dest:
testItRabbitMqAdminExecFile)
+}
+
+ant.fileset(dir: testItRabbitMqSbinDir, includes: "rabbitmq*").each{
+ it.file.setExecutable(true, false)
+}
+
+def testDebShareDataDir = new
File(project.properties["project.build.testDebShareDataDirectory"])
+def testItRabbitMqConfDir =
Paths.get(testItRabbitMqDir.path, "etc", "rabbitmq").toFile()
+def testItRabbitMqEnvProps = PropertiesLoaderUtils.loadProperties(new
FileSystemResource(new File(testItRabbitMqConfDir, "rabbitmq-env.conf")))
+def testItRabbitMqEnvPropPlaceholderHelper = new
PropertyPlaceholderHelper(PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_PREFIX,
+ PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_SUFFIX)
+def testItRabbitMqPidFile = new File(testItRabbitMqSbinDir,
StringUtils.remove(testItRabbitMqEnvPropPlaceholderHelper.replacePlaceholders(
+ testItRabbitMqEnvProps.getProperty("PID_FILE"),
testItRabbitMqEnvProps), "\""))
+def testItRabbitMqMgmtHttpPort =
resolvedProps["phiz.rabbitmq.port.mgmt.http"]
+
+Thread testItRabbitMqShutdownHookThread = new Thread({
+ if (testItRabbitMqPidFile.exists()) {
+ log.info(String.format("Shutting down integration testing RabbitMQ
service (pid=%s).", StringUtils.trim(testItRabbitMqPidFile.text)))
+
+ ant.exec(executable: testItRabbitMqControlExecFile, dir:
testItRabbitMqSbinDir, spawn: true) {
+ ant.arg(value: "stop")
+ ant.arg(value: testItRabbitMqPidFile)
+ }
+ }
+})
+
+Runtime.runtime.addShutdownHook(testItRabbitMqShutdownHookThread)
+
+ant.exec(executable: testItRabbitMqServerExecFile, dir:
testItRabbitMqSbinDir, spawn: true) {
+ ant.arg(value: "-kernel")
+ ant.arg(value: "inet_dist_listen_min")
+ ant.arg(value: 0)
+ ant.arg(value: "-kernel")
+ ant.arg(value: "inet_dist_listen_max")
+ ant.arg(value: 0)
+ ant.arg(value: "-rabbit")
+ ant.arg(value: "log_levels")
+ ant.arg(value: "[{connection, info}]")
+ ant.arg(value: "-rabbit")
+ ant.arg(value: "tcp_listeners")
+ ant.arg(value: "[]")
+ ant.arg(value: "-rabbit")
+ ant.arg(value: "ssl_listeners")
+ ant.arg(value: "[${resolvedProps["phiz.rabbitmq.port.amqps"]}]")
+ ant.arg(value: "-rabbit")
+ ant.arg(value: "ssl_options")
+ ant.arg(value: """[
+ {cacertfile, "${new File(testDebShareDataDir,
resolvedProps["phiz.crypto.cred.ca.cert.file"])}"},
+ {certfile, "${new File(testDebShareDataDir,
resolvedProps["phiz.rabbitmq.crypto.server.cred.ssl.cert.file"])}"},
+ {fail_if_no_peer_cert, ${true}},
+ {honor_cipher_order, ${true}},
+ {keyfile, "${new File(testDebShareDataDir,
resolvedProps["phiz.rabbitmq.crypto.server.cred.ssl.key.private.file"])}"},
+ {secure_renegotiate, ${true}},
+ {verify, verify_peer},
+ {versions, ['${PhizTlsVersions.TLS_1_2_NAME.toLowerCase()}']}
+ ]""")
+ ant.arg(value: "-rabbit")
+ ant.arg(value: "ssl_cert_login_from")
+ ant.arg(value: "common_name")
+ ant.arg(value: "-rabbit")
+ ant.arg(value: "ssl_handshake_timeout")
+ ant.arg(value: 5000)
+ ant.arg(value: "-rabbit")
+ ant.arg(value: "auth_mechanisms")
+ ant.arg(value: "['EXTERNAL']")
+ ant.arg(value: "-rabbitmq_management")
+ ant.arg(value: "listener")
+ ant.arg(value: "[{port, ${testItRabbitMqMgmtHttpPort}}]")
+}
+
+ant.sleep(seconds: 2)
+
+if (testItRabbitMqPidFile.exists()) {
+ ant.exec(executable: testItRabbitMqControlExecFile, dir:
testItRabbitMqSbinDir, failonerror: true) {
+ ant.arg(value: "wait")
+ ant.arg(value: testItRabbitMqPidFile)
+ }
+}
+
+log.info(String.format("Integration testing RabbitMQ service started
(pid=%s).", StringUtils.trim(testItRabbitMqPidFile.text)))
+
+ant.exec(executable: testItRabbitMqAdminExecFile, dir:
testItRabbitMqSbinDir, failonerror: true) {
+ ant.arg(value: "-P")
+ ant.arg(value: testItRabbitMqMgmtHttpPort)
+ ant.arg(value: "import")
+ ant.arg(value: new
File(testItRabbitMqConfDir, "rabbitmq-broker-${project.artifactId}.json"))
+}
=======================================
--- /dev/null
+++
/phiz-core/src/test/scripts/groovy/phiz-process-test-resources-it.groovy
Thu Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,38 @@
+import groovy.xml.XmlUtil
+import org.apache.commons.lang3.StringUtils
+
+def itPomXmlFile = new File(dir, "pom.xml")
+
+if (!itPomXmlFile.exists()) {
+ return
+}
+
+def itPomXmlSlurper = new XmlSlurper(false, false)
+itPomXmlSlurper.keepIgnorableWhitespace = true
+
+def itPomXml = itPomXmlSlurper.parseText(itPomXmlFile.text)
+def itPomXmlDepsElem = itPomXml.dependencies
+
+project.dependencies.each{ dep ->
+ itPomXmlDepsElem.appendNode {
+ dependency {
+ groupId(dep.groupId)
+ artifactId(dep.artifactId)
+ version(dep.version)
+
+ if (dep.type != "jar") {
+ type(dep.type)
+ }
+
+ if (!StringUtils.isEmpty(dep.classifier)) {
+ classifier(dep.classifier)
+ }
+
+ if (dep.scope != "compile") {
+ scope(dep.scope)
+ }
+ }
+ }
+}
+
+itPomXmlFile.text = XmlUtil.serialize(itPomXml)
=======================================
--- /dev/null
+++ /phiz-tools/src/main/deb/control/postinst Thu Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+set -e
+
+pkgName="%{project.artifactId}"
+pkgUser="root"
+pkgGroup="adm"
+
+rootDir="$(pwd)"
+rootDir="${rootDir#*/}"
+
+case "$1" in
+ abort-deconfigure|abort-remove|abort-upgrade)
+ ;;
+
+ configure)
+ cacheDir="${rootDir}/var/cache/${pkgName}"
+ logDir="${rootDir}/var/log/${pkgName}"
+ runDir="${rootDir}/var/run/${pkgName}"
+ shareDir="${rootDir}/usr/share/${pkgName}"
+ varDir="${rootDir}/var/lib/${pkgName}"
+
+ chown -R "${pkgUser}:${pkgGroup}" "${cacheDir}"
+ chown -R "${pkgUser}:${pkgGroup}" "${logDir}"
+ chown -R "${pkgUser}:${pkgGroup}" "${runDir}"
+ chown -R "${pkgUser}:${pkgGroup}" "${varDir}"
+ ;;
+esac
+
+exit 0
=======================================
--- /dev/null
+++ /phiz-tools/src/main/deb/control/postrm Thu Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+set -e
+
+case "$1" in
+ abort-install|abort-upgrade|disappear|failed-upgrade|purge|remove|
upgrade)
+ ;;
+esac
+
+exit 0
=======================================
--- /dev/null
+++ /phiz-tools/src/main/deb/control/preinst Thu Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+set -e
+
+case "$1" in
+ abort-upgrade|install|upgrade)
+ ;;
+esac
+
+exit 0
=======================================
--- /dev/null
+++ /phiz-tools/src/main/deb/control/prerm Thu Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+set -e
+
+case "$1" in
+ deconfigure|failed-upgrade|upgrade)
+ ;;
+esac
+
+exit 0
=======================================
--- /dev/null
+++ /phiz-tools/src/main/deb/data/etc/logrotate.d/phiz-tools.logrotate Thu
Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,16 @@
+"/%{project.build.debLogDataDirectoryPath}/*.log" {
+ copytruncate
+ create 640 root adm
+ daily
+ dateext
+ dateformat .%Y-%m-%d
+ extension .log
+ missingok
+ nocompress
+ postrotate
+ chmod 640 "$1"
+ chown "root:adm" "$1"
+ endscript
+ rotate 51
+ sharedscripts
+}
=======================================
--- /dev/null
+++ /phiz-web-portal/src/main/deb/control/postinst Thu Jan 22 06:01:46 2015
UTC
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+set -e
+
+adminGroup="adm"
+pkgName="%{project.artifactId}"
+pkgUser="%{project.artifactId}"
+pkgGroup="%{project.artifactId}"
+
+rootDir="$(pwd)"
+rootDir="${rootDir#*/}"
+
+case "$1" in
+ abort-deconfigure|abort-remove|abort-upgrade)
+ ;;
+
+ configure)
+ cacheDir="${rootDir}/var/cache/${pkgName}"
+ logDir="${rootDir}/var/log/${pkgName}"
+ runDir="${rootDir}/var/run/${pkgName}"
+ shareDir="${rootDir}/usr/share/${pkgName}"
+ varDir="${rootDir}/var/lib/${pkgName}"
+
+ users="$(cut -d ":" -f 1 <"${rootDir}/etc/passwd" | sort)"
+ groups="$(cut -d ":" -f 1 <"${rootDir}/etc/group" | sort)"
+
+ [[ -n "$(printf "--" '%s\n%s' "${groups}" "${pkgGroup}" | sort |
uniq -d)" ]] || \
+ groupadd \
+ -r \
+ "${pkgGroup}"
+
+ [[ -n "$(printf "--" '%s\n%s' "${users}" "${pkgUser}" | sort |
uniq -d)" ]] || \
+ useradd \
+ -d "${shareDir}" \
+ -g "${pkgGroup}" \
+ -M \
+ -N \
+ -r \
+ -s "/bin/false" \
+ "${pkgUser}"
+
+ chown -R "${pkgUser}:${pkgGroup}" "${cacheDir}"
+ chown -R "${pkgUser}:${adminGroup}" "${logDir}"
+ chown -R "${pkgUser}:${pkgGroup}" "${runDir}"
+ chown -R "${pkgUser}:${pkgGroup}" "${varDir}"
+
+ update-rc.d "${pkgName}" "defaults"
+ ;;
+esac
+
+exit 0
=======================================
--- /dev/null
+++ /phiz-web-portal/src/main/deb/control/postrm Thu Jan 22 06:01:46 2015
UTC
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+set -e
+
+pkgName="%{project.artifactId}"
+pkgUser="%{project.artifactId}"
+pkgGroup="%{project.artifactId}"
+
+rootDir="$(pwd)"
+rootDir="${rootDir#*/}"
+
+case "$1" in
+ abort-install|abort-upgrade|disappear|failed-upgrade|upgrade)
+ ;;
+
+ purge|remove)
+ update-rc.d "${pkgName}" "remove"
+ ;;&
+
+ purge)
+ users="$(cut -d ":" -f 1 <"${rootDir}/etc/passwd" | sort)"
+
+ [[ -z "$(printf "--" '%s\n%s' "${users}" "${pkgUser}" | sort |
uniq -d)" ]] || userdel "${pkgUser}"
+
+ while read "groupLine"; do
+ [[ "$(cut -d ":" -f 1 <<<"${groupLine}")" != "${pkgGroup}" ]] |
| \
+ {
+ [[ -n "$(cut -d ":" -f 4 <<<"${groupLine}")" ]] || \
+ groupdel "${pkgGroup}"
+
+ break
+ }
+ done <"${rootDir}/etc/group"
+esac
+
+exit 0
=======================================
--- /dev/null
+++ /phiz-web-portal/src/main/deb/control/preinst Thu Jan 22 06:01:46 2015
UTC
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -e
+
+pkgName="%{project.artifactId}"
+pkgUser="%{project.artifactId}"
+pkgGroup="%{project.artifactId}"
+
+rootDir="$(pwd)"
+rootDir="${rootDir#*/}"
+
+case "$1" in
+ abort-upgrade)
+ ;;
+
+ install|upgrade)
+ ! service "${pkgName}" "status" &>"/dev/null" ||
service "${pkgName}" "stop"
+ ;;
+esac
+
+exit 0
=======================================
--- /dev/null
+++ /phiz-web-portal/src/main/deb/control/prerm Thu Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -e
+
+pkgName="%{project.artifactId}"
+
+case "$1" in
+ deconfigure)
+ ! service "${pkgName}" "status" &>"/dev/null" ||
service "${pkgName}" "stop"
+ ;;
+
+ failed-upgrade|upgrade)
+ ;;
+esac
+
+exit 0
=======================================
--- /dev/null
+++
/phiz-web-portal/src/main/deb/data/etc/logrotate.d/phiz-web-portal.logrotate
Thu Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,16 @@
+"/%{project.build.debLogDataDirectoryPath}/*.log" {
+ copytruncate
+ create 640 %{project.artifactId} adm
+ daily
+ dateext
+ dateformat .%Y-%m-%d
+ extension .log
+ missingok
+ nocompress
+ postrotate
+ chmod 640 "$1"
+ chown "%{project.artifactId}:adm" "$1"
+ endscript
+ rotate 51
+ sharedscripts
+}
=======================================
--- /dev/null
+++
/phiz-web-portal/src/main/deb/data/etc/phiz-web-portal/catalina-phiz-web-portal.policy
Thu Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,3 @@
+grant codeBase "file:lib/-" {
+ permission java.security.AllPermission;
+};
=======================================
--- /dev/null
+++ /phiz-web-ws/src/main/deb/data/etc/logrotate.d/phiz-web-ws.logrotate
Thu Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,16 @@
+"/%{project.build.debLogDataDirectoryPath}/*.log" {
+ copytruncate
+ create 640 %{project.artifactId} adm
+ daily
+ dateext
+ dateformat .%Y-%m-%d
+ extension .log
+ missingok
+ nocompress
+ postrotate
+ chmod 640 "$1"
+ chown "%{project.artifactId}:adm" "$1"
+ endscript
+ rotate 51
+ sharedscripts
+}
=======================================
--- /dev/null
+++
/phiz-web-ws/src/main/deb/data/etc/phiz-web-ws/catalina-phiz-web-ws.policy
Thu Jan 22 06:01:46 2015 UTC
@@ -0,0 +1,3 @@
+grant codeBase "file:lib/-" {
+ permission java.security.AllPermission;
+};
=======================================
--- /phiz-core/src/main/scripts/groovy/phiz-app-process-scripts.groovy Thu
Dec 18 15:30:39 2014 UTC
+++ /dev/null
@@ -1,17 +0,0 @@
-ant.fileset(dir: "${project.properties["project.build.appassemblerDaemonsJswDirectory"]}/bin",
erroronmissingdir:
false, includes: project.artifactId).each{
- it.file.write(it.file.text
- .replaceFirst(~/\n\[\s+\-f\s+".BASEDIR"\/bin\/setenv\-\$\{APP_NAME\}\.sh\s+\]/,
- "\n[ -f \"\\\${BASEDIR}/../../../etc/default/\\\${APP_NAME}\"
] && . \"\\\${BASEDIR}/../../../etc/default/\\\${APP_NAME}\"\n\$0")
- )
-}
-
-ant.fileset(dir: "${project.properties["project.build.appassemblerProgramsDirectory"]}/bin",
erroronmissingdir:
false,
- includes: "${project.artifactId}-*").each{
- it.file.write(it.file.text
- .replaceFirst(~/^(#!\/bin\/sh\n)(?:#[^\n]*\n)+/, "\$1\nAPP_NAME=\"${it.file.name}\"")
- .replaceFirst(~/\n\[\s+\-f\s+".BASEDIR"\/bin\/setenv\-\$\{APP_NAME\}\.sh\s+\]/,
- "\n[ -f \"\\\${BASEDIR}/../../../etc/default/\\\${APP_NAME}\"
] && . \"\\\${BASEDIR}/../../../etc/default/\\\${APP_NAME}\"\n\$0")
- .replaceFirst(~/(\nexec\s+".JAVACMD"\s+.JAVA_OPTS)([^\n]+)(\s+\\\n)/,
{
it[1] + it[2].replaceAll(~/\s+([^\s]+)/, " \\\\\n \$1") + it[3] })
- .replaceAll(~/(\s+\-D)(app\.[a-z]+)/, "\$1phiz.\$2")
- )
-}
=======================================
--- /phiz-core/src/main/scripts/groovy/phiz-ws-process-sources.groovy Mon
Dec 8 08:48:51 2014 UTC
+++ /dev/null
@@ -1,8 +0,0 @@
-ant.fileset(dir:
project.properties["project.build.cxfGeneratedSourceDirectory"],
includes: "**/*.java").each{
- if (it.file.name ==~ /^(package\-info|IIS[a-zA-Z]*Service)\.java$/) {
- it.file.delete()
- } else if (it.file.name ==~ /^((JAXBContext|Object)Factory)\.java$/) {
-
it.file.write(it.file.text.replaceFirst(~/(\npublic\s+class\s+[a-zA-Z]+\s+)/,
- "\n@SuppressWarnings({
com.github.sebhoss.warnings.CompilerWarnings.RAWTYPES,
com.github.sebhoss.warnings.CompilerWarnings.UNCHECKED })\$1"))
- }
-}
=======================================
--- /phiz-core/src/test/scripts/groovy/phiz-test-pre-it-process-deb.groovy
Sun Jan 4 15:55:30 2015 UTC
+++ /dev/null
@@ -1,57 +0,0 @@
-import java.nio.file.Files
-import java.nio.file.Paths
-import org.apache.commons.compress.archivers.ar.ArArchiveInputStream
-import org.apache.commons.compress.archivers.tar.TarArchiveInputStream
-import
org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream
-import org.apache.commons.io.IOUtils
-
-def debFileFileset = ant.fileset(dir: project.build.directory,
erroronmissingdir: false, includes: "${project.artifactId}_*.deb")
-
-if (debFileFileset.size() == 0) {
- return
-}
-
-def debFileArchiveInStream = null
-def debFileArchiveEntry
-def debDataFileName = "data.tar.gz"
-def debDataFileArchiveInStream = null
-def debDataFileArchiveEntry
-def testDebDataDirPath =
Paths.get(project.properties["project.build.testDebDataDirectory"])
-def testDebDataEntryPath
-
-try {
- debFileArchiveInStream = new
ArArchiveInputStream(debFileFileset[0].file.newInputStream())
-
- while ((debFileArchiveEntry = debFileArchiveInStream.nextArEntry) !=
null) {
- if (debFileArchiveEntry.name == debDataFileName) {
- break
- }
- }
-
- debDataFileArchiveInStream = new TarArchiveInputStream(new
GzipCompressorInputStream(new
ByteArrayInputStream(debFileArchiveInStream.bytes)))
-
- while ((debDataFileArchiveEntry =
debDataFileArchiveInStream.nextTarEntry) != null) {
- testDebDataEntryPath =
testDebDataDirPath.resolve(debDataFileArchiveEntry.name)
-
- if (debDataFileArchiveEntry.symbolicLink) {
- Files.createSymbolicLink(testDebDataEntryPath,
Paths.get(debDataFileArchiveEntry.linkName))
- } else if (debDataFileArchiveEntry.directory) {
- Files.createDirectories(testDebDataEntryPath)
- } else if (debDataFileArchiveEntry.isFile()) {
- testDebDataEntryPath.bytes =
IOUtils.toByteArray(debDataFileArchiveInStream,
debDataFileArchiveInStream.available())
-
- if (((debDataFileArchiveEntry.mode & 0x111) - 0xff - 1) > 0) {
- testDebDataEntryPath.toFile().setExecutable(true, false)
- }
- }
- }
-} finally{
- debFileArchiveInStream?.close()
- debDataFileArchiveInStream?.close()
-}
-
-def testConfSslDirPath = Paths.get(project.build.directory, "surefire-ssl")
-
-ant.mkdir(dir: testConfSslDirPath.toFile())
-
-Files.createSymbolicLink(Paths.get(project.properties["project.build.testDebConfDataDirectory"], "ssl"),
testConfSslDirPath)
=======================================
---
/phiz-core/src/test/scripts/groovy/phiz-test-pre-it-process-files.groovy
Sun Jan 4 15:55:30 2015 UTC
+++ /dev/null
@@ -1,103 +0,0 @@
-import gov.hhs.onc.phiz.context.PhizProperties
-import groovy.xml.XmlUtil
-import java.util.stream.Stream
-import org.apache.commons.lang3.StringUtils
-import org.springframework.beans.factory.config.BeanExpressionContext
-import org.springframework.beans.factory.support.DefaultListableBeanFactory
-import org.springframework.boot.bind.PropertySourceUtils
-import
org.springframework.context.expression.StandardBeanExpressionResolver
-import org.springframework.core.env.MapPropertySource
-import org.springframework.core.env.MutablePropertySources
-import org.springframework.core.env.PropertiesPropertySource
-import org.springframework.core.env.PropertySourcesPropertyResolver
-import org.springframework.core.env.StandardEnvironment
-import org.springframework.core.io.DefaultResourceLoader
-import org.springframework.core.io.support.PropertiesLoaderUtils
-import org.springframework.core.io.support.ResourcePatternResolver
-import org.springframework.core.io.support.ResourcePatternUtils
-
-def pluginContextMap =
session.getPluginContext(mojoExecution.mojoDescriptor.pluginDescriptor,
project)
-
-def resourcePatternResolver =
ResourcePatternUtils.getResourcePatternResolver(new DefaultResourceLoader())
-
-def beanFactory = new DefaultListableBeanFactory()
-beanFactory.setBeanExpressionResolver(new StandardBeanExpressionResolver())
-
-def beanExprResolver = beanFactory.beanExpressionResolver
-def beanExprContext = new BeanExpressionContext(beanFactory, null)
-
-def propSources = new MutablePropertySources()
-def propSourcesPropResolver = new
PropertySourcesPropertyResolver(propSources)
-
-propSources.addLast(new MapPropertySource(UUID.randomUUID().toString(),
PropertySourceUtils.getSubProperties(new
StandardEnvironment().getPropertySources(),
- StringUtils.EMPTY)));
-
-propSources.addLast(new
PropertiesPropertySource(UUID.randomUUID().toString(), project.properties))
-
-Stream.concat(Stream.of(resourcePatternResolver.getResources("${ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX}META-INF/phiz/phiz*-test.properties")),
-
Stream.of(resourcePatternResolver.getResources("${ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX}META-INF/phiz/phiz*.properties")))
- .map{ new PropertiesPropertySource(UUID.randomUUID().toString(),
PropertiesLoaderUtils.loadProperties(it)) }
- .forEach{ propSources.addLast(it) }
-
-def resolvedProps = new Properties()
-pluginContextMap.put("resolvedProps", resolvedProps)
-
-PropertySourceUtils.getSubProperties(propSources,
PhizProperties.PREFIX).forEach{ propName, propValue ->
- if (!resolvedProps.containsKey((propName = (PhizProperties.PREFIX +
propName)))) {
- resolvedProps.setProperty(propName,
Objects.toString(beanExprResolver.evaluate(propSourcesPropResolver.resolveRequiredPlaceholders(
- Objects.toString(propValue, null)), beanExprContext), null))
- }
-}
-
-def resolvedPropSources = new MutablePropertySources()
-resolvedPropSources.addLast(new
PropertiesPropertySource(UUID.randomUUID().toString(), resolvedProps))
-pluginContextMap.put("resolvedPropSources", resolvedPropSources)
-
-def resolvedPropSourcesPropResolver = new
PropertySourcesPropertyResolver(resolvedPropSources)
-resolvedPropSourcesPropResolver.setPlaceholderPrefix("@{")
-pluginContextMap.put("resolvedPropSourcesPropResolver",
resolvedPropSourcesPropResolver)
-
-(ant.fileset(dir: project.properties["project.build.itDirectory"]) {
- ant.include(name: "**/*.conf")
- ant.include(name: "**/*.config")
- ant.include(name: "**/*.json")
- ant.include(name: "**/*.properties")
- ant.include(name: "**/*.sql")
- ant.include(name: "**/*.xml")
-}).each{
- def itFileContent = it.file.text
-
- if (it.file.name == "pom.xml") {
- def itProjectXmlSlurper = new XmlSlurper(false, false)
- itProjectXmlSlurper.keepIgnorableWhitespace = true
-
- def itProjectXml = itProjectXmlSlurper.parseText(itFileContent)
- def itProjectXmlDepsElem = itProjectXml.dependencies
-
- project.dependencies.each{ dep ->
- itProjectXmlDepsElem.appendNode {
- dependency {
- groupId(dep.groupId)
- artifactId(dep.artifactId)
- version(dep.version)
-
- if (dep.type != "jar") {
- type(dep.type)
- }
-
- if (!StringUtils.isEmpty(dep.classifier)) {
- classifier(dep.classifier)
- }
-
- if (dep.scope != "compile") {
- scope(dep.scope)
- }
- }
- }
- }
-
- itFileContent = XmlUtil.serialize(itProjectXml)
- }
-
- it.file.write(((String)
beanExprResolver.evaluate(resolvedPropSourcesPropResolver.resolveRequiredPlaceholders(itFileContent),
beanExprContext)))
-}
=======================================
---
/phiz-core/src/test/scripts/groovy/phiz-test-pre-it-process-rabbitmq.groovy
Fri Jan 9 01:16:51 2015 UTC
+++ /dev/null
@@ -1,163 +0,0 @@
-import gov.hhs.onc.phiz.crypto.ssl.PhizTlsVersions
-import java.nio.file.Paths
-import org.apache.commons.lang3.StringUtils
-import org.apache.maven.artifact.Artifact
-import org.apache.maven.artifact.DefaultArtifact
-import org.apache.maven.artifact.handler.DefaultArtifactHandler
-import
org.springframework.beans.factory.config.PlaceholderConfigurerSupport
-import org.springframework.core.io.FileSystemResource
-import org.springframework.core.io.support.PropertiesLoaderUtils
-import org.springframework.util.PropertyPlaceholderHelper
-
-def pluginContextMap =
session.getPluginContext(mojoExecution.mojoDescriptor.pluginDescriptor,
project)
-def resolvedProps = pluginContextMap.get("resolvedProps")
-
-def localRepo = project.projectBuildingRequest.localRepository
-
-def rabbitMqServerArtifact = new
DefaultArtifact("com.rabbitmq", "rabbitmq-server-generic-unix", "3.4.2",
Artifact.SCOPE_TEST, "tar.gz", StringUtils.EMPTY,
- new DefaultArtifactHandler())
-def rabbitMqServerArtifactLocalRepoFile = new
File(localRepo.basedir, "${localRepo.pathOf(rabbitMqServerArtifact)}.${rabbitMqServerArtifact.type}")
-def rabbitMqServerArtifactFileName
= "${rabbitMqServerArtifact.artifactId}-${rabbitMqServerArtifact.version}.${rabbitMqServerArtifact.type}"
-def rabbitMqServerArtifactUrl
= "http://www.rabbitmq.com/releases/rabbitmq-server/current/${rabbitMqServerArtifactFileName}"
-
-def testItRabbitMqDir = new
File(project.properties["project.build.itDirectory"], "rabbitmq")
-
-if (!testItRabbitMqDir.exists()) {
- return
-}
-
-def testItRabbitMqServerArtifactFile = new File(testItRabbitMqDir,
rabbitMqServerArtifactFileName)
-
-testItRabbitMqDir.mkdirs()
-
-if (!rabbitMqServerArtifactLocalRepoFile.exists()) {
- ant.get(src: rabbitMqServerArtifactUrl, dest:
testItRabbitMqServerArtifactFile)
-
- ant.exec(executable: "mvn", failonerror: true) {
- ant.arg(value: "-q")
- ant.arg(value: "install:install-file")
- ant.arg(value: "-DgroupId=${rabbitMqServerArtifact.groupId}")
- ant.arg(value: "-DartifactId=${rabbitMqServerArtifact.artifactId}")
- ant.arg(value: "-Dversion=${rabbitMqServerArtifact.version}")
- ant.arg(value: "-Dpackaging=${rabbitMqServerArtifact.type}")
- ant.arg(value: "-DgeneratePom=true")
- ant.arg(value: "-Dfile=${testItRabbitMqServerArtifactFile}")
- }
-}
-
-ant.untar(src: rabbitMqServerArtifactLocalRepoFile, dest:
testItRabbitMqDir, compression: "gzip") {
- ant.cutdirsmapper(dirs: 1)
-}
-
-def rabbitMqAdminExecArtifact = new
DefaultArtifact("com.rabbitmq", "rabbitmq-admin", "3.4.2",
Artifact.SCOPE_TEST, "py", StringUtils.EMPTY,
- new DefaultArtifactHandler())
-def rabbitMqAdminExecArtifactLocalRepoFile = new
File(localRepo.basedir, "${localRepo.pathOf(rabbitMqAdminExecArtifact)}.${rabbitMqServerArtifact.type}")
-def rabbitMqAdminExecArtifactUrl
= "http://hg.rabbitmq.com/rabbitmq-management/raw-file/rabbitmq_v3_4_2/bin/rabbitmqadmin"
-
-def testItRabbitMqSbinDir = new File(testItRabbitMqDir, "sbin")
-def testItRabbitMqAdminExecFile = new
File(testItRabbitMqSbinDir, "rabbitmqadmin")
-def testItRabbitMqControlExecFile = new
File(testItRabbitMqSbinDir, "rabbitmqctl")
-def testItRabbitMqServerExecFile = new
File(testItRabbitMqSbinDir, "rabbitmq-server")
-
-if (!rabbitMqAdminExecArtifactLocalRepoFile.exists()) {
- ant.get(src: rabbitMqAdminExecArtifactUrl, dest:
testItRabbitMqAdminExecFile)
-
- ant.exec(executable: "mvn", failonerror: true) {
- ant.arg(value: "-q")
- ant.arg(value: "install:install-file")
- ant.arg(value: "-DgroupId=${rabbitMqAdminExecArtifact.groupId}")
-
ant.arg(value: "-DartifactId=${rabbitMqAdminExecArtifact.artifactId}")
- ant.arg(value: "-Dversion=${rabbitMqAdminExecArtifact.version}")
- ant.arg(value: "-Dpackaging=${rabbitMqAdminExecArtifact.type}")
- ant.arg(value: "-DgeneratePom=true")
- ant.arg(value: "-Dfile=${testItRabbitMqAdminExecFile}")
- }
-} else {
- ant.copy(src: rabbitMqAdminExecArtifactLocalRepoFile, dest:
testItRabbitMqAdminExecFile)
-}
-
-ant.fileset(dir: testItRabbitMqSbinDir, includes: "rabbitmq*").each{
- it.file.setExecutable(true, false)
-}
-
-def testDebShareDataDir = new
File(project.properties["project.build.testDebShareDataDirectory"])
-def testItRabbitMqConfDir =
Paths.get(testItRabbitMqDir.path, "etc", "rabbitmq").toFile()
-def testItRabbitMqEnvProps = PropertiesLoaderUtils.loadProperties(new
FileSystemResource(new File(testItRabbitMqConfDir, "rabbitmq-env.conf")))
-def testItRabbitMqEnvPropPlaceholderHelper = new
PropertyPlaceholderHelper(PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_PREFIX,
- PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_SUFFIX)
-def testItRabbitMqPidFile = new File(testItRabbitMqSbinDir,
StringUtils.remove(testItRabbitMqEnvPropPlaceholderHelper.replacePlaceholders(
- testItRabbitMqEnvProps.getProperty("PID_FILE"),
testItRabbitMqEnvProps), "\""))
-def testItRabbitMqMgmtHttpPort =
resolvedProps["phiz.rabbitmq.port.mgmt.http"]
-
-Thread testItRabbitMqShutdownHookThread = new Thread({
- if (testItRabbitMqPidFile.exists()) {
- log.info(String.format("Shutting down integration testing RabbitMQ
service (pid=%s).", StringUtils.trim(testItRabbitMqPidFile.text)))
-
- ant.exec(executable: testItRabbitMqControlExecFile, dir:
testItRabbitMqSbinDir, spawn: true) {
- ant.arg(value: "stop")
- ant.arg(value: testItRabbitMqPidFile)
- }
- }
-})
-
-Runtime.runtime.addShutdownHook(testItRabbitMqShutdownHookThread)
-
-ant.exec(executable: testItRabbitMqServerExecFile, dir:
testItRabbitMqSbinDir, spawn: true) {
- ant.arg(value: "-kernel")
- ant.arg(value: "inet_dist_listen_min")
- ant.arg(value: 0)
- ant.arg(value: "-kernel")
- ant.arg(value: "inet_dist_listen_max")
- ant.arg(value: 0)
- ant.arg(value: "-rabbit")
- ant.arg(value: "log_levels")
- ant.arg(value: "[{connection, info}]")
- ant.arg(value: "-rabbit")
- ant.arg(value: "tcp_listeners")
- ant.arg(value: "[]")
- ant.arg(value: "-rabbit")
- ant.arg(value: "ssl_listeners")
- ant.arg(value: "[${resolvedProps["phiz.rabbitmq.port.amqps"]}]")
- ant.arg(value: "-rabbit")
- ant.arg(value: "ssl_options")
- ant.arg(value: """[
- {cacertfile, "${new File(testDebShareDataDir,
resolvedProps["phiz.crypto.cred.ca.cert.file"])}"},
- {certfile, "${new File(testDebShareDataDir,
resolvedProps["phiz.rabbitmq.crypto.server.cred.ssl.cert.file"])}"},
- {fail_if_no_peer_cert, ${true}},
- {honor_cipher_order, ${true}},
- {keyfile, "${new File(testDebShareDataDir,
resolvedProps["phiz.rabbitmq.crypto.server.cred.ssl.key.private.file"])}"},
- {secure_renegotiate, ${true}},
- {verify, verify_peer},
- {versions, ['${PhizTlsVersions.TLS_1_2_NAME.toLowerCase()}']}
- ]""")
- ant.arg(value: "-rabbit")
- ant.arg(value: "ssl_cert_login_from")
- ant.arg(value: "common_name")
- ant.arg(value: "-rabbit")
- ant.arg(value: "ssl_handshake_timeout")
- ant.arg(value: 5000)
- ant.arg(value: "-rabbit")
- ant.arg(value: "auth_mechanisms")
- ant.arg(value: "['EXTERNAL']")
- ant.arg(value: "-rabbitmq_management")
- ant.arg(value: "listener")
- ant.arg(value: "[{port, ${testItRabbitMqMgmtHttpPort}}]")
-}
-
-ant.sleep(seconds: 2)
-
-if (testItRabbitMqPidFile.exists()) {
- ant.exec(executable: testItRabbitMqControlExecFile, dir:
testItRabbitMqSbinDir, failonerror: true) {
- ant.arg(value: "wait")
- ant.arg(value: testItRabbitMqPidFile)
- }
-}
-
-log.info(String.format("Integration testing RabbitMQ service started
(pid=%s).", StringUtils.trim(testItRabbitMqPidFile.text)))
-
-ant.exec(executable: testItRabbitMqAdminExecFile, dir:
testItRabbitMqSbinDir, failonerror: true) {
- ant.arg(value: "-P")
- ant.arg(value: testItRabbitMqMgmtHttpPort)
- ant.arg(value: "import")
- ant.arg(value: new
File(testItRabbitMqConfDir, "rabbitmq-broker-${project.artifactId}.json"))
-}
=======================================
--- /phiz-web-core/src/main/resources/META-INF/aop.xml Sun Jan 4 15:55:30
2015 UTC
+++ /dev/null
@@ -1,4 +0,0 @@
-<!DOCTYPE aspectj
PUBLIC "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
-<aspectj>
- <weaver options="-warn:none -Xset:weaveJavaxPackages=true"/>
-</aspectj>
=======================================
--- /phiz-core/pom.xml Tue Jan 20 22:42:18 2015 UTC
+++ /phiz-core/pom.xml Thu Jan 22 06:01:46 2015 UTC
@@ -129,6 +129,10 @@
<artifactId>cxf-rt-ws-policy</artifactId>
</dependency>
<dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
</dependency>
@@ -201,6 +205,10 @@
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-instrument</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</dependency>
@@ -500,23 +508,37 @@
<artifactId>gmavenplus-plugin</artifactId>
<executions>
<execution>
- <id>process-ws-sources</id>
+ <id>process-sources-ws</id>
<phase>process-sources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<scripts>
-
<script>file://${project.build.groovyScriptSourceDirectory}/phiz-ws-process-sources.groovy</script>
+
<script>file://${project.build.groovyScriptSourceDirectory}/phiz-process-sources-ws.groovy</script>
</scripts>
</configuration>
</execution>
<execution>
- <id>process-app-scripts</id>
+ <id>process-resources-app-scripts</id>
<phase>none</phase>
</execution>
<execution>
- <id>pre-integration-test-process-components</id>
+ <id>process-properties</id>
+ </execution>
+ <execution>
+ <id>process-test-resources</id>
+ </execution>
+ <execution>
+ <id>process-resources-deb-control</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>process-resources-deb-data</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>process-test-components-it</id>
<phase>none</phase>
</execution>
</executions>
=======================================
--- /phiz-core/src/main/cxf/logback-phiz-cxf-codegen.xml Mon Nov 24
00:46:37 2014 UTC
+++ /phiz-core/src/main/cxf/logback-phiz-cxf-codegen.xml Thu Jan 22
06:01:46 2015 UTC
@@ -3,15 +3,27 @@
debug="false"
xmlns="ch.qos.logback">

+
<!--====================================================================================================
+ = CONTEXT NAME
+
=====================================================================================================-->
<contextName>phiz-cxf-codegen</contextName>

+
<!--====================================================================================================
+ = STATUS LISTENERS
+
=====================================================================================================-->
<statusListener class="ch.qos.logback.core.status.NopStatusListener"/>

+
<!--====================================================================================================
+ = CONTEXT LISTENERS
+
=====================================================================================================-->
<contextListener
class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>

- <appender name="console-cxf-codegen"
class="ch.qos.logback.core.ConsoleAppender">
+
<!--====================================================================================================
+ = APPENDERS: CONSOLE
+
=====================================================================================================-->
+ <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder
class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%d{yyyy-MM-dd HH:mm:ss z} [%C:%L %t] %p
- %m%n%rEx</pattern>
</encoder>
@@ -19,10 +31,17 @@
<withJansi>true</withJansi>
</appender>

+
<!--====================================================================================================
+ = LOGGERS: APACHE
+
=====================================================================================================-->
<logger name="org.apache" level="info" additivity="false">
- <appender-ref ref="console-cxf-codegen"/>
+ <appender-ref ref="console"/>
</logger>
+
+
<!--====================================================================================================
+ = ROOT LOGGER
+
=====================================================================================================-->
<root level="warn">
- <appender-ref ref="console-cxf-codegen"/>
+ <appender-ref ref="console"/>
</root>
</configuration>
=======================================
---
/phiz-core/src/main/java/gov/hhs/onc/phiz/beans/factory/EmbeddedPlaceholderResolver.java
Tue Jan 20 22:42:18 2015 UTC
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/beans/factory/EmbeddedPlaceholderResolver.java
Thu Jan 22 06:01:46 2015 UTC
@@ -1,8 +1,9 @@
package gov.hhs.onc.phiz.beans.factory;

+import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.InitializingBean;

-public interface EmbeddedPlaceholderResolver extends InitializingBean {
+public interface EmbeddedPlaceholderResolver extends BeanFactoryAware,
InitializingBean {
public String resolvePlaceholders(String str);

public String resolvePlaceholders(String str, boolean asPropName);
=======================================
---
/phiz-core/src/main/java/gov/hhs/onc/phiz/beans/factory/impl/EmbeddedPlaceholderResolverImpl.java
Tue Jan 20 22:42:18 2015 UTC
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/beans/factory/impl/EmbeddedPlaceholderResolverImpl.java
Thu Jan 22 06:01:46 2015 UTC
@@ -2,7 +2,8 @@

import gov.hhs.onc.phiz.beans.factory.EmbeddedPlaceholderResolver;
import java.util.Objects;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.config.BeanExpressionContext;
import org.springframework.beans.factory.config.BeanExpressionResolver;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
@@ -11,9 +12,7 @@

@Component("embeddedPlaceholderResolverImpl")
public class EmbeddedPlaceholderResolverImpl implements
EmbeddedPlaceholderResolver {
- @Autowired
private ConfigurableBeanFactory beanFactory;
-
private BeanExpressionResolver beanExprResolver;
private BeanExpressionContext beanExprContext;

@@ -43,4 +42,9 @@
this.beanExprResolver =
this.beanFactory.getBeanExpressionResolver();
this.beanExprContext = new BeanExpressionContext(this.beanFactory,
null);
}
+
+ @Override
+ public void setBeanFactory(BeanFactory beanFactory) throws
BeansException {
+ this.beanFactory = ((ConfigurableBeanFactory) beanFactory);
+ }
}
=======================================
---
/phiz-core/src/main/java/gov/hhs/onc/phiz/context/impl/PhizApplication.java
Thu Dec 18 15:30:39 2014 UTC
+++
/phiz-core/src/main/java/gov/hhs/onc/phiz/context/impl/PhizApplication.java
Thu Jan 22 06:01:46 2015 UTC
@@ -7,7 +7,7 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

-@Configuration
+@Configuration("app")
@ImportResource({ "classpath*:META-INF/phiz/spring/spring-phiz*.xml" })
public abstract class PhizApplication {
public static void main(String ... args) {
=======================================
---
/phiz-core/src/main/resources/META-INF/phiz/logback/logback-phiz-include.xml
Fri Jan 9 08:17:07 2015 UTC
+++
/phiz-core/src/main/resources/META-INF/phiz/logback/logback-phiz-include.xml
Thu Jan 22 06:01:46 2015 UTC
@@ -60,17 +60,12 @@

=====================================================================================================-->
<if condition='isDefined("phiz.log.file.dir") &amp;&amp; !new
java.io.File(p("phiz.log.file.dir")).isFile()'>
<then>
- <appender name="file"
class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <appender name="file" class="ch.qos.logback.core.FileAppender">

<file>${phiz.log.file.dir}/${phiz.log.file.name}${phiz.log.file.name.ext}</file>
- <rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-
<fileNamePattern>${phiz.log.file.dir}/${phiz.log.file.name}.%d{yyyy-MM-dd}.%i${phiz.log.file.name.ext}</fileNamePattern>
- <timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
- <maxFileSize>100MB</maxFileSize>
- </timeBasedFileNamingAndTriggeringPolicy>
- </rollingPolicy>
<encoder
class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%d{yyyy-MM-dd HH:mm:ss z} [%C:%L %t]%xReq %p
- %m%n%rEx</pattern>
</encoder>
+ <prudent>true</prudent>
</appender>
</then>
<else>
=======================================
--- /phiz-parent/pom.xml Tue Jan 20 22:42:18 2015 UTC
+++ /phiz-parent/pom.xml Thu Jan 22 06:01:46 2015 UTC
@@ -284,6 +284,11 @@
<version>3.0.3</version>
</dependency>
<dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ <version>1.8.4</version>
+ </dependency>
+ <dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.51</version>
@@ -397,6 +402,11 @@
<scope>import</scope>
</dependency>
<dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-instrument</artifactId>
+ <version>4.1.4.RELEASE</version>
+ </dependency>
+ <dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-amqp</artifactId>
<version>1.4.2.RELEASE</version>
@@ -707,6 +717,8 @@

<directory>${project.build.debDataSourceDirectory}</directory>
<filtering>true</filtering>
<includes>
+
<include>etc/default/${project.artifactId}</include>
+
<include>etc/logrotate.d/${project.artifactId}.logrotate</include>

<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
@@ -714,6 +726,8 @@
<resource>

<directory>${project.build.debDataSourceDirectory}</directory>
<excludes>
+
<exclude>etc/default/${project.artifactId}</exclude>
+
<exclude>etc/logrotate.d/${project.artifactId}.logrotate</exclude>

<exclude>**/*.properties</exclude>
<exclude>**/*.xml</exclude>
</excludes>
@@ -851,8 +865,8 @@
<includes>
<include>**/*.conf</include>
<include>**/*.config</include>
+ <include>**/*.json</include>

<include>**/*.properties</include>
- <include>**/*.sql</include>
<include>**/*.xml</include>
</includes>
</resource>
@@ -861,8 +875,8 @@
<excludes>
<exclude>**/*.conf</exclude>
<exclude>**/*.config</exclude>
+ <exclude>**/*.json</exclude>

<exclude>**/*.properties</exclude>
- <exclude>**/*.sql</exclude>
<exclude>**/*.xml</exclude>
</excludes>
</resource>
@@ -899,9 +913,6 @@
<version>2.18</version>
<inherited>true</inherited>
<configuration>
- <argLine>
- -Xms256m -Xmx512m -Xss8m
-XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -XX:+UseG1GC
-XX:MaxGCPauseMillis=50 -XX:ParallelGCThreads=4 -XX:ConcGCThreads=4
- </argLine>
<reportFormat>plain</reportFormat>
<suiteXmlFiles>

<suiteXmlFile>${project.build.testngDirectory}/testng-${project.artifactId}.xml</suiteXmlFile>
@@ -927,6 +938,9 @@
<id>default-test</id>
<inherited>true</inherited>
<configuration>
+ <argLine>
+ -Xms256m -Xmx512m -Xss8m
-XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -XX:+UseG1GC
-XX:MaxGCPauseMillis=50 -XX:ParallelGCThreads=4 -XX:ConcGCThreads=4
+ </argLine>
<skip>${skipTests}</skip>
</configuration>
</execution>
@@ -938,6 +952,9 @@
</goals>
<inherited>true</inherited>
<configuration>
+ <argLine>
+ -Xms128m -Xmx256m
-XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=128m -XX:+UseG1GC
-XX:MaxGCPauseMillis=50 -XX:ParallelGCThreads=4 -XX:ConcGCThreads=4
-javaagent:lib/aspectjweaver-1.8.4.jar
-javaagent:lib/spring-instrument-4.1.4.RELEASE.jar
+ </argLine>
<reportNameSuffix>it</reportNameSuffix>
<skip>true</skip>
</configuration>
@@ -971,11 +988,6 @@
<version>3.3.2</version>
</dependency>
<dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-ant-tasks</artifactId>
- <version>2.1.3</version>
- </dependency>
- <dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.3.8</version>
@@ -983,11 +995,21 @@
</dependency>
</dependencies>
<configuration>
+ <properties combine.children="append">
+ <property>
+ <name>excludes</name>
+ <value/>
+ </property>
+ <property>
+ <name>includes</name>
+ <value>**/*</value>
+ </property>
+ </properties>
<scripts combine.children="append"/>
</configuration>
<executions>
<execution>
- <id>process-app-scripts</id>
+ <id>process-resources-app-scripts</id>
<phase>process-resources</phase>
<goals>
<goal>execute</goal>
@@ -995,22 +1017,126 @@
<inherited>true</inherited>
<configuration>
<scripts>
-
<script>file://${project.basedir.all}/phiz-core/src/main/scripts/groovy/phiz-app-process-scripts.groovy</script>
+
<script>file://${project.basedir.all}/phiz-core/src/main/scripts/groovy/phiz-process-resources-app-scripts.groovy</script>
</scripts>
</configuration>
</execution>
<execution>
-
<id>pre-integration-test-process-components</id>
+ <id>process-properties</id>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <inherited>true</inherited>
+ <configuration>
+ <scripts>
+
<script>file://${project.basedir.all}/phiz-core/src/main/scripts/groovy/phiz-process-properties.groovy</script>
+ </scripts>
+ </configuration>
+ </execution>
+ <execution>
+ <id>process-test-resources</id>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <inherited>true</inherited>
+ <configuration>
+ <properties>
+ <property>
+ <name>dir</name>
+
<value>${project.build.testOutputDirectory}/META-INF</value>
+ </property>
+ <property>
+ <name>excludes</name>
+ <value>
+ phiz/spring/**
+ </value>
+ </property>
+ <property>
+ <name>includes</name>
+ <value>
+ **/*.properties
+ **/*.xml
+ </value>
+ </property>
+ </properties>
+ <scripts>
+
<script>file://${project.basedir.all}/phiz-core/src/main/scripts/groovy/phiz-process-resources.groovy</script>
+ </scripts>
+ </configuration>
+ </execution>
+ <execution>
+ <id>process-resources-deb-control</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <inherited>true</inherited>
+ <configuration>
+ <properties>
+ <property>
+ <name>dir</name>
+
<value>${project.build.debControlDirectory}</value>
+ </property>
+ </properties>
+ <scripts>
+
<script>file://${project.basedir.all}/phiz-core/src/main/scripts/groovy/phiz-process-resources.groovy</script>
+ </scripts>
+ </configuration>
+ </execution>
+ <execution>
+ <id>process-resources-deb-data</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <inherited>true</inherited>
+ <configuration>
+ <properties>
+ <property>
+ <name>dir</name>
+
<value>${project.build.debDataDirectory}</value>
+ </property>
+ <property>
+ <name>includes</name>
+ <value>etc/**</value>
+ </property>
+ </properties>
+ <scripts>
+
<script>file://${project.basedir.all}/phiz-core/src/main/scripts/groovy/phiz-process-resources.groovy</script>
+ </scripts>
+ </configuration>
+ </execution>
+ <execution>
+ <id>process-test-components-it</id>
<phase>pre-integration-test</phase>
<goals>
<goal>execute</goal>
</goals>
<inherited>true</inherited>
<configuration>
+ <properties>
+ <property>
+ <name>dir</name>
+
<value>${project.build.itDirectory}</value>
+ </property>
+ <property>
+ <name>includes</name>
+ <value>
+ **/*.conf
+ **/*.config
+ **/*.json
+ **/*.properties
+ **/*.xml
+ </value>
+ </property>
+ </properties>
<scripts>
-
<script>file://${project.basedir.all}/phiz-core/src/test/scripts/groovy/phiz-test-pre-it-process-deb.groovy</script>
-
<script>file://${project.basedir.all}/phiz-core/src/test/scripts/groovy/phiz-test-pre-it-process-files.groovy</script>
-
<script>file://${project.basedir.all}/phiz-core/src/test/scripts/groovy/phiz-test-pre-it-process-rabbitmq.groovy</script>
+
<script>file://${project.basedir.all}/phiz-core/src/test/scripts/groovy/phiz-process-test-deb-it.groovy</script>
+
<script>file://${project.basedir.all}/phiz-core/src/main/scripts/groovy/phiz-process-resources.groovy</script>
+
<script>file://${project.basedir.all}/phiz-core/src/test/scripts/groovy/phiz-process-test-resources-it.groovy</script>
+
<script>file://${project.basedir.all}/phiz-core/src/test/scripts/groovy/phiz-process-test-rabbitmq-it.groovy</script>
</scripts>
<skip>${skipTests}</skip>
</configuration>
@@ -1196,13 +1322,13 @@

<controlDir>${project.build.debControlDirectory}</controlDir>
<dataSet combine.children="append">
<data>
-
<src>${project.build.debConfDataDirectory}</src>
+
<src>${project.build.debDataDirectory}/etc</src>
<type>directory</type>
<conffile>true</conffile>
<missingSrc>ignore</missingSrc>
<mapper>
<type>perm</type>
-
<prefix>/${project.build.debConfDataDirectoryPath}</prefix>
+ <prefix>/etc</prefix>
</mapper>
</data>
<data>
@@ -1232,7 +1358,7 @@
<data>

<src>${project.build.debDataDirectory}</src>
<type>directory</type>
-
<excludes>${project.build.debConfDataDirectoryPath}/**,${project.build.debShareBinDataDirectoryPath}/**</excludes>
+
<excludes>etc/**,${project.build.debShareBinDataDirectoryPath}/**</excludes>
</data>
<data>
<type>template</type>
=======================================
--- /phiz-tools/pom.xml Tue Jan 20 22:42:18 2015 UTC
+++ /phiz-tools/pom.xml Thu Jan 22 06:01:46 2015 UTC
@@ -70,6 +70,10 @@
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
</dependency>
@@ -118,6 +122,10 @@
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-instrument</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-loader</artifactId>
<scope>provided</scope>
@@ -259,10 +267,22 @@
<artifactId>gmavenplus-plugin</artifactId>
<executions>
<execution>
- <id>process-app-scripts</id>
+ <id>process-resources-app-scripts</id>
</execution>
<execution>
- <id>pre-integration-test-process-components</id>
+ <id>process-properties</id>
+ </execution>
+ <execution>
+ <id>process-test-resources</id>
+ </execution>
+ <execution>
+ <id>process-resources-deb-control</id>
+ </execution>
+ <execution>
+ <id>process-resources-deb-data</id>
+ </execution>
+ <execution>
+ <id>process-test-components-it</id>
</execution>
</executions>
</plugin>
=======================================
--- /phiz-tools/src/main/deb/control/control Wed Dec 3 17:31:58 2014 UTC
+++ /phiz-tools/src/main/deb/control/control Thu Jan 22 06:01:46 2015 UTC
@@ -5,5 +5,5 @@
Architecture: all
Maintainer: PHIZ Project <phiz-p...@esacinc.com>
Homepage: [[url]]
-Depends: oracle-java8-installer, oracle-java8-unlimited-jce-policy
+Depends: logrotate, oracle-java8-installer,
oracle-java8-unlimited-jce-policy
Description: Public Health Immunization Data Exchange (PHIZ) tools Debian
package.
=======================================
--- /phiz-web-core/pom.xml Tue Jan 20 22:42:18 2015 UTC
+++ /phiz-web-core/pom.xml Thu Jan 22 06:01:46 2015 UTC
@@ -94,7 +94,6 @@
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
@@ -147,12 +146,6 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-instrument-tomcat</artifactId>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
=======================================
---
/phiz-web-core/src/main/java/gov/hhs/onc/phiz/web/tomcat/impl/PhizTomcatEmbeddedServletContainerFactory.java
Fri Jan 9 08:17:07 2015 UTC
+++
/phiz-web-core/src/main/java/gov/hhs/onc/phiz/web/tomcat/impl/PhizTomcatEmbeddedServletContainerFactory.java
Thu Jan 22 06:01:46 2015 UTC
@@ -53,7 +53,7 @@
context.setTldValidation(true);
context.setXmlNamespaceAware(true);
context.setXmlValidation(true);
-
+
context.setLoginConfig(this.loginConfig);

super.configureContext(context,
ArrayUtils.add(servletContextInits, 0, ((servletContext) -> {
=======================================
---
/phiz-web-core/src/main/resources/META-INF/phiz/spring/spring-phiz-web.xml
Fri Jan 9 08:17:07 2015 UTC
+++
/phiz-web-core/src/main/resources/META-INF/phiz/spring/spring-phiz-web.xml
Thu Jan 22 06:01:46 2015 UTC
@@ -15,11 +15,6 @@
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd">

-
<!--====================================================================================================
- = CONTEXT
-
=====================================================================================================-->
- <context:load-time-weaver/>
-

<!--====================================================================================================
= SESSION COOKIE CONFIGURATIONS

=====================================================================================================-->
=======================================
--- /phiz-web-parent/pom.xml Tue Jan 20 22:42:18 2015 UTC
+++ /phiz-web-parent/pom.xml Thu Jan 22 06:01:46 2015 UTC
@@ -142,12 +142,6 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <version>1.8.4</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<version>3.0.0</version>
@@ -169,18 +163,6 @@
</exclusions>
</dependency>
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-instrument</artifactId>
- <version>4.1.4.RELEASE</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-instrument-tomcat</artifactId>
- <version>4.1.4.RELEASE</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>1.2.1.RELEASE</version>
@@ -350,20 +332,6 @@
</executions>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>test-integration</id>
- <configuration>
- <argLine combine.self="override">
- -Xms128m -Xmx256m
-XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=128m -XX:+UseG1GC
-XX:MaxGCPauseMillis=50 -XX:ParallelGCThreads=4 -XX:ConcGCThreads=4
-javaagent:lib/aspectjweaver-1.8.4.jar
-javaagent:lib/spring-instrument-4.1.4.RELEASE.jar
- </argLine>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.5</version>
@@ -439,12 +407,16 @@
<extraArguments>

<extraArgument>-Xss4m</extraArgument>

<extraArgument>-XX:MetaspaceSize=512m</extraArgument>
-
<extraArgument>-javaagent:lib/aspectjweaver-1.8.4.jar</extraArgument>
-
<extraArgument>-javaagent:lib/spring-instrument-4.1.4.RELEASE.jar</extraArgument>
+
<extraArgument>-javaagent:%REPO_DIR%/aspectjweaver-1.8.4.jar</extraArgument>
+
<extraArgument>-javaagent:%REPO_DIR%/spring-instrument-4.1.4.RELEASE.jar</extraArgument>
</extraArguments>

<initialMemorySize>1024M</initialMemorySize>

<maxMemorySize>2048M</maxMemorySize>

<maxStackSize>768M</maxStackSize>
+ <systemProperties>
+
<systemProperty>java.security.manager=</systemProperty>
+
<systemProperty>java.security.policy=conf/catalina-${project.artifactId}.policy</systemProperty>
+ </systemProperties>
</jvmSettings>
</daemon>
</daemons>
=======================================
--- /phiz-web-portal/pom.xml Tue Jan 20 22:42:18 2015 UTC
+++ /phiz-web-portal/pom.xml Thu Jan 22 06:01:46 2015 UTC
@@ -119,7 +119,6 @@
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
@@ -177,12 +176,6 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-instrument-tomcat</artifactId>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
@@ -412,10 +405,22 @@
<artifactId>gmavenplus-plugin</artifactId>
<executions>
<execution>
- <id>process-app-scripts</id>
+ <id>process-resources-app-scripts</id>
</execution>
<execution>
- <id>pre-integration-test-process-components</id>
+ <id>process-properties</id>
+ </execution>
+ <execution>
+ <id>process-test-resources</id>
+ </execution>
+ <execution>
+ <id>process-resources-deb-control</id>
+ </execution>
+ <execution>
+ <id>process-resources-deb-data</id>
+ </execution>
+ <execution>
+ <id>process-test-components-it</id>
</execution>
</executions>
</plugin>
@@ -467,6 +472,15 @@
<executions>
<execution>
<id>jdeb</id>
+ <configuration>
+ <dataSet>
+ <data>
+ <type>link</type>
+
<linkName>/etc/init.d/${project.artifactId}</linkName>
+
<linkTarget>../../${project.build.debShareBinDataDirectoryPath}/${project.artifactId}</linkTarget>
+ </data>
+ </dataSet>
+ </configuration>
</execution>
</executions>
</plugin>
=======================================
--- /phiz-web-ws/pom.xml Tue Jan 20 22:42:18 2015 UTC
+++ /phiz-web-ws/pom.xml Thu Jan 22 06:01:46 2015 UTC
@@ -145,7 +145,6 @@
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
@@ -202,12 +201,6 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-instrument-tomcat</artifactId>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
@@ -436,10 +429,22 @@
<artifactId>gmavenplus-plugin</artifactId>
<executions>
<execution>
- <id>process-app-scripts</id>
+ <id>process-resources-app-scripts</id>
</execution>
<execution>
- <id>pre-integration-test-process-components</id>
+ <id>process-properties</id>
+ </execution>
+ <execution>
+ <id>process-test-resources</id>
+ </execution>
+ <execution>
+ <id>process-resources-deb-control</id>
+ </execution>
+ <execution>
+ <id>process-resources-deb-data</id>
+ </execution>
+ <execution>
+ <id>process-test-components-it</id>
</execution>
</executions>
</plugin>
@@ -491,6 +496,15 @@
<executions>
<execution>
<id>jdeb</id>
+ <configuration>
+ <dataSet>
+ <data>
+ <type>link</type>
+
<linkName>/etc/init.d/${project.artifactId}</linkName>
+
<linkTarget>../../${project.build.debShareBinDataDirectoryPath}/${project.artifactId}</linkTarget>
+ </data>
+ </dataSet>
+ </configuration>
</execution>
</executions>
</plugin>
=======================================
--- /phiz-web-ws/src/main/deb/control/control Wed Dec 3 17:31:58 2014 UTC
+++ /phiz-web-ws/src/main/deb/control/control Thu Jan 22 06:01:46 2015 UTC
@@ -5,5 +5,5 @@
Architecture: all
Maintainer: PHIZ Project <phiz-p...@esacinc.com>
Homepage: [[url]]
-Depends: authbind, oracle-java8-installer,
oracle-java8-unlimited-jce-policy
+Depends: authbind, logrotate, oracle-java8-installer,
oracle-java8-unlimited-jce-policy
Description: Public Health Immunization Data Exchange (PHIZ) web services
web application Debian package.
=======================================
--- /phiz-web-ws/src/main/deb/control/postinst Wed Dec 3 17:31:58 2014 UTC
+++ /phiz-web-ws/src/main/deb/control/postinst Thu Jan 22 06:01:46 2015 UTC
@@ -2,9 +2,49 @@

set -e

+adminGroup="adm"
+pkgName="%{project.artifactId}"
+pkgUser="%{project.artifactId}"
+pkgGroup="%{project.artifactId}"
+
+rootDir="$(pwd)"
+rootDir="${rootDir#*/}"
+
case "$1" in
- abort-deconfigure|abort-remove|abort-upgrade|configure)
- #service "%{project.artifactId}-tomcat" "status" &>"/dev/null" ||
{ service "%{project.artifactId}-tomcat" "start" || true; }
+ abort-deconfigure|abort-remove|abort-upgrade)
+ ;;
+
+ configure)
+ cacheDir="${rootDir}/var/cache/${pkgName}"
+ logDir="${rootDir}/var/log/${pkgName}"
+ runDir="${rootDir}/var/run/${pkgName}"
+ shareDir="${rootDir}/usr/share/${pkgName}"
+ varDir="${rootDir}/var/lib/${pkgName}"
+
+ users="$(cut -d ":" -f 1 <"${rootDir}/etc/passwd" | sort)"
+ groups="$(cut -d ":" -f 1 <"${rootDir}/etc/group" | sort)"
+
+ [[ -n "$(printf "--" '%s\n%s' "${groups}" "${pkgGroup}" | sort |
uniq -d)" ]] || \
+ groupadd \
+ -r \
+ "${pkgGroup}"
+
+ [[ -n "$(printf "--" '%s\n%s' "${users}" "${pkgUser}" | sort |
uniq -d)" ]] || \
+ useradd \
+ -d "${shareDir}" \
+ -g "${pkgGroup}" \
+ -M \
+ -N \
+ -r \
+ -s "/bin/false" \
+ "${pkgUser}"
+
+ chown -R "${pkgUser}:${pkgGroup}" "${cacheDir}"
+ chown -R "${pkgUser}:${adminGroup}" "${logDir}"
+ chown -R "${pkgUser}:${pkgGroup}" "${runDir}"
+ chown -R "${pkgUser}:${pkgGroup}" "${varDir}"
+
+ update-rc.d "${pkgName}" "defaults"
;;
esac

=======================================
--- /phiz-web-ws/src/main/deb/control/postrm Wed Dec 3 17:31:58 2014 UTC
+++ /phiz-web-ws/src/main/deb/control/postrm Thu Jan 22 06:01:46 2015 UTC
@@ -2,10 +2,35 @@

set -e

+pkgName="%{project.artifactId}"
+pkgUser="%{project.artifactId}"
+pkgGroup="%{project.artifactId}"
+
+rootDir="$(pwd)"
+rootDir="${rootDir#*/}"
+
case "$1" in
- abort-install|abort-upgrade|disappear|failed-upgrade|purge|remove|
upgrade)
- #service "%{project.artifactId}-tomcat" "status" &>"/dev/null" ||
{ service "%{project.artifactId}-tomcat" "start" || true; }
+ abort-install|abort-upgrade|disappear|failed-upgrade|upgrade)
;;
+
+ purge|remove)
+ update-rc.d "${pkgName}" "remove"
+ ;;&
+
+ purge)
+ users="$(cut -d ":" -f 1 <"${rootDir}/etc/passwd" | sort)"
+
+ [[ -z "$(printf "--" '%s\n%s' "${users}" "${pkgUser}" | sort |
uniq -d)" ]] || userdel "${pkgUser}"
+
+ while read "groupLine"; do
+ [[ "$(cut -d ":" -f 1 <<<"${groupLine}")" != "${pkgGroup}" ]] |
| \
+ {
+ [[ -n "$(cut -d ":" -f 4 <<<"${groupLine}")" ]] || \
+ groupdel "${pkgGroup}"
+
+ break
+ }
+ done <"${rootDir}/etc/group"
esac

exit 0
=======================================
--- /phiz-web-ws/src/main/deb/control/preinst Wed Dec 3 17:31:58 2014 UTC
+++ /phiz-web-ws/src/main/deb/control/preinst Thu Jan 22 06:01:46 2015 UTC
@@ -2,9 +2,19 @@

set -e

+pkgName="%{project.artifactId}"
+pkgUser="%{project.artifactId}"
+pkgGroup="%{project.artifactId}"
+
+rootDir="$(pwd)"
+rootDir="${rootDir#*/}"
+
case "$1" in
- abort-upgrade|install|upgrade)
- #! service "%{project.artifactId}-tomcat" "status" &>"/dev/null" |
| { service "%{project.artifactId}-tomcat" "stop" || true; }
+ abort-upgrade)
+ ;;
+
+ install|upgrade)
+ ! service "${pkgName}" "status" &>"/dev/null" ||
service "${pkgName}" "stop"
;;
esac

=======================================
--- /phiz-web-ws/src/main/deb/control/prerm Wed Dec 3 17:31:58 2014 UTC
+++ /phiz-web-ws/src/main/deb/control/prerm Thu Jan 22 06:01:46 2015 UTC
@@ -2,9 +2,14 @@

set -e

+pkgName="%{project.artifactId}"
+
case "$1" in
- deconfigure|failed-upgrade|remove|upgrade)
- #! service "%{project.artifactId}-tomcat" "status" &>"/dev/null" |
| { service "%{project.artifactId}-tomcat" "stop" || true; }
+ deconfigure)
+ ! service "${pkgName}" "status" &>"/dev/null" ||
service "${pkgName}" "stop"
+ ;;
+
+ failed-upgrade|upgrade)
;;
esac

Reply all
Reply to author
Forward
0 new messages