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.status().isOk())
.andExpect(MockMvcResultMatchers.jsonPath("$").isArray()) .andExpect(MockMvcResultMatchers.jsonPath("$").isArray())
.andExpect(MockMvcResultMatchers.jsonPath("$[0]").exists()) .andExpect(MockMvcResultMatchers.jsonPath("$[0]").exists())
.andExpect(MockMvcResultMatchers.jsonPath("$[0]").value("BooleanScalar")) .andExpect(MockMvcResultMatchers.jsonPath("$[0]").value("BoolScalar"))
.andExpect(MockMvcResultMatchers.jsonPath("$[1]").value("BooleanWaveform")); .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 { public void testSpecificChannelSearch() throws Exception {
this.mockMvc.perform( this.mockMvc.perform(
MockMvcRequestBuilders MockMvcRequestBuilders
.get(QueryRestController.CHANNELS + "/integer") .get(QueryRestController.CHANNELS + "/int32")
.contentType(MediaType.APPLICATION_JSON)) .contentType(MediaType.APPLICATION_JSON))
.andDo(MockMvcResultHandlers.print()) .andDo(MockMvcResultHandlers.print())
.andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.jsonPath("$").isArray()) .andExpect(MockMvcResultMatchers.jsonPath("$").isArray())
.andExpect(MockMvcResultMatchers.jsonPath("$[0]").exists()) .andExpect(MockMvcResultMatchers.jsonPath("$[0]").exists())
.andExpect(MockMvcResultMatchers.jsonPath("$[0]").value("IntegerScalar")) .andExpect(MockMvcResultMatchers.jsonPath("$[0]").value("Int32Scalar"))
.andExpect(MockMvcResultMatchers.jsonPath("$[1]").value("IntegerWaveform")) .andExpect(MockMvcResultMatchers.jsonPath("$[1]").exists())
.andExpect(MockMvcResultMatchers.jsonPath("$[2]").value("UIntegerScalar")) .andExpect(MockMvcResultMatchers.jsonPath("$[1]").value("Int32Waveform"))
.andExpect(MockMvcResultMatchers.jsonPath("$[3]").value("UIntegerWaveform")) .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()); .andExpect(MockMvcResultMatchers.jsonPath("$[4]").doesNotExist());
} }

View File

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