Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added tests for accessors and chain config parameter
Configuration keys #53
- Loading branch information
Michail Plushnikov
committed
Mar 28, 2016
1 parent
09487d2
commit 553ac36
Showing
15 changed files
with
353 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/test/java/de/plushnikov/intellij/plugin/configsystem/AccessorsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package de.plushnikov.intellij.plugin.configsystem; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Unit tests for IntelliJPlugin for Lombok with activated config system | ||
*/ | ||
public class AccessorsTest extends AbstractLombokConfigSystemTestCase { | ||
|
||
protected boolean shouldCompareAnnotations() { | ||
return true; | ||
} | ||
|
||
@Override | ||
protected String getBasePath() { | ||
return super.getBasePath() + "/configsystem/accessors"; | ||
} | ||
|
||
public void testChain$GetterSetterFieldTest() throws IOException { | ||
doTest(); | ||
} | ||
|
||
public void testChain$GetterSetterFieldAnnotationOverwriteTest() throws IOException { | ||
doTest(); | ||
} | ||
|
||
public void testChain$GetterSetterClassTest() throws IOException { | ||
doTest(); | ||
} | ||
|
||
public void testChain$GetterSetterClassAnnotationOverwriteTest() throws IOException { | ||
doTest(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
testData/configsystem/accessors/chain/GetterSetterClassAnnotationOverwriteTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import lombok.experimental.Accessors; | ||
|
||
@Getter | ||
@Setter | ||
@Accessors(chain = false) | ||
public class GetterSetterClassAnnotationOverwriteTest { | ||
private int intProperty; | ||
private double doubleProperty; | ||
private boolean booleanProperty; | ||
private String stringProperty; | ||
|
||
public static void main(String[] args) { | ||
final GetterSetterClassAnnotationOverwriteTest test = new GetterSetterClassAnnotationOverwriteTest(); | ||
test.setStringProperty(""); | ||
test.setIntProperty(1) | ||
test.setBooleanProperty(true) | ||
test.setDoubleProperty(0.0); | ||
|
||
System.out.println(test); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
testData/configsystem/accessors/chain/GetterSetterClassTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import lombok.experimental.Accessors; | ||
|
||
@Getter | ||
@Setter | ||
@Accessors(chain = true) | ||
public class GetterSetterFieldTest { | ||
private int intProperty; | ||
private double doubleProperty; | ||
private boolean booleanProperty; | ||
private String stringProperty; | ||
|
||
public static void main(String[] args) { | ||
final GetterSetterClassTest test = new GetterSetterClassTest(); | ||
test.setStringProperty("") | ||
.setIntProperty(1) | ||
.setBooleanProperty(true) | ||
.setDoubleProperty(0.0); | ||
|
||
System.out.println(test); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
testData/configsystem/accessors/chain/GetterSetterFieldAnnotationOverwriteTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import lombok.experimental.Accessors; | ||
|
||
@Getter | ||
@Setter | ||
public class GetterSetterFieldAnnotationOverwriteTest { | ||
@Accessors(chain=false) | ||
private int intProperty; | ||
@Accessors(chain=false) | ||
private double doubleProperty; | ||
@Accessors(chain=false) | ||
private boolean booleanProperty; | ||
@Accessors(chain=false) | ||
private String stringProperty; | ||
|
||
public static void main(String[] args) { | ||
final GetterSetterFieldAnnotationOverwriteTest test = new GetterSetterFieldAnnotationOverwriteTest(); | ||
test.setStringProperty(""); | ||
test.setIntProperty(1) | ||
test.setBooleanProperty(true) | ||
test.setDoubleProperty(0.0); | ||
|
||
System.out.println(test); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
testData/configsystem/accessors/chain/GetterSetterFieldTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import lombok.experimental.Accessors; | ||
|
||
@Getter | ||
@Setter | ||
public class GetterSetterFieldTest { | ||
@Accessors | ||
private int intProperty; | ||
@Accessors | ||
private double doubleProperty; | ||
@Accessors | ||
private boolean booleanProperty; | ||
@Accessors | ||
private String stringProperty; | ||
|
||
public static void main(String[] args) { | ||
final GetterSetterFieldTest test = new GetterSetterFieldTest(); | ||
test.setStringProperty("") | ||
.setIntProperty(1) | ||
.setBooleanProperty(true) | ||
.setDoubleProperty(0.0); | ||
|
||
System.out.println(test); | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
testData/configsystem/accessors/chain/after/GetterSetterClassAnnotationOverwriteTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
public class GetterSetterClassAnnotationOverwriteTest { | ||
private int intProperty; | ||
private double doubleProperty; | ||
private boolean booleanProperty; | ||
private String stringProperty; | ||
|
||
public static void main(String[] args) { | ||
final GetterSetterClassAnnotationOverwriteTest test = new GetterSetterClassAnnotationOverwriteTest(); | ||
test.setStringProperty(""); | ||
test.setIntProperty(1) | ||
test.setBooleanProperty(true) | ||
test.setDoubleProperty(0.0); | ||
|
||
System.out.println(test); | ||
} | ||
|
||
public int getIntProperty() { | ||
return this.intProperty; | ||
} | ||
|
||
public double getDoubleProperty() { | ||
return this.doubleProperty; | ||
} | ||
|
||
public boolean isBooleanProperty() { | ||
return this.booleanProperty; | ||
} | ||
|
||
public String getStringProperty() { | ||
return this.stringProperty; | ||
} | ||
|
||
public void setIntProperty(int intProperty) { | ||
this.intProperty = intProperty; | ||
} | ||
|
||
public void setDoubleProperty(double doubleProperty) { | ||
this.doubleProperty = doubleProperty; | ||
} | ||
|
||
public void setBooleanProperty(boolean booleanProperty) { | ||
this.booleanProperty = booleanProperty; | ||
} | ||
|
||
public void setStringProperty(String stringProperty) { | ||
this.stringProperty = stringProperty; | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
testData/configsystem/accessors/chain/after/GetterSetterClassTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
public class GetterSetterFieldTest { | ||
private int intProperty; | ||
private double doubleProperty; | ||
private boolean booleanProperty; | ||
private String stringProperty; | ||
|
||
public static void main(String[] args) { | ||
final GetterSetterClassTest test = new GetterSetterClassTest(); | ||
test.setStringProperty("") | ||
.setIntProperty(1) | ||
.setBooleanProperty(true) | ||
.setDoubleProperty(0.0); | ||
|
||
System.out.println(test); | ||
} | ||
|
||
public int getIntProperty() { | ||
return this.intProperty; | ||
} | ||
|
||
public double getDoubleProperty() { | ||
return this.doubleProperty; | ||
} | ||
|
||
public boolean isBooleanProperty() { | ||
return this.booleanProperty; | ||
} | ||
|
||
public String getStringProperty() { | ||
return this.stringProperty; | ||
} | ||
|
||
public GetterSetterFieldTest setIntProperty(int intProperty) { | ||
this.intProperty = intProperty; | ||
return this; | ||
} | ||
|
||
public GetterSetterFieldTest setDoubleProperty(double doubleProperty) { | ||
this.doubleProperty = doubleProperty; | ||
return this; | ||
} | ||
|
||
public GetterSetterFieldTest setBooleanProperty(boolean booleanProperty) { | ||
this.booleanProperty = booleanProperty; | ||
return this; | ||
} | ||
|
||
public GetterSetterFieldTest setStringProperty(String stringProperty) { | ||
this.stringProperty = stringProperty; | ||
return this; | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
testData/configsystem/accessors/chain/after/GetterSetterFieldAnnotationOverwriteTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
public class GetterSetterFieldAnnotationOverwriteTest { | ||
private int intProperty; | ||
private double doubleProperty; | ||
private boolean booleanProperty; | ||
private String stringProperty; | ||
|
||
public static void main(String[] args) { | ||
final GetterSetterFieldAnnotationOverwriteTest test = new GetterSetterFieldAnnotationOverwriteTest(); | ||
test.setStringProperty(""); | ||
test.setIntProperty(1) | ||
test.setBooleanProperty(true) | ||
test.setDoubleProperty(0.0); | ||
|
||
System.out.println(test); | ||
} | ||
|
||
public int getIntProperty() { | ||
return this.intProperty; | ||
} | ||
|
||
public double getDoubleProperty() { | ||
return this.doubleProperty; | ||
} | ||
|
||
public boolean isBooleanProperty() { | ||
return this.booleanProperty; | ||
} | ||
|
||
public String getStringProperty() { | ||
return this.stringProperty; | ||
} | ||
|
||
public void setIntProperty(int intProperty) { | ||
this.intProperty = intProperty; | ||
} | ||
|
||
public void setDoubleProperty(double doubleProperty) { | ||
this.doubleProperty = doubleProperty; | ||
} | ||
|
||
public void setBooleanProperty(boolean booleanProperty) { | ||
this.booleanProperty = booleanProperty; | ||
} | ||
|
||
public void setStringProperty(String stringProperty) { | ||
this.stringProperty = stringProperty; | ||
} | ||
} |
Oops, something went wrong.