Java Code Examples for com.googlecode.objectify.ObjectifyService#setFactory()

The following examples show how to use com.googlecode.objectify.ObjectifyService#setFactory() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OfyFilterTest.java    From nomulus with Apache License 2.0 5 votes vote down vote up
@Before
public void before() {
  helper = new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig()).setUp();
  // Clear out the factory so that it requires re-registration on each test method.
  // Otherwise, static registration of types in one method would persist across methods.
  initOfy();
  factory = ObjectifyService.factory();
  ObjectifyService.setFactory(new ObjectifyFactory(false));
}
 
Example 2
Source File: OfyFilterTest.java    From nomulus with Apache License 2.0 5 votes vote down vote up
@After
public void after() {
  ObjectifyFilter.complete();
  ObjectifyService.setFactory(factory);
  ObjectifyFilter.complete();
  helper.tearDown();
}
 
Example 3
Source File: TicTacToeServletTest.java    From java-docs-samples with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUpBeforeClass() {
  // Reset the Factory so that all translators work properly.
  ObjectifyService.setFactory(new ObjectifyFactory());
  ObjectifyService.register(Game.class);
  // Mock out the firebase config
  FirebaseChannel.firebaseConfigStream =
      new ByteArrayInputStream(String.format("databaseURL: \"%s\"", FIREBASE_DB_URL).getBytes());
}
 
Example 4
Source File: OpenedServletTest.java    From java-docs-samples with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUpBeforeClass() {
  // Reset the Factory so that all translators work properly.
  ObjectifyService.setFactory(new ObjectifyFactory());
  ObjectifyService.register(Game.class);
  // Mock out the firebase config
  FirebaseChannel.firebaseConfigStream =
      new ByteArrayInputStream(String.format("databaseURL: \"%s\"", FIREBASE_DB_URL).getBytes());
}
 
Example 5
Source File: DeleteServletTest.java    From java-docs-samples with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUpBeforeClass() {
  // Reset the Factory so that all translators work properly.
  ObjectifyService.setFactory(new ObjectifyFactory());
  ObjectifyService.register(Game.class);
  // Mock out the firebase config
  FirebaseChannel.firebaseConfigStream =
      new ByteArrayInputStream(String.format("databaseURL: \"%s\"", FIREBASE_DB_URL).getBytes());
}
 
Example 6
Source File: MoveServletTest.java    From java-docs-samples with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUpBeforeClass() {
  // Reset the Factory so that all translators work properly.
  ObjectifyService.setFactory(new ObjectifyFactory());
  ObjectifyService.register(Game.class);
  // Mock out the firebase config
  FirebaseChannel.firebaseConfigStream =
      new ByteArrayInputStream(String.format("databaseURL: \"%s\"", FIREBASE_DB_URL).getBytes());
}