public JSTestCaseModel() throws QuickFixException {
AuraContext context = Aura.getContextService().getCurrentContext();
BaseComponent<?, ?> component = context.getCurrentComponent();
TestCaseDef caseDef = (TestCaseDef) component.getAttributes().getValue("case");
String baseUrl = component.getAttributes().getValue("url").toString();
Set<Entry<String, Object>> attributes = caseDef.getAttributeValues().entrySet();
List<NameValuePair> newParams = Lists.newArrayList();
String hash = "";
if (!attributes.isEmpty()) {
for (Entry<String, Object> entry : attributes) {
String key = entry.getKey();
String value = entry.getValue().toString();
if (key.equals("__layout")) {
hash = value;
} else {
newParams.add(new BasicNameValuePair(key, value));
}
}
}
newParams.add(new BasicNameValuePair("aura.test", caseDef.getDescriptor().getQualifiedName()));
url = baseUrl + "&" + URLEncodedUtils.format(newParams, "UTF-8") + hash;
count = ((TestSuiteDef) component.getAttributes().getValue("suite")).getTestCaseDefs().size();
}