Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2014 Objectos, Fábrica de Software LTDA.
  *
  * 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.
 */
package br.com.objectos.way.auto.builder;

Author(s):
marcio.endo@objectos.com.br (Marcio Endo)
public class AutoBuilderProcessorTest {
  @Test
  public void medium() {
    ..about(JavaSourcesSubjectFactory.javaSources())
        .that(forResource("MediumBuilder.java"))
        .processedWith(new AutoBuilderProcessor())
        .compilesWithoutError()
        .and().generatesSources(
            forSourceCode("MediumBuilderPojo""MediumBuilderPojo.java"));
  }
  @Test
  public void simple() {
    ..about(JavaSourcesSubjectFactory.javaSources())
        .that(forResource("SimpleBuilder.java"))
        .processedWith(new AutoBuilderProcessor())
        .compilesWithoutError()
        .and().generatesSources(
            forSourceCode("SimpleBuilderPojo""SimpleBuilderPojo.java"));
  }
  private Iterable<? extends JavaFileObjectforResource(String... paths) {
    return WayIterables.from(paths)
        .toImmutableList();
  }
  private JavaFileObject forSourceCode(String nameString path) {
    String source = WayAsserts.contentsOf("/code/way-auto-builder/" + path);
    String qname = "br.com.objectos.way.auto.core.fakes." + name;
    return JavaFileObjects.forSourceString(qnamesource);
  }
  private static enum PathToJavaFileObject implements Function<StringJavaFileObject> {
    INSTANCE;
    @Override
    public JavaFileObject apply(String input) {
      return JavaFileObjects.forResource("code/way-auto-builder/" + input);
    }
  }
New to GrepCode? Check out our FAQ X