code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
private String getMime(String name, String delimiter) {
if (StringUtils.hasText(name)) {
return name.substring(name.lastIndexOf(delimiter), name.length());
}
return null;
} | java |
public void setCompressedData(byte[] compressedData) {
if (compressedData != null) {
this.compressedData = Arrays.copyOf(compressedData, compressedData.length);
}
} | java |
public BankAccount create(BankAccount bankAccount, String customerId) throws BaseException {
logger.debug("Enter BankAccountService::create");
if (StringUtils.isBlank(customerId)) {
logger.error("IllegalArgumentException {}", customerId);
throw new IllegalArgumentException("customerId cannot be empty or n... | java |
@SuppressWarnings("unchecked")
public QueryResponse getAllBankAccounts(String customerId, int count) throws BaseException {
logger.debug("Enter BankAccountService::getAllBankAccounts");
if (StringUtils.isBlank(customerId)) {
logger.error("IllegalArgumentException {}", customerId);
throw new IllegalArgume... | java |
private String extractEntity(Object obj) {
String name = obj.getClass().getSimpleName();
String[] extracted = name.split("\\$\\$");
if (extracted.length == NUM_3) {
return extracted[0];
}
return null;
} | java |
protected String extractPropertyName(Method method) {
String name = method.getName();
name = name.startsWith("is") ? name.substring(NUM_2) : name.substring(NUM_3);
return name;
} | java |
public Object getObject(Type type) throws FMSException {
Object obj = null;
if (type instanceof ParameterizedType) {
ParameterizedType pt = (ParameterizedType) type;
String typeString = pt.getActualTypeArguments()[0].toString().split(" ")[1];
try {
obj = Class.forName(typeString).newInstance();
} ca... | java |
public List<EntitlementsResponse.Entitlement> getEntitlement() {
if (entitlement == null) {
entitlement = new ArrayList<EntitlementsResponse.Entitlement>();
}
return this.entitlement;
} | java |
public void prepareResponse(Request request, Response response, Entity entity) {
entity.setIntuit_tid(response.getIntuit_tid());
entity.setRequestId(request.getContext().getRequestId());
} | java |
public Expression<Boolean> eq(Boolean value) {
String valueString = value.toString();
return new Expression<Boolean>(this, Operation.eq, valueString);
} | java |
public Expression<Boolean> neq(Boolean value) {
String valueString = value.toString();
return new Expression<Boolean>(this, Operation.neq, valueString);
} | java |
public Expression<Boolean> in(Boolean[] value) {
String listBooleanString = "";
Boolean firstNumber = true;
for (Boolean v : value) {
if (firstNumber) {
listBooleanString = listBooleanString.concat("(").concat(v.toString());
firstNumber = false;
} else {
listBooleanString = listBooleanString.con... | java |
public List<JAXBElement<? extends IntuitEntity>> getIntuitObject() {
if (intuitObject == null) {
intuitObject = new ArrayList<JAXBElement<? extends IntuitEntity>>();
}
return this.intuitObject;
} | java |
private static PropertyHelper init() {
propertHelper = new PropertyHelper();
try
{
ResourceBundle bundle = ResourceBundle.getBundle("ippdevkit");
propertHelper.setVersion(bundle.getString("version"));
propertHelper.setRequestSource(bundle.getString("request.source"));
propertHelper.setRequestSourceHead... | java |
@SuppressWarnings("unchecked")
private <T extends IEntity> List<T> getEntities(QueryResponse queryResponse) {
List<T> entityList = new ArrayList<T>();
List<JAXBElement<? extends IntuitEntity>> intuitObjectsList = queryResponse.getIntuitObject();
// Iterate the IntuitObjects list in QueryResponse and convert t... | java |
private boolean isDownload(String action) {
if (StringUtils.hasText(action) && action.equals(OperationType.DOWNLOAD.toString())) {
return true;
}
return false;
} | java |
private InputStream getDownloadedFile(String response) throws FMSException {
if (response != null) {
try {
URL url = new URL(response);
return url.openStream();
} catch (Exception e) {
throw new FMSException("Exception while downloading the file from URL.", e);
}
}
return null;
} | java |
private void executeRequestInterceptors(final IntuitMessage intuitMessage) throws FMSException {
Iterator<Interceptor> itr = requestInterceptors.iterator();
while (itr.hasNext()) {
Interceptor interceptor = itr.next();
interceptor.execute(intuitMessage);
}
} | java |
private void executeResponseInterceptors(final IntuitMessage intuitMessage) throws FMSException {
Iterator<Interceptor> itr = responseInterceptors.iterator();
while (itr.hasNext()) {
Interceptor interceptor = itr.next();
interceptor.execute(intuitMessage);
}
} | java |
protected void invokeFeature(String featureSwitch, Feature feature ) {
if(Config.getBooleanProperty(featureSwitch,true)) {
feature.execute();
}
} | java |
protected void updateBigDecimalScale(IntuitEntity intuitType) {
Feature feature = new Feature() {
private IntuitEntity obj;
public <T extends IntuitEntity> void set(T object) {
obj = object;
}
public void execute() {
(new BigDecima... | java |
private void prepareDataServiceRequest(IntuitMessage intuitMessage, RequestElements requestElements, Map<String, String> requestParameters,
String action) throws FMSException {
requestParameters.put(RequestElements.REQ_PARAM_RESOURCE_URL,
getUri(intuitMessage.isPlatformService(), action, requestElements.getCon... | java |
private void setupAcceptEncoding(Map<String, String> requestHeaders) {
// validates whether to add headers for accept-encoding for compression
String acceptCompressionFormat = Config.getProperty(Config.COMPRESSION_RESPONSE_FORMAT);
if (StringUtils.hasText(acceptCompressionFormat)) {
... | java |
private void setupAcceptHeader(String action, Map<String, String> requestHeaders, Map<String, String> requestParameters) {
// validates whether to add headers for accept for serialization
String serializeAcceptFormat = getSerializationResponseFormat();
if (StringUtils.hasText(serializeAcceptForm... | java |
private <T extends IEntity> String getEntityName(T entity) {
if (entity != null) {
return entity.getClass().getSimpleName().toLowerCase();
}
return null;
} | java |
private <T extends IEntity> String getUri(Boolean platformService, String action, Context context, Map<String, String> requestParameters, Boolean entitlementService)
throws FMSException {
String uri = null;
if (!platformService) {
ServiceType serviceType = context.getIntuitServiceType();
if (entitlemen... | java |
protected String getBaseUrl(String url) {
if (url.endsWith("/")) {
return url.substring(0, url.length() - 1);
}
else {
return url;
}
} | java |
private <T extends IEntity> String prepareQBOUri(String entityName, Context context,
Map<String, String> requestParameters) throws FMSException {
StringBuilder uri = new StringBuilder();
if(entityName.equalsIgnoreCase("Taxservice"))
{
entityName = entityName + "/" + "taxcode";
}
// constructs... | java |
private void addEntityID(Map<String, String> requestParameters, StringBuilder uri) {
if (StringUtils.hasText(requestParameters.get(RequestElements.REQ_PARAM_ENTITY_ID))) {
uri.append("/").append(requestParameters.get(RequestElements.REQ_PARAM_ENTITY_ID));
}
} | java |
private void addEntitySelector(Map<String, String> requestParameters, StringBuilder uri) {
if (StringUtils.hasText(requestParameters.get(RequestElements.REQ_PARAM_ENTITY_SELECTOR))) {
uri.append("/").append(requestParameters.get(RequestElements.REQ_PARAM_ENTITY_SELECTOR));
}
} | java |
private <T extends IEntity> String prepareQBOPremierUri(String entityName, Context context,
Map<String, String> requestParameters) throws FMSException {
StringBuilder uri = new StringBuilder();
// constructs request URI
uri.append(Config.getProperty("BASE_URL_QBO_OLB")).append("/").append(context.getRealmID(... | java |
private String prepareIPSUri(String action, Context context) throws FMSException {
StringBuilder uri = new StringBuilder();
uri.append(Config.getProperty(Config.BASE_URL_PLATFORMSERVICE)).append("/").append(context.getAppDBID())
.append("?act=").append(action).append("&token=").append(context.getAppToken());
r... | java |
private String buildRequestParams(Map<String, String> requestParameters) throws FMSException {
StringBuilder reqParams = new StringBuilder();
Set<String> keySet = requestParameters.keySet();
Iterator<String> keySetIterator = keySet.iterator();
while (keySetIterator.hasNext()) {
String key = keySetIterator.n... | java |
private void prepareUploadParams(RequestElements requestElements) {
Map<String, String> requestHeaders = requestElements.getRequestHeaders();
UploadRequestElements uploadRequestElements = requestElements.getUploadRequestElements();
String boundaryId = uploadRequestElements.getBoundaryId();
String formMetadataNa... | java |
private boolean isDownloadPDF(Map<String, String> map) {
return StringUtils.hasText(map.get(RequestElements.REQ_PARAM_ENTITY_SELECTOR))
&& map.get(RequestElements.REQ_PARAM_ENTITY_SELECTOR).equalsIgnoreCase(ContentTypes.PDF.name());
} | java |
private boolean isSendEmail(Map<String, String> map) {
return StringUtils.hasText(map.get(RequestElements.REQ_PARAM_ENTITY_SELECTOR))
&& map.get(RequestElements.REQ_PARAM_ENTITY_SELECTOR).equalsIgnoreCase(RequestElements.PARAM_SEND_SELECTOR);
} | java |
private boolean isUpload(String action) {
if (StringUtils.hasText(action) && action.equals(OperationType.UPLOAD.toString())) {
return true;
}
return false;
} | java |
private SyncError getSyncError(JsonNode jsonNode) throws IOException {
ObjectMapper mapper = new ObjectMapper();
SimpleModule simpleModule = new SimpleModule("SyncErrorDeserializer", new Version(1, 0, 0, null));
simpleModule.addDeserializer(SyncError.class, new SyncErrorDeserializer());
mapper.registerModule(... | java |
public Expression<Enum<?>> eq(Enum<?> value) {
String valueString = "'" + EnumPath.getValue(value) + "'";
return new Expression<Enum<?>>(this, Operation.eq, valueString);
} | java |
private static String getValue(Enum<?> value){
try{
Method m = value.getClass().getDeclaredMethod("value");
return (String) m.invoke(value);
} catch (NoSuchMethodException ex){
} catch (IllegalAccessException ex){
} catch (InvocationTargetException ex){
}
return value.toString();
} | java |
public Token createToken(Token token) throws BaseException {
logger.debug("Enter TokenService::createToken");
// prepare API url
String apiUrl = requestContext.getBaseUrl() + "tokens";
logger.info("apiUrl - " + apiUrl);
// assign TypeReference for deserialization
TypeReference<Token> typeReference = ne... | java |
private String getCDCQueryJson(CDCQuery cdcQuery) throws SerializationException {
ObjectMapper mapper = getObjectMapper();
String json = null;
try {
json = mapper.writeValueAsString(cdcQuery);
} catch (Exception e) {
throw new SerializationException(e);
}
return json;
} | java |
private ObjectMapper getObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
AnnotationIntrospector primary = new JacksonAnnotationIntrospector();
AnnotationIntrospector secondary = new JaxbAnnotationIntrospector();
AnnotationIntrospector pair = new AnnotationIntrospectorPair(primary, secondary);
mappe... | java |
public OAuthMigrationResponse migrate() throws ConnectionException {
logger.debug("Enter OAuthMigrationClient::migrate");
try {
HttpRequestClient client = new HttpRequestClient(oAuthMigrationRequest.getOauth2config().getProxyConfig());
//prepare post json
String requestjson = new JSONObjec... | java |
public Date unmarshal(String value) {
if (value != null) {
if (value.length() >= lengthOfDateFmtYYYY_MM_DD) {
//Extract just the date from the string YYYY-MM-DD
value = value.substring(0, lengthOfDateFmtYYYY_MM_DD);
boolean isMatch = value.matches(datePattern);
if (isMatch) {
return Dat... | java |
public <T extends IEntity> void addEntity(T entity, OperationEnum operation, String bId) {
BatchItemRequest batchItemRequest = new BatchItemRequest();
batchItemRequest.setBId(bId);
batchItemRequest.setOperation(operation);
batchItemRequest.setIntuitObject(getIntuitObject(entity));
batchItemRequests.add(... | java |
public void addQuery(String query, String bId) {
BatchItemRequest batchItemRequest = new BatchItemRequest();
batchItemRequest.setBId(bId);
batchItemRequest.setQuery(query);
batchItemRequests.add(batchItemRequest);
bIds.add(bId);
} | java |
public void addCDCQuery(List<? extends IEntity> entities, String changedSince, String bId) throws FMSException {
if (entities == null || entities.isEmpty()) {
throw new FMSException("Entities is required.");
}
if (!StringUtils.hasText(changedSince)) {
throw new FMSException("changedSince is required."... | java |
public void addReportQuery(String reportQuery, String bId) {
BatchItemRequest batchItemRequest = new BatchItemRequest();
batchItemRequest.setBId(bId);
batchItemRequest.setReportQuery(reportQuery);
batchItemRequests.add(batchItemRequest);
bIds.add(bId);
} | java |
@SuppressWarnings("unchecked")
protected <T> JAXBElement<? extends IntuitEntity> getIntuitObject(T entity) {
Class<?> objectClass = entity.getClass();
String methodName = "create".concat(objectClass.getSimpleName());
ObjectFactory objectEntity = new ObjectFactory();
Class<?> objectEntityClass = objectEntity.ge... | java |
public CredentialsProvider setProxyAuthentication(ProxyConfig proxyConfig) {
if (proxyConfig == null) {
return null;
}
String username = proxyConfig.getUsername();
String password = proxyConfig.getPassword();
if (!username.isEmpty() && !password.isEmpty()) {
String host = proxyConfig.getHost();
Str... | java |
public Response makeJsonRequest(Request request, OAuthMigrationRequest migrationRequest) throws InvalidRequestException {
logger.debug("Enter HttpRequestClient::makeJsonRequest");
//create oauth consumer using tokens
OAuthConsumer consumer = new CommonsHttpOAuthConsumer(migrationRequest.getConsumerKey(), migrati... | java |
public static Marshaller createMarshaller() throws JAXBException {
Marshaller marshaller = MessageUtilsHelper.getContext().createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
return marshaller;
} | java |
public URL constructURL() throws InvalidRequestException {
String stringUri = url;
try {
URI uri = new URI(stringUri);
return uri.toURL();
} catch (final URISyntaxException e) {
throw new InvalidRequestException("Bad URI: " + stringUri, e);
} catch... | java |
public OptionalSyntax where(Expression<?>... expression) {
for (Expression<?> exp : expression) {
getMessage().getOptional().add(exp.toString());
LOG.debug("expression: " + exp);
}
QueryMessage mess = getMessage();
return new OptionalSyntax(mess);
} | java |
public OptionalSyntax orderBy(Path<?>... path) {
String fieldList = "";
boolean firstExpression = true;
for (Path<?> exp : path) {
if (firstExpression) {
fieldList = fieldList.concat(exp.toString());
firstExpression = false;
} else {
fieldList = fieldList.concat(", ").concat(exp.toString());
... | java |
public OptionalSyntax skip(int num) {
getMessage().setStartposition(num);
QueryMessage mess = getMessage();
return new OptionalSyntax(mess);
} | java |
public OptionalSyntax take(int num) {
getMessage().setMaxresults(num);
QueryMessage mess = getMessage();
return new OptionalSyntax(mess);
} | java |
public static String getResult(HttpResponse response) throws IOException {
StringBuffer result = new StringBuffer();
if (response.getEntity() != null && response.getEntity().getContent() != null) {
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
String line = ... | java |
JavaXmlQuery compile(XPath xpath) {
try {
this.expression = xpath.compile(getQuery());
} catch (XPathExpressionException e) {
LOGGER.error("Cannot compile XPath query: " + getQuery(), e);
}
return this;
} | java |
private Object getObjectValue(XmlNode node, String fieldName) {
// we have to take into account the fact that fieldName will be in the lower case
if (node != null) {
String name = node.getName();
switch (node.getType()) {
case XmlNode.ATTRIBUTE_NODE:
... | java |
private String getStringValue(XmlNodeArray nodes) {
StringBuilder stringBuilder = new StringBuilder();
// If all we have is just a bunch of nodes and the user wants a string
// we'll use a parent element called <string> to have a valid XML document
stringBuilder.append("<string>");
... | java |
private Object getObjectValue(Node node, String fieldName) {
// we have to take into account the fact that fieldName will be in the lower case
if (node != null) {
String name = node.getLocalName();
switch (node.getNodeType()) {
case Node.ATTRIBUTE_NODE:
... | java |
private String getStringValue(Object o) {
if (o instanceof String) {
return (String) o;
} else if (o instanceof NodeArray) {
NodeArray array = (NodeArray) o;
switch (array.size()) {
case 0:
return null;
case 1: {
... | java |
private String getStringValue(Node node) {
switch (node.getNodeType()) {
case Node.ATTRIBUTE_NODE:
case Node.TEXT_NODE:
return node.getNodeValue();
default: {
try {
Transformer transformer = TRANSFORMER_FACTORY.newTransforme... | java |
private String getStringValue(NodeArray nodes) {
StringBuilder stringBuilder = new StringBuilder();
// If all we have is just a bunch of nodes and the user wants a string
// we'll use a parent element called <string> to have a valid XML document
stringBuilder.append("<string>");
... | java |
@SuppressWarnings({"unchecked", "rawtypes"})
private void populateMap(Map map, Node node) {
Map.Entry entry = getMapEntry(node);
if (entry != null) {
map.put(entry.getKey(), entry.getValue());
}
} | java |
public void addAttribute(final String _name, final String _value) {
this.attributes.put(_name, new XmlNode() {
{
this.name = _name;
this.value = _value;
this.valid = true;
this.type = XmlNode.ATTRIBUTE_NODE;
}
});
... | java |
public static Object getPrimitiveValue(String value, PrimitiveCategory primitiveCategory) {
if (value != null) {
try {
switch (primitiveCategory) {
case BOOLEAN:
return Boolean.valueOf(value);
case BYTE:
... | java |
public static ObjectInspector getStandardJavaObjectInspectorFromTypeInfo(TypeInfo typeInfo, XmlProcessor xmlProcessor) {
switch (typeInfo.getCategory()) {
case PRIMITIVE: {
return PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(((PrimitiveTypeInfo) typeInfo).getPrimit... | java |
public static StructObjectInspector getStandardStructObjectInspector(List<String> structFieldNames,
List<ObjectInspector> structFieldObjectInspectors,
XmlProcessor xmlProcessor) {
return new XmlStructObjectInspector(structFieldNames, structFieldObjectInspectors, xmlProcessor);
} | java |
public void transform(XmlNode node, StringBuilder builder) {
switch (node.getType()) {
case XmlNode.ELEMENT_NODE: {
builder.append("<");
builder.append(node.getName());
for (XmlNode attribute : node.getAttributes().values()) {
trans... | java |
public void setVideoURI(Uri uri, Map<String, String> headers) {
mUri = uri;
mHeaders = headers;
mSeekWhenPrepared = 0;
openVideo();
requestLayout();
invalidate();
} | java |
public static StartupSettings fromJSONFile(File jsonFile) throws JSONException,
FileNotFoundException, IOException {
// Read the file to a String.
StringBuffer buffer = new StringBuffer();
try (BufferedReader br = new BufferedReader(new FileReader(jsonFile)) ){
String line;
while ((lin... | java |
protected void sendMembershipList(LocalGossipMember me, List<LocalGossipMember> memberList) {
GossipService.LOGGER.debug("Send sendMembershipList() is called.");
me.setHeartbeat(System.currentTimeMillis());
LocalGossipMember member = selectPartner(memberList);
if (member == null) {
return;
}
... | java |
public void run() {
for (LocalGossipMember member : members.keySet()) {
if (member != me) {
member.startTimeoutTimer();
}
}
try {
passiveGossipThread = passiveGossipThreadClass.getConstructor(GossipManager.class)
.newInstance(this);
gossipThreadExecutor.execute(... | java |
public void shutdown() {
gossipServiceRunning.set(false);
gossipThreadExecutor.shutdown();
if (passiveGossipThread != null) {
passiveGossipThread.shutdown();
}
if (activeGossipThread != null) {
activeGossipThread.shutdown();
}
try {
boolean result = gossipThreadExecutor.awa... | java |
private boolean isObjectHasValue(Object targetObj) {
for (Map.Entry<String, String> entry : cellMapping.entrySet()) {
if (!StringUtils.equalsIgnoreCase(HEADER_KEY, entry.getKey())) {
if (StringUtils.isNotBlank(getPropertyValue(targetObj, entry.getValue()))) {
return true;
}
}
... | java |
private void readSheet(StylesTable styles, ReadOnlySharedStringsTable sharedStringsTable,
InputStream sheetInputStream) throws IOException, ParserConfigurationException, SAXException {
SAXParserFactory saxFactory = SAXParserFactory.newInstance();
XMLReader sheetParser = saxFactory.newSAXParser().getXMLRe... | java |
private static String getProgramProperty(String property) {
if (System.getProperty(property) != null) {
return System.getProperty(property).trim();
}
Properties prop = new Properties();
try (InputStream input = new FileInputStream(SELENIFIED)) {
prop.load(input);
... | java |
public static boolean generatePDF() {
String generatePDF = getProgramProperty(GENERATE_PDF);
if (generatePDF == null) {
return false;
}
if ("".equals(generatePDF)) {
return true;
}
return "true".equalsIgnoreCase(generatePDF);
} | java |
public static boolean packageResults() {
String packageResults = getProgramProperty(PACKAGE_RESULTS);
if (packageResults == null) {
return false;
}
if ("".equals(packageResults)) {
return true;
}
return "true".equalsIgnoreCase(packageResults);
... | java |
public static String getProxy() throws InvalidProxyException {
String proxy = getProgramProperty(PROXY);
if (proxy == null) {
throw new InvalidProxyException(PROXY_ISNT_SET);
}
String[] proxyParts = proxy.split(":");
if (proxyParts.length != 2) {
throw new... | java |
public static String getAppURL(String clazz, ITestContext context) throws InvalidHTTPException {
String appURL = checkAppURL(null, (String) context.getAttribute(clazz + APP_URL), "The provided app via test case setup '");
Properties prop = new Properties();
try (InputStream input = new FileInput... | java |
private static String checkAppURL(String originalAppURL, String newAppURL, String s) {
if (newAppURL != null && !"".equals(newAppURL)) {
if (!newAppURL.toLowerCase().startsWith("http") && !newAppURL.toLowerCase().startsWith("file")) {
newAppURL = "http://" + newAppURL;
}
... | java |
public static String getBrowser() {
String browser = getProgramProperty(BROWSER);
if (browser == null || "".equals(browser)) {
browser = Browser.BrowserName.HTMLUNIT.toString();
}
return browser;
} | java |
public static boolean runHeadless() {
String headless = getProgramProperty(HEADLESS);
if (headless == null) {
return false;
}
if ("".equals(headless)) {
return true;
}
return "true".equalsIgnoreCase(headless);
} | java |
public static String getOptions() throws InvalidBrowserOptionsException {
String options = getProgramProperty(OPTIONS);
if (options == null || "".equals(options)) {
throw new InvalidBrowserOptionsException("Browser options aren't set");
}
return options;
} | java |
public void present(double seconds) {
try {
double timeTook = elementPresent(seconds);
checkPresent(seconds, timeTook);
} catch (TimeoutException e) {
checkPresent(seconds, seconds);
}
} | java |
public void notPresent(double seconds) {
double end = System.currentTimeMillis() + (seconds * 1000);
try {
WebDriverWait wait = new WebDriverWait(element.getDriver(), (long) seconds, DEFAULT_POLLING_INTERVAL);
wait.until(ExpectedConditions.not(ExpectedConditions.presenceOfAllElem... | java |
public void displayed(double seconds) {
double end = System.currentTimeMillis() + (seconds * 1000);
try {
double timeTook = elementPresent(seconds);
WebDriverWait wait = new WebDriverWait(element.getDriver(), (long) (seconds - timeTook), DEFAULT_POLLING_INTERVAL);
wai... | java |
public void notDisplayed(double seconds) {
double end = System.currentTimeMillis() + (seconds * 1000);
try {
double timeTook = elementPresent(seconds);
WebDriverWait wait = new WebDriverWait(element.getDriver(), (long) (seconds - timeTook), DEFAULT_POLLING_INTERVAL);
... | java |
public void checked(double seconds) {
double end = System.currentTimeMillis() + (seconds * 1000);
try {
elementPresent(seconds);
while (!element.is().checked() && System.currentTimeMillis() < end) ;
double timeTook = Math.min((seconds * 1000) - (end - System.currentTi... | java |
public void editable(double seconds) {
double end = System.currentTimeMillis() + (seconds * 1000);
try {
elementPresent(seconds);
while (!element.is().editable() && System.currentTimeMillis() < end) ;
double timeTook = Math.min((seconds * 1000) - (end - System.current... | java |
public void enabled(double seconds) {
double end = System.currentTimeMillis() + (seconds * 1000);
try {
double timeTook = elementPresent(seconds);
WebDriverWait wait = new WebDriverWait(element.getDriver(), (long) (seconds - timeTook), DEFAULT_POLLING_INTERVAL);
wait.... | java |
public void notEnabled(double seconds) {
double end = System.currentTimeMillis() + (seconds * 1000);
try {
double timeTook = elementPresent(seconds);
WebDriverWait wait = new WebDriverWait(element.getDriver(), (long) (seconds - timeTook), DEFAULT_POLLING_INTERVAL);
wa... | java |
private Response call(Method method, String endpoint, Request params, File inputFile) {
StringBuilder action = new StringBuilder();
action.append("Making <i>");
action.append(method.toString());
action.append("</i> call to <i>");
action.append(http.getServiceBaseUrl()).append(end... | java |
public void setupProxy() throws InvalidProxyException {
// are we running through a proxy
if (Property.isProxySet()) {
// set the proxy information
Proxy proxy = new Proxy();
proxy.setHttpProxy(Property.getProxy());
desiredCapabilities.setCapability(Capabi... | java |
public WebDriver setupDriver() throws InvalidBrowserException {
WebDriver driver;
// check the browser
switch (browser.getName()) {
case HTMLUNIT:
System.getProperties().put("org.apache.commons.logging.simplelog.defaultlog", "fatal");
java.util.logging... | java |
public void addExtraCapabilities(DesiredCapabilities extraCapabilities) {
if (extraCapabilities != null && browser.getName() != BrowserName.NONE) {
desiredCapabilities = desiredCapabilities.merge(extraCapabilities);
}
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.