This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fetching http://www.loadui.org... | |
Media: (82) | |
* script: <http://www.loadui.org/media/system/js/mootools.js> | |
* script: <http://www.loadui.org/media/system/js/caption.js> | |
* script: <http://www.loadui.org/plugins/content/syntaxhighlighter/scripts/shCore.js> | |
* script: <http://www.loadui.org/plugins/content/syntaxhighlighter/scripts/shBrushGroovy.js> | |
* script: <http://www.loadui.org/plugins/content/syntaxhighlighter/scripts/shBrushJava.js> | |
* script: <http://www.loadui.org/plugins/content/syntaxhighlighter/scripts/shBrushPlain.js> | |
* script: <http://www.loadui.org/plugins/content/syntaxhighlighter/scripts/shBrushSql.js> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Media: | |
* script: <http://www.loadui.org/media/system/js/mootools.js> | |
* script: <http://www.loadui.org/media/system/js/caption.js> | |
* script: <http://www.loadui.org/plugins/content/syntaxhighlighter/scripts/shCore.js> | |
* script: <http://www.loadui.org/plugins/content/syntaxhighlighter/scripts/shBrushGroovy.js> | |
* script: <http://www.loadui.org/plugins/content/syntaxhighlighter/scripts/shBrushJava.js> | |
* script: <http://www.loadui.org/plugins/content/syntaxhighlighter/scripts/shBrushPlain.js> | |
* script: <http://www.loadui.org/plugins/content/syntaxhighlighter/scripts/shBrushSql.js> | |
* script: <http://www.loadui.org/plugins/content/syntaxhighlighter/scripts/shBrushXml.js> | |
* script: <http://www.loadui.org/modules/mod_rokajaxsearch/js/rokajaxsearch.js> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void shouldSendRequests() throws Exception | |
{ | |
Multiset<String> expectedRequests = ImmutableMultiset.of( | |
"GET http://www.example.org/image1.png", | |
"GET http://www.example.org/style.css" | |
); | |
// WHEN | |
triggerAndWait(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Before | |
public void setup() throws ComponentCreationException, IOException | |
{ | |
ctu = new ComponentTestUtils(); | |
ctu.getDefaultBeanInjectorMocker(); | |
component = ctu.createComponentItem(); | |
ComponentContext contextSpy = spy( component.getContext() ); | |
ctu.mockStatisticsFor( component, contextSpy ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.smartbear.saas.rs.storage; | |
import com.smartbear.saas.rs.model.TestRun; | |
import java.util.Optional; | |
import java.util.Set; | |
public interface TestRunStorage | |
{ | |
Optional<TestRun> getTest( String customerId, String testId ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@GET | |
@Path( "/{test}/assets" ) | |
@ApiOperation(value = "Returns all assets in a test run") | |
@ApiResponses(value = { | |
@ApiResponse(code = 404, message = "No test with given ID"), | |
}) | |
public String assets( @Auth User user, @PathParam( "test" ) String testId, @QueryParam( "scenario" ) String scenario ) | |
{ | |
TestRun testRun = testRunStorage.getTestRun( testId, user.getId() ) | |
.orElseThrow( () -> new WebApplicationException( NOT_FOUND ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void startingAndFetch() | |
{ | |
ClientResponse response = resources.client().resource( ENDPOINT ) | |
.type( MediaType.APPLICATION_JSON ) | |
.header( HttpHeaders.AUTHORIZATION, "Bearer DUMMYTOKEN" ) | |
.post( ClientResponse.class, dummyJson ); | |
assertThat( response.getStatus(), is( 201 ) ); | |
TestRun testRun = resources.client().resource( response.getLocation() ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void accessingNonExistentTest_should_fail() | |
{ | |
asList( "", "/assets", "/live-tabular-stats" ) | |
.forEach( this::assertPathYields404 ); | |
} | |
private void assertPathYields404( String path ) | |
{ | |
ClientResponse response = R.client().resource( ENDPOINT + "/"+ nonExistentId + path ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Manages statistic updates for a Runner in a load test. | |
*/ | |
public class WebRunnerStatsSender | |
{ | |
private final Map<String, VariableGroup> resourceToVariableGroup = new HashMap<>(); | |
private final Clock clock; | |
public WebRunnerStatsSender( Clock clock ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Manages statistic updates for a Runner in a load test. | |
*/ | |
public class WebRunnerStatsSender | |
{ | |
private final Map<String, VariableGroup> resourceToVariableGroup = new HashMap<>(); | |
private final Clock clock; | |
public WebRunnerStatsSender( Clock clock ) | |
{ |