Clean up formatting

This commit is contained in:
David Morley 2016-04-11 05:26:50 -05:00
parent 44c327d1a3
commit ce2891ed68
4 changed files with 86 additions and 89 deletions

View File

@ -1,12 +1,10 @@
# Root logger option
log4j.rootLogger=DEBUG, file
# Redirect log messages to console
# log4j.appender.stdout=org.apache.log4j.ConsoleAppender
# log4j.appender.stdout.Target=System.out
# log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
# Redirect log messages to a log file, support file rolling.
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=D:\\Test\\xstream-application.log

View File

@ -1,14 +1,13 @@
package com.baeldung.test;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import com.baeldung.initializer.SimpleXstreamInitializer;
import com.baeldung.pojo.ContactDetails;
import com.baeldung.pojo.Customer;
import com.baeldung.utility.SimpleDataGeneration;
import com.thoughtworks.xstream.XStream;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class XStreamJettisonTest {
@ -28,9 +27,9 @@ public class XStreamJettisonTest {
@Test
public void convertObjectToJson() {
customer = SimpleDataGeneration.generateData();
xstream.alias("customer" , Customer.class);
xstream.alias("contactDetails" , ContactDetails.class);
xstream.aliasField("fn" , Customer.class , "firstName");
xstream.alias("customer", Customer.class);
xstream.alias("contactDetails", ContactDetails.class);
xstream.aliasField("fn", Customer.class, "firstName");
dataJson = xstream.toXML(customer);
System.out.println(dataJson);
Assert.assertNotNull(dataJson);