Skip to content

Commit

Permalink
fix status test
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-actoron committed Jun 3, 2021
1 parent f030ad6 commit 7556ce5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,6 @@ public void terminated(Exception reason)
*/
public ISubscriptionIntermediateFuture<QueryEvent> subscribeToQueries()
{
System.out.println(agent+" subscribeToQueries");

ISubscriptionIntermediateFuture<QueryEvent> fut = serviceregistry.subscribeToQueries();
SubscriptionIntermediateDelegationFuture<QueryEvent> ret = new SubscriptionIntermediateDelegationFuture<QueryEvent>(fut);
SFuture.avoidCallTimeouts(ret, agent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
import jadex.base.test.util.STest;
import jadex.bridge.IExternalAccess;
import jadex.bridge.component.IMessageFeature;
import jadex.bridge.service.ServiceScope;
import jadex.bridge.service.search.ServiceQuery;
import jadex.bridge.service.types.simulation.SSimulation;
import jadex.commons.future.Future;
import jadex.commons.future.IFuture;

/**
* Test the web registry page.
Expand All @@ -35,10 +38,10 @@ public void testStatusPage() throws IOException
s.close();

// Start platform with published status agent gui
IPlatformConfiguration baseconf = STest.createDefaultTestConfig(getClass());
IPlatformConfiguration baseconf = STest.createDefaultTestConfig(getClass())
.setValue("superpeerclient.awaonly", false);
IPlatformConfiguration webguiconf = baseconf.clone()
.setSuperpeer(true)
.setValue("superpeerclient.awaonly", false)
.getExtendedPlatformConfiguration().setRsPublish(true)
.setValue("jettyrspublish", true)
.setValue("status", true)
Expand Down Expand Up @@ -84,8 +87,15 @@ public void testStatusPage() throws IOException
assertContainsField(con, "platform");
assertContainsField(con, "connected");
assertContainsField(con, "protocol");
dummy.killComponent().get();

// Check that queries can be retrieved.
dummy.addQuery(new ServiceQuery<>(IStatusService.class).setScope(ServiceScope.NETWORK));
String query = getUrlContent("http://localhost:"+port+"/status/subscribeToQueries");
System.out.println("query: "+query);
assertContainsField(query, "serviceType");
assertContainsField(query, "owner");
assertContainsField(query, "scope");

// Check that provided services can be retrieved.
String service = getUrlContent("http://localhost:"+port+"/status/subscribeToServices");
System.out.println("service: "+service);
Expand All @@ -95,13 +105,8 @@ public void testStatusPage() throws IOException
assertContainsField(service, "scope");
assertContainsField(service, "networkNames");
assertContainsField(service, "unrestricted");

// Check that queries can be retrieved.
String query = getUrlContent("http://localhost:"+port+"/status/subscribeToQueries");
System.out.println("query: "+query);
assertContainsField(query, "serviceType");
assertContainsField(query, "owner");
assertContainsField(query, "scope");

dummy.killComponent().get();
});
}

Expand Down

0 comments on commit 7556ce5

Please sign in to comment.