Skip to content

Commit

Permalink
Added simple JUnit tests - fix #5
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Dubois committed Nov 5, 2013
1 parent 2ad3fd1 commit f3ab366
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 37 deletions.
2 changes: 1 addition & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ JhipsterGenerator.prototype.app = function app() {
this.mkdir(testDir);
this.template('src/test/java/package/test/_ApplicationTestConfiguration.java', testDir + 'test/ApplicationTestConfiguration.java');
this.template('src/test/java/package/web/rest/_UserResourceTest.java', testDir + 'web/rest/UserResourceTest.java');
this.copy(testResourceDir + 'META-INF/application/application.properties', testResourceDir + 'META-INF/' + this.baseName + '/' + this.baseName + '.properties');
this.template(testResourceDir + 'META-INF/spring/_applicationContext-database.xml', testResourceDir + 'META-INF/spring/applicationContext-database.xml');
this.copy(testResourceDir + 'logback.xml', testResourceDir + 'logback.xml');
this.template(testResourceDir + '_ehcache.xml', testResourceDir + 'ehcache.xml');

// Create Webapp
var webappDir = 'src/main/webapp/';
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation= "http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/data/jpa
http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd">

<context:property-placeholder location="classpath:/META-INF/<%= baseName %>/<%= baseName %>.properties"/>

<tx:annotation-driven/>

<bean id="dataSource"
class="org.apache.tomcat.jdbc.pool.DataSource">

<property name="driverClassName" value="<%= _.unescape('\$\{datasource.driverclassname}')%>"/>
<property name="url" value="<%= _.unescape('\$\{datasource.url}')%>"/>
<property name="username" value="<%= _.unescape('\$\{datasource.username}')%>"/>
<property name="password" value="<%= _.unescape('\$\{datasource.password}')%>"/>
<property name="initialSize" value="<%= _.unescape('\$\{datasource.initialSize}')%>"/>
<property name="minIdle" value="<%= _.unescape('\$\{datasource.minIdle}')%>"/>
<property name="maxIdle" value="<%= _.unescape('\$\{datasource.maxIdle}')%>"/>
<property name="maxActive" value="<%= _.unescape('\$\{datasource.maxActive}')%>"/>
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
<property name="url" value="jdbc:hsqldb:mem:test"/>
<property name="username" value=""/>
<property name="password" value=""/>
<property name="initialSize" value="1"/>
<property name="minIdle" value="1"/>
<property name="maxIdle" value="1"/>
<property name="maxActive" value="1"/>
</bean>

<bean id="transactionManager"
Expand Down
36 changes: 36 additions & 0 deletions app/templates/src/test/resources/_ehcache.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd"
name="CM1"
updateCheck="false"
maxBytesLocalHeap="16M">

<diskStore path="java.io.tmpdir"/>

<defaultCache
eternal="false"
overflowToDisk="false"
/>

<cache name="<%=packageName%>.domain.User"
timeToLiveSeconds="3600">
</cache>

<cache name="<%=packageName%>.domain.Authority"
timeToLiveSeconds="3600">
</cache>

<cache name="<%=packageName%>.domain.User.authorities"
timeToLiveSeconds="3600">
</cache>

<cache name="<%=packageName%>.domain.PersistentToken"
timeToLiveSeconds="3600">
</cache>

<cache name="<%=packageName%>.domain.User.persistentTokens"
timeToLiveSeconds="3600">
</cache>

</ehcache>

0 comments on commit f3ab366

Please sign in to comment.