Ejemplo n.º 1
0
    public void initializeParentHierarchy(MPWTests tests) {

      if (parent != null) {
        parentCase = tests.getCase(parent);
        parentCase.initializeParentHierarchy(tests);
      }

      algorithm =
          ifNotNullElse(
              algorithm,
              new NNSupplier<String>() {
                @Nonnull
                @Override
                public String get() {
                  return checkNotNull(parentCase.algorithm);
                }
              });
      fullName =
          ifNotNullElse(
              fullName,
              new NNSupplier<String>() {
                @Nonnull
                @Override
                public String get() {
                  return checkNotNull(parentCase.fullName);
                }
              });
      masterPassword =
          ifNotNullElse(
              masterPassword,
              new NNSupplier<String>() {
                @Nonnull
                @Override
                public String get() {
                  return checkNotNull(parentCase.masterPassword);
                }
              });
      keyID =
          ifNotNullElse(
              keyID,
              new NNSupplier<String>() {
                @Nonnull
                @Override
                public String get() {
                  return checkNotNull(parentCase.keyID);
                }
              });
      siteName =
          ifNotNullElse(
              siteName,
              new NNSupplier<String>() {
                @Nonnull
                @Override
                public String get() {
                  return checkNotNull(parentCase.siteName);
                }
              });
      siteCounter =
          ifNotNullElse(
              siteCounter,
              new NNSupplier<Integer>() {
                @Nonnull
                @Override
                public Integer get() {
                  return checkNotNull(parentCase.siteCounter);
                }
              });
      siteType =
          ifNotNullElse(
              siteType,
              new NNSupplier<String>() {
                @Nonnull
                @Override
                public String get() {
                  return checkNotNull(parentCase.siteType);
                }
              });
      siteVariant =
          ifNotNullElse(
              siteVariant,
              new NNSupplier<String>() {
                @Nonnull
                @Override
                public String get() {
                  return checkNotNull(parentCase.siteVariant);
                }
              });
      siteContext =
          ifNotNullElse(
              siteContext,
              new NNSupplier<String>() {
                @Nonnull
                @Override
                public String get() {
                  return parentCase == null ? "" : checkNotNull(parentCase.siteContext);
                }
              });
      result =
          ifNotNullElse(
              result,
              new NNSupplier<String>() {
                @Nonnull
                @Override
                public String get() {
                  return parentCase == null ? "" : checkNotNull(parentCase.result);
                }
              });
    }
Ejemplo n.º 2
0
  public Case getCase(String identifier) {
    for (Case testCase : getCases())
      if (identifier.equals(testCase.getIdentifier())) return testCase;

    throw new IllegalArgumentException("No case for identifier: " + identifier);
  }