List of usage examples for java.lang Object Object
@HotSpotIntrinsicCandidate
public Object()
From source file:com.github.fharms.camel.route.CamelEntityManagerBean.java
public void forceRollback(Exchange exchange) { Dog dog = exchange.getIn().getBody(Dog.class); assertEquals("Skippy", dog.getPetName()); assertEquals("Terrier", dog.getRace()); em.persist(new Object()); }
From source file:com.abiquo.api.spring.security.URLAuthenticator.java
/** * Check if a url is allowed for logged user. If there is no roleVoter then always show the * links./*w w w.j a va2s.c om*/ * * @param url to check * @return true if is allowed, else false */ public boolean checkPermissions(final StringBuffer url, final String baseUri) { if (roleVoter == null) // No role based security { return Boolean.TRUE; } Authentication auth = SecurityContextHolder.getContext().getAuthentication(); DefaultFilterInvocationDefinitionSource fids = (DefaultFilterInvocationDefinitionSource) filterSecurityInterceptor .getObjectDefinitionSource(); String path = parse(url, baseUri); if (StringUtils.isBlank(path)) // The uri is not Abiquo { return Boolean.TRUE; } OUTER_LOOP: for (methods m : methods.values()) { ConfigAttributeDefinition config = fids.lookupAttributes(path, m.name()); if (config != null) { int result = roleVoter.vote(auth, new Object(), config); switch (result) { case AccessDecisionVoter.ACCESS_GRANTED: return Boolean.TRUE; case AccessDecisionVoter.ACCESS_DENIED: default: continue OUTER_LOOP; } } } return Boolean.FALSE; }
From source file:com.spectralogic.ds3client.helpers.channels.WindowedSeekableByteChannel_Test.java
@Test(timeout = 1000) public void writeDoesNotExceedWindow() throws IOException { try (final ByteArraySeekableByteChannel channel = new ByteArraySeekableByteChannel()) { final Object lock = new Object(); try (final WindowedSeekableByteChannel window = new WindowedSeekableByteChannel(channel, lock, 2L, 7L)) {// w w w.j a v a2 s. c o m final ByteBuffer buffer = Charset.forName("UTF-8").encode("0123456789"); buffer.position(1); assertThat(window.write(buffer), is(7)); assertThat(window.position(), is(7L)); assertThat(buffer.position(), is(8)); assertThat(buffer.limit(), is(10)); assertThat(window.write(buffer), is(-1)); assertThat(window.position(), is(7L)); assertThat(channel.size(), is(9L)); channel.position(0); assertThat(channel.toString(), is("\0\0" + "1234567")); } } }
From source file:com.job.portal.manager.JobsManager.java
public JSONArray getAllJobs(HttpServletRequest request) { JSONArray arr = null;/*from ww w.jav a 2 s . c o m*/ try { arr = jd.getAllJobs(); } catch (Exception e) { LogOut.log.error("In " + new Object() { }.getClass().getEnclosingClass().getName() + "." + new Object() { }.getClass().getEnclosingMethod().getName() + " " + e); } finally { return arr; } }
From source file:org.jimsey.project.turbine.spring.controller.IndicatorControllerTest.java
@Test public void testGetAllStocksGreaterThanDate() throws Exception { Mockito.when(elasticsearch.findIndicatorsByMarketAndSymbolAndNameAndDateGreaterThan(Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.any(Long.class))).thenReturn(indicators); String expected = json.writeValueAsString(new Object() { @JsonProperty("indicators") List<IndicatorJson> indicatorz = indicators; });//from w ww.j a v a 2 s . co m long date = Instant.now().minus(1, ChronoUnit.MINUTES).toEpochMilli(); String restUri = String.format("%s/%s/%s/%s/%s", TurbineCondenserConstants.REST_ROOT_INDICATORS, "market", "symbol", "testName", date); mvc.perform(MockMvcRequestBuilders.get(restUri).accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()).andExpect(content().string(equalTo(expected))); }
From source file:com.adaptris.jdbc.connection.FailoverDatasourceTest.java
@Test public void testPoolAttendant() throws Exception { FailoverConfig cfg = new FailoverConfig(createProperties()); PoolAttendant p = new PoolAttendant(cfg); assertFalse(p.validateObject(null)); assertFalse(p.validateObject(new FailingProxy())); p.destroyObject(new Object()); }
From source file:com.redhat.lightblue.metadata.types.DoubleTypeTest.java
@Test public void testCompareV1Null() { assertEquals(doubleType.compare(null, new Object()), -1); }
From source file:com.workplacesystems.queuj.utils.BackgroundProcess.java
/** Creates a new instance of BackgroundProcess that will run in the current thread. */ protected BackgroundProcess(ThreadPoolCreator tp_creator) { this();// w w w . j a v a 2 s . c o m this.in_process = false; this.thread_pool = getThreadPool(tp_creator); pool_borrow_mutex = new Object(); pool_mutex = new Object(); }
From source file:it.osm.gtfs.GTFSOSMImport.java
@Command(description = "Analyze the diff between osm relations and gtfs trips") public void reldiffx() throws IOException, ParserConfigurationException, SAXException { final Object lock = new Object(); final GTFSRouteDiffGui app = new GTFSRouteDiffGui(); app.setVisible(true);/*from ww w .j a va2 s .co m*/ app.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent arg0) { synchronized (lock) { app.setVisible(false); lock.notify(); } } }); synchronized (lock) { while (app.isVisible()) try { lock.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } app.dispose(); System.out.println("Done"); }
From source file:com.facebook.internal.FileLruCache.java
public FileLruCache(Context context, String tag, Limits limits) { this.tag = tag; this.limits = limits; this.directory = new File(context.getCacheDir(), tag); this.lock = new Object(); // Ensure the cache dir exists if (this.directory.mkdirs() || this.directory.isDirectory()) { // Remove any stale partially-written files from a previous run BufferFile.deleteAll(this.directory); }//from ww w. j a v a 2 s .c om }