Skip to content

Commit

Permalink
MGR-91 fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
madness-inc committed Jan 14, 2020
1 parent 08ffd8a commit ea2eb33
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Expand Up @@ -15,12 +15,15 @@
*/
package org.appng.application.manager.business;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

import javax.persistence.EntityManager;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.appng.api.Platform;
import org.appng.api.SiteProperties;
Expand All @@ -46,7 +49,8 @@
import org.springframework.test.context.ContextConfiguration;

@Ignore
@ContextConfiguration(locations = { TestBase.TESTCONTEXT_CORE, TestBase.TESTCONTEXT_JPA }, initializers = AbstractTest.class)
@ContextConfiguration(locations = { TestBase.TESTCONTEXT_CORE,
TestBase.TESTCONTEXT_JPA }, initializers = AbstractTest.class)
public class AbstractTest extends TestBase {

@Autowired
Expand Down Expand Up @@ -86,6 +90,12 @@ protected AbstractTest() {
setUseFullClassname(false);
setEntityPackage("org.appng.core.domain");
setRepositoryBase("org.appng.core.repository");
try {
FileUtils.copyInputStreamToFile(getClass().getClassLoader().getResourceAsStream("log4j.properties"),
new File("target/ROOT/WEB-INF/conf/log4j.properties"));
} catch (IOException e) {
throw new RuntimeException(e);
}
}

@Before
Expand Down Expand Up @@ -114,6 +124,7 @@ protected Properties getProperties() {
Properties properties = super.getProperties();
properties.put("hibernate.show_sql", "false");
properties.put("hibernate.format_sql", "false");
properties.put("platform.platformRootPath", "target/ROOT");
return properties;
}

Expand Down
5 changes: 4 additions & 1 deletion src/test/resources/log4j.properties
Expand Up @@ -3,4 +3,7 @@ log4j.threshold = ALL

log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern = %d{ISO8601} %-5p [%t] %-30c: %m%n
log4j.appender.stdout.layout.ConversionPattern = %d{ISO8601} %-5p [%t] %-30c: %m%n

# for unit testing
log4j.appender.appng.File = ${webapp.root}/appNG.log

0 comments on commit ea2eb33

Please sign in to comment.