Search in sources :

Example 6 with Ds3ApiSpec

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"));
}
Also used : Ds3SpecParser(com.spectralogic.ds3autogen.api.Ds3SpecParser) Ds3ApiSpec(com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec) Test(org.junit.Test)

Example 7 with Ds3ApiSpec

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));
}
Also used : Ds3SpecParser(com.spectralogic.ds3autogen.api.Ds3SpecParser) Ds3Type(com.spectralogic.ds3autogen.api.models.apispec.Ds3Type) Ds3ApiSpec(com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec) Ds3Element(com.spectralogic.ds3autogen.api.models.apispec.Ds3Element) Test(org.junit.Test)

Example 8 with Ds3ApiSpec

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()));
}
Also used : Ds3SpecParser(com.spectralogic.ds3autogen.api.Ds3SpecParser) Ds3ApiSpec(com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec) Test(org.junit.Test)

Example 9 with Ds3ApiSpec

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()));
}
Also used : Ds3SpecParser(com.spectralogic.ds3autogen.api.Ds3SpecParser) Ds3ApiSpec(com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec) Test(org.junit.Test)

Example 10 with Ds3ApiSpec

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()));
}
Also used : Ds3SpecParser(com.spectralogic.ds3autogen.api.Ds3SpecParser) Ds3ApiSpec(com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec) Test(org.junit.Test)

Aggregations

Ds3ApiSpec (com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec)50 Test (org.junit.Test)41 Ds3SpecParser (com.spectralogic.ds3autogen.api.Ds3SpecParser)37 Ds3SpecParserImpl (com.spectralogic.ds3autogen.Ds3SpecParserImpl)33 Ds3DocSpecEmptyImpl (com.spectralogic.ds3autogen.docspec.Ds3DocSpecEmptyImpl)26 TestFileUtilsImpl (com.spectralogic.ds3autogen.utils.TestFileUtilsImpl)24 ByteArrayOutputStream (java.io.ByteArrayOutputStream)22 Enum (com.spectralogic.ds3autogen.c.models.Enum)15 Source (com.spectralogic.ds3autogen.c.models.Source)9 CodeGenerator (com.spectralogic.ds3autogen.api.CodeGenerator)5 Ds3Request (com.spectralogic.ds3autogen.api.models.apispec.Ds3Request)5 Ds3DocSpec (com.spectralogic.ds3autogen.api.models.docspec.Ds3DocSpec)5 NameMapper (com.spectralogic.ds3autogen.NameMapper)4 Ds3DocSpecParser (com.spectralogic.ds3autogen.api.Ds3DocSpecParser)4 Ds3Type (com.spectralogic.ds3autogen.api.models.apispec.Ds3Type)4 Ds3DocSpecParserImpl (com.spectralogic.ds3autogen.docspec.Ds3DocSpecParserImpl)4 JavaCodeGenerator (com.spectralogic.ds3autogen.java.JavaCodeGenerator)4 Ds3Element (com.spectralogic.ds3autogen.api.models.apispec.Ds3Element)3 ImmutableMap (com.google.common.collect.ImmutableMap)2 FileUtils (com.spectralogic.ds3autogen.api.FileUtils)2