Repository: camel
Updated Branches:
  refs/heads/master 100133625 -> 683548000


camel-optaplanner: Upgrade OptaPlanner from 6.0.1.Final to 6.1.0.CR2


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/05092311
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/05092311
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/05092311

Branch: refs/heads/master
Commit: 05092311ed8501eff263d2e536425b341462a06c
Parents: 5ec6adf
Author: Geoffrey De Smet <gds.geoffrey.de.s...@gmail.com>
Authored: Tue Jul 15 16:39:08 2014 +0200
Committer: Geoffrey De Smet <gds.geoffrey.de.s...@gmail.com>
Committed: Tue Jul 15 16:39:08 2014 +0200

----------------------------------------------------------------------
 .../camel/component/optaplanner/OptaPlannerComponent.java    | 3 +--
 .../camel/component/optaplanner/OptaPlannerEndpoint.java     | 5 ++---
 ...ptaPlannerComponentConfigurationAndDocumentationTest.java | 2 +-
 .../apache/camel/component/optaplanner/OptaPlannerTest.java  | 3 ++-
 .../org/apache/camel/component/optaplanner/solverConfig.xml  | 8 ++++----
 parent/pom.xml                                               | 2 +-
 6 files changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/05092311/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerComponent.java
----------------------------------------------------------------------
diff --git 
a/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerComponent.java
 
b/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerComponent.java
index f19fe5f..cb59460 100644
--- 
a/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerComponent.java
+++ 
b/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerComponent.java
@@ -21,7 +21,6 @@ import java.util.Map;
 import org.apache.camel.Endpoint;
 import org.apache.camel.impl.UriEndpointComponent;
 import org.optaplanner.core.api.solver.SolverFactory;
-import org.optaplanner.core.config.solver.XmlSolverFactory;
 
 /**
  * OptaPlanner component for Camel
@@ -33,7 +32,7 @@ public class OptaPlannerComponent extends 
UriEndpointComponent {
     }
 
     protected Endpoint createEndpoint(String uri, String remaining, 
Map<String, Object> parameters) throws Exception {
-        SolverFactory solverFactory = new XmlSolverFactory(remaining);
+        SolverFactory solverFactory = 
SolverFactory.createFromXmlResource(remaining);
 
         OptaPlannerEndpoint endpoint = new OptaPlannerEndpoint(uri, this, 
remaining);
         endpoint.setSolverFactory(solverFactory);

http://git-wip-us.apache.org/repos/asf/camel/blob/05092311/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerEndpoint.java
----------------------------------------------------------------------
diff --git 
a/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerEndpoint.java
 
b/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerEndpoint.java
index c120fd0..9cc96aa 100644
--- 
a/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerEndpoint.java
+++ 
b/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerEndpoint.java
@@ -22,9 +22,9 @@ import org.apache.camel.ExchangePattern;
 import org.apache.camel.component.ResourceEndpoint;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.util.ObjectHelper;
+import org.optaplanner.core.api.domain.solution.Solution;
 import org.optaplanner.core.api.solver.Solver;
 import org.optaplanner.core.api.solver.SolverFactory;
-import org.optaplanner.core.impl.solution.Solution;
 
 /**
  * OptaPlanner endpoint for Camel
@@ -66,8 +66,7 @@ public class OptaPlannerEndpoint extends ResourceEndpoint {
 
         Solution planningProblem = 
exchange.getIn().getMandatoryBody(Solution.class);
 
-        solver.setPlanningProblem(planningProblem);
-        solver.solve();
+        solver.solve(planningProblem);
         Solution bestSolution = solver.getBestSolution();
 
         exchange.getOut().setBody(bestSolution);

http://git-wip-us.apache.org/repos/asf/camel/blob/05092311/components/camel-optaplanner/src/test/java/org/apache/camel/component/optaplanner/OptaPlannerComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-optaplanner/src/test/java/org/apache/camel/component/optaplanner/OptaPlannerComponentConfigurationAndDocumentationTest.java
 
b/components/camel-optaplanner/src/test/java/org/apache/camel/component/optaplanner/OptaPlannerComponentConfigurationAndDocumentationTest.java
index 19269d6..fd3ab3c 100644
--- 
a/components/camel-optaplanner/src/test/java/org/apache/camel/component/optaplanner/OptaPlannerComponentConfigurationAndDocumentationTest.java
+++ 
b/components/camel-optaplanner/src/test/java/org/apache/camel/component/optaplanner/OptaPlannerComponentConfigurationAndDocumentationTest.java
@@ -33,7 +33,7 @@ public class 
OptaPlannerComponentConfigurationAndDocumentationTest extends Camel
     @Test
     public void testComponentConfiguration() throws Exception {
         OptaPlannerComponent component = context.getComponent("optaplanner", 
OptaPlannerComponent.class);
-        EndpointConfiguration configuration = 
component.createConfiguration("optaplanner:/org/apache/camel/component/optaplanner/solverConfig.xml?"
+        EndpointConfiguration configuration = 
component.createConfiguration("optaplanner:org/apache/camel/component/optaplanner/solverConfig.xml?"
                 + "synchronous=false&contentCache=true");
 
         assertEquals("true", configuration.getParameter("contentCache"));

http://git-wip-us.apache.org/repos/asf/camel/blob/05092311/components/camel-optaplanner/src/test/java/org/apache/camel/component/optaplanner/OptaPlannerTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-optaplanner/src/test/java/org/apache/camel/component/optaplanner/OptaPlannerTest.java
 
b/components/camel-optaplanner/src/test/java/org/apache/camel/component/optaplanner/OptaPlannerTest.java
index 1d541be..5a7fd15 100644
--- 
a/components/camel-optaplanner/src/test/java/org/apache/camel/component/optaplanner/OptaPlannerTest.java
+++ 
b/components/camel-optaplanner/src/test/java/org/apache/camel/component/optaplanner/OptaPlannerTest.java
@@ -47,8 +47,9 @@ public class OptaPlannerTest extends CamelTestSupport {
         return new RouteBuilder() {
             public void configure() {
                 from("direct:in").
-                        
to("optaplanner:/org/apache/camel/component/optaplanner/solverConfig.xml");
+                        
to("optaplanner:org/apache/camel/component/optaplanner/solverConfig.xml");
             }
         };
     }
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/05092311/components/camel-optaplanner/src/test/resources/org/apache/camel/component/optaplanner/solverConfig.xml
----------------------------------------------------------------------
diff --git 
a/components/camel-optaplanner/src/test/resources/org/apache/camel/component/optaplanner/solverConfig.xml
 
b/components/camel-optaplanner/src/test/resources/org/apache/camel/component/optaplanner/solverConfig.xml
index eb07fc0..6ecf1a6 100644
--- 
a/components/camel-optaplanner/src/test/resources/org/apache/camel/component/optaplanner/solverConfig.xml
+++ 
b/components/camel-optaplanner/src/test/resources/org/apache/camel/component/optaplanner/solverConfig.xml
@@ -20,19 +20,19 @@
 
   <!-- Domain model configuration -->
   
<solutionClass>org.optaplanner.examples.cloudbalancing.domain.CloudBalance</solutionClass>
-  
<planningEntityClass>org.optaplanner.examples.cloudbalancing.domain.CloudProcess</planningEntityClass>
+  
<entityClass>org.optaplanner.examples.cloudbalancing.domain.CloudProcess</entityClass>
 
   <!-- Score configuration -->
   <scoreDirectorFactory>
     <scoreDefinitionType>HARD_SOFT</scoreDefinitionType>
-    
<scoreDrl>/org/optaplanner/examples/cloudbalancing/solver/cloudBalancingScoreRules.drl</scoreDrl>
+    
<scoreDrl>org/optaplanner/examples/cloudbalancing/solver/cloudBalancingScoreRules.drl</scoreDrl>
   </scoreDirectorFactory>
 
   <!-- Optimization algorithms configuration -->
   <termination>
     <terminationCompositionStyle>AND</terminationCompositionStyle>
-    <maximumSecondsSpend>10</maximumSecondsSpend>
-    <scoreAttained>-1hard/0soft</scoreAttained>
+    <secondsSpentLimit>10</secondsSpentLimit>
+    <bestScoreFeasible>true</bestScoreFeasible>
   </termination>
   <constructionHeuristic>
     <constructionHeuristicType>FIRST_FIT_DECREASING</constructionHeuristicType>

http://git-wip-us.apache.org/repos/asf/camel/blob/05092311/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 874dc0e..04049a5 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -322,7 +322,7 @@
     <openjpa-version>2.3.0</openjpa-version>
     <opensaml-version>2.5.1_2</opensaml-version>
     <openshift-java-client-version>2.5.0.Final</openshift-java-client-version>
-    <optaplanner-version>6.0.1.Final</optaplanner-version>
+    <optaplanner-version>6.1.0.CR2</optaplanner-version>
     <oro-bundle-version>2.0.8_6</oro-bundle-version>
     <oscache-bundle-version>2.4_5</oscache-bundle-version>
     <osgi-version>4.3.1</osgi-version>

Reply via email to