Merge pull request #16 in ST/ch.psi.daq.queryrest from ATEST-261 to master

# By Fabian Märki
# Via Fabian Märki
* commit '7fb24f830e85848096ea5bc0a0b7fe8912a8385e':
  ATEST-261
This commit is contained in:
Märki Fabian
2015-11-02 09:18:11 +01:00
2 changed files with 34 additions and 30 deletions

View File

@ -52,8 +52,9 @@ public class QueryRestControllerTest extends AbstractDaqRestTest {
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.jsonPath("$").isArray())
.andExpect(MockMvcResultMatchers.jsonPath("$[0]").exists())
.andExpect(MockMvcResultMatchers.jsonPath("$[0]").value("BooleanScalar"))
.andExpect(MockMvcResultMatchers.jsonPath("$[1]").value("BooleanWaveform"));
.andExpect(MockMvcResultMatchers.jsonPath("$[0]").value("BoolScalar"))
.andExpect(MockMvcResultMatchers.jsonPath("$[1]").exists())
.andExpect(MockMvcResultMatchers.jsonPath("$[1]").value("BoolWaveform"));
}
@ -61,16 +62,19 @@ public class QueryRestControllerTest extends AbstractDaqRestTest {
public void testSpecificChannelSearch() throws Exception {
this.mockMvc.perform(
MockMvcRequestBuilders
.get(QueryRestController.CHANNELS + "/integer")
.get(QueryRestController.CHANNELS + "/int32")
.contentType(MediaType.APPLICATION_JSON))
.andDo(MockMvcResultHandlers.print())
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.jsonPath("$").isArray())
.andExpect(MockMvcResultMatchers.jsonPath("$[0]").exists())
.andExpect(MockMvcResultMatchers.jsonPath("$[0]").value("IntegerScalar"))
.andExpect(MockMvcResultMatchers.jsonPath("$[1]").value("IntegerWaveform"))
.andExpect(MockMvcResultMatchers.jsonPath("$[2]").value("UIntegerScalar"))
.andExpect(MockMvcResultMatchers.jsonPath("$[3]").value("UIntegerWaveform"))
.andExpect(MockMvcResultMatchers.jsonPath("$[0]").value("Int32Scalar"))
.andExpect(MockMvcResultMatchers.jsonPath("$[1]").exists())
.andExpect(MockMvcResultMatchers.jsonPath("$[1]").value("Int32Waveform"))
.andExpect(MockMvcResultMatchers.jsonPath("$[2]").exists())
.andExpect(MockMvcResultMatchers.jsonPath("$[2]").value("UInt32Scalar"))
.andExpect(MockMvcResultMatchers.jsonPath("$[3]").exists())
.andExpect(MockMvcResultMatchers.jsonPath("$[3]").value("UInt32Waveform"))
.andExpect(MockMvcResultMatchers.jsonPath("$[4]").doesNotExist());
}

View File

@ -46,29 +46,29 @@ public class DummyCassandraReader implements CassandraReader {
this.channels = new String[]{
"testChannel1",
"testChannel2",
"BooleanScalar",
"BooleanWaveform",
"ByteScalar",
"ByteWaveform",
"DoubleScalar",
"DoubleWaveform",
"FloatScalar",
"FloatWaveform",
"IntegerScalar",
"IntegerWaveform",
"LongScalar",
"LongWaveform",
"ShortScalar",
"ShortWaveform",
"StringScalar",
"UByteScalar",
"UByteWaveform",
"UIntegerScalar",
"UIntegerWaveform",
"ULongScalar",
"ULongWaveform",
"UShortScalar",
"UShortWaveform"};
"BoolScalar",
"BoolWaveform",
"Int8Scalar",
"Int8Waveform",
"UInt8Scalar",
"UInt8Waveform",
"Int16Scalar",
"Int16Waveform",
"UInt16Scalar",
"UInt16Waveform",
"Int32Scalar",
"Int32Waveform",
"UInt32Scalar",
"UInt32Waveform",
"Int64Scalar",
"Int64Waveform",
"UInt64Scalar",
"UInt64Waveform",
"Float32Scalar",
"Float32Waveform",
"Float64Scalar",
"Float64Waveform",
"StringScalar"};
}
/**
* @{inheritDoc}