Package play.mvc.Http

Examples of play.mvc.Http.Context


    if (Logger.isTraceEnabled()) Logger.trace("Method Start");
    if (Logger.isTraceEnabled()) Logger.trace("collectionName: " + collectionName);

    long count;
    try {
      Context ctx=Http.Context.current.get();
      QueryParams criteria = (QueryParams) ctx.args.get(IQueryParametersKeys.QUERY_PARAMETERS);
      count = DocumentService.getCount(collectionName,criteria);
      if (Logger.isTraceEnabled()) Logger.trace("count: " + count);
    } catch (InvalidCollectionException e) {
      if (Logger.isDebugEnabled()) Logger.debug (collectionName + " is not a valid collection name");
View Full Code Here


    if (Logger.isTraceEnabled()) Logger.trace("collectionName: " + collectionName);

    List<ODocument> result;
    String ret="{[]}";
    try {
      Context ctx=Http.Context.current.get();
      QueryParams criteria = (QueryParams) ctx.args.get(IQueryParametersKeys.QUERY_PARAMETERS);
      result = DocumentService.getDocuments(collectionName,criteria);
      if (Logger.isTraceEnabled()) Logger.trace("count: " + result.size());
    } catch (InvalidCollectionException e) {
      if (Logger.isDebugEnabled()) Logger.debug (collectionName + " is not a valid collection name");
View Full Code Here

    }
  }

  @With  ({UserCredentialWrapFilter.class,ConnectToDBFilter.class, CheckAdminRoleFilter.class, ExtractQueryParameters.class})
  public static Result getAll() throws  Throwable{
    Context ctx=Http.Context.current.get();
    QueryParams criteria = (QueryParams) ctx.args.get(IQueryParametersKeys.QUERY_PARAMETERS);
    List<ODocument> listOfDocs = AssetService.getAssets(criteria);
    return ok(prepareResponseToJson(listOfDocs));
  }
View Full Code Here

  @InjectMocks
  private GameManager gameManager;

  @Before
  public void createStubs() {
    Context context = Mockito.mock(Context.class);
    Context.current.set(context);
    Mockito.when(gameForm.gameLength).thenReturn(2);
    Mockito.when(gameForm.gameTitle).thenReturn("Test game");
    Mockito.when(gameForm.maxPlayers).thenReturn(2);
    Mockito.when(gameForm.openBalance).thenReturn(1000.00);
View Full Code Here

import exceptions.InvalidStockException;
@RunWith(MockitoJUnitRunner.class)
public class UserManagerTest extends AbstractTest{
  @Before
  public void createStubs(){
    Context context = Mockito.mock(Context.class);
    Context.current.set(context);
    /*
    Mockito.when(gameForm.gameLength).thenReturn(2);
    Mockito.when(gameForm.gameTitle).thenReturn("Test game");
    Mockito.when(gameForm.maxPlayers).thenReturn(2);
View Full Code Here

  private Timestamp date;


  @Before
  public void createStubs(){
    Context context = Mockito.mock(Context.class);
    Context.current.set(context);
    Mockito.when(gameForm.gameLength).thenReturn(2);
    Mockito.when(gameForm.gameTitle).thenReturn("Test game");
    Mockito.when(gameForm.maxPlayers).thenReturn(2);
    Mockito.when(gameForm.openBalance).thenReturn(1000.00);
View Full Code Here

    }
    Map<String, String> session = new HashMap<String, String>();
    Map<String, String> flash = new HashMap<String, String>();
    Map<String, Object> args = new HashMap<String, Object>();

    Context.current.set(new Context(1L, reqHeader, req, session, flash, args));
  }
View Full Code Here

    }
    Map<String, String> session = new HashMap<String, String>();
    Map<String, String> flash = new HashMap<String, String>();
    Map<String, Object> args = new HashMap<String, Object>();

    Context.current.set(new Context(1L, reqHeader, req, session, flash, args));
  }
View Full Code Here

//        // Get the pattern from the configuration
//        return new SimpleDateFormat(I18N.getDateFormat()).format(date);
//    }
//
    public static String format(Date date, String pattern) {
      Context ctx = Context.current.get();
      if (ctx != null && ctx.request() != null) {
        Lang lan = play.i18n.Lang.preferred(ctx.request().acceptLanguages());
        return format(date, pattern, lan.language());
      }
      else {
        return format(date, pattern, play.i18n.Lang.defaultLang().language());
      }
View Full Code Here

TOP

Related Classes of play.mvc.Http.Context

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.