killbill-memoizeit

Details

diff --git a/catalog/src/main/java/com/ning/billing/catalog/rules/CasePriceList.java b/catalog/src/main/java/com/ning/billing/catalog/rules/CasePriceList.java
index a18bac4..ccd0f87 100644
--- a/catalog/src/main/java/com/ning/billing/catalog/rules/CasePriceList.java
+++ b/catalog/src/main/java/com/ning/billing/catalog/rules/CasePriceList.java
@@ -26,14 +26,8 @@ import com.ning.billing.catalog.api.ProductCategory;
 
 public class CasePriceList extends Case<PriceList> {
 
-	@XmlElement(required=true)
 	private PriceList toPriceList;
 
-	@Override
-	protected PriceList getResult() {
-		return toPriceList;
-	}
-
 	@XmlElement(required=false, name="fromProduct")
 	@XmlIDREF
 	public Product getProduct(){
@@ -55,4 +49,11 @@ public class CasePriceList extends Case<PriceList> {
 	public PriceList getPriceList() {
 		return priceList;
 	}
+
+	@Override
+	@XmlElement(required=true, name="toPriceList")
+	@XmlIDREF
+	protected PriceList getResult() {
+		return toPriceList;
+	}
 }
diff --git a/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-1.xml b/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-1.xml
index ccba4c0..2214b04 100644
--- a/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-1.xml
+++ b/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-1.xml
@@ -153,7 +153,7 @@
 		</plan>
 	</plans>
 	<priceLists>
-		<defaultPriceList>			
+		<defaultPriceList name="DEFAULT">			
 				<plans>	
 				<plan>pistol-monthly</plan>
 				<plan>shotgun-monthly</plan>
diff --git a/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-2.xml b/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-2.xml
index e97d5ba..7d0e1b8 100644
--- a/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-2.xml
+++ b/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-2.xml
@@ -16,7 +16,7 @@
   -->
 
 <catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:noNamespaceSchemaLocation="../../../main/resources/CatalogSchema.xsd ">
+	xsi:noNamespaceSchemaLocation="../CatalogSchema.xsd ">
 
 	<effectiveDate>2011-02-02T00:00:00+00:00</effectiveDate>
 	<catalogName>WeaponsHireSmall</catalogName>
@@ -153,7 +153,7 @@
 		</plan>
 	</plans>
 	<priceLists>
-		<defaultPriceList>			
+		<defaultPriceList name="DEFAULT">			
 				<plans>	
 				<plan>pistol-monthly</plan>
 				<plan>shotgun-monthly</plan>
diff --git a/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-3.xml b/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-3.xml
index 568ec5e..070adbe 100644
--- a/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-3.xml
+++ b/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-3.xml
@@ -16,7 +16,7 @@
   -->
 
 <catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:noNamespaceSchemaLocation="../../../main/resources/CatalogSchema.xsd ">
+	xsi:noNamespaceSchemaLocation="../CatalogSchema.xsd ">
 
 	<effectiveDate>2011-03-03T00:00:00+00:00</effectiveDate>
 	<catalogName>WeaponsHireSmall</catalogName>
@@ -153,7 +153,7 @@
 		</plan>
 	</plans>
 	<priceLists>
-		<defaultPriceList>			
+		<defaultPriceList name="DEFAULT">			
 				<plans>	
 				<plan>pistol-monthly</plan>
 				<plan>shotgun-monthly</plan>
diff --git a/catalog/src/test/resources/WeaponsHire.xml b/catalog/src/test/resources/WeaponsHire.xml
index 5c36142..cfd445b 100644
--- a/catalog/src/test/resources/WeaponsHire.xml
+++ b/catalog/src/test/resources/WeaponsHire.xml
@@ -153,8 +153,8 @@ Use Cases to do:
 			<alignment>BUNDLE</alignment>
 		</billingAlignmentCase>
 		<priceListCase>
-			<fromPriceList></fromPriceList>
-			<priceList>DEFAULT</priceList>
+			<fromPriceList>rescue</fromPriceList>
+			<toPriceList>DEFAULT</toPriceList>
 		</priceListCase>
 	</rules>
 
@@ -553,7 +553,7 @@ Use Cases to do:
 		</plan>
 	</plans>
 	<priceLists>
-		<defaultPriceList> 
+		<defaultPriceList name="DEFAULT"> 
 			<plans>
 				<plan>pistol-monthly</plan>
 				<plan>shotgun-monthly</plan>
diff --git a/catalog/src/test/resources/WeaponsHireSmall.xml b/catalog/src/test/resources/WeaponsHireSmall.xml
index c6b25da..c4a098d 100644
--- a/catalog/src/test/resources/WeaponsHireSmall.xml
+++ b/catalog/src/test/resources/WeaponsHireSmall.xml
@@ -153,7 +153,7 @@
 		</plan>
 	</plans>
 	<priceLists>
-		<defaultPriceList>
+		<defaultPriceList name="DEFAULT">
 				<plans>	
 					<plan>pistol-monthly</plan>
 					<plan>shotgun-monthly</plan>
diff --git a/entitlement/src/test/resources/testInput.xml b/entitlement/src/test/resources/testInput.xml
index e9c041b..cfd445b 100644
--- a/entitlement/src/test/resources/testInput.xml
+++ b/entitlement/src/test/resources/testInput.xml
@@ -152,6 +152,10 @@ Use Cases to do:
 			<productCategory>ADD_ON</productCategory>
 			<alignment>BUNDLE</alignment>
 		</billingAlignmentCase>
+		<priceListCase>
+			<fromPriceList>rescue</fromPriceList>
+			<toPriceList>DEFAULT</toPriceList>
+		</priceListCase>
 	</rules>
 
 	<plans>
@@ -549,7 +553,7 @@ Use Cases to do:
 		</plan>
 	</plans>
 	<priceLists>
-		<defaultPriceList> 
+		<defaultPriceList name="DEFAULT"> 
 			<plans>
 				<plan>pistol-monthly</plan>
 				<plan>shotgun-monthly</plan>
diff --git a/util/src/test/java/com/ning/billing/util/config/TestXMLWriter.java b/util/src/test/java/com/ning/billing/util/config/TestXMLWriter.java
index f9115a0..007c16b 100644
--- a/util/src/test/java/com/ning/billing/util/config/TestXMLWriter.java
+++ b/util/src/test/java/com/ning/billing/util/config/TestXMLWriter.java
@@ -45,7 +45,7 @@ public class TestXMLWriter {
 		String output = XMLWriter.writeXML(test, XmlTestClass.class);
 		
 		System.out.println(output);
-		assertEquals(output, TEST_XML);
+		assertEquals(output.replaceAll("\\s", ""), TEST_XML.replaceAll("\\s", ""));
 		 
 	}
 
diff --git a/util/src/test/resources/log4j.xml b/util/src/test/resources/log4j.xml
new file mode 100644
index 0000000..75abc76
--- /dev/null
+++ b/util/src/test/resources/log4j.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2010-2011 Ning, Inc.
+  ~
+  ~ Ning licenses this file to you under the Apache License, version 2.0
+  ~ (the "License"); you may not use this file except in compliance with the
+  ~ License.  You may obtain a copy of the License at:
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+  ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+  ~ License for the specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+    <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
+        <param name="Target" value="System.out"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%p	%d{ISO8601}	%X{trace}	%t	%c	%m%n"/>
+        </layout>
+    </appender>
+
+
+    <logger name="com.ning.billing.entitlement">
+        <level value="info"/>
+    </logger>
+
+    <root>
+        <priority value="info"/>
+        <appender-ref ref="stdout"/>
+    </root>
+</log4j:configuration>