Skip to content

Commit 6a77ffc

Browse files
fmt
1 parent 1b8dd09 commit 6a77ffc

File tree

7 files changed

+191
-190
lines changed

7 files changed

+191
-190
lines changed

src/main/java/edu/ie3/datamodel/io/processor/timeseries/TimeSeriesProcessor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public class TimeSeriesProcessor<
7070
* invoke
7171
*/
7272
private final SortedMap<String, FieldSourceToMethod> fieldToSource;
73+
7374
private final String[] flattenedHeaderElements;
7475

7576
public TimeSeriesProcessor(Class<T> timeSeriesClass, Class<E> entryClass, Class<V> valueClass)

src/test/groovy/edu/ie3/datamodel/io/factory/timeseries/IconTimeBasedWeatherValueFactoryTest.groovy

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -80,36 +80,36 @@ class IconTimeBasedWeatherValueFactoryTest extends Specification {
8080
def coordinate = CosmoWeatherTestData.COORDINATE_67775
8181

8282
def parameter = [
83-
"time" : "2019-08-01T01:00:00Z",
84-
"albRad" : "13.015240669",
85-
"asobS" : "3.555093673828124",
86-
"aswdifdS" : "1.8088226191406245",
87-
"aswdifuS" : "0.5713421484374998",
88-
"aswdirS" : "2.317613203124999",
89-
"t2m" : "289.1179319051744",
90-
"tg" : "288.4101691197649",
91-
"u10m" : "0.3021732864307963",
92-
"tG" : "288.4101691197649",
93-
"u131m" : "2.6058700426057797",
94-
"u20m" : "0.32384365019387784",
95-
"u216m" : "3.9015497418041756",
96-
"u65m" : "1.2823686334340363",
97-
"v10m" : "1.3852550649486943",
98-
"v131m" : "3.8391590569599927",
99-
"v20m" : "1.3726831152710628",
100-
"v216m" : "4.339362039492466",
101-
"v65m" : "2.809877942347672",
102-
"w131m" : "-0.02633474740256081",
103-
"w20m" : "-0.0100060345167524",
104-
"w216m" : "-0.030348050471342078",
105-
"w65m" : "-0.01817112027569893",
106-
"z0" : "0.955323922526438",
107-
"coordinateId": "67775",
108-
"p131m" : "",
109-
"p20m" : "",
110-
"p65m" : "",
111-
"sobsRad" : "",
112-
"t131m" : ""
83+
"time" : "2019-08-01T01:00:00Z",
84+
"albRad" : "13.015240669",
85+
"asobS" : "3.555093673828124",
86+
"aswdifdS" : "1.8088226191406245",
87+
"aswdifuS" : "0.5713421484374998",
88+
"aswdirS" : "2.317613203124999",
89+
"t2m" : "289.1179319051744",
90+
"tg" : "288.4101691197649",
91+
"u10m" : "0.3021732864307963",
92+
"tG" : "288.4101691197649",
93+
"u131m" : "2.6058700426057797",
94+
"u20m" : "0.32384365019387784",
95+
"u216m" : "3.9015497418041756",
96+
"u65m" : "1.2823686334340363",
97+
"v10m" : "1.3852550649486943",
98+
"v131m" : "3.8391590569599927",
99+
"v20m" : "1.3726831152710628",
100+
"v216m" : "4.339362039492466",
101+
"v65m" : "2.809877942347672",
102+
"w131m" : "-0.02633474740256081",
103+
"w20m" : "-0.0100060345167524",
104+
"w216m" : "-0.030348050471342078",
105+
"w65m" : "-0.01817112027569893",
106+
"z0" : "0.955323922526438",
107+
"coordinateId": "67775",
108+
"p131m" : "",
109+
"p20m" : "",
110+
"p65m" : "",
111+
"sobsRad" : "",
112+
"t131m" : ""
113113
]
114114
def data = new TimeBasedWeatherValueData(parameter, coordinate)
115115

@@ -138,36 +138,36 @@ class IconTimeBasedWeatherValueFactoryTest extends Specification {
138138
def coordinate = CosmoWeatherTestData.COORDINATE_67775
139139

140140
def parameter = [
141-
"time" : "2019-08-01T01:00:00Z",
142-
"albRad" : "13.015240669",
143-
"asobS" : "3.555093673828124",
144-
"aswdifdS" : "1.8088226191406245",
145-
"aswdifuS" : "0.5713421484374998",
146-
"aswdirS" : "2.317613203124999",
147-
"t2m" : "289.1179319051744",
148-
"tg" : "288.4101691197649",
149-
"u10m" : "0.3021732864307963",
150-
"tG" : "288.4101691197649",
151-
"u131m" : "2.6058700426057797",
152-
"u20m" : "0.32384365019387784",
153-
"u216m" : "3.9015497418041756",
154-
"u65m" : "1.2823686334340363",
155-
"v10m" : "1.3852550649486943",
156-
"v131m" : "3.8391590569599927",
157-
"v20m" : "1.3726831152710628",
158-
"v216m" : "4.339362039492466",
159-
"v65m" : "2.809877942347672",
160-
"w131m" : "-0.02633474740256081",
161-
"w20m" : "-0.0100060345167524",
162-
"w216m" : "-0.030348050471342078",
163-
"w65m" : "-0.01817112027569893",
164-
"z0" : "0.955323922526438",
165-
"coordinateId": "67775",
166-
"p131m" : "",
167-
"p20m" : "",
168-
"p65m" : "",
169-
"sobsRad" : "",
170-
"t131m" : ""
141+
"time" : "2019-08-01T01:00:00Z",
142+
"albRad" : "13.015240669",
143+
"asobS" : "3.555093673828124",
144+
"aswdifdS" : "1.8088226191406245",
145+
"aswdifuS" : "0.5713421484374998",
146+
"aswdirS" : "2.317613203124999",
147+
"t2m" : "289.1179319051744",
148+
"tg" : "288.4101691197649",
149+
"u10m" : "0.3021732864307963",
150+
"tG" : "288.4101691197649",
151+
"u131m" : "2.6058700426057797",
152+
"u20m" : "0.32384365019387784",
153+
"u216m" : "3.9015497418041756",
154+
"u65m" : "1.2823686334340363",
155+
"v10m" : "1.3852550649486943",
156+
"v131m" : "3.8391590569599927",
157+
"v20m" : "1.3726831152710628",
158+
"v216m" : "4.339362039492466",
159+
"v65m" : "2.809877942347672",
160+
"w131m" : "-0.02633474740256081",
161+
"w20m" : "-0.0100060345167524",
162+
"w216m" : "-0.030348050471342078",
163+
"w65m" : "-0.01817112027569893",
164+
"z0" : "0.955323922526438",
165+
"coordinateId": "67775",
166+
"p131m" : "",
167+
"p20m" : "",
168+
"p65m" : "",
169+
"sobsRad" : "",
170+
"t131m" : ""
171171
]
172172
def data = new TimeBasedWeatherValueData(parameter, coordinate)
173173

src/test/groovy/edu/ie3/datamodel/io/source/couchbase/CouchbaseWeatherSourceCosmoIT.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CouchbaseWeatherSourceCosmoIT extends Specification implements TestContain
3535
CouchbaseContainer couchbaseContainer = new CouchbaseContainer("couchbase/server:6.6.0")
3636
.withBucket(bucketDefinition)
3737
.withExposedPorts(8091, 8092, 8093, 8094, 11210)
38-
.withStartupAttempts(3) // 3 attempts because startup (node renaming) sometimes fails when executed too early
38+
.withStartupAttempts(3) // 3 attempts because startup (node renaming) sometimes fails when executed too early
3939

4040
@Shared
4141
CouchbaseWeatherSource source
@@ -46,13 +46,13 @@ class CouchbaseWeatherSourceCosmoIT extends Specification implements TestContain
4646
// Copy import file with json array of documents into docker
4747
MountableFile couchbaseWeatherJsonsFile = getMountableFile("_weather/cosmo/weather.json")
4848
couchbaseContainer.copyFileToContainer(couchbaseWeatherJsonsFile, "/home/weather_cosmo.json")
49-
// create an index for the document keys
49+
// create an index for the document keys
5050
couchbaseContainer.execInContainer("cbq",
5151
"-e", "http://localhost:8093",
5252
"-u", couchbaseContainer.username,
5353
"-p", couchbaseContainer.password,
5454
"-s", "CREATE index id_idx ON `" + bucketDefinition.name + "` (META().id);")
55-
//import the json documents from the copied file
55+
//import the json documents from the copied file
5656
couchbaseContainer.execInContainer("cbimport", "json",
5757
"-cluster", "http://localhost:8091",
5858
"--bucket", "ie3_in",
@@ -142,7 +142,7 @@ class CouchbaseWeatherSourceCosmoIT extends Specification implements TestContain
142142
then:
143143
coordinateToTimeSeries.keySet().size() == 3
144144
equalsIgnoreUUID(coordinateToTimeSeries.get(CosmoWeatherTestData.COORDINATE_193186).entries, timeSeries193186.entries)
145-
equalsIgnoreUUID(coordinateToTimeSeries.get(CosmoWeatherTestData.COORDINATE_193187).entries, timeSeries193187.entries)
145+
equalsIgnoreUUID(coordinateToTimeSeries.get(CosmoWeatherTestData.COORDINATE_193187).entries, timeSeries193187.entries)
146146
equalsIgnoreUUID(coordinateToTimeSeries.get(CosmoWeatherTestData.COORDINATE_193188).entries, timeSeries193188.entries)
147147
}
148148

src/test/groovy/edu/ie3/datamodel/io/source/couchbase/CouchbaseWeatherSourceIconIT.groovy

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CouchbaseWeatherSourceIconIT extends Specification implements TestContaine
3333
CouchbaseContainer couchbaseContainer = new CouchbaseContainer("couchbase/server:6.6.0")
3434
.withBucket(bucketDefinition)
3535
.withExposedPorts(8091, 8092, 8093, 8094, 11210)
36-
.withStartupAttempts(3) // 3 attempts because startup (node renaming) sometimes fails when executed too early
36+
.withStartupAttempts(3) // 3 attempts because startup (node renaming) sometimes fails when executed too early
3737

3838
@Shared
3939
CouchbaseWeatherSource source
@@ -44,13 +44,13 @@ class CouchbaseWeatherSourceIconIT extends Specification implements TestContaine
4444
// Copy import file with json array of documents into docker
4545
def couchbaseWeatherJsonsFile = getMountableFile("_weather/icon/weather.json")
4646
couchbaseContainer.copyFileToContainer(couchbaseWeatherJsonsFile, "/home/weather_icon.json")
47-
// create an index for the document keys
47+
// create an index for the document keys
4848
couchbaseContainer.execInContainer("cbq",
4949
"-e", "http://localhost:8093",
5050
"-u", couchbaseContainer.username,
5151
"-p", couchbaseContainer.password,
5252
"-s", "CREATE index id_idx ON `" + bucketDefinition.name + "` (META().id);")
53-
//import the json documents from the copied file
53+
//import the json documents from the copied file
5454
couchbaseContainer.execInContainer("cbimport", "json",
5555
"-cluster", "http://localhost:8091",
5656
"--bucket", "ie3_in",
@@ -88,7 +88,7 @@ class CouchbaseWeatherSourceIconIT extends Specification implements TestContaine
8888

8989
then:
9090
optTimeBasedValue.present
91-
equalsIgnoreUUID(optTimeBasedValue.get(), expectedTimeBasedValue)
91+
equalsIgnoreUUID(optTimeBasedValue.get(), expectedTimeBasedValue)
9292
}
9393

9494
def "A CouchbaseWeatherSource can read multiple time series values for multiple coordinates"() {
@@ -114,8 +114,8 @@ class CouchbaseWeatherSourceIconIT extends Specification implements TestContaine
114114

115115
then:
116116
coordinateToTimeSeries.keySet().size() == 2
117-
equalsIgnoreUUID(coordinateToTimeSeries.get(IconWeatherTestData.COORDINATE_67775), timeSeries67775)
118-
equalsIgnoreUUID(coordinateToTimeSeries.get(IconWeatherTestData.COORDINATE_67776), timeSeries67776)
117+
equalsIgnoreUUID(coordinateToTimeSeries.get(IconWeatherTestData.COORDINATE_67775), timeSeries67775)
118+
equalsIgnoreUUID(coordinateToTimeSeries.get(IconWeatherTestData.COORDINATE_67776), timeSeries67776)
119119
}
120120

121121
def "A CouchbaseWeatherSource can read all weather data in a given time interval"() {
@@ -138,8 +138,8 @@ class CouchbaseWeatherSourceIconIT extends Specification implements TestContaine
138138

139139
then:
140140
coordinateToTimeSeries.keySet().size() == 2
141-
equalsIgnoreUUID(coordinateToTimeSeries.get(IconWeatherTestData.COORDINATE_67775).entries, timeSeries67775.entries)
142-
equalsIgnoreUUID(coordinateToTimeSeries.get(IconWeatherTestData.COORDINATE_67776).entries, timeSeries67776.entries)
141+
equalsIgnoreUUID(coordinateToTimeSeries.get(IconWeatherTestData.COORDINATE_67775).entries, timeSeries67775.entries)
142+
equalsIgnoreUUID(coordinateToTimeSeries.get(IconWeatherTestData.COORDINATE_67776).entries, timeSeries67776.entries)
143143
}
144144

145145
def "The CouchbaseWeatherSource returns all time keys after a given time key correctly"() {

src/test/groovy/edu/ie3/datamodel/io/source/csv/CsvWeatherSourceCosmoTest.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class CsvWeatherSourceCosmoTest extends Specification implements CsvTestDataMeta
4949

5050
then:
5151
optTimeBasedValue.present
52-
equalsIgnoreUUID(optTimeBasedValue.get(), expectedTimeBasedValue)
52+
equalsIgnoreUUID(optTimeBasedValue.get(), expectedTimeBasedValue)
5353
}
5454

5555
def "A CsvWeatherSource can read multiple time series values for multiple coordinates"() {
@@ -105,8 +105,8 @@ class CsvWeatherSourceCosmoTest extends Specification implements CsvTestDataMeta
105105
then:
106106
coordinateToTimeSeries.keySet().size() == 3
107107
equalsIgnoreUUID(coordinateToTimeSeries.get(CosmoWeatherTestData.COORDINATE_193186).entries, timeSeries193186.entries)
108-
equalsIgnoreUUID(coordinateToTimeSeries.get(CosmoWeatherTestData.COORDINATE_193187).entries, timeSeries193187.entries)
109-
equalsIgnoreUUID(coordinateToTimeSeries.get(CosmoWeatherTestData.COORDINATE_193188).entries, timeSeries193188.entries)
108+
equalsIgnoreUUID(coordinateToTimeSeries.get(CosmoWeatherTestData.COORDINATE_193187).entries, timeSeries193187.entries)
109+
equalsIgnoreUUID(coordinateToTimeSeries.get(CosmoWeatherTestData.COORDINATE_193188).entries, timeSeries193188.entries)
110110
}
111111

112112
def "The CsvWeatherSource is able to build a single WeatherValue from field to value mapping"() {

0 commit comments

Comments
 (0)