Package com.getperka.flatpack

Examples of com.getperka.flatpack.Configuration


   */
  @Before
  public void before() throws IOException {
    random = new Random(0);

    Configuration config = new Configuration()
        .addTypeSource(ClientTypeSource.get());
    api = new ClientApi(FlatPack.create(config));
    api.setServerBase(UriBuilder.fromUri("http://localhost").port(PORT).build());
    api.setVerbose(true);
    assertEquals(204, api.resetPost().execute().getResponseCode());
View Full Code Here


public class PolicyTestBase {

  protected FlatPack flatpack(String policyContents) {
    StaticPolicy securityPolicy = new StaticPolicy(policyContents);
    FlatPack flatpack = FlatPack.create(
        new Configuration()
            .addTypeSource(new TypeSource() {
              @Override
              public Set<Class<?>> getTypes() {
                Set<Class<?>> toReturn = setForIteration();
                toReturn.addAll(Arrays.<Class<?>> asList(
View Full Code Here

    } catch (IOException e) {
      throw new RuntimeException("Could not load security policy file", e);
    }
    Set<Object> toReturn = new LinkedHashSet<Object>();
    // Create the FlatPack configuration. This object adapts FlatPack behaviors to the local system.
    Configuration configuration = new Configuration()
        /*
         * The EntityResolver is optional and is used when FlatPack deserializes a payload to
         * retrieve a persistent entity to which properties in the incoming payload will be applied.
         * Implementors that do not that need to manually merge incoming DTOs with persistent state
         * may omit this configuration.
View Full Code Here

   */
  @Test
  public void test() throws Exception {
    Method method = ApiDescriberTest.class.getDeclaredMethod("sampleMethod");

    FlatPack flatpack = FlatPack.create(new Configuration()
        .addTypeSource(new SearchTypeSource("com.getperka.flatpack")));
    ApiDescription description = new ApiDescriber(flatpack, Collections.singletonList(method))
        .describe();

    EntityDescription toCheck = null;
View Full Code Here

  @Before
  public void before() {
    String policy = loadTestPolicyContents("PrincipalSecurityTest.policy");
    assertNotNull(policy);
    FlatPack flatpack = FlatPack.create(new Configuration()
        .addTypeSource(new TypeSource() {
          @Override
          public Set<Class<?>> getTypes() {
            return Collections.<Class<?>> singleton(Person.class);
          }
View Full Code Here

          defaultValue = DEFAULT_URI) URI source,
      @Flag(tag = "dialect", help = "The source dialect to use", defaultValue = "js") String dialect,
      @Flag(tag = "out", help = "The directory to generate source into", defaultValue = ".") File out)
      throws IOException {

    Unpacker unpacker = FlatPack.create(new Configuration()
        .addTypeSource(new SearchTypeSource("com.getperka.flatpack")))
        .getUnpacker();

    logger.info("Retrieving {}", source);
    Reader reader = new InputStreamReader(source.toURL().openStream(), Charset.forName("UTF8"));
View Full Code Here

  public boolean exec() throws Exception {
    /*
     * Configuration of a client-side FlatPack stack is very similar to the server-side
     * configuration.
     */
    Configuration configuration = new Configuration()
        /*
         * The ClientTypeSource is generated by the code-gen tool and contains all of the types
         * generated from the ApiDescription.
         */
        .addTypeSource(ClientTypeSource.get())
View Full Code Here

TOP

Related Classes of com.getperka.flatpack.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.