#543 - Tidy up test logging - adjust test LoggedSqlCollector - remove logging noise when running tests

This commit is contained in:
Robin Bygrave
2016-01-27 20:12:36 +13:00
parent 424a83fa0a
commit 24151f11fd
8 changed files with 12 additions and 32 deletions
@@ -30,7 +30,6 @@ public class PrimaryServerTest {
public void testLoadProperties() throws Exception {
Properties properties = PrimaryServer.getProperties();
System.out.println(properties);
assertTrue(properties.size() > 0);
}
}
@@ -2,15 +2,11 @@ package com.avaje.ebean.dbmigration.migrationreader;
import com.avaje.ebean.dbmigration.migration.Migration;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
public class MigrationXmlWriterTest {
Logger logger = LoggerFactory.getLogger(MigrationXmlWriterTest.class);
@Test
public void testReadWrite() throws Exception {
@@ -20,7 +16,5 @@ public class MigrationXmlWriterTest {
MigrationXmlWriter writer = new MigrationXmlWriter();
writer.write(migration, temp);
logger.info("wrote migration file: "+temp.getAbsolutePath());
}
}
@@ -34,8 +34,6 @@ public class TestLazyLoadEmptyCollection extends BaseTestCase {
for (Contact contact : contacts) {
contact.getNotes();
}
System.out.println(customer);
System.out.println(contacts);
}
}
@@ -102,9 +102,6 @@ public class TestChangeLog extends BaseTestCase {
this.changes = changes;
try {
String json = objectMapper.writeValueAsString(changes);
logger.info(json);
ChangeSet changes1 = objectMapper.readValue(json, ChangeSet.class);
assertEquals(changes.getTxnId(), changes1.getTxnId());
@@ -61,7 +61,10 @@ public class TestQueryFindIterate extends BaseTestCase {
Order order = queryIterator.next();
Customer customer = order.getCustomer();
// invoke lazy loading on customer, order details and order shipments
System.out.println("order: " + order.getId() + " customerName:" + customer.getName()+" details:"+order.getDetails().size()+" shipments:"+order.getShipments().size());
order.getId();
customer.getName();
order.getDetails().size();
order.getShipments().size();
}
} finally {
@@ -22,7 +22,6 @@ public class TestQueryJoinMulipleMany extends BaseTestCase {
.gt("id", 0).findList();
Assert.assertNotNull(list);
System.out.println(list);
for (Order order : list) {
List<Contact> contacts = order.getCustomer().getContacts();
@@ -17,11 +17,9 @@ public class TestWhereLikeWithSlash extends BaseTestCase {
basic.setName("slash\\monkey");
Ebean.save(basic);
Query<EBasic> query = Ebean.find(EBasic.class).where().like("name", "slash\\mon%").query();
List<EBasic> list = query.findList();
query.findList();
// This doesn't work in the latest version of H2 so disable for now.
// Still good on Postgres which was the original issue
@@ -1,27 +1,23 @@
package com.avaje.tests.text.json;
import java.io.IOException;
import java.util.TimeZone;
import org.junit.Assert;
import org.junit.Test;
import com.avaje.ebean.BaseTestCase;
import com.avaje.ebean.Ebean;
import com.avaje.ebean.text.json.JsonContext;
import com.avaje.tests.model.basic.BeanWithTimeZone;
import org.junit.Assert;
import org.junit.Test;
import java.io.IOException;
import java.util.TimeZone;
public class TestJsonBeanWithTimeZone extends BaseTestCase {
//private static final Logger logger = LoggerFactory.getLogger(TestJsonBeanWithTimeZone.class);
@Test
public void testSimple() throws IOException {
TimeZone defaultTimeZone = TimeZone.getDefault();
String[] ids = TimeZone.getAvailableIDs(defaultTimeZone.getRawOffset());
System.out.println(ids);
TimeZone.getAvailableIDs(defaultTimeZone.getRawOffset());
String id = defaultTimeZone.getID();
TimeZone timeZone = TimeZone.getTimeZone(id);
@@ -43,10 +39,6 @@ public class TestJsonBeanWithTimeZone extends BaseTestCase {
Assert.assertEquals(bean.getTimezone(), bean3.getTimezone());
// EbeanServer server = Ebean.getServer(null);
// server.shutdown();
// logger.info("shudown server manually, JVM shutdown hook fires next");
}
}