Skip to content

Commit

Permalink
Data base:
Browse files Browse the repository at this point in the history
- improved description of steps
  • Loading branch information
TikhomirovSergey committed Sep 3, 2018
1 parent b1d5c43 commit 0b97394
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ subprojects {
apply plugin: 'maven-publish'

group 'ru.tinkoff.qa.neptune'
version '0.1.3-ALPHA'
version '0.1.4-ALPHA'

sourceCompatibility = 1.9
targetCompatibility = 1.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public DataBaseSteps switchTo(JDOPersistenceManagerFactory jdoPersistenceManager
* @return self-reference
*/
public DataBaseSteps switchTo(CharSequence persistenceUnitName) {
return switchTo(getPersistenceManagerFactory(persistenceUnitName.toString(), true));
return switchTo(getPersistenceManagerFactory(persistenceUnitName, true));
}

public DataBaseSteps switchToDefault() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public Function<DataBaseSteps, List<T>> get() {

@Override
protected Function<DataBaseSteps, List<T>> getEndFunction() {
String description = format("Delete objects: \n %s", toBeDeleted.toString());
String description = format("Deleted objects: \n %s", toBeDeleted.toString());
return toGet(description, dataBaseSteps -> {
dataBaseSteps.getCurrentPersistenceManager().deletePersistentAll(toBeDeleted);
PersistableList<T> result = new PersistableList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ static boolean isPersistentManagerFactory(String name) {
* is thrown. {@code null} is returned otherwise.
* @return an instance of {@link PersistenceManagerFactorySupplier} found by name.
*/
public static JDOPersistenceManagerFactory getPersistenceManagerFactory(String name,
public static JDOPersistenceManagerFactory getPersistenceManagerFactory(CharSequence name,
boolean throwExceptionIfNotPresent) {
checkArgument(!isBlank(name), "Persistence unit name is expected to be not a blank string.");
return getPersistenceManagerFactorySuppliers().stream().filter(persistenceManagerFactorySupplier ->
persistenceManagerFactorySupplier.name().equalsIgnoreCase(name))
persistenceManagerFactorySupplier.name().equalsIgnoreCase(name.toString()))
.findFirst()
.map(PersistenceManagerFactorySupplier::get).orElseGet(() -> {
if (!throwExceptionIfNotPresent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public final class SelectListByIdsSupplier<T extends PersistableObject>
extends ByIdsSequentialGetStepSupplier<T, List<T>, SelectListByIdsSupplier<T>> {

private static final String DESCRIPTION = "Get result as a list of type %s by ids %s";
private static final String DESCRIPTION = "Result as a list of type %s by ids %s";

private SelectListByIdsSupplier(Class<T> ofType, Object... ids) {
super(ofType, ids);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public final class SelectListByQuerySupplier<T extends PersistableObject>
extends ByQuerySequentialGetStepSupplier<T, List<T>, SelectListByQuerySupplier<T>> {

private static final String DESCRIPTION = "Get selection result as a list";
private static final String DESCRIPTION = "Selection result as a list";

private SelectListByQuerySupplier(QueryBuilderFunction<T> queryBuilder) {
super(queryBuilder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public final class SelectSingleObjectByIdSupplier<T extends PersistableObject>
extends ByIdsSequentialGetStepSupplier<T, T, SelectSingleObjectByIdSupplier<T>> {

private static final String DESCRIPTION = "Get result as a single item of type %s by id %s";
private static final String DESCRIPTION = "Result as a single item of type %s by id %s";

private SelectSingleObjectByIdSupplier(Class<T> ofType, Object id) {
super(ofType, id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public final class SelectSingleObjectByQuerySupplier<T extends PersistableObject>
extends ByQuerySequentialGetStepSupplier<T, T, SelectSingleObjectByQuerySupplier<T>> {

private static final String DESCRIPTION = "Get selection result as a single item";
private static final String DESCRIPTION = "Selection result as a single item";


private SelectSingleObjectByQuerySupplier(QueryBuilderFunction<T> queryBuilder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static <T extends PersistableObject> StoreSequentialGetStepSupplier<T> st

@Override
protected Function<DataBaseSteps, List<T>> getEndFunction() {
String description = format("Store objects: \n %s", toBePersisted.toString());
String description = format("Stored objects: \n %s", toBePersisted.toString());
return toGet(description, dataBaseSteps -> {
JDOPersistenceManager manager = dataBaseSteps.getCurrentPersistenceManager();
ArrayList<T> toBeStored = new ArrayList<>(toBePersisted);
Expand Down

0 comments on commit 0b97394

Please sign in to comment.