Refactored intent framework to deal with batches.
There is still work to be done, but for now, submit, withdraw and reroute are working.
Change-Id: Ib94cf8c4be03786cc070f402d1f296f5dfa6588b
diff --git a/core/api/src/test/java/org/onlab/onos/net/intent/FakeIntentManager.java b/core/api/src/test/java/org/onlab/onos/net/intent/FakeIntentManager.java
index 9f4755a..d6732c7 100644
--- a/core/api/src/test/java/org/onlab/onos/net/intent/FakeIntentManager.java
+++ b/core/api/src/test/java/org/onlab/onos/net/intent/FakeIntentManager.java
@@ -24,7 +24,6 @@
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
/**
* Fake implementation of the intent service to assist in developing tests of
@@ -104,7 +103,7 @@
try {
// For the fake, we compile using a single level pass
List<Intent> installable = new ArrayList<>();
- for (Intent compiled : getCompiler(intent).compile(intent)) {
+ for (Intent compiled : getCompiler(intent).compile(intent, null, null)) {
installable.add((Intent) compiled);
}
executeInstallingPhase(intent, installable);
@@ -192,9 +191,8 @@
}
@Override
- public Future<IntentOperations> execute(IntentOperations operations) {
+ public void execute(IntentOperations operations) {
// TODO: implement later
- return null;
}
@Override
diff --git a/core/api/src/test/java/org/onlab/onos/net/intent/IntentServiceTest.java b/core/api/src/test/java/org/onlab/onos/net/intent/IntentServiceTest.java
index 86ebc59..a7004a2 100644
--- a/core/api/src/test/java/org/onlab/onos/net/intent/IntentServiceTest.java
+++ b/core/api/src/test/java/org/onlab/onos/net/intent/IntentServiceTest.java
@@ -29,11 +29,13 @@
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.onlab.onos.net.flow.FlowRuleBatchOperation;
+import org.onlab.onos.net.resource.LinkResourceAllocations;
/**
* Suite of tests for the intent service contract.
@@ -294,7 +296,8 @@
}
@Override
- public List<Intent> compile(TestIntent intent) {
+ public List<Intent> compile(TestIntent intent, List<Intent> installable,
+ Set<LinkResourceAllocations> resources) {
if (fail) {
throw new IntentException("compile failed by design");
}
@@ -326,6 +329,12 @@
}
return null;
}
+
+ @Override
+ public List<FlowRuleBatchOperation> replace(TestInstallableIntent intent,
+ TestInstallableIntent newIntent) {
+ return null;
+ }
}
}