use of com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec in project ds3_autogen by SpectraLogic.
the class Ds3SpecParserImpl_Test method twoRequestHandlers.
@Test
public void twoRequestHandlers() throws IOException {
final Ds3SpecParser parser = new Ds3SpecParserImpl();
final Ds3ApiSpec spec = parser.getSpec(Ds3SpecParserImpl_Test.class.getResourceAsStream("/specs/twoRequestHandlers.xml"));
assertThat(spec, is(notNullValue()));
assertThat(spec.getRequests(), is(notNullValue()));
assertThat(spec.getRequests().size(), is(2));
assertThat(spec.getRequests().get(0).getName(), is("com.spectralogic.s3.server.handler.reqhandler.amazons3.GetObjectRequest"));
assertThat(spec.getRequests().get(1).getName(), is("com.spectralogic.s3.server.handler.reqhandler.amazons3.AbortMultiPartUploadRequest"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec in project ds3_autogen by SpectraLogic.
the class Ds3SpecParserImpl_Test method blobApiBean.
@Test
public void blobApiBean() throws IOException {
final Ds3SpecParser parser = new Ds3SpecParserImpl();
final Ds3ApiSpec spec = parser.getSpec(Ds3SpecParserImpl_Test.class.getResourceAsStream("/specs/blobApiBean.xml"));
assertThat(spec.getTypes().size(), is(1));
final Ds3Type blobApiBean = spec.getTypes().get("com.spectralogic.s3.common.platform.domain.BulkObject");
assertThat(blobApiBean, is(notNullValue()));
final ImmutableList<Ds3Element> elements = blobApiBean.getElements();
assertThat(elements.size(), is(7));
assertThat(elements.get(0).getName(), is("InCache"));
assertThat(elements.get(0).getNullable(), is(true));
assertThat(elements.get(1).getName(), is("Latest"));
assertThat(elements.get(1).getNullable(), is(false));
assertThat(elements.get(2).getName(), is("Length"));
assertThat(elements.get(2).getNullable(), is(false));
assertThat(elements.get(3).getName(), is("Name"));
assertThat(elements.get(3).getNullable(), is(true));
assertThat(elements.get(4).getName(), is("Offset"));
assertThat(elements.get(4).getNullable(), is(false));
assertThat(elements.get(5).getName(), is("PhysicalPlacement"));
assertThat(elements.get(5).getNullable(), is(true));
assertThat(elements.get(6).getName(), is("Version"));
assertThat(elements.get(6).getNullable(), is(false));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec in project ds3_autogen by SpectraLogic.
the class Ds3SpecParserImpl_Test method fullXml_3_2.
@Test
public void fullXml_3_2() throws IOException {
final Ds3SpecParser parser = new Ds3SpecParserImpl();
final Ds3ApiSpec spec = parser.getSpec(Ds3SpecParserImpl_Test.class.getResourceAsStream("/specs/3_2_fullXml.xml"));
assertThat(spec, is(notNullValue()));
assertThat(spec.getRequests(), is(notNullValue()));
assertThat(spec.getTypes(), is(notNullValue()));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec in project ds3_autogen by SpectraLogic.
the class Ds3SpecParserImpl_Test method twoRequestHandlersAndTwoTypes.
@Test
public void twoRequestHandlersAndTwoTypes() throws IOException {
final Ds3SpecParser parser = new Ds3SpecParserImpl();
final Ds3ApiSpec spec = parser.getSpec(Ds3SpecParserImpl_Test.class.getResourceAsStream("/specs/twoRequestHandlersAndTwoTypes.xml"));
assertThat(spec, is(notNullValue()));
assertThat(spec.getTypes(), is(notNullValue()));
assertThat(spec.getTypes().size(), is(2));
assertThat(spec.getTypes().containsKey("com.spectralogic.s3.common.dao.domain.ds3.Priority"), is(true));
assertThat(spec.getTypes().containsKey("com.spectralogic.s3.common.dao.domain.tape.DetailedTapeFailure"), is(true));
assertThat(spec.getTypes().get("com.spectralogic.s3.common.dao.domain.ds3.Priority"), is(notNullValue()));
assertThat(spec.getTypes().get("com.spectralogic.s3.common.dao.domain.tape.DetailedTapeFailure"), is(notNullValue()));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec in project ds3_autogen by SpectraLogic.
the class Ds3SpecParserImpl_Test method fullXml.
@Test
public void fullXml() throws IOException {
final Ds3SpecParser parser = new Ds3SpecParserImpl();
final Ds3ApiSpec spec = parser.getSpec(Ds3SpecParserImpl_Test.class.getResourceAsStream("/specs/fullXml.xml"));
assertThat(spec, is(notNullValue()));
assertThat(spec.getRequests(), is(notNullValue()));
assertThat(spec.getTypes(), is(notNullValue()));
}
Aggregations