-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
36 changed files
with
663 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
*.class | ||
target | ||
target/* | ||
**/target | ||
**/target/* | ||
*.jar | ||
hs_err_pid* | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> | ||
<!-- TODO: a jarjar format would be better --> | ||
<id>jar-with-dependencies</id> | ||
<formats> | ||
<format>jar</format> | ||
</formats> | ||
<includeBaseDirectory>false</includeBaseDirectory> | ||
<dependencySets> | ||
<dependencySet> | ||
<outputDirectory>/</outputDirectory> | ||
<useProjectArtifact>true</useProjectArtifact> | ||
<unpack>true</unpack> | ||
<scope>runtime</scope> | ||
</dependencySet> | ||
</dependencySets> | ||
</assembly> |
33 changes: 33 additions & 0 deletions
33
all/src/test/java/org/unitsheet/SpreadsheetRuleReadColumnTest.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,33 @@ | ||
package org.unitsheet; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.unitsheet.annotations.ReadCell; | ||
import org.unitsheet.annotations.ReadColumn; | ||
import org.unitsheet.annotations.Workbook; | ||
import org.unitsheet.junit.SpreadsheetRule; | ||
|
||
import java.util.List; | ||
|
||
import static org.fest.assertions.Assertions.assertThat; | ||
import static org.junit.Assert.assertEquals; | ||
import static org.unitsheet.utils.Collections.listOf; | ||
|
||
@Workbook("classpath:spreadsheets/SumOfColumn.ods") | ||
public class SpreadsheetRuleReadColumnTest { | ||
|
||
@Rule | ||
public SpreadsheetRule spreadsheetRule = new SpreadsheetRule(); | ||
|
||
@ReadColumn(from = "B2", to = "B6") | ||
private List<Integer> listOfNumbers; | ||
|
||
@Test | ||
public void checkAllNumbersGetRead() { | ||
List<Integer> expcected = listOf(100, 200, 300, 400, 500); | ||
assertThat(listOfNumbers) | ||
.hasSize(5) | ||
.isEqualTo(expcected); | ||
} | ||
|
||
} |
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
Binary file not shown.
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
29 changes: 29 additions & 0 deletions
29
api/src/main/java/org/unitsheet/api/adapter/ColumnInfo.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,29 @@ | ||
package org.unitsheet.api.adapter; | ||
|
||
// TODO - use Builder | ||
public class ColumnInfo { | ||
|
||
private final String sheetName; | ||
|
||
private final CellInfo fromCellInfo; | ||
|
||
private final CellInfo toCellInfo; | ||
|
||
public ColumnInfo(String sheetName, CellInfo fromCellInfo, CellInfo toCellInfo) { | ||
this.sheetName = sheetName; | ||
this.fromCellInfo = fromCellInfo; | ||
this.toCellInfo = toCellInfo; | ||
} | ||
|
||
public String getSheetName() { | ||
return sheetName; | ||
} | ||
|
||
public CellInfo getFromCellInfo() { | ||
return fromCellInfo; | ||
} | ||
|
||
public CellInfo getToCellInfo() { | ||
return toCellInfo; | ||
} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
api/src/main/java/org/unitsheet/api/exceptions/InvalidColumnRangeException.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,13 @@ | ||
package org.unitsheet.api.exceptions; | ||
|
||
public class InvalidColumnRangeException extends UnitSheetException { | ||
|
||
public InvalidColumnRangeException() { | ||
} | ||
|
||
public InvalidColumnRangeException(String message) { | ||
super(message); | ||
} | ||
|
||
|
||
} |
24 changes: 24 additions & 0 deletions
24
api/src/main/java/org/unitsheet/api/exceptions/UnitSheetException.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,24 @@ | ||
package org.unitsheet.api.exceptions; | ||
|
||
public class UnitSheetException extends RuntimeException { | ||
|
||
public UnitSheetException() { | ||
} | ||
|
||
public UnitSheetException(String message) { | ||
super(message); | ||
} | ||
|
||
public UnitSheetException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
public UnitSheetException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
public UnitSheetException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { | ||
super(message, cause, enableSuppression, writableStackTrace); | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,9 @@ | |
public @interface ReadCell { | ||
|
||
String sheet() default ""; | ||
|
||
String name() default ""; | ||
|
||
String value(); | ||
|
||
} |
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
Oops, something went wrong.