public JsonToken peek() { try { return reader.peek(); } catch (IOException e) { throw new CukesRuntimeException(e); } }
public Attribute getAttribute(String attribute) { if (entity == null) { throw new CukesRuntimeException("Entity was not loaded"); } return entity.get(attribute); }
public Attribute getAttribute(String attribute) { if (entity == null) { throw new CukesRuntimeException("Entity was not loaded"); } return entity.get(attribute); }
public String nextString() { try { return reader.nextString(); } catch (IOException e) { throw new CukesRuntimeException(e); } }
public void nextName() { try { reader.nextName(); } catch (IOException e) { throw new CukesRuntimeException(e); } }
public Attribute getNotNullAttribute(String attribute) { if (entity == null) { throw new CukesRuntimeException("Entity was not loaded"); } Attribute attr = entity.get(attribute); assertThat("Expected that attribute '" + attribute + "' will be present", attr, notNullValue()); return attr; }
public boolean nextBoolean() { try { return reader.nextBoolean(); } catch (IOException e) { throw new CukesRuntimeException(e); } }
public Attribute getNotNullAttribute(String attribute) { if (entity == null) { throw new CukesRuntimeException("Entity was not loaded"); } Attribute attr = entity.get(attribute); assertThat("Expected that attribute '" + attribute + "' will be present", attr, notNullValue()); return attr; }
public void nextNull() { try { reader.nextNull(); } catch (IOException e) { throw new CukesRuntimeException(e); } }
public boolean nextBoolean() { try { return reader.nextBoolean(); } catch (IOException e) { throw new CukesRuntimeException(e); } }
public void endArray() { try { reader.endArray(); } catch (IOException e) { throw new CukesRuntimeException(e); } }
public void close() { if (context != null) { try { context.close(); } catch (NamingException e) { throw new CukesRuntimeException(e); } } context = null; }
public void close() { try { reader.close(); } catch (IOException e) { throw new CukesRuntimeException(e); } }
private void addExternalModules() { Reflections reflections = new Reflections("lv.ctco.cukes"); for (Class targetClass : reflections.getTypesAnnotatedWith(CukesInjectableModule.class)) { try { Constructor<Module> constructor = targetClass.getConstructor(); Module module = constructor.newInstance(); addModule(module); } catch (Exception e) { throw new CukesRuntimeException("Unable to add External Module to Guice"); } } }
public void importLdif(String ldif) { try { importLdif(new ByteArrayInputStream(ldif.getBytes("UTF-8"))); } catch (IOException e) { throw new CukesRuntimeException(e); } }
private void importLdif(InputStream inputStream) { try { Map<String, Attributes> entities = LDIFUtils.read(inputStream); for (Map.Entry<String, Attributes> entry : entities.entrySet()) { entityService.createEntity(entry.getKey(), entry.getValue()); } } catch (IOException e) { throw new CukesRuntimeException(e); } }
private void importLdif(InputStream inputStream) { try { Map<String, Attributes> entities = LDIFUtils.read(inputStream); for (Map.Entry<String, Attributes> entry : entities.entrySet()) { entityService.createEntity(entry.getKey(), entry.getValue()); } } catch (IOException e) { throw new CukesRuntimeException(e); } }
public void importLdifFromFile(String ldifFile) { try { String path = filePathService.normalize(ldifFile); importLdif(new FileInputStream(path)); } catch (FileNotFoundException e) { throw new CukesRuntimeException(e); } }
public void modifyByDn(String dn, List<ModificationItem> modificationItems) { try { LdapContext context = connectionService.getContext(); context.modifyAttributes(dn, modificationItems.toArray(new ModificationItem[modificationItems.size()])); } catch (NamingException e) { throw new CukesRuntimeException("Cannot modify entity by dn " + dn, e); } finally { connectionService.close(); } } }
public void initNewSpecification() { try { specification = RestAssured.given().config(restConfig.getConfig()); awaitCondition = null; onCreate(); } catch (Exception e) { throw new CukesRuntimeException(e); } }