List of usage examples for junit.framework Assert assertFalse
static public void assertFalse(boolean condition)
From source file:de.akquinet.gomobile.androlog.test.MailReporterTest.java
public void testMailWithLongLog() { Log.init(getContext());/*from www. jav a 2s. co m*/ String message = "This is a INFO test"; String tag = "my.log.info"; Log.d(tag, message); Log.i(tag, message); Log.w(tag, message); for (int i = 0; i < 200; i++) { Log.w("" + i); } List<String> list = Log.getReportedEntries(); Assert.assertNotNull(list); Assert.assertFalse(list.isEmpty()); Assert.assertEquals(25, list.size()); Log.report(); Log.report("this is a user message", null); Exception error = new MalformedChallengeException("error message", new NumberFormatException()); Log.report(null, error); }
From source file:com.sinosoft.one.showcase.rule.test.RuleServiceTest.java
@Test public void testproposalService() { ProPosalInputBOM ppib = new ProPosalInputBOM(); ppib.setAreaCode("010"); ppib.setCityCode("000"); ppib.setProPosal(true);/*ww w.j a va 2 s . co m*/ ProVehicle pv = new ProVehicle(); pv.setIsNewVehicle("01"); pv.setModelCode("VC1234567890123456"); pv.setModelName("?"); pv.setUseNatureCode("01"); pv.setReplacementValue(new BigDecimal(800000.00)); ppib.setProVehicle(pv); proposalRuleService.executeRule(ppib); System.out.println("VC1234567890123456 ???" + ppib.isProPosal()); Assert.assertFalse(ppib.isProPosal()); try { System.out.println("=========in sleep "); System.out.println("========="); Thread.sleep(30 * 1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } ppib.setAreaCode("010"); ppib.setCityCode("005"); ppib.setProPosal(true); pv.setIsNewVehicle("01"); pv.setModelCode("VC12343456"); pv.setModelName("?"); pv.setUseNatureCode("01"); pv.setReplacementValue(new BigDecimal(800000.00)); ppib.setProVehicle(pv); proposalRuleService.executeRule(ppib); System.out.println("VC12343456 ???" + ppib.isProPosal()); Assert.assertTrue(ppib.isProPosal()); }
From source file:org.wso2.carbon.apimgt.handlers.AuthenticationHandlerTest.java
@Test(description = "Handle request with without device type", dependsOnMethods = "testHandleRequestWithEmptyTransportHeader") public void testHandleRequestWithoutDeviceType() throws Exception { HashMap<String, String> transportHeaders = new HashMap<>(); transportHeaders.put(AuthConstants.MDM_SIGNATURE, "some cert"); boolean response = this.handler.handleRequest(createSynapseMessageContext("<empty/>", this.synapseConfiguration, transportHeaders, "https://test.com/testservice")); Assert.assertFalse(response); }
From source file:com.logsniffer.model.support.LineInputStreamTest.java
@Test public void testNLTrimingDuringBufferLimit() throws IOException { FileLog flog = new FileLog(new File("src/test/resources/logs/nl-triming.txt")); DirectFileLogAccess logAccess = new DirectFileLogAccess(flog); LineInputStream log = new LineInputStream(logAccess, logAccess.getInputStream(null), "UTF-8"); String line;// w w w . j av a 2 s .c o m int i = 0; while ((line = log.readNextLine()) != null) { i++; Assert.assertFalse(line.matches("[\n\r]+$")); } log.close(); Assert.assertEquals(53, i); }
From source file:com.ewcms.publication.freemarker.directive.ChannelListDirectiveTest.java
@Test public void testLoadingChannelChildren() throws Exception { Channel channel = createChannel(1, true); ChannelPublishServiceable service = mock(ChannelPublishServiceable.class); when(service.getChannel(any(Integer.class), any(Integer.class))).thenReturn(channel); List<Channel> children = createChannelChildren(1, 5); when(service.getChannelChildren(any(Integer.class))).thenReturn(children); ChannelListDirective directive = new ChannelListDirective(service); List<Channel> list = directive.loadingChannel(1, 1, false, true, false); Assert.assertFalse(list.isEmpty()); Assert.assertEquals(3, list.size()); }
From source file:com.collective.celos.FileSystemStateDatabaseTest.java
@Test public void testPauseFileExistence() throws Exception { StateDatabaseConnection db = getStateDatabaseConnection(); WorkflowID workflowID = new WorkflowID("wf1"); File pauseFile = new File(getDatabaseDir(), "paused/wf1"); Assert.assertFalse(db.isPaused(workflowID)); Assert.assertFalse(pauseFile.exists()); db.setPaused(workflowID, false);/*from w w w . j ava 2 s .c o m*/ Assert.assertFalse(db.isPaused(workflowID)); Assert.assertFalse(pauseFile.exists()); db.setPaused(workflowID, true); Assert.assertTrue(pauseFile.exists()); Assert.assertTrue(db.isPaused(workflowID)); db.setPaused(workflowID, false); Assert.assertFalse(db.isPaused(workflowID)); Assert.assertFalse(pauseFile.exists()); }
From source file:core.service.test.executor.mina.TestMinaExecutor.java
@Test public void textNoServer() { server.stop();/*from ww w . java 2s . c o m*/ ProcessApplicationService applicationService = (ProcessApplicationService) clientContext .getBean(ProcessApplicationService.class); // acceptable application Application application = new Application(Application.TYPE_DRIVER_LICENSEE); Applicant applicant = new Applicant("Jerry", "Cantrell", 16); application.setApplicant(applicant); ServiceResult result = applicationService.applyForDriving(application, applicant); Assert.assertFalse(result.isSuccess()); }
From source file:org.openmrs.module.webservices.rest.web.v1_0.controller.PersonNameControllerTest.java
@Test public void shouldVoidName() throws Exception { PersonName pname = service.getPersonNameByUuid(nameUuid); Assert.assertFalse(pname.isVoided()); controller.delete(personUuid, nameUuid, "unit test", request, response); pname = service.getPersonNameByUuid(nameUuid); Assert.assertTrue(pname.isVoided()); Assert.assertEquals("unit test", pname.getVoidReason()); }
From source file:io.cloudslang.lang.compiler.modeller.transformers.DoTransformerTest.java
@Test public void testTransformEmptyArgumentExpression() throws Exception { @SuppressWarnings("unchecked") Map<String, Object> doArgumentsMap = loadFirstTaskFromFile( "/corrupted/flow_with_empty_argument_expression.yaml"); @SuppressWarnings("unchecked") List<Argument> arguments = doTransformer.transform(doArgumentsMap); Assert.assertFalse(arguments.isEmpty()); Assert.assertEquals(2, arguments.size()); Argument argument = arguments.get(1); Assert.assertEquals("country", argument.getName()); Assert.assertEquals(false, argument.isOverridable()); }
From source file:io.druid.indexer.HdfsClasspathSetupTest.java
@After public void tearDown() throws IOException { dummyJarFile.delete();// w ww . j a v a 2 s .c o m Assert.assertFalse(dummyJarFile.exists()); miniCluster.getFileSystem().delete(finalClasspath, true); Assert.assertFalse(miniCluster.getFileSystem().exists(finalClasspath)); miniCluster.getFileSystem().delete(intermediatePath, true); Assert.assertFalse(miniCluster.getFileSystem().exists(intermediatePath)); }