diff --git a/Source/Server/src/ca/uqac/lif/cornipickle/server/DummyImage.java b/Source/Server/src/ca/uqac/lif/cornipickle/server/DummyImage.java index a552ef6..f99ffe2 100755 --- a/Source/Server/src/ca/uqac/lif/cornipickle/server/DummyImage.java +++ b/Source/Server/src/ca/uqac/lif/cornipickle/server/DummyImage.java @@ -174,7 +174,7 @@ public CallbackResponse process(HttpExchange t) if (j != null) { m_interpreter.evaluateAll(j); - //m_server.setLastProbeContact(); + m_server.setLastProbeContact(); } // Select the dummy image to send back verdicts = m_interpreter.getVerdicts(); diff --git a/Source/Server/src/ca/uqac/lif/cornipickle/server/DummyImageMobile.java b/Source/Server/src/ca/uqac/lif/cornipickle/server/DummyImageMobile.java index 426edfc..d33c84c 100644 --- a/Source/Server/src/ca/uqac/lif/cornipickle/server/DummyImageMobile.java +++ b/Source/Server/src/ca/uqac/lif/cornipickle/server/DummyImageMobile.java @@ -146,7 +146,7 @@ public CallbackResponse process(HttpExchange t) if (j != null) { m_interpreter.evaluateAll(j); - //m_server.setLastProbeContact(); + m_server.setLastProbeContact(); } // System.out.println(j.toString()); // Select the dummy image to send back diff --git a/Source/Server/src/ca/uqac/lif/cornipickle/server/PreEvaluation.java b/Source/Server/src/ca/uqac/lif/cornipickle/server/PreEvaluation.java index 50cb23c..1be0ebb 100644 --- a/Source/Server/src/ca/uqac/lif/cornipickle/server/PreEvaluation.java +++ b/Source/Server/src/ca/uqac/lif/cornipickle/server/PreEvaluation.java @@ -82,7 +82,7 @@ public CallbackResponse process(HttpExchange t) if (j != null) { m_interpreter.evaluateAll(j); - //m_server.setLastProbeContact(); + m_server.setLastProbeContact(); } // Select the dummy image to send back diff --git a/Source/Server/src/ca/uqac/lif/cornipickle/server/StatusPageCallback.java b/Source/Server/src/ca/uqac/lif/cornipickle/server/StatusPageCallback.java index 866bca0..5c42675 100755 --- a/Source/Server/src/ca/uqac/lif/cornipickle/server/StatusPageCallback.java +++ b/Source/Server/src/ca/uqac/lif/cornipickle/server/StatusPageCallback.java @@ -39,195 +39,194 @@ class StatusPageCallback extends InterpreterCallback * queries information about the server's state. */ protected CornipickleServer m_server; - - public StatusPageCallback(Interpreter i, CornipickleServer s) - { - super(i, RequestCallback.Method.GET, "/status"); - m_server = s; - } - - @Override - public CallbackResponse process(HttpExchange t) - { - StringBuilder page = new StringBuilder(); - page.append(pageHead("Cornipickle status")); - page.append("
Type here the Cornipickle properties you want to add.
\n"); - page.append("\n"); - page.append("No contact with probe so far.
\n"); - } - else - { - page.append("Last contact with probe just now"); - //page.append(last_contact) - page.append("
\n"); - } - } - - protected static void createStatusMessage(MapCornipickle has no property to evaluate.
"); - } - else - { - page.append("All's well! All properties evaluate to true.
"); - } - } - else if (num_errors == 1) - { - page.append("Oops! There is a problem with some property.
"); - } - else - { - page.append("Oops! There is a problem with ").append(num_errors).append(" properties.
"); - } - } - - protected void createPropertyList(MapType here the Cornipickle properties you want to add.
\n"); + page.append("\n"); + page.append("No contact with probe so far.
\n"); + } + else + { + page.append("Last contact with probe just now"); + page.append("
\n"); + } + } + + protected static void createStatusMessage(MapCornipickle has no property to evaluate.
"); + } + else + { + page.append("All's well! All properties evaluate to true.
"); + } + } + else if (num_errors == 1) + { + page.append("Oops! There is a problem with some property.
"); + } + else + { + page.append("Oops! There is a problem with ").append(num_errors).append(" properties.
"); + } + } + + protected void createPropertyList(MapNo contact with probe so far.
\n"; - - assertTrue(expected.equals(result.toString())); - - } - - - @Test - public void TestStatusPageCallbackCreateProbeContactMessageOk(){ - - StringBuilder result = new StringBuilder(); - - StatusPageCallback.createProbeContactMessage(new Date(), result); - - String expected = "Last contact with probe just now
\n"; - - assertTrue(expected.equals(result.toString())); - - } - @Test public void TestStatusPageCallBackFooter(){