[sci-flex] r431 committed - Aligned code.

0 views
Skip to first unread message

codesite...@google.com

unread,
Sep 6, 2009, 1:29:06 PM9/6/09
to sci-fl...@googlegroups.com
Revision: 431
Author: senakafdo
Date: Sun Sep 6 10:26:30 2009
Log: Aligned code.

http://code.google.com/p/sci-flex/source/detail?r=431

Modified:

/sci-flex/trunk/java/axiom/src/test/java/org/apache/axiom/om/AbstractTestCase.java

/sci-flex/trunk/java/axiom/src/test/java/org/apache/axiom/om/MapDataSourceJavaSerializerSerializationTest.java

/sci-flex/trunk/java/axiom/src/test/java/org/apache/axiom/om/MapDataSourceSerializationTest.java

/sci-flex/trunk/java/axiom/src/test/java/org/apache/axiom/om/MapDataSourceXMLStreamReaderSerializationTest.java

=======================================
---
/sci-flex/trunk/java/axiom/src/test/java/org/apache/axiom/om/AbstractTestCase.java
Sun Sep 6 10:23:49 2009
+++
/sci-flex/trunk/java/axiom/src/test/java/org/apache/axiom/om/AbstractTestCase.java
Sun Sep 6 10:26:30 2009
@@ -30,14 +30,14 @@

import org.custommonkey.xmlunit.XMLTestCase;

-/**
+/**
* Abstract base class for test cases.
*/
public abstract class AbstractTestCase extends XMLTestCase {

/**
* Test Directory.
- */
+ */
protected String testDir = "test" + File.separator;

/**
@@ -65,12 +65,12 @@
*/
protected String testResourceDir = "test-resources";

- /**
+ /**
* Basedir for all file I/O. Important when running tests from the
reactor.
*/
public String basedir = System.getProperty("basedir");

- /**
+ /**
* Construct a new test case. Test must implement their own constructor
* which must pass the name parameter to it's super class.
*
@@ -89,7 +89,7 @@

/**
* Obtains a {@link File} handle for the test resource file.
- *
+ *
* @param relativePath the relative path to required resource.
* @return test resource file
*/
@@ -97,9 +97,9 @@
return new File(testResourceDir, relativePath);
}

- /**
+ /**
* Obtains a {@link File} handle for the temporary output file.
- *
+ *
* @param filename the path name of the file.
* @return temporary output file
*/
=======================================
---
/sci-flex/trunk/java/axiom/src/test/java/org/apache/axiom/om/MapDataSourceJavaSerializerSerializationTest.java
Sun Sep 6 10:23:49 2009
+++
/sci-flex/trunk/java/axiom/src/test/java/org/apache/axiom/om/MapDataSourceJavaSerializerSerializationTest.java
Sun Sep 6 10:26:30 2009
@@ -42,7 +42,7 @@
private final String LN_2 = "map";
private OMNamespace ns;

- /**
+ /**
* Construct a new test case. Test must implement their own constructor
* which must pass the name parameter to it's super class.
*
@@ -106,15 +106,15 @@
assertTrue("OMSourcedElement is not expanded. This is unexpected",
child.isExpanded());
ByteArrayOutputStream baos = new ByteArrayOutputStream();

-GregorianCalendar gc1 = new GregorianCalendar();
+ GregorianCalendar gc1 = new GregorianCalendar();
// source.serialize(baos);
-mds.getXMLBytes(null);
-GregorianCalendar gc2 = new GregorianCalendar();
- Date d1 = gc1.getTime();
- Date d2 = gc2.getTime();
- long l1 = d1.getTime();
- long l2 = d2.getTime();
- long difference = l2 - l1;
+ mds.getXMLBytes(null);
+ GregorianCalendar gc2 = new GregorianCalendar();
+ Date d1 = gc1.getTime();
+ Date d2 = gc2.getTime();
+ long l1 = d1.getTime();
+ long l2 = d2.getTime();
+ long difference = l2 - l1;
System.out.println(difference);
ByteArrayInputStream bais = new
ByteArrayInputStream(baos.toByteArray());

@@ -125,7 +125,7 @@
assertTrue("Invalid Object Type", result instanceof Map);

assertTrue("The expected payload was not present in the output",
- map.equals(result));
+ map.equals(result));

// Validate close
mds.close();
=======================================
---
/sci-flex/trunk/java/axiom/src/test/java/org/apache/axiom/om/MapDataSourceSerializationTest.java
Sun Sep 6 10:23:49 2009
+++
/sci-flex/trunk/java/axiom/src/test/java/org/apache/axiom/om/MapDataSourceSerializationTest.java
Sun Sep 6 10:26:30 2009
@@ -34,7 +34,7 @@
* Validate the serialization of the MapDataSource.
*/
public class MapDataSourceSerializationTest extends AbstractTestCase
implements OMConstants {
- private OMFactory omBuilderFactory;
+ private OMFactory omBuilderFactory;
private MapDataSource mds;
private final String ENCODING = "utf-8";
private final String LN_1 = "mapPayloadHolder";
@@ -42,7 +42,7 @@
private String PAYLOAD = "<tns:mapPayloadHolder
xmlns:tns=\"urn://test\"><map><String>five</String><float>5.5</float><int>5</int></map></tns:mapPayloadHolder>";
private OMNamespace ns;

- /**
+ /**
* Construct a new test case. Test must implement their own constructor
* which must pass the name parameter to it's super class.
*
@@ -60,7 +60,7 @@
@SuppressWarnings("unchecked")
protected void setUp() throws Exception {
super.setUp();
-Map map = new TreeMap();
+ Map map = new TreeMap();

// Insert elements to Map, output is order by key's ASCII index.
map.put("int", 5);
@@ -103,19 +103,19 @@
// written. Thus serializing the OMSourcedElement should not
cause the expansion
// of the OMSourcedElement.
ByteArrayOutputStream baos = new ByteArrayOutputStream();
-GregorianCalendar gc1 = new GregorianCalendar();
+ GregorianCalendar gc1 = new GregorianCalendar();
omele.serialize(baos);
-mds.getXMLBytes(null);
-GregorianCalendar gc2 = new GregorianCalendar();
- Date d1 = gc1.getTime();
- Date d2 = gc2.getTime();
- long l1 = d1.getTime();
- long l2 = d2.getTime();
- long difference = l2 - l1;
+ mds.getXMLBytes(null);
+ GregorianCalendar gc2 = new GregorianCalendar();
+ Date d1 = gc1.getTime();
+ Date d2 = gc2.getTime();
+ long l1 = d1.getTime();
+ long l2 = d2.getTime();
+ long difference = l2 - l1;
String output = baos.toString(ENCODING);
System.out.println(output + PAYLOAD);
assertTrue("The expected payload was not present in the output",
- output.equals(PAYLOAD));
+ output.equals(PAYLOAD));
assertTrue("OMSourcedElement is expanded. This is
unexpected", !child.isExpanded());

// Validate close
=======================================
---
/sci-flex/trunk/java/axiom/src/test/java/org/apache/axiom/om/MapDataSourceXMLStreamReaderSerializationTest.java
Sun Sep 6 10:23:49 2009
+++
/sci-flex/trunk/java/axiom/src/test/java/org/apache/axiom/om/MapDataSourceXMLStreamReaderSerializationTest.java
Sun Sep 6 10:26:30 2009
@@ -39,7 +39,7 @@
private OMNamespace ns;
private Map map = null;

- /**
+ /**
* Construct a new test case. Test must implement their own constructor
* which must pass the name parameter to it's super class.
*
@@ -103,19 +103,19 @@

GregorianCalendar gc1 = new GregorianCalendar();
// omele.serialize(baos);
-mds.getXMLBytes(null);
-GregorianCalendar gc2 = new GregorianCalendar();
- Date d1 = gc1.getTime();
- Date d2 = gc2.getTime();
- long l1 = d1.getTime();
- long l2 = d2.getTime();
- long difference = l2 - l1;
+ mds.getXMLBytes(null);
+ GregorianCalendar gc2 = new GregorianCalendar();
+ Date d1 = gc1.getTime();
+ Date d2 = gc2.getTime();
+ long l1 = d1.getTime();
+ long l2 = d2.getTime();
+ long difference = l2 - l1;
System.out.println(difference);

String output = baos.toString(ENCODING);
System.out.println(output);
assertTrue("The expected payload was not present in the output",
- output.equals(PAYLOAD));
+ output.equals(PAYLOAD));
assertTrue("OMSourcedElement is expanded. This is
unexpected", !child.isExpanded());

Map newMap = (new
GetHierarchicalMapForWrappedMapNode()).getUnderlyingMap(child);

Reply all
Reply to author
Forward
0 new messages