From 96fa71ccb72217c4b5d591614d9f9969b5266d5c Mon Sep 17 00:00:00 2001
From: Ryan Izard <rizard@g.clemson.edu>
Date: Sun, 21 Dec 2014 13:55:57 -0500
Subject: [PATCH] Updated Forwarding's unit test to expect a priority of 1 now
 in all flowmods.

---
 .../routing/IRoutingDecision.java             |  2 +-
 .../routing/RoutingDecision.java              |  4 ++--
 .../resources/web/js/models/switchmodel.js    | 24 +++++++------------
 .../resources/web/tpl/flow-list-item.html     |  2 +-
 src/main/resources/web/tpl/flow-list.html     |  2 +-
 .../forwarding/ForwardingTest.java            |  2 ++
 6 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/src/main/java/net/floodlightcontroller/routing/IRoutingDecision.java b/src/main/java/net/floodlightcontroller/routing/IRoutingDecision.java
index bc9df880f..6af24c6e3 100644
--- a/src/main/java/net/floodlightcontroller/routing/IRoutingDecision.java
+++ b/src/main/java/net/floodlightcontroller/routing/IRoutingDecision.java
@@ -61,6 +61,6 @@ public interface IRoutingDecision {
     public void setMulticastInterfaces(List<SwitchPort> lspt);
     public Match getMatch();
     public void setMatch(Match match);
-    public short getHardTimeout();
+    public int getHardTimeout();
     public void setHardTimeout(short hardTimeout);
 }
diff --git a/src/main/java/net/floodlightcontroller/routing/RoutingDecision.java b/src/main/java/net/floodlightcontroller/routing/RoutingDecision.java
index 0e1935cab..e72ccfc6e 100644
--- a/src/main/java/net/floodlightcontroller/routing/RoutingDecision.java
+++ b/src/main/java/net/floodlightcontroller/routing/RoutingDecision.java
@@ -33,7 +33,7 @@ public class RoutingDecision implements IRoutingDecision {
 
     protected RoutingAction action;
     protected Match match;
-    protected short hardTimeout;
+    protected int hardTimeout;
     protected SwitchPort srcPort;
     protected IDevice srcDevice;
     protected List<IDevice> destDevices;
@@ -105,7 +105,7 @@ public class RoutingDecision implements IRoutingDecision {
     }
    
     @Override
-    public short getHardTimeout() {
+    public int getHardTimeout() {
         return hardTimeout;
     }
 
diff --git a/src/main/resources/web/js/models/switchmodel.js b/src/main/resources/web/js/models/switchmodel.js
index 5a9403fed..aced9b857 100644
--- a/src/main/resources/web/js/models/switchmodel.js
+++ b/src/main/resources/web/js/models/switchmodel.js
@@ -1,12 +1,10 @@
+
 /*
  Copyright 2012 IBM
- 
  Licensed 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.
@@ -165,9 +163,9 @@ window.Switch = Backbone.Model.extend({
                                              url:hackBase + "/wm/core/switch/" + self.id + '/flow/json',
                                              dataType:"json",
                                              success:function (data) {
-                                             console.log("fetched  switch " + self.id + " flows");
+                                             //console.log("fetched  switch " + self.id + " flows");
                                              var flows = data['flows'];
-                                             console.log(flows);
+                                             //console.log(flows);
                                              
                                              // create flow models
                                              var i = 0;
@@ -181,7 +179,7 @@ window.Switch = Backbone.Model.extend({
                                                            f.matchHTML += key + "=" + value +" ";
                                                            },f);
                                                     }
-                                                    f.matchHTML = f.matchHTML.substr(0, f.matchHTML.length - 1);
+                                                    f.matchHTML = f.matchHTML.substr(0, f.matchHTML.length - 2);
                                                     
                                                     f.applyActionText = '';
                                                     f.writeActionText = '';
@@ -198,16 +196,10 @@ window.Switch = Backbone.Model.extend({
                                                     }
                                                     
                                                     }
-                                                    if(f.hasOwnProperty('actions')) {
-                                                    _.each(f.actions, function(value, key) {
-                                                           f.applyActionText += key + ":" + value +" ";
-                                                           },f);
-                                                    }
-                                                                                                        }
                                                     // build human-readable action list
-                                                    f.applyActionText = f.applyActionText.substr(0, f.applyActionText.length - 1);
-                                                    f.writeActionText = f.writeActionText.substr(0, f.writeActionText.length - 1);
-                                                    console.log(f);
+                                                    f.applyActionText = f.applyActionText.substr(0, f.applyActionText.length - 2);
+                                                    f.writeActionText = f.writeActionText.substr(0, f.writeActionText.length - 2);
+                                                    //console.log(f);
                                                     self.flows.add(f, {silent: true});
                                                     });
                                              self.flows.trigger('add');
@@ -248,3 +240,5 @@ window.SwitchCollection = Backbone.Collection.extend({
                                                      },
                                                      
                                                      });
+Status API Training Shop Blog About
+© 2014 GitHub, Inc. Terms Privacy Security Contact
diff --git a/src/main/resources/web/tpl/flow-list-item.html b/src/main/resources/web/tpl/flow-list-item.html
index 4fb9a3ec8..bf049896c 100644
--- a/src/main/resources/web/tpl/flow-list-item.html
+++ b/src/main/resources/web/tpl/flow-list-item.html
@@ -1 +1 @@
-        <td><%= cookie %></td><td><%= priority %></td><td><%= matchHTML %></td><td><%= applyActionText %></td><td><%= writeActionText %></td><td><%= packetCount %></td><td><%= byteCount %></td><td><%= durationSeconds %> s</td><td><%= idleTimeoutSec %> s</td>
+        <td><%= cookie %></td><td><%= priority %></td><td><%= matchHTML %></td><td><%= applyActionText %></td><td><%= writeActionText %></td><td><%= clearActionText %></td><td><%= gotoGroupText %></td><td><%= gotoMeterText %></td><td><%= writeMetadataText %></td><td><%= experimenterText %></td><td><%= packetCount %></td><td><%= byteCount %></td><td><%= durationSeconds %> s</td><td><%= idleTimeoutSec %> s</td>
diff --git a/src/main/resources/web/tpl/flow-list.html b/src/main/resources/web/tpl/flow-list.html
index 3c23a292e..ea2d944e5 100644
--- a/src/main/resources/web/tpl/flow-list.html
+++ b/src/main/resources/web/tpl/flow-list.html
@@ -2,7 +2,7 @@
     <h1>Flows (<%= nflows %>)</h1>
 </div>
 <table class="table table-striped flow-table">
-    <thead><tr><th>Cookie</th><th>Priority</th><th>Match</th><th>Apply Actions</th><th>Write Actions</th><th>Packets</th><th>Bytes</th><th>Age</th><th>Timeout</th></tr></thead>
+    <thead><tr><th>Cookie</th><th>Priority</th><th>Match</th><th>Apply Actions</th><th>Write Actions</th><th>Clear Actions</th><th>Goto Group</th><th>Goto Meter</th><th>Write Metadata</th><th>Experimenter</th><th>Packets</th><th>Bytes</th><th>Age</th><th>Timeout</th></tr></thead>
     <tbody>
         <!-- flows will be inserted here by FlowListView:render -->
     </tbody>
diff --git a/src/test/java/net/floodlightcontroller/forwarding/ForwardingTest.java b/src/test/java/net/floodlightcontroller/forwarding/ForwardingTest.java
index 346753098..ef39fc88d 100644
--- a/src/test/java/net/floodlightcontroller/forwarding/ForwardingTest.java
+++ b/src/test/java/net/floodlightcontroller/forwarding/ForwardingTest.java
@@ -342,6 +342,7 @@ public class ForwardingTest extends FloodlightTestCase {
         		.setOutPort(action.getPort())
         		.setBufferId(OFBufferId.NO_BUFFER)
         		.setCookie(U64.of(2L << 52))
+        		.setPriority(1)
         		.build();
         OFFlowMod fm2 = fm1.createBuilder().build();
 
@@ -405,6 +406,7 @@ public class ForwardingTest extends FloodlightTestCase {
             .setOutPort(OFPort.of(3))
             .setBufferId(OFBufferId.NO_BUFFER)
             .setCookie(U64.of(2L<< 52))
+            .setPriority(1)
             .build();
                 
         // Record expected packet-outs/flow-mods
-- 
GitLab