Skip to content

Commit

Permalink
work on Lombok 1.16.8 features #192
Browse files Browse the repository at this point in the history
added new automatic tests for Singular
  • Loading branch information
Michail Plushnikov committed Jun 11, 2016
1 parent 62fa200 commit 2c5affd
Show file tree
Hide file tree
Showing 36 changed files with 3,364 additions and 40 deletions.
@@ -0,0 +1,86 @@
package de.plushnikov.intellij.plugin.processor;

import de.plushnikov.intellij.plugin.AbstractLombokParsingTestCase;

import java.io.IOException;

/**
* Unit tests for IntelliJPlugin for Lombok, based on lombok test classes
*/
public class BuilderSingularTest extends AbstractLombokParsingTestCase {
@Override
public void setUp() throws Exception {
super.setUp();
// Add dummy classes, which are absent in mockJDK
myFixture.addClass("package java.util;\n public interface NavigableMap<K,V> extends java.util.SortedMap<K,V> {}");
}

public void testBuilder$Singular$Generic$Guava$SingularGuavaBiMap() throws IOException {
doTest(true);
}

public void testBuilder$Singular$Generic$Guava$SingularGuavaCollection() throws IOException {
doTest(true);
}

public void testBuilder$Singular$Generic$Guava$SingularGuavaList() throws IOException {
doTest(true);
}

public void testBuilder$Singular$Generic$Guava$SingularGuavaMap() throws IOException {
doTest(true);
}

public void testBuilder$Singular$Generic$Guava$SingularGuavaSet() throws IOException {
doTest(true);
}

public void testBuilder$Singular$Generic$Guava$SingularGuavaSortedMap() throws IOException {
doTest(true);
}

public void testBuilder$Singular$Generic$Guava$SingularGuavaSortedSet() throws IOException {
doTest(true);
}

public void testBuilder$Singular$Generic$Guava$SingularGuavaTable() throws IOException {
doTest(true);
}


public void testBuilder$Singular$Generic$Util$Collection$SingularCollection() throws IOException {
doTest(true);
}

public void testBuilder$Singular$Generic$Util$Collection$SingularIterable() throws IOException {
doTest(true);
}

public void testBuilder$Singular$Generic$Util$Collection$SingularList() throws IOException {
doTest(true);
}

public void testBuilder$Singular$Generic$Util$Collection$SingularNavigableSet() throws IOException {
doTest(true);
}

public void testBuilder$Singular$Generic$Util$Collection$SingularSet() throws IOException {
doTest(true);
}

public void testBuilder$Singular$Generic$Util$Collection$SingularSortedSet() throws IOException {
doTest(true);
}

public void testBuilder$Singular$Generic$Util$Map$SingularMap() throws IOException {
doTest(true);
}

public void testBuilder$Singular$Generic$Util$Map$SingularNavigableMap() throws IOException {
doTest(true);
}

public void testBuilder$Singular$Generic$Util$Map$SingularSortedMap() throws IOException {
doTest(true);
}
}
Expand Up @@ -82,16 +82,13 @@ public void setUp() throws Exception {
doTest(); doTest();
} }


public void testBuilder$Singular$SingularList() throws IOException {
doTest();
}

// ignored because of disabled auto singularization // ignored because of disabled auto singularization
public void ignore_testBuilder$BuilderSingularNoAuto() throws IOException { public void ignore_testBuilder$BuilderSingularNoAuto() throws IOException {
doTest(); doTest();
} }


public void testBuilder$BuilderSingularRedirectToGuava() throws IOException { // ignored because of disabled guava redirection
public void ignore_testBuilder$BuilderSingularRedirectToGuava() throws IOException {
doTest(); doTest();
} }


Expand Down
160 changes: 160 additions & 0 deletions testData/after/builder/singular/generic/guava/SingularGuavaBiMap.java
@@ -0,0 +1,160 @@
// Generated by delombok at Sat Jun 11 10:40:08 CEST 2016

import com.google.common.collect.ImmutableBiMap;

public class SingularGuavaBiMap<A, B> {
private ImmutableBiMap rawTypes;
private ImmutableBiMap<Integer, Float> integers;
private ImmutableBiMap<A, B> generics;
private ImmutableBiMap<? extends Number, ? extends String> extendsGenerics;

public static void main(String[] args) {
}

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
SingularGuavaBiMap(final ImmutableBiMap rawTypes, final ImmutableBiMap<Integer, Float> integers, final ImmutableBiMap<A, B> generics, final ImmutableBiMap<? extends Number, ? extends String> extendsGenerics) {
this.rawTypes = rawTypes;
this.integers = integers;
this.generics = generics;
this.extendsGenerics = extendsGenerics;
}


@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public static class SingularGuavaBiMapBuilder<A, B> {
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
private com.google.common.collect.ImmutableBiMap.Builder<java.lang.Object, java.lang.Object> rawTypes;
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
private com.google.common.collect.ImmutableBiMap.Builder<Integer, Float> integers;
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
private com.google.common.collect.ImmutableBiMap.Builder<A, B> generics;
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
private com.google.common.collect.ImmutableBiMap.Builder<Number, String> extendsGenerics;

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
SingularGuavaBiMapBuilder() {
}

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public SingularGuavaBiMapBuilder<A, B> rawType(final java.lang.Object key, final java.lang.Object value) {
if (this.rawTypes == null) this.rawTypes = com.google.common.collect.ImmutableBiMap.builder();
this.rawTypes.put(key, value);
return this;
}

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public SingularGuavaBiMapBuilder<A, B> rawTypes(final java.util.Map<?, ?> rawTypes) {
if (this.rawTypes == null) this.rawTypes = com.google.common.collect.ImmutableBiMap.builder();
this.rawTypes.putAll(rawTypes);
return this;
}

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public SingularGuavaBiMapBuilder<A, B> clearRawTypes() {
this.rawTypes = null;
return this;
}

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public SingularGuavaBiMapBuilder<A, B> integer(final Integer key, final Float value) {
if (this.integers == null) this.integers = com.google.common.collect.ImmutableBiMap.builder();
this.integers.put(key, value);
return this;
}

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public SingularGuavaBiMapBuilder<A, B> integers(final java.util.Map<? extends Integer, ? extends Float> integers) {
if (this.integers == null) this.integers = com.google.common.collect.ImmutableBiMap.builder();
this.integers.putAll(integers);
return this;
}

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public SingularGuavaBiMapBuilder<A, B> clearIntegers() {
this.integers = null;
return this;
}

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public SingularGuavaBiMapBuilder<A, B> generic(final A key, final B value) {
if (this.generics == null) this.generics = com.google.common.collect.ImmutableBiMap.builder();
this.generics.put(key, value);
return this;
}

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public SingularGuavaBiMapBuilder<A, B> generics(final java.util.Map<? extends A, ? extends B> generics) {
if (this.generics == null) this.generics = com.google.common.collect.ImmutableBiMap.builder();
this.generics.putAll(generics);
return this;
}

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public SingularGuavaBiMapBuilder<A, B> clearGenerics() {
this.generics = null;
return this;
}

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public SingularGuavaBiMapBuilder<A, B> extendsGeneric(final Number key, final String value) {
if (this.extendsGenerics == null) this.extendsGenerics = com.google.common.collect.ImmutableBiMap.builder();
this.extendsGenerics.put(key, value);
return this;
}

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public SingularGuavaBiMapBuilder<A, B> extendsGenerics(final java.util.Map<? extends Number, ? extends String> extendsGenerics) {
if (this.extendsGenerics == null) this.extendsGenerics = com.google.common.collect.ImmutableBiMap.builder();
this.extendsGenerics.putAll(extendsGenerics);
return this;
}

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public SingularGuavaBiMapBuilder<A, B> clearExtendsGenerics() {
this.extendsGenerics = null;
return this;
}

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public SingularGuavaBiMap<A, B> build() {
com.google.common.collect.ImmutableBiMap<java.lang.Object, java.lang.Object> rawTypes = this.rawTypes == null ? com.google.common.collect.ImmutableBiMap.<java.lang.Object, java.lang.Object>of() : this.rawTypes.build();
com.google.common.collect.ImmutableBiMap<Integer, Float> integers = this.integers == null ? com.google.common.collect.ImmutableBiMap.<Integer, Float>of() : this.integers.build();
com.google.common.collect.ImmutableBiMap<A, B> generics = this.generics == null ? com.google.common.collect.ImmutableBiMap.<A, B>of() : this.generics.build();
com.google.common.collect.ImmutableBiMap<Number, String> extendsGenerics = this.extendsGenerics == null ? com.google.common.collect.ImmutableBiMap.<Number, String>of() : this.extendsGenerics.build();
return new SingularGuavaBiMap<A, B>(rawTypes, integers, generics, extendsGenerics);
}

@java.lang.Override
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public java.lang.String toString() {
return "SingularGuavaBiMap.SingularGuavaBiMapBuilder(rawTypes=" + this.rawTypes + ", integers=" + this.integers + ", generics=" + this.generics + ", extendsGenerics=" + this.extendsGenerics + ")";
}
}

@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public static <A, B> SingularGuavaBiMapBuilder<A, B> builder() {
return new SingularGuavaBiMapBuilder<A, B>();
}
}

0 comments on commit 2c5affd

Please sign in to comment.