/** * Common initialization code for new list entries. */ private void init() { customElements = new CustomElementCollection(); this.setExtension(customElements); }
/** * Declares the extensions used by the XML parser in the given profile object. */ public void declareExtensions(ExtensionProfile extProfile) { extProfile.declare(ListEntry.class, CustomElementCollection.getDefaultDescription()); } }
/** * Get single Entry for {@link IBrowserConf} for single row in the Google * sheet * * @param row * @return */ private IBrowserConf getBrowserConfFromRow(ListEntry row) { Map<String, String> browserMap = new HashMap<String, String>(); for (String tag : row.getCustomElements().getTags()) { browserMap.put(tag, row.getCustomElements().getValue(tag)); } return new PrepareDriverConf(browserMap).refineBrowserValues() .checkForRules().get(); }
@Override public String getVisibleCellValue(final SpreadsheetColumn column) { super.validateColumn(column); try { final String googleColumnId = ((GSColumn) column).getGoogleColumnId(); final String value = this.listEntry.getCustomElements().getValue(googleColumnId); return value == null ? "" : value; // null is returned when cell is completely empty } catch (Exception e) { e.printStackTrace(); throw new IllegalStateException(e.getMessage()); } }
private void extractGoogleIdsFromRow(final ListEntry row, final int lastColumnIndex) { int columnIndex = 1 - this.getColumnOffset(); final Iterator<String> it = row.getCustomElements().getTags().iterator(); // Google preserves column ordering while (it.hasNext()) { final String googleColumnId = it.next(); final GSColumn column = (GSColumn) super.getColumn(columnIndex); if (column != null) { column.setGoogleColumnId(googleColumnId); } final boolean lastColumnReached = columnIndex == lastColumnIndex; if (lastColumnReached) { break; } columnIndex++; } }
@Override protected SpreadsheetRow insertRow(final Map<SpreadsheetColumn, String> values) { LOGGER.debug("*** Inserting Row: " + values); this.checkThatWorksheetExists(); try { ListEntry listEntry = new ListEntry(); for (final Map.Entry<SpreadsheetColumn, String> entry : values.entrySet()) { final GSColumn column = (GSColumn) entry.getKey(); String value = entry.getValue().equals("") ? this.getDefaultEmptyCellValue() : entry.getValue(); listEntry.getCustomElements().setValueLocal(column.getGoogleColumnId(), value); } listEntry = this.model.insertRow(worksheetEntry, listEntry); this.worksheetEntry = this.worksheetEntry.getSelf(); final GSRow row = new GSRow(this, listEntry); this.rows.add(row); return row; } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } }
DataPerEnvironment testEnvHolder = null; for (ListEntry row : rows.getEntries()) { LOGGER.debug("Row is: " + row.getCustomElements().getValue("key") + "value: " + row.getCustomElements().getValue("value")); if (row.getCustomElements().getValue("key").contains("Environment")) { if (testEnvHolder != null) { testEnvironmentMap.add(testEnvHolder); .getValue("value")); row.getCustomElements().getValue("key"), row .getCustomElements().getValue("value")); keyValuePair.put(row.getCustomElements().getValue("key"), row .getCustomElements().getValue("value"));
@Override public void overwriteCellValue(final SpreadsheetColumn column, final String value) { super.validateColumn(column); try { final GSWorksheet worksheet = (GSWorksheet) super.worksheet; final String googleColumnId = ((GSColumn) column).getGoogleColumnId(); // getting list entry again as the API seems to lose touch with the existing one final ListEntry listEntry = worksheet.getListEntry(this); listEntry.getCustomElements().setValueLocal(googleColumnId, value); this.listEntry = listEntry.update(); worksheet.getSelf(); } catch (Exception e) { e.printStackTrace(); throw new IllegalStateException(e.getMessage()); } }
/** * get ImplementMap frmo the Mapping sheet for single row * * @param row * @return */ private ImplementIMap getMap(ListEntry row) { LOGGER.debug("In preparing the Map:"); return new ImplementIMap.Builder() .withClientEnvironment( getList(row.getCustomElements() .getValue("browsersheet"))) .withTestData(row.getCustomElements().getValue("testdatasheet")) .withRunStartegy( row.getCustomElements().getValue("runstrategy")) .build(); }
/** * Declares the extensions used by the XML parser in the given profile object. */ public void declareExtensions(ExtensionProfile extProfile) { extProfile.declare(ListEntry.class, CustomElementCollection.getDefaultDescription()); } }
/** * Common initialization code for new list entries. */ private void init() { customElements = new CustomElementCollection(); this.setExtension(customElements); }
/*** * Get the primary data from the Mapping sheet in Google sheet, This would * be fed to MappedValue for refinement */ @Override public Map<String, IMappingData> getPrimaryData() { if (mappingBucket.isEmpty()) { URL listFeedURL; try { listFeedURL = getWorkSheet( GoogleSheetConstant.GOOGLE_MAP_SHEET_NAME) .getListFeedUrl(); ListFeed listFeed = service .getFeed(listFeedURL, ListFeed.class); for (ListEntry row : listFeed.getEntries()) { mappingBucket.put( row.getCustomElements().getValue("methodname"), getMap(row)); } } catch (IOException e) { LOGGER.error(e); } catch (ServiceException e) { LOGGER.error(e); } } return mappingBucket; }