All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.assertj.maven.Templates Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
/**
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *
 * Copyright 2012-2015 the original author or authors.
 */
package org.assertj.maven;

import static org.apache.commons.io.Charsets.UTF_8;
import static org.apache.commons.io.FileUtils.readFileToString;
import static org.assertj.assertions.generator.Template.Type.ABSTRACT_ASSERT_CLASS;
import static org.assertj.assertions.generator.Template.Type.ASSERTIONS_ENTRY_POINT_CLASS;
import static org.assertj.assertions.generator.Template.Type.ASSERTION_ENTRY_POINT;
import static org.assertj.assertions.generator.Template.Type.ASSERT_CLASS;
import static org.assertj.assertions.generator.Template.Type.BDD_ASSERTIONS_ENTRY_POINT_CLASS;
import static org.assertj.assertions.generator.Template.Type.BDD_ENTRY_POINT_METHOD_ASSERTION;
import static org.assertj.assertions.generator.Template.Type.HAS;
import static org.assertj.assertions.generator.Template.Type.HAS_FOR_ARRAY;
import static org.assertj.assertions.generator.Template.Type.HAS_FOR_CHAR;
import static org.assertj.assertions.generator.Template.Type.HAS_FOR_CHARACTER;
import static org.assertj.assertions.generator.Template.Type.HAS_FOR_ITERABLE;
import static org.assertj.assertions.generator.Template.Type.HAS_FOR_REAL_NUMBER;
import static org.assertj.assertions.generator.Template.Type.HAS_FOR_REAL_NUMBER_WRAPPER;
import static org.assertj.assertions.generator.Template.Type.HAS_FOR_WHOLE_NUMBER;
import static org.assertj.assertions.generator.Template.Type.HAS_FOR_WHOLE_NUMBER_WRAPPER;
import static org.assertj.assertions.generator.Template.Type.HIERARCHICAL_ASSERT_CLASS;
import static org.assertj.assertions.generator.Template.Type.IS;
import static org.assertj.assertions.generator.Template.Type.IS_WRAPPER;
import static org.assertj.assertions.generator.Template.Type.JUNIT_SOFT_ASSERTIONS_ENTRY_POINT_CLASS;
import static org.assertj.assertions.generator.Template.Type.SOFT_ASSERTIONS_ENTRY_POINT_CLASS;
import static org.assertj.assertions.generator.Template.Type.SOFT_ENTRY_POINT_METHOD_ASSERTION;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import org.assertj.assertions.generator.Template;
import org.assertj.core.util.VisibleForTesting;
import org.assertj.maven.generator.AssertionsGeneratorReport;

public class Templates {

  public String templatesDirectory;
  // assertion class templates
  public String assertionClass;
  public String hierarchicalAssertionConcreteClass;
  public String hierarchicalAssertionAbstractClass;
  // assertion method templates
  public String objectAssertion;
  public String booleanAssertion;
  public String booleanWrapperAssertion;
  public String arrayAssertion;
  public String iterableAssertion;
  public String charAssertion;
  public String characterAssertion;
  public String realNumberAssertion;
  public String realNumberWrapperAssertion;
  public String wholeNumberAssertion;
  public String wholeNumberWrapperAssertion;
  // entry point templates
  public String assertionsEntryPointClass;
  public String assertionEntryPointMethod;
  public String softEntryPointAssertionClass;
  public String junitSoftEntryPointAssertionClass;
  public String softEntryPointAssertionMethod;
  public String bddEntryPointAssertionClass;
  public String bddEntryPointAssertionMethod;

  public List