input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
test02 ( ) { com . itextpdf . kernel . pdf . PdfDocument pdfDocument = new com . itextpdf . kernel . pdf . PdfDocument ( new com . itextpdf . kernel . pdf . PdfReader ( ( ( com . itextpdf . kernel . pdf . canvas . parser . BidiTextExtractionTest . sourceFolder ) + "in02.pdf" ) ) ) ; final java . lang . String [ ] expectedText = new java . lang . String [ ] { "1879<sp>" , "ืืืืคื ืืข" , ")ืืืืืื<sp>ืืืืืืจ<sp>ืืืืืืื<sp>ืืืืืื,1885<sp>(," } ; final com . itextpdf . kernel . geom . Rectangle [ ] regions = new com . itextpdf . kernel . geom . Rectangle [ ] { new com . itextpdf . kernel . geom . Rectangle ( 493 , 765 , 23 , 11 ) , new com . itextpdf . kernel . geom . Rectangle ( 522 , 784 , 38 , 12 ) , new com . itextpdf . kernel . geom . Rectangle ( 332 , 784 , 185 , 12 ) } ; final com . itextpdf . kernel . pdf . canvas . parser . filter . TextRegionEventFilter [ ] regionFilters = new com . itextpdf . kernel . pdf . canvas . parser . filter . TextRegionEventFilter [ regions . length ] ; for ( int i = 0 ; i < ( regions . length ) ; i ++ ) regionFilters [ i ] = new com . itextpdf . kernel . pdf . canvas . parser . filter . TextRegionEventFilter ( regions [ i ] ) ; com . itextpdf . kernel . pdf . canvas . parser . listener . FilteredEventListener listener = new com . itextpdf . kernel . pdf . canvas . parser . listener . FilteredEventListener ( ) ; com . itextpdf . kernel . pdf . canvas . parser . listener . LocationTextExtractionStrategy [ ] extractionStrategies = new com . itextpdf . kernel . pdf . canvas . parser . listener . LocationTextExtractionStrategy [ regions . length ] ; for ( int i = 0 ; i < ( regions . length ) ; i ++ ) extractionStrategies [ i ] = listener . attachEventListener ( new com . itextpdf . kernel . pdf . canvas . parser . listener . LocationTextExtractionStrategy ( ) . setRightToLeftRunDirection ( true ) , regionFilters [ i ] ) ; new com . itextpdf . kernel . pdf . canvas . parser . PdfCanvasProcessor ( listener ) . processPageContent ( pdfDocument . getPage ( 1 ) ) ; for ( int i = 0 ; i < ( regions . length ) ; i ++ ) { java . lang . String actualText = extractionStrategies [ i ] . getResultantText ( ) ; "<AssertPlaceHolder>" ; } } getPage ( com . itextpdf . kernel . pdf . PdfDictionary ) { int pageNum = getPageNumber ( pageDictionary ) ; if ( pageNum > 0 ) { return getPage ( pageNum ) ; } return null ; } | org . junit . Assert . assertEquals ( expectedText [ i ] , actualText ) |
testNewDocumentIsCreatedForEachWsdlRequest ( ) { org . apache . cxf . jaxws . JaxWsServerFactoryBean factory = new org . apache . cxf . jaxws . JaxWsServerFactoryBean ( ) ; factory . setServiceBean ( new org . apache . cxf . systest . jaxws . WsdlGetUtilsTest . StuffImpl ( ) ) ; factory . setAddress ( ( ( "http://localhost:" + ( org . apache . cxf . systest . jaxws . WsdlGetUtilsTest . PORT ) ) + "/Stuff" ) ) ; org . apache . cxf . endpoint . Server server = factory . create ( ) ; try { org . apache . cxf . message . Message message = new org . apache . cxf . message . MessageImpl ( ) ; org . apache . cxf . message . Exchange exchange = new org . apache . cxf . message . ExchangeImpl ( ) ; exchange . put ( org . apache . cxf . Bus . class , getBus ( ) ) ; exchange . put ( org . apache . cxf . service . Service . class , server . getEndpoint ( ) . getService ( ) ) ; exchange . put ( org . apache . cxf . endpoint . Endpoint . class , server . getEndpoint ( ) ) ; message . setExchange ( exchange ) ; java . util . Map < java . lang . String , java . lang . String > map = org . apache . cxf . common . util . UrlUtils . parseQueryString ( "wsdl" ) ; java . lang . String baseUri = ( "http://localhost:" + ( org . apache . cxf . systest . jaxws . WsdlGetUtilsTest . PORT ) ) + "/Stuff" ; java . lang . String ctx = "/Stuff" ; org . apache . cxf . frontend . WSDLGetUtils utils = new org . apache . cxf . frontend . WSDLGetUtils ( ) ; org . w3c . dom . Document doc = utils . getDocument ( message , baseUri , map , ctx , server . getEndpoint ( ) . getEndpointInfo ( ) ) ; org . w3c . dom . Document doc2 = utils . getDocument ( message , baseUri , map , ctx , server . getEndpoint ( ) . getEndpointInfo ( ) ) ; "<AssertPlaceHolder>" ; } finally { server . stop ( ) ; } } getEndpointInfo ( ) { return endpointInfo ; } | org . junit . Assert . assertFalse ( ( doc == doc2 ) ) |
shouldReturnIdImmediatelyAfterRecordId ( ) { org . neo4j . unsafe . impl . batchimport . store . PrepareIdSequence idSequence = new org . neo4j . unsafe . impl . batchimport . store . SecondaryUnitPrepareIdSequence ( ) ; org . neo4j . kernel . impl . store . id . IdSequence actual = mock ( org . neo4j . kernel . impl . store . id . IdSequence . class ) ; long recordId = 10 ; org . neo4j . kernel . impl . store . id . IdSequence prepared = idSequence . apply ( actual ) . apply ( recordId ) ; long nextRecordId = prepared . nextId ( ) ; "<AssertPlaceHolder>" ; verifyNoMoreInteractions ( actual ) ; } nextId ( ) { assert ! ( closed ) ; long id ; while ( ( ( currentBatch ) == null ) || ( ( id = currentBatch . nextId ( ) ) == ( org . neo4j . kernel . impl . store . id . IdRangeIterator . VALUE_REPRESENTING_NULL ) ) ) { currentBatch = source . nextIdBatch ( batchSize ) . iterator ( ) ; } return id ; } | org . junit . Assert . assertEquals ( ( 10 + 1 ) , nextRecordId ) |
testGetAllProgramsInAttributesAndDataElements ( ) { org . hisp . dhis . program . ProgramTrackedEntityAttributeDimensionItem ptaA = new org . hisp . dhis . program . ProgramTrackedEntityAttributeDimensionItem ( prA , atA ) ; org . hisp . dhis . program . ProgramDataElementDimensionItem pdeA = new org . hisp . dhis . program . ProgramDataElementDimensionItem ( prB , deA ) ; org . hisp . dhis . analytics . DataQueryParams params = org . hisp . dhis . analytics . DataQueryParams . newBuilder ( ) . withProgramAttributes ( com . google . common . collect . Lists . newArrayList ( ptaA ) ) . withProgramDataElements ( com . google . common . collect . Lists . newArrayList ( pdeA ) ) . withPeriods ( com . google . common . collect . Lists . newArrayList ( peA , peB ) ) . withOrganisationUnits ( com . google . common . collect . Lists . newArrayList ( ouA , ouB ) ) . build ( ) ; org . hisp . dhis . analytics . Set < org . hisp . dhis . program . Program > expected = com . google . common . collect . Sets . newHashSet ( prA , prB ) ; "<AssertPlaceHolder>" ; } getProgramsInAttributesAndDataElements ( ) { final java . util . Set < org . hisp . dhis . common . IdentifiableObject > programs = new java . util . HashSet ( ) ; getAllProgramAttributes ( ) . stream ( ) . map ( ( a ) -> ( ( org . hisp . dhis . program . ProgramTrackedEntityAttributeDimensionItem ) ( a ) ) ) . filter ( ( a ) -> ( a . getProgram ( ) ) != null ) . forEach ( ( a ) -> programs . add ( a . getProgram ( ) ) ) ; getAllProgramDataElements ( ) . stream ( ) . map ( ( d ) -> ( ( org . hisp . dhis . program . ProgramDataElementDimensionItem ) ( d ) ) ) . filter ( ( d ) -> ( d . getProgram ( ) ) != null ) . forEach ( ( d ) -> programs . add ( d . getProgram ( ) ) ) ; return programs ; } | org . junit . Assert . assertEquals ( expected , params . getProgramsInAttributesAndDataElements ( ) ) |
testTimeoffset ( ) { final com . amazonaws . AmazonWebServiceClientTest . AmazonTestClient client = new com . amazonaws . AmazonWebServiceClientTest . AmazonTestClient ( ) ; client . withTimeOffset ( 100 ) ; "<AssertPlaceHolder>" ; } getTimeOffset ( ) { return timeOffset ; } | org . junit . Assert . assertEquals ( client . getTimeOffset ( ) , 100 ) |
create_by_id_right_after_entity_creation_should_not_throw_exception ( ) { @ com . artemis . annotations . Wire ( injectInherited = true ) class TestSystem extends com . artemis . ComponentMapperTest . BasicSystem { @ com . artemis . Override protected void process ( com . artemis . Entity e ) { final com . artemis . Entity t1 = world . createEntity ( ) ; com . artemis . ComponentMapperTest . Pos c1 = mPos . create ( t1 . id ) ; "<AssertPlaceHolder>" ; } } createAndProcessWorld ( new TestSystem ( ) ) ; } create ( java . lang . Class ) { return com . artemis . generator . model . artemis . ComponentDescriptor . create ( type , new com . artemis . FluidGeneratorPreferences ( ) ) ; } | org . junit . Assert . assertNotNull ( c1 ) |
handle_no_such_function_error_from_server ( ) { net . gjerull . etherpad . client . EPLiteConnection connection = new net . gjerull . etherpad . client . EPLiteConnection ( "http://example.com/" , "apikey" , net . gjerull . etherpad . client . EPLiteConnectionTest . API_VERSION , net . gjerull . etherpad . client . EPLiteConnectionTest . ENCODING ) ; java . lang . String serverResponse = java . lang . String . format ( net . gjerull . etherpad . client . EPLiteConnectionTest . RESPONSE_TEMPLATE , 3 , "no<sp>such<sp>function" , null ) ; try { connection . handleResponse ( serverResponse ) ; org . junit . Assert . fail ( ( ( "Expected<sp>'" + ( net . gjerull . etherpad . client . EPLiteException . class . getName ( ) ) ) + "'<sp>to<sp>be<sp>thrown" ) ) ; } catch ( net . gjerull . etherpad . client . EPLiteException e ) { "<AssertPlaceHolder>" ; } } handleResponse ( java . lang . String ) { try { org . json . simple . parser . JSONParser parser = new org . json . simple . parser . JSONParser ( ) ; java . util . Map response = ( ( java . util . Map ) ( parser . parse ( jsonString ) ) ) ; if ( ( response . get ( "code" ) ) != null ) { int code = ( ( java . lang . Long ) ( response . get ( "code" ) ) ) . intValue ( ) ; switch ( code ) { case net . gjerull . etherpad . client . EPLiteConnection . CODE_OK : return response . get ( "data" ) ; case net . gjerull . etherpad . client . EPLiteConnection . CODE_INVALID_PARAMETERS : case net . gjerull . etherpad . client . EPLiteConnection . CODE_INTERNAL_ERROR : case net . gjerull . etherpad . client . EPLiteConnection . CODE_INVALID_METHOD : case net . gjerull . etherpad . client . EPLiteConnection . CODE_INVALID_API_KEY : throw new net . gjerull . etherpad . client . EPLiteException ( ( ( java . lang . String ) ( response . get ( "message" ) ) ) ) ; default : throw new net . gjerull . etherpad . client . EPLiteException ( ( "An<sp>unknown<sp>error<sp>has<sp>occurred<sp>while<sp>handling<sp>the<sp>response:<sp>" + jsonString ) ) ; } } else { throw new net . gjerull . etherpad . client . EPLiteException ( ( "An<sp>unexpected<sp>response<sp>from<sp>the<sp>server:<sp>" + jsonString ) ) ; } } catch ( org . json . simple . parser . ParseException e ) { throw new net . gjerull . etherpad . client . EPLiteException ( ( ( "Unable<sp>to<sp>parse<sp>JSON<sp>response<sp>(" + jsonString ) + ")" ) , e ) ; } } | org . junit . Assert . assertEquals ( "no<sp>such<sp>function" , e . getMessage ( ) ) |
testIsHideScrollbars ( ) { classUnderTest . setHideScrollbars ( true ) ; "<AssertPlaceHolder>" ; } isHideScrollbars ( ) { return _hideScrollBars ; } | org . junit . Assert . assertEquals ( true , classUnderTest . isHideScrollbars ( ) ) |
testAddGoal ( ) { phase . addGoal ( goal ( "goal" , 2000 , 1000 ) ) ; "<AssertPlaceHolder>" ; } getGoals ( ) { return goals ; } | org . junit . Assert . assertEquals ( phase . getGoals ( ) . size ( ) , 1 ) |
loadsEmptyMap ( ) { org . jmxtrans . agent . properties . NoPropertiesSourcePropertiesLoader loader = new org . jmxtrans . agent . properties . NoPropertiesSourcePropertiesLoader ( ) ; java . util . Map < java . lang . String , java . lang . String > loadedProperties = loader . loadProperties ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return names . size ( ) ; } | org . junit . Assert . assertThat ( loadedProperties . size ( ) , equalTo ( 0 ) ) |
listenersAreCalledCorrectlyInTheFaceOfFailures ( ) { org . junit . runner . JUnitCore core = new org . junit . runner . JUnitCore ( ) ; final java . util . List < org . junit . runner . notification . Failure > failures = new java . util . ArrayList < org . junit . runner . notification . Failure > ( ) ; core . addListener ( new org . junit . runner . notification . RunListener ( ) { @ org . junit . tests . experimental . max . Override public void testRunFinished ( org . junit . runner . Result result ) throws java . lang . Exception { failures . addAll ( result . getFailures ( ) ) ; } } ) ; fMax . run ( org . junit . runner . Request . aClass ( org . junit . tests . experimental . max . MaxStarterTest . TwoTests . class ) , core ) ; "<AssertPlaceHolder>" ; } size ( ) { return list . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , failures . size ( ) ) |
evaluateResource ( ) { org . xwiki . webjars . internal . WebJarsResourceReference reference = new org . xwiki . webjars . internal . WebJarsResourceReference ( "wiki:wiki" , java . util . Arrays . asList ( "angular" , "2.1.11" , "angular.js" ) ) ; reference . addParameter ( "evaluate" , true ) ; java . io . ByteArrayInputStream resourceStream = new java . io . ByteArrayInputStream ( "content" . getBytes ( ) ) ; when ( this . classLoader . getResourceAsStream ( "META-INF/resources/webjars/angular/2.1.11/angular.js" ) ) . thenReturn ( resourceStream ) ; org . xwiki . velocity . VelocityManager velocityManager = this . componentManager . getInstance ( org . xwiki . velocity . VelocityManager . class ) ; org . xwiki . velocity . VelocityEngine velocityEngine = mock ( org . xwiki . velocity . VelocityEngine . class ) ; when ( velocityManager . getVelocityEngine ( ) ) . thenReturn ( velocityEngine ) ; doAnswer ( new org . mockito . stubbing . Answer < java . lang . Void > ( ) { @ org . xwiki . webjars . Override public org . xwiki . webjars . Void answer ( org . mockito . invocation . InvocationOnMock invocation ) { ( ( java . io . StringWriter ) ( invocation . getArguments ( ) [ 1 ] ) ) . write ( "evaluated<sp>content" ) ; return null ; } } ) . when ( velocityEngine ) . evaluate ( any ( ) , any ( ) , eq ( "angular/2.1.11/angular.js" ) , any ( java . io . Reader . class ) ) ; this . handler . handle ( reference , this . chain ) ; "<AssertPlaceHolder>" ; verify ( this . response ) . setContentType ( "application/javascript" ) ; verify ( this . response . getHttpServletResponse ( ) , never ( ) ) . setHeader ( any ( ) , any ( ) ) ; verify ( this . response . getHttpServletResponse ( ) , never ( ) ) . setDateHeader ( any ( ) , anyLong ( ) ) ; } getOutputStream ( ) { if ( ( this . portletResponse ) instanceof javax . portlet . RenderResponse ) { return ( ( javax . portlet . RenderResponse ) ( this . portletResponse ) ) . getPortletOutputStream ( ) ; } return null ; } | org . junit . Assert . assertEquals ( "evaluated<sp>content" , this . response . getOutputStream ( ) . toString ( ) ) |
testIntervalActionEndCalculationWithInterval ( ) { final com . liferay . portal . kernel . interval . IntervalActionProcessor < java . lang . Void > intervalActionProcessor = new com . liferay . portal . kernel . interval . IntervalActionProcessor ( 125 , 200 ) ; intervalActionProcessor . setPerformIntervalActionMethod ( new com . liferay . portal . kernel . interval . IntervalActionProcessor . PerformIntervalActionMethod < java . lang . Void > ( ) { @ java . lang . Override public java . lang . Void performIntervalAction ( int start , int end ) { for ( int i = start ; i < end ; i ++ ) { _count . incrementAndGet ( ) ; } intervalActionProcessor . incrementStart ( ( end - start ) ) ; return null ; } } ) ; intervalActionProcessor . performIntervalActions ( ) ; "<AssertPlaceHolder>" ; } get ( ) { return _byteBuffer . get ( ) ; } | org . junit . Assert . assertEquals ( 125 , _count . get ( ) ) |
testSerialization ( ) { org . jfree . chart . plot . ValueMarker m1 = new org . jfree . chart . plot . ValueMarker ( 25.0 ) ; org . jfree . chart . plot . ValueMarker m2 = ( ( org . jfree . chart . plot . ValueMarker ) ( org . jfree . chart . TestUtilities . serialised ( m1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( m1 , m2 ) |
testCase91 ( ) { org . evosuite . testcase . DefaultTestCase tc = buildTestCase91 ( ) ; java . util . List < org . evosuite . symbolic . BranchCondition > branch_conditions = executeTest ( tc ) ; "<AssertPlaceHolder>" ; } size ( ) { return theTest . size ( ) ; } | org . junit . Assert . assertEquals ( 6 , branch_conditions . size ( ) ) |
useDefault ( ) { java . util . Map < java . lang . String , java . lang . Object > map = java . util . Collections . emptyMap ( ) ; org . neo4j . graphalgo . core . ProcedureConfiguration procedureConfiguration = org . neo4j . graphalgo . core . ProcedureConfiguration . create ( map ) ; java . lang . String value = procedureConfiguration . get ( "partitionProperty" , "defaultValue" ) ; "<AssertPlaceHolder>" ; } get ( long , double ) { return weights . getOrDefault ( id , defaultValue ) ; } | org . junit . Assert . assertEquals ( "defaultValue" , value ) |
complexTest1 ( ) { java . util . Calendar cal = new java . util . GregorianCalendar ( ) ; cal . set ( Calendar . HOUR_OF_DAY , 9 ) ; cal . add ( Calendar . DAY_OF_YEAR , ( - 1 ) ) ; setSubHourFieldsZero ( cal ) ; java . util . Date startDate = cal . getTime ( ) ; long [ ] result = this . parseTimes ( "noon<sp>yesterday<sp>-3hours" , "now" ) ; long start = ( result [ 0 ] ) * 1000 ; "<AssertPlaceHolder>" ; } getTime ( ) { return time ; } | org . junit . Assert . assertEquals ( startDate . getTime ( ) , start ) |
test_ips_pools_get ( ) { com . sendgrid . SendGrid sg = new com . sendgrid . SendGrid ( "SENDGRID_API_KEY" , true ) ; sg . setHost ( "localhost:4010" ) ; sg . addRequestHeader ( "X-Mock" , "200" ) ; com . sendgrid . Request request = new com . sendgrid . Request ( ) ; request . setMethod ( Method . GET ) ; request . setEndpoint ( "ips/pools" ) ; com . sendgrid . Response response = sg . api ( request ) ; "<AssertPlaceHolder>" ; } api ( com . sendgrid . Request ) { com . sendgrid . Request req = new com . sendgrid . Request ( ) ; req . setMethod ( request . getMethod ( ) ) ; req . setBaseUri ( this . host ) ; req . setEndpoint ( ( ( ( "/" + ( version ) ) + "/" ) + ( request . getEndpoint ( ) ) ) ) ; req . setBody ( request . getBody ( ) ) ; for ( Map . Entry < java . lang . String , java . lang . String > header : this . requestHeaders . entrySet ( ) ) { req . addHeader ( header . getKey ( ) , header . getValue ( ) ) ; } for ( Map . Entry < java . lang . String , java . lang . String > queryParam : request . getQueryParams ( ) . entrySet ( ) ) { req . addQueryParam ( queryParam . getKey ( ) , queryParam . getValue ( ) ) ; } return makeCall ( req ) ; } | org . junit . Assert . assertEquals ( 200 , response . getStatusCode ( ) ) |
givenAndroidManifestWithoutInstrumentationThenInstrumentationRunnerIsNotFound ( ) { final java . net . URL url = this . getClass ( ) . getResource ( "AndroidManifestWithoutInstrumentation.xml" ) ; final java . net . URI uri = url . toURI ( ) ; final java . io . File file = new java . io . File ( uri ) ; final java . lang . String foundInstrumentationRunner = androidMojo . extractInstrumentationRunnerFromAndroidManifest ( file ) ; "<AssertPlaceHolder>" ; } extractInstrumentationRunnerFromAndroidManifest ( java . io . File ) { final java . net . URL xmlURL ; try { xmlURL = manifestFile . toURI ( ) . toURL ( ) ; } catch ( java . net . MalformedURLException e ) { throw new org . apache . maven . plugin . MojoExecutionException ( ( "Error<sp>while<sp>trying<sp>to<sp>figure<sp>out<sp>instrumentation<sp>runner<sp>from<sp>inside<sp>AndroidManifest.xml<sp>file<sp>" + manifestFile ) , e ) ; } final org . apache . commons . jxpath . xml . DocumentContainer documentContainer = new org . apache . commons . jxpath . xml . DocumentContainer ( xmlURL ) ; final java . lang . Object instrumentationRunner ; try { instrumentationRunner = org . apache . commons . jxpath . JXPathContext . newContext ( documentContainer ) . getValue ( "manifest//instrumentation/@android:name" , java . lang . String . class ) ; } catch ( org . apache . commons . jxpath . JXPathNotFoundException e ) { return null ; } return ( ( java . lang . String ) ( instrumentationRunner ) ) ; } | org . junit . Assert . assertNull ( foundInstrumentationRunner ) |
testXPathHelperWithDocument ( ) { try { org . w3c . dom . Document document = getDocument ( ddf . catalog . impl . XPathHelperTest . INPUT_FILE ) ; ddf . util . XPathHelper xHelper = new ddf . util . XPathHelper ( document ) ; org . w3c . dom . NodeList nodeList = ( ( org . w3c . dom . NodeList ) ( xHelper . evaluate ( ddf . catalog . impl . XPathHelperTest . XPATH_EXPRESSION , XPathConstants . NODESET , new ddf . catalog . impl . MockNamespaceResolver ( ) ) ) ) ; ddf . catalog . impl . XPathHelperTest . LOGGER . debug ( "testXPathHelper_WithDocument()<sp>-<sp>nodeList<sp>length<sp>=<sp>{}" , nodeList . getLength ( ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e1 ) { ddf . catalog . impl . XPathHelperTest . LOGGER . error ( "Exception<sp>thrown<sp>during<sp>testXPathHelper_WithDocument" , e1 ) ; } } getLength ( ) { return length ; } | org . junit . Assert . assertEquals ( 6 , nodeList . getLength ( ) ) |
testSerialization ( ) { org . jfree . chart . renderer . xy . StackedXYAreaRenderer r1 = new org . jfree . chart . renderer . xy . StackedXYAreaRenderer ( ) ; r1 . setShapePaint ( Color . RED ) ; r1 . setShapeStroke ( new java . awt . BasicStroke ( 1.23F ) ) ; org . jfree . chart . renderer . xy . StackedXYAreaRenderer r2 = ( ( org . jfree . chart . renderer . xy . StackedXYAreaRenderer ) ( org . jfree . chart . TestUtils . serialised ( r1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( r1 , r2 ) |
testOnCutSelectionCommandExecuted ( ) { pasteSelectionSessionCommand . bind ( session ) ; pasteSelectionSessionCommand . listen ( statusCallback ) ; pasteSelectionSessionCommand . onCutSelectionCommandExecuted ( new org . kie . workbench . common . stunner . core . client . session . command . impl . CutSelectionSessionCommandExecutedEvent ( mock ( org . kie . workbench . common . stunner . core . client . session . command . impl . CutSelectionSessionCommand . class ) , session ) ) ; verify ( statusCallback , times ( 1 ) ) . execute ( ) ; "<AssertPlaceHolder>" ; } isEnabled ( ) { return ! ( registry . isEmpty ( ) ) ; } | org . junit . Assert . assertTrue ( command . isEnabled ( ) ) |
runAsUserTest ( ) { java . util . concurrent . Callable < java . lang . String > callable = ( ( java . util . concurrent . Callable < java . lang . String > ) ( mock ( java . util . concurrent . Callable . class ) ) ) ; when ( callable . call ( ) ) . thenReturn ( org . pentaho . platform . engine . security . SecurityHelperTest . CALLABLE_RETURNED_VALUE_OK ) ; java . lang . String runningResult = getAuthorizedSecurityHelper ( ) . runAsUser ( org . pentaho . platform . engine . security . SecurityHelperTest . DEF_USERNAME , callable ) ; "<AssertPlaceHolder>" ; } runAsUser ( java . lang . String , java . util . concurrent . Callable ) { becomeUser ( principalName ) ; return callable . call ( ) ; } | org . junit . Assert . assertEquals ( org . pentaho . platform . engine . security . SecurityHelperTest . CALLABLE_RETURNED_VALUE_OK , runningResult ) |
testObtainingInjectionTarget ( javax . enterprise . inject . spi . BeanManager ) { javax . enterprise . inject . spi . InjectionTarget < org . jboss . weld . tests . injectionTarget . InjectionTargetTest . NonStaticInnerClass > it = beanManager . getInjectionTargetFactory ( beanManager . createAnnotatedType ( org . jboss . weld . tests . injectionTarget . InjectionTargetTest . NonStaticInnerClass . class ) ) . createInjectionTarget ( null ) ; javax . enterprise . context . spi . CreationalContext < org . jboss . weld . tests . injectionTarget . InjectionTargetTest . NonStaticInnerClass > ctx = beanManager . createCreationalContext ( null ) ; org . jboss . weld . tests . injectionTarget . InjectionTargetTest . NonStaticInnerClass instance = new org . jboss . weld . tests . injectionTarget . InjectionTargetTest . NonStaticInnerClass ( ) ; it . postConstruct ( instance ) ; it . inject ( instance , ctx ) ; "<AssertPlaceHolder>" ; try { it . produce ( ctx ) ; org . junit . Assert . fail ( ) ; } catch ( org . jboss . weld . exceptions . CreationException expected ) { } it . preDestroy ( instance ) ; } getEvent ( ) { return event ; } | org . junit . Assert . assertNotNull ( instance . getEvent ( ) ) |
testLogFilesAreArchived ( ) { org . apache . hadoop . hbase . master . TestSplitLogManager . LOG . info ( "testLogFilesAreArchived" ) ; slm = new org . apache . hadoop . hbase . master . SplitLogManager ( master , conf ) ; org . apache . hadoop . fs . FileSystem fs = org . apache . hadoop . hbase . master . TestSplitLogManager . TEST_UTIL . getTestFileSystem ( ) ; org . apache . hadoop . fs . Path dir = org . apache . hadoop . hbase . master . TestSplitLogManager . TEST_UTIL . getDataTestDirOnTestFS ( "testLogFilesAreArchived" ) ; conf . set ( HConstants . HBASE_DIR , dir . toString ( ) ) ; java . lang . String serverName = org . apache . hadoop . hbase . ServerName . valueOf ( "foo" , 1 , 1 ) . toString ( ) ; org . apache . hadoop . fs . Path logDirPath = new org . apache . hadoop . fs . Path ( new org . apache . hadoop . fs . Path ( dir , org . apache . hadoop . hbase . HConstants . HREGION_LOGDIR_NAME ) , serverName ) ; fs . mkdirs ( logDirPath ) ; java . lang . String logFile = new org . apache . hadoop . fs . Path ( logDirPath , org . apache . hadoop . hbase . master . TestSplitLogManager . TEST_UTIL . getRandomUUID ( ) . toString ( ) ) . toString ( ) ; fs . create ( new org . apache . hadoop . fs . Path ( logDirPath , logFile ) ) . close ( ) ; new java . lang . Thread ( ) { @ org . apache . hadoop . hbase . master . Override public void run ( ) { boolean done = false ; while ( ! done ) { for ( Map . Entry < java . lang . String , org . apache . hadoop . hbase . master . SplitLogManager . Task > entry : slm . getTasks ( ) . entrySet ( ) ) { final org . apache . hadoop . hbase . ServerName worker1 = org . apache . hadoop . hbase . ServerName . valueOf ( "worker1,1,1" ) ; org . apache . hadoop . hbase . SplitLogTask slt = new org . apache . hadoop . hbase . SplitLogTask . Done ( worker1 ) ; boolean encounteredZKException = false ; try { org . apache . hadoop . hbase . zookeeper . ZKUtil . setData ( zkw , entry . getKey ( ) , slt . toByteArray ( ) ) ; } catch ( org . apache . zookeeper . KeeperException e ) { org . apache . hadoop . hbase . master . TestSplitLogManager . LOG . warn ( e . toString ( ) , e ) ; encounteredZKException = true ; } if ( ! encounteredZKException ) { done = true ; } } } } } . start ( ) ; slm . splitLogDistributed ( logDirPath ) ; "<AssertPlaceHolder>" ; } exists ( java . util . List ) { org . apache . hadoop . hbase . rest . client . RemoteHTable . LOG . warn ( "exists(List<Get>)<sp>is<sp>really<sp>list<sp>of<sp>get()<sp>calls,<sp>just<sp>use<sp>get()" ) ; boolean [ ] results = new boolean [ gets . size ( ) ] ; for ( int i = 0 ; i < ( results . length ) ; i ++ ) { results [ i ] = exists ( gets . get ( i ) ) ; } return results ; } | org . junit . Assert . assertFalse ( fs . exists ( logDirPath ) ) |
testGetTemplateFile ( ) { when ( org . oscm . app . dao . TemplateFileDAOTest . query . getSingleResult ( ) ) . thenReturn ( org . oscm . app . dao . TemplateFileDAOTest . tf ) ; org . oscm . app . domain . TemplateFile result = org . oscm . app . dao . TemplateFileDAOTest . tfDAO . getTemplateFileByUnique ( "file" , "controller" ) ; "<AssertPlaceHolder>" ; } getTemplateFileByUnique ( java . lang . String , java . lang . String ) { javax . persistence . TypedQuery < org . oscm . app . domain . TemplateFile > query = em . createNamedQuery ( "TemplateFile.getForFileAndControllerId" , org . oscm . app . domain . TemplateFile . class ) ; query . setParameter ( "fileName" , fileName ) ; query . setParameter ( "controllerId" , controllerId ) ; try { return query . getSingleResult ( ) ; } catch ( javax . persistence . NoResultException e ) { return null ; } } | org . junit . Assert . assertEquals ( org . oscm . app . dao . TemplateFileDAOTest . tf , result ) |
doesOrganizationForTenantExist ( ) { runTX ( new java . util . concurrent . Callable < java . lang . Void > ( ) { @ org . oscm . tenant . dao . Override public org . oscm . tenant . dao . Void call ( ) throws org . oscm . tenant . dao . Exception { bean . addTenant ( org . oscm . tenant . assembler . TenantAssembler . toVOTenant ( tenant1 ) ) ; return null ; } } ) ; final org . oscm . domobjects . Tenant returnedTenant = runTX ( new java . util . concurrent . Callable < org . oscm . domobjects . Tenant > ( ) { @ org . oscm . tenant . dao . Override public org . oscm . domobjects . Tenant call ( ) throws org . oscm . tenant . dao . Exception { return tenantDao . getTenantByTenantId ( "tenantID1" ) ; } } ) ; runTX ( new java . util . concurrent . Callable < java . lang . Void > ( ) { @ org . oscm . tenant . dao . Override public org . oscm . tenant . dao . Void call ( ) throws org . oscm . tenant . dao . Exception { org . oscm . domobjects . Organization org = new org . oscm . domobjects . Organization ( ) ; org . setOrganizationId ( "orgId" ) ; org . setTenant ( returnedTenant ) ; org . setCutOffDay ( 1 ) ; dm . persist ( org ) ; return null ; } } ) ; final java . lang . Long count = runTX ( new java . util . concurrent . Callable < java . lang . Long > ( ) { @ org . oscm . tenant . dao . Override public org . oscm . tenant . dao . Long call ( ) throws org . oscm . tenant . dao . Exception { return tenantDao . doesOrganizationForTenantExist ( returnedTenant ) ; } } ) ; "<AssertPlaceHolder>" ; } doesOrganizationForTenantExist ( org . oscm . domobjects . Tenant ) { javax . persistence . Query query = dataManager . createNamedQuery ( "Tenant.checkOrganization" ) ; query . setParameter ( "tenant" , tenant ) ; return ( ( long ) ( query . getSingleResult ( ) ) ) ; } | org . junit . Assert . assertTrue ( ( count == 1L ) ) |
shouldReturnFalseWhenSchemaHasEmptyValidatorEdgeFilters ( ) { final uk . gov . gchq . gaffer . store . schema . Schema schema = new uk . gov . gchq . gaffer . store . schema . Schema . Builder ( ) . edge ( TestGroups . EDGE , new uk . gov . gchq . gaffer . store . schema . SchemaEdgeDefinition . Builder ( ) . validator ( new uk . gov . gchq . gaffer . data . element . function . ElementFilter . Builder ( ) . build ( ) ) . build ( ) ) . build ( ) ; final boolean result = schema . hasValidation ( ) ; "<AssertPlaceHolder>" ; } hasValidation ( ) { for ( final uk . gov . gchq . gaffer . store . schema . SchemaElementDefinition elementDef : new uk . gov . gchq . gaffer . commonutil . iterable . ChainedIterable < uk . gov . gchq . gaffer . store . schema . SchemaElementDefinition > ( getEntities ( ) . values ( ) , getEdges ( ) . values ( ) ) ) { if ( null != elementDef ) { if ( elementDef . hasValidation ( ) ) { return true ; } } } return false ; } | org . junit . Assert . assertFalse ( result ) |
testNoneMatchWithFalseResult ( ) { boolean match = com . annimon . stream . Stream . range ( 0 , 10 ) . noneMatch ( com . annimon . stream . Functions . remainder ( 2 ) ) ; "<AssertPlaceHolder>" ; } remainder ( int ) { return new com . annimon . stream . Predicate < java . lang . Integer > ( ) { @ com . annimon . stream . Override public boolean test ( java . lang . Integer v ) { return ( v % val ) == 0 ; } } ; } | org . junit . Assert . assertFalse ( match ) |
testDoForwardWithMementoWithHash ( ) { final org . apache . jena . rdf . model . Resource resource = createResource ( "http://localhost:8080/some/container/fcr:versions/20180315180915#test" ) ; when ( session . getNode ( "/container/fedora:timemap/20180315180915/#/test" ) ) . thenReturn ( node ) ; final org . fcrepo . kernel . api . models . FedoraResource converted = converter . convert ( resource ) ; final javax . jcr . Node resultNode = getJcrNode ( converted ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . String ) { final java . util . regex . Matcher matcher = org . fcrepo . http . commons . domain . Range . rangePattern . matcher ( source ) ; if ( ! ( matcher . matches ( ) ) ) { return new org . fcrepo . http . commons . domain . Range ( ) ; } final java . lang . String from = matcher . group ( 1 ) ; final java . lang . String to = matcher . group ( 2 ) ; final long start ; if ( from . equals ( "" ) ) { start = 0 ; } else { start = java . lang . Long . parseLong ( from ) ; } final long end ; if ( to . equals ( "" ) ) { end = - 1 ; } else { end = java . lang . Long . parseLong ( to ) ; } return new org . fcrepo . http . commons . domain . Range ( start , end ) ; } | org . junit . Assert . assertEquals ( node , resultNode ) |
testRoundtrip ( ) { final java . io . StringWriter out = new java . io . StringWriter ( ) ; final leap . lang . csv . CSVPrinter printer = new leap . lang . csv . CSVPrinter ( out , CSVFormat . DEFAULT ) ; final java . lang . String input = "a,b,c\r\n1,2,3\r\nx,y,z\r\n" ; for ( final leap . lang . csv . CSVRecord record : leap . lang . csv . CSVParser . parse ( input , CSVFormat . DEFAULT ) ) { printer . printRecord ( record ) ; } "<AssertPlaceHolder>" ; printer . close ( ) ; } toString ( ) { return ( ( ( ( method ) + "<sp>" ) + ( pathTemplate . getTemplate ( ) ) ) + "<sp>" ) + ( action ) ; } | org . junit . Assert . assertEquals ( input , out . toString ( ) ) |
shouldContainsAllGivenDoesNotContainAll ( ) { java . util . SortedSet < java . lang . Double > set = new uk . co . webamoeba . mockito . collections . util . LinkedSortedSet < java . lang . Double > ( ) ; java . lang . Double elementOne = 0.1 ; java . lang . Double elementTwo = 12.2 ; set . addAll ( java . util . Arrays . asList ( elementOne , elementTwo , 0.01 ) ) ; boolean containsAll = set . containsAll ( java . util . Arrays . asList ( elementOne , elementTwo , 3.1 ) ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertFalse ( containsAll ) |
testWithRandomParams ( ) { java . lang . String random = ( ( ( ( ( ( ( ( ( ( ( ( ( "&su=" 0 + ( java . net . URLEncoder . encode ( "http://subject1" , com . atomgraph . core . riot . lang . RDFPostReaderTest . ENC ) ) ) + "&su=" 3 ) + "&pu=" ) + ( java . net . URLEncoder . encode ( "http://predicate1" , com . atomgraph . core . riot . lang . RDFPostReaderTest . ENC ) ) ) + "&ol=" ) + ( java . net . URLEncoder . encode ( "literal" , com . atomgraph . core . riot . lang . RDFPostReaderTest . ENC ) ) ) + "&ZZZ=pu" ) + "&su=" ) + ( java . net . URLEncoder . encode ( "&su=" 2 , com . atomgraph . core . riot . lang . RDFPostReaderTest . ENC ) ) ) + "&q=42" ) + "&pu=" ) + ( java . net . URLEncoder . encode ( "&su=" 1 , com . atomgraph . core . riot . lang . RDFPostReaderTest . ENC ) ) ) + "&ol=" ) + ( java . net . URLEncoder . encode ( "literal1" , com . atomgraph . core . riot . lang . RDFPostReaderTest . ENC ) ) ; org . apache . jena . rdf . model . Model randomParsed = org . apache . jena . rdf . model . ModelFactory . createDefaultModel ( ) ; createRIOTParser ( ) . read ( new java . io . ByteArrayInputStream ( random . getBytes ( ) ) , "http://base" , null , org . apache . jena . riot . system . StreamRDFLib . graph ( randomParsed . getGraph ( ) ) , null ) ; "<AssertPlaceHolder>" ; } read ( java . io . InputStream , java . lang . String , org . apache . jena . atlas . web . ContentType , org . apache . jena . riot . system . StreamRDF , org . apache . jena . sparql . util . Context ) { read ( in , baseURI , org . apache . jena . riot . RDFLanguages . contentTypeToLang ( ct ) , output , context ) ; } | org . junit . Assert . assertTrue ( randomParsed . isEmpty ( ) ) |
postgresqlServiceDownIsDetected ( ) { "<AssertPlaceHolder>" ; } isRDBMSRunning ( ) { return dbAdmDao . isRDBMSRunning ( ) ; } | org . junit . Assert . assertFalse ( dbAdmDao . isRDBMSRunning ( ) ) |
testReadBlockGroupFailByCheckSumMultiBlocks2 ( ) { java . nio . ByteBuffer blocks = java . nio . ByteBuffer . allocate ( 110 ) ; for ( int i = 0 ; i < 2 ; i ++ ) { blocks . put ( new byte [ ] { 34 , 5 , 5 , 66 } ) ; while ( ( blocks . remaining ( ) ) > ( 110 - ( ( i + 1 ) * 10 ) ) ) { blocks . put ( ( ( byte ) ( 0 ) ) ) ; } } blocks . put ( com . geekhua . filequeue . datastore . BlockGroupTest . HEADER ) ; blocks . putInt ( 20 ) ; blocks . put ( new byte [ ] { 0 , 0 } ) ; byte [ ] content = new byte [ ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 } ; blocks . put ( contentBytesWithoutChecksum ( content , 10 ) ) ; blocks . put ( contentBytes ( content , 10 ) ) ; java . io . RandomAccessFile file = getFile ( ) ; file . write ( blocks . array ( ) ) ; file . seek ( 0 ) ; com . geekhua . filequeue . datastore . BlockGroup readBlockGroup = com . geekhua . filequeue . datastore . BlockGroup . read ( file , 10 ) ; "<AssertPlaceHolder>" ; file . close ( ) ; } getContent ( ) { return content ; } | org . junit . Assert . assertArrayEquals ( content , readBlockGroup . getContent ( ) ) |
testGetAll ( ) { oAuth2ClientService . saveOAuth2Client ( clientA ) ; oAuth2ClientService . saveOAuth2Client ( clientB ) ; oAuth2ClientService . saveOAuth2Client ( clientC ) ; java . util . Collection < org . hisp . dhis . security . oauth2 . OAuth2Client > all = oAuth2ClientService . getOAuth2Clients ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return messages . size ( ) ; } | org . junit . Assert . assertEquals ( 3 , all . size ( ) ) |
handleAsyncUpdateSubscription_Pending ( ) { org . oscm . domobjects . Subscription subscription = givenSubscription ( SubscriptionStatus . PENDING , initialProduct ) ; bean . handleAsyncUpdateSubscription ( subscription , targetProduct ) ; verify ( as , never ( ) ) . asyncModifySubscription ( any ( org . oscm . domobjects . Subscription . class ) , any ( org . oscm . domobjects . Product . class ) ) ; "<AssertPlaceHolder>" ; } getStatus ( ) { return this . status ; } | org . junit . Assert . assertEquals ( SubscriptionStatus . PENDING , subscription . getStatus ( ) ) |
testLastRequestId ( ) { ormTestHelper . createStageCommands ( ) ; org . apache . ambari . server . orm . dao . RequestDAO requestDAO = injector . getInstance ( org . apache . ambari . server . orm . dao . RequestDAO . class ) ; org . apache . ambari . server . orm . entities . RequestEntity requestEntity = requestDAO . findByPK ( 1L ) ; java . util . List < org . apache . ambari . server . orm . entities . StageEntity > stageEntities = new java . util . ArrayList ( ) ; org . apache . ambari . server . orm . entities . StageEntity stageEntity = new org . apache . ambari . server . orm . entities . StageEntity ( ) ; stageEntity . setClusterId ( clusterDAO . findByName ( "test_cluster1" ) . getClusterId ( ) ) ; stageEntity . setRequest ( requestEntity ) ; stageEntity . setStageId ( 2L ) ; stageDAO . create ( stageEntity ) ; org . apache . ambari . server . orm . entities . StageEntity stageEntity2 = new org . apache . ambari . server . orm . entities . StageEntity ( ) ; stageEntity2 . setClusterId ( clusterDAO . findByName ( "test_cluster1" ) . getClusterId ( ) ) ; stageEntity2 . setRequest ( requestEntity ) ; stageEntity2 . setRequestId ( 1L ) ; stageEntity2 . setStageId ( 3L ) ; stageDAO . create ( stageEntity2 ) ; stageEntities . add ( stageEntity ) ; stageEntities . add ( stageEntity2 ) ; requestEntity . setStages ( stageEntities ) ; requestDAO . merge ( requestEntity ) ; "<AssertPlaceHolder>" ; } getLastRequestId ( ) { javax . persistence . TypedQuery < java . lang . Long > query = entityManagerProvider . get ( ) . createQuery ( "SELECT<sp>max(stage.requestId)<sp>FROM<sp>StageEntity<sp>stage" , org . apache . ambari . server . orm . dao . Long . class ) ; java . lang . Long result = daoUtils . selectSingle ( query ) ; if ( result != null ) { return result ; } else { return 0 ; } } | org . junit . Assert . assertEquals ( 1L , stageDAO . getLastRequestId ( ) ) |
testServiceBuilderProjectName ( ) { if ( shouldSkipBundleTests ( ) ) return ; final com . liferay . ide . project . core . model . NewLiferayPluginProjectOp op = newProjectOp ( "test-sb" ) ; op . setPluginType ( PluginType . servicebuilder ) ; op . setUseDefaultLocation ( true ) ; final org . eclipse . core . resources . IProject expectedProject = createAntProject ( op ) ; java . lang . String expectedProjectName = expectedProject . getName ( ) ; java . lang . String actualProjectName = op . getProjectNames ( ) . get ( 0 ) . getName ( ) . content ( ) ; "<AssertPlaceHolder>" ; } getName ( ) { return _name ; } | org . junit . Assert . assertEquals ( expectedProjectName , actualProjectName ) |
testMaxRows ( ) { org . apache . metamodel . schema . Table table = org . apache . metamodel . cassandra . CassandraDataContextTest . dc . getDefaultSchema ( ) . getTableByName ( org . apache . metamodel . cassandra . CassandraDataContextTest . testTableName ) ; org . apache . metamodel . query . Query query = new org . apache . metamodel . query . Query ( ) . from ( table ) . select ( table . getColumns ( ) ) . setMaxRows ( 2 ) ; org . apache . metamodel . data . DataSet dataSet = org . apache . metamodel . cassandra . CassandraDataContextTest . dc . executeQuery ( query ) ; javax . swing . table . TableModel tableModel = new org . apache . metamodel . data . DataSetTableModel ( dataSet ) ; "<AssertPlaceHolder>" ; } getRowCount ( ) { if ( ( _cachedRowCount ) == null ) { _cachedRowCount = getRowCount ( _query ) ; } return _cachedRowCount ; } | org . junit . Assert . assertEquals ( 2 , tableModel . getRowCount ( ) ) |
testDIRSERVER_1183 ( ) { javax . naming . ldap . LdapContext ctx = ( ( javax . naming . ldap . LdapContext ) ( getWiredContext ( getLdapServer ( ) ) . lookup ( org . apache . directory . server . operations . add . AddIT . BASE ) ) ) ; javax . naming . directory . Attributes attrs = new javax . naming . directory . BasicAttributes ( "objectClass" , "inetOrgPerson" , true ) ; attrs . get ( "objectClass" ) . add ( "organizationalPerson" ) ; attrs . get ( "objectClass" ) . add ( "person" ) ; attrs . put ( "organizationalPerson" 1 , "organizationalPerson" 0 ) ; attrs . put ( "sn" , "Bean" ) ; attrs . put ( "cn" , "Jim,<sp>Bean" ) ; javax . naming . directory . DirContext jimBeanCtx = ctx . createSubcontext ( "cn=\"Jim,<sp>Bean\"" , attrs ) ; "<AssertPlaceHolder>" ; } put ( java . lang . Object , java . lang . Object ) { return dictionary . put ( arg0 , arg1 ) ; } | org . junit . Assert . assertNotNull ( jimBeanCtx ) |
testInterfaceDefaultNull ( ) { org . skife . config . TestCollections . EmptyInterfaceDefaultNull ec = cof . build ( org . skife . config . TestCollections . EmptyInterfaceDefaultNull . class ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertNull ( ec . getValue ( ) ) |
testIsComplete_InvalidRepositoryUrl ( ) { final org . kie . workbench . common . screens . examples . model . ExampleRepository repository = new org . kie . workbench . common . screens . examples . model . ExampleRepository ( "cheese" ) ; model . setSelectedRepository ( repository ) ; final org . uberfire . client . callbacks . Callback < java . lang . Boolean > callback = mock ( org . uberfire . client . callbacks . Callback . class ) ; page . isComplete ( callback ) ; verify ( callback , times ( 1 ) ) . callback ( eq ( false ) ) ; verify ( view , times ( 1 ) ) . setUrlGroupType ( eq ( ValidationState . ERROR ) ) ; verify ( view , times ( 1 ) ) . showUrlHelpMessage ( any ( java . lang . String . class ) ) ; "<AssertPlaceHolder>" ; } isUrlValid ( ) { return isUrlValid ; } | org . junit . Assert . assertFalse ( repository . isUrlValid ( ) ) |
testNoUnConvertApos ( ) { java . lang . String testString = "'" ; "<AssertPlaceHolder>" ; } unescapeToXML ( java . lang . String ) { if ( com . github . bordertech . wcomponents . util . Util . empty ( input ) ) { return input ; } java . lang . String encoded = com . github . bordertech . wcomponents . WebUtilities . doubleEncodeBrackets ( input ) ; java . lang . String unescaped = com . github . bordertech . wcomponents . util . HtmlToXMLUtil . UNESCAPE_HTML_TO_XML . translate ( encoded ) ; java . lang . String decoded = com . github . bordertech . wcomponents . WebUtilities . doubleDecodeBrackets ( unescaped ) ; return decoded ; } | org . junit . Assert . assertEquals ( testString , com . github . bordertech . wcomponents . util . HtmlToXMLUtil . unescapeToXML ( testString ) ) |
testFindByPrimaryKeyExisting ( ) { com . liferay . change . tracking . model . CTEntry newCTEntry = addCTEntry ( ) ; com . liferay . change . tracking . model . CTEntry existingCTEntry = _persistence . findByPrimaryKey ( newCTEntry . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; } | org . junit . Assert . assertEquals ( existingCTEntry , newCTEntry ) |
testFindByPrimaryKeyExisting ( ) { com . liferay . document . library . kernel . model . DLFileEntry newDLFileEntry = addDLFileEntry ( ) ; com . liferay . document . library . kernel . model . DLFileEntry existingDLFileEntry = _persistence . findByPrimaryKey ( newDLFileEntry . getPrimaryKey ( ) ) ; "<AssertPlaceHolder>" ; } getPrimaryKey ( ) { return _amImageEntryId ; } | org . junit . Assert . assertEquals ( existingDLFileEntry , newDLFileEntry ) |
shouldInstrumentIfElseNoBraceTry ( ) { java . lang . String source = "" + ( ( ( ( ( ( "if<sp>(condition)\n" + "<sp>f1();\n" 6 ) + "<sp>f1();\n" 4 ) + "<sp>f2()\n" ) + "<sp>f1();\n" 9 ) + "<sp>f3(ex);\n" ) + "<sp>}<sp>catch<sp>(ex)<sp>{\n" 0 ) ; java . lang . String instrumentedSource = sourceProcessor . instrumentSource ( source ) ; java . lang . String expectedSource = "<sp>f1();\n" 5 + ( ( ( ( ( ( ( ( ( ( ( ( "if<sp>(condition)<sp>{\n" + "<sp>f1();\n" 7 ) + "<sp>f1();\n" ) + "<sp>f1();\n" 3 ) + "<sp>f1();\n" 8 ) + "<sp>}<sp>catch<sp>(ex)<sp>{\n" 1 ) + "<sp>_$jscoverage[\'test.js\'].lineData[4]++;\n" ) + "<sp>f2();\n" ) + "<sp>}<sp>catch<sp>(ex)<sp>{\n" ) + "<sp>_$jscoverage[\'test.js\'].lineData[6]++;\n" ) + "<sp>f1();\n" 2 ) + "<sp>f1();\n" 0 ) + "<sp>f1();\n" 1 ) ; "<AssertPlaceHolder>" ; } instrumentSource ( java . lang . String ) { return instrumentSource ( uri , source ) ; } | org . junit . Assert . assertEquals ( expectedSource , instrumentedSource ) |
constructorTest ( ) { int n = 10 ; org . openscience . cdk . group . DisjointSetForest forest = new org . openscience . cdk . group . DisjointSetForest ( n ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( forest ) |
shouldGetSessionIdFromUnderlyingSession ( ) { java . lang . String expectedSessionId = "FOO_SESSION_ID" ; when ( mockSession . getId ( ) ) . thenReturn ( expectedSessionId ) ; when ( mockRouteContext . getSession ( ) ) . thenReturn ( mockSession ) ; when ( mockPippoWebContext . getRouteContext ( ) ) . thenReturn ( mockRouteContext ) ; ro . pippo . pac4j . PippoSessionStore sessionStore = new ro . pippo . pac4j . PippoSessionStore ( ) ; "<AssertPlaceHolder>" ; verify ( mockSession , times ( 1 ) ) . getId ( ) ; verify ( mockRouteContext , times ( 1 ) ) . getSession ( ) ; verify ( mockPippoWebContext , times ( 1 ) ) . getRouteContext ( ) ; } getOrCreateSessionId ( ro . pippo . pac4j . PippoWebContext ) { return getSession ( pippoWebContext ) . getId ( ) ; } | org . junit . Assert . assertThat ( sessionStore . getOrCreateSessionId ( mockPippoWebContext ) , org . hamcrest . core . Is . is ( expectedSessionId ) ) |
testGetEmailNull ( ) { ddf . security . Subject subject = getSubjectWithAttributes ( java . util . Collections . emptyMap ( ) ) ; "<AssertPlaceHolder>" ; } getEmailAddress ( javax . security . auth . x500 . X500Principal ) { return ddf . security . SubjectUtils . getExtendedCertAttribute ( principal , BCStyle . EmailAddress ) ; } | org . junit . Assert . assertNull ( ddf . security . SubjectUtils . getEmailAddress ( subject ) ) |
testGetNumBands ( ) { "<AssertPlaceHolder>" ; } getNumBands ( ) { return 0 ; } | org . junit . Assert . assertEquals ( 4 , metadata . getNumBands ( ) ) |
testNoHistoryConfiguration ( ) { com . mvp4g . rebind . config . loader . annotation . List < com . google . gwt . core . ext . typeinfo . JClassType > annotedClasses = new com . mvp4g . rebind . config . loader . annotation . ArrayList < com . google . gwt . core . ext . typeinfo . JClassType > ( ) ; annotedClasses . add ( oracle . addClass ( com . mvp4g . rebind . test_tools . annotation . presenters . SimplePresenter01 . class ) ) ; new com . mvp4g . rebind . config . loader . annotation . PresenterAnnotationsLoader ( ) . load ( annotedClasses , configuration ) ; annotedClasses = new com . mvp4g . rebind . config . loader . annotation . ArrayList < com . google . gwt . core . ext . typeinfo . JClassType > ( ) ; annotedClasses . add ( oracle . addClass ( Events . SimpleEventBus . class ) ) ; loader . load ( annotedClasses , configuration ) ; com . mvp4g . rebind . config . loader . annotation . HistoryElement historyConfig = configuration . getHistory ( ) ; "<AssertPlaceHolder>" ; } getHistory ( ) { return HistoryProxyProvider . INSTANCE . get ( ) ; } | org . junit . Assert . assertNull ( historyConfig ) |
testExtractMonthTimestamp ( ) { java . lang . String sqlText = ( "select<sp>ts,<sp>EXTRACT(MONTH<sp>FROM<sp>ts)<sp>as<sp>\"MONTH\"<sp>from<sp>" + ( com . splicemachine . derby . utils . SpliceDateFunctionsIT . tableWatcherI ) ) + "<sp>order<sp>by<sp>ts" ; try ( com . splicemachine . derby . utils . ResultSet rs = methodWatcher . executeQuery ( sqlText ) ) { java . lang . String expected = "2009-09-02<sp>11:22:33.04<sp>|<sp>9<sp>|\n" 0 + ( ( ( ( ( ( "--------------------------------\n" + "2009-01-02<sp>11:22:33.04<sp>|<sp>1<sp>|\n" ) + "2009-07-02<sp>11:22:33.04<sp>|<sp>7<sp>|\n" ) + "2009-09-02<sp>11:22:33.04<sp>|<sp>9<sp>|\n" ) + "2012-12-31<sp>00:00:00.03<sp>|<sp>12<sp>|\n" ) + "<sp>2012-12-31<sp>20:38:40.0<sp>|<sp>12<sp>|\n" ) + "2009-09-02<sp>11:22:33.04<sp>|<sp>9<sp>|\n" 1 ) ; "<AssertPlaceHolder>" ; } } toStringUnsorted ( com . splicemachine . homeless . ResultSet ) { return com . splicemachine . homeless . TestUtils . FormattedResult . ResultFactory . convert ( "" , rs , false ) . toString ( ) . trim ( ) ; } | org . junit . Assert . assertEquals ( ( ( "\n" + sqlText ) + "\n" ) , expected , TestUtils . FormattedResult . ResultFactory . toStringUnsorted ( rs ) ) |
loadTsl_whenCacheIsExpired_shouldDownloadNewTsl ( ) { this . configuration = new org . digidoc4j . Configuration ( Configuration . Mode . TEST ) ; this . configuration . setTslCacheExpirationTime ( 500L ) ; this . createTSLLoader ( ) ; long lastModified = this . refreshTSLAndGetCacheLastModificationTime ( ) ; org . digidoc4j . test . util . TestCommonUtil . sleepInSeconds ( 1 ) ; long newModificationTime = this . refreshTSLAndGetCacheLastModificationTime ( ) ; "<AssertPlaceHolder>" ; } refreshTSLAndGetCacheLastModificationTime ( ) { this . tslLoader . prepareTsl ( ) ; this . tslLoader . getTslValidationJob ( ) . refresh ( ) ; return org . digidoc4j . test . util . TestTSLUtil . getCacheLastModified ( ) ; } | org . junit . Assert . assertTrue ( ( lastModified < newModificationTime ) ) |
isMacOrWinOrLinux ( ) { gov . nasa . ensemble . common . logging . LogUtil . debug ( ( ( org . eclipse . core . runtime . Platform . getOS ( ) ) + "<sp>is<sp>our<sp>OS" ) ) ; gov . nasa . ensemble . common . logging . LogUtil . debug ( ( "Mac<sp>" + ( gov . nasa . ensemble . common . CommonUtils . isOSMac ( ) ) ) ) ; gov . nasa . ensemble . common . logging . LogUtil . debug ( ( "Win<sp>" + ( gov . nasa . ensemble . common . CommonUtils . isOSWindows ( ) ) ) ) ; gov . nasa . ensemble . common . logging . LogUtil . debug ( ( "Linux<sp>" + ( gov . nasa . ensemble . common . CommonUtils . isOSLinux ( ) ) ) ) ; "<AssertPlaceHolder>" ; } isOSLinux ( ) { return org . eclipse . core . runtime . Platform . OS_LINUX . equals ( org . eclipse . core . runtime . Platform . getOS ( ) ) ; } | org . junit . Assert . assertTrue ( ( ( ( gov . nasa . ensemble . common . CommonUtils . isOSLinux ( ) ) || ( gov . nasa . ensemble . common . CommonUtils . isOSMac ( ) ) ) || ( gov . nasa . ensemble . common . CommonUtils . isOSWindows ( ) ) ) ) |
fillAllFields_confUrl_CUSTOMER_TEMPLATE ( ) { org . oscm . domobjects . Product customerTemplate = product . copyForCustomer ( supplier ) ; org . oscm . internal . vo . VOService service = new org . oscm . internal . vo . VOService ( ) ; org . oscm . serviceprovisioningservice . assembler . ProductAssembler . fillAllFields ( customerTemplate , facade , service , PerformanceHint . ALL_FIELDS ) ; "<AssertPlaceHolder>" ; } getConfiguratorUrl ( ) { return vo . getConfiguratorUrl ( ) ; } | org . junit . Assert . assertEquals ( product . getConfiguratorUrl ( ) , service . getConfiguratorUrl ( ) ) |
testDynamicQueryByProjectionMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . document . library . opener . model . DLOpenerFileEntryReference . class , _dynamicQueryClassLoader ) ; dynamicQuery . setProjection ( com . liferay . portal . kernel . dao . orm . ProjectionFactoryUtil . property ( "dlOpenerFileEntryReferenceId" ) ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . in ( "dlOpenerFileEntryReferenceId" , new java . lang . Object [ ] { com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) } ) ) ; java . util . List < java . lang . Object > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; } | org . junit . Assert . assertEquals ( 0 , result . size ( ) ) |
testIsSupportsEmbeddedPortletsWithTypePanel ( ) { _layout . setType ( LayoutConstants . TYPE_PANEL ) ; "<AssertPlaceHolder>" ; } isSupportsEmbeddedPortlets ( ) { return model . isSupportsEmbeddedPortlets ( ) ; } | org . junit . Assert . assertTrue ( _layout . isSupportsEmbeddedPortlets ( ) ) |
bitmapOfTest ( ) { int [ ] cuiRelsArray = new int [ 1024 ] ; for ( int k = 0 ; k < ( cuiRelsArray . length ) ; ++ k ) { cuiRelsArray [ k ] = k ; } org . roaringbitmap . RoaringBitmap rr1 = org . roaringbitmap . RoaringBitmap . bitmapOf ( cuiRelsArray ) ; int [ ] back = rr1 . toArray ( ) ; "<AssertPlaceHolder>" ; } toArray ( ) { final int [ ] array = new int [ this . getCardinality ( ) ] ; int pos = 0 ; int pos2 = 0 ; while ( pos < ( this . highLowContainer . size ( ) ) ) { final int hs = ( org . roaringbitmap . buffer . BufferUtil . BufferUtil . toIntUnsigned ( this . highLowContainer . getKeyAtIndex ( pos ) ) ) << 16 ; final org . roaringbitmap . buffer . MappeableContainer c = this . highLowContainer . getContainerAtIndex ( ( pos ++ ) ) ; c . fillLeastSignificant16bits ( array , pos2 , hs ) ; pos2 += c . getCardinality ( ) ; } return array ; } | org . junit . Assert . assertArrayEquals ( cuiRelsArray , back ) |
testChannel ( ) { org . apache . cayenne . MockDataChannel channel = new org . apache . cayenne . MockDataChannel ( ) ; org . apache . cayenne . CayenneContext context = new org . apache . cayenne . CayenneContext ( channel ) ; "<AssertPlaceHolder>" ; } getChannel ( ) { return channel ; } | org . junit . Assert . assertSame ( channel , context . getChannel ( ) ) |
inMemoryBlob ( ) { org . apache . jackrabbit . oak . api . Blob b = new org . apache . jackrabbit . oak . plugins . memory . ArrayBasedBlob ( "hello<sp>world" . getBytes ( ) ) ; java . lang . String value = serializer . serialize ( b ) ; org . apache . jackrabbit . oak . api . Blob b2 = serializer . deserialize ( value ) ; "<AssertPlaceHolder>" ; } equal ( org . apache . jackrabbit . oak . api . Blob , org . apache . jackrabbit . oak . api . Blob ) { long al = a . length ( ) ; long bl = b . length ( ) ; if ( ( ( al != ( - 1 ) ) && ( bl != ( - 1 ) ) ) && ( al != bl ) ) { return false ; } java . lang . String ai = a . getContentIdentity ( ) ; java . lang . String bi = b . getContentIdentity ( ) ; if ( ( ( ai != null ) && ( bi != null ) ) && ( ai . equals ( bi ) ) ) { return true ; } try { return org . apache . jackrabbit . oak . plugins . memory . AbstractBlob . supplier ( a ) . contentEquals ( org . apache . jackrabbit . oak . plugins . memory . AbstractBlob . supplier ( b ) ) ; } catch ( java . io . IOException e ) { throw new java . lang . IllegalStateException ( "Blob<sp>equality<sp>check<sp>failed" , e ) ; } } | org . junit . Assert . assertTrue ( org . apache . jackrabbit . oak . plugins . memory . AbstractBlob . equal ( b , b2 ) ) |
testUser ( ) { java . lang . String dockerFile = new io . fabric8 . maven . docker . assembly . DockerFileBuilder ( ) . assemblyUser ( "jboss:jboss:jboss" ) . user ( "bob" ) . add ( "a" , "a/nested" ) . add ( "b" , "b/deeper/nested" ) . content ( ) ; java . lang . String EXPECTED_REGEXP = "USER<sp>bob$" ; java . util . regex . Pattern pattern = java . util . regex . Pattern . compile ( EXPECTED_REGEXP ) ; "<AssertPlaceHolder>" ; } content ( ) { java . lang . StringBuilder b = new java . lang . StringBuilder ( ) ; DockerFileKeyword . FROM . addTo ( b , ( ( baseImage ) != null ? baseImage : DockerAssemblyManager . DEFAULT_DATA_BASE_IMAGE ) ) ; if ( ( maintainer ) != null ) { DockerFileKeyword . MAINTAINER . addTo ( b , maintainer ) ; } addOptimisation ( ) ; addEnv ( b ) ; addLabels ( b ) ; addPorts ( b ) ; addCopy ( b ) ; addWorkdir ( b ) ; addShell ( b ) ; addRun ( b ) ; addVolumes ( b ) ; addHealthCheck ( b ) ; addCmd ( b ) ; addEntryPoint ( b ) ; addUser ( b ) ; return b . toString ( ) ; } | org . junit . Assert . assertTrue ( pattern . matcher ( dockerFile ) . find ( ) ) |
getStatusGets ( ) { final byte [ ] actualData = new byte [ ] { } ; com . microsoft . azure . sdk . iot . device . transport . IotHubTransportMessage msg = new com . microsoft . azure . sdk . iot . device . transport . IotHubTransportMessage ( actualData , com . microsoft . azure . sdk . iot . device . MessageType . DEVICE_TWIN ) ; msg . setStatus ( "12" ) ; java . lang . String status = msg . getStatus ( ) ; "<AssertPlaceHolder>" ; } getStatus ( ) { return status ; } | org . junit . Assert . assertEquals ( status , "12" ) |
testInsertParentChild ( ) { com . jmethods . catatumbo . entities . ParentEntity parent = new com . jmethods . catatumbo . entities . ParentEntity ( ) ; parent . setField1 ( "I'm<sp>parent!" ) ; parent = com . jmethods . catatumbo . EntityManagerTest . em . insert ( parent ) ; com . jmethods . catatumbo . entities . ChildEntity child = new com . jmethods . catatumbo . entities . ChildEntity ( ) ; child . setField1 ( "I'm<sp>child!" ) ; child . setParentKey ( parent . getKey ( ) ) ; child = com . jmethods . catatumbo . EntityManagerTest . em . insert ( child ) ; com . jmethods . catatumbo . entities . GrandchildEntity grandchild = new com . jmethods . catatumbo . entities . GrandchildEntity ( ) ; grandchild . setField1 ( "I'm<sp>grangchild" ) ; grandchild . setParentKey ( child . getKey ( ) ) ; grandchild = com . jmethods . catatumbo . EntityManagerTest . em . insert ( grandchild ) ; "<AssertPlaceHolder>" ; } getParentKey ( ) { return parentKey ; } | org . junit . Assert . assertTrue ( ( ( child . getParentKey ( ) . equals ( parent . getKey ( ) ) ) && ( grandchild . getParentKey ( ) . equals ( child . getKey ( ) ) ) ) ) |
notEqualsNull ( ) { final com . lightboxtechnologies . nsrl . OSData osd = new com . lightboxtechnologies . nsrl . OSData ( com . lightboxtechnologies . nsrl . OSDataTest . code , com . lightboxtechnologies . nsrl . OSDataTest . name , com . lightboxtechnologies . nsrl . OSDataTest . version , com . lightboxtechnologies . nsrl . OSDataTest . mfg_code ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { return false ; } | org . junit . Assert . assertFalse ( osd . equals ( null ) ) |
decrementByValue ( ) { counter . reset ( ) ; counter . decrementByValue ( 2 ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertEquals ( counter . getValue ( ) , ( - 2 ) ) |
testIsRequestCounterValid_falseWithMissingParameter ( ) { org . eclipse . rap . rwt . internal . lifecycle . RequestCounter . getInstance ( ) . nextRequestId ( ) ; org . eclipse . rap . rwt . internal . protocol . RequestMessage requestMessage = new org . eclipse . rap . rwt . testfixture . internal . TestMessage ( ) ; boolean valid = org . eclipse . rap . rwt . internal . service . LifeCycleServiceHandler . isRequestCounterValid ( requestMessage ) ; "<AssertPlaceHolder>" ; } isRequestCounterValid ( org . eclipse . rap . rwt . internal . protocol . RequestMessage ) { int expectedRequestId = org . eclipse . rap . rwt . internal . lifecycle . RequestCounter . getInstance ( ) . currentRequestId ( ) ; org . eclipse . rap . json . JsonValue sentRequestId = requestMessage . getHead ( ) . get ( org . eclipse . rap . rwt . internal . service . REQUEST_COUNTER ) ; if ( sentRequestId == null ) { return false ; } return ( sentRequestId . asInt ( ) ) == expectedRequestId ; } | org . junit . Assert . assertFalse ( valid ) |
whenAddDuplicateInSetThatOnlyUniqueValueSetCanHave ( ) { ru . szhernovoy . set . SimpleSet < java . lang . String > container = new ru . szhernovoy . set . SimpleSet ( 10 ) ; container . add ( "first" ) ; container . add ( "second" ) ; container . add ( "first" ) ; java . util . Iterator < java . lang . String > iter = container . iterator ( ) ; java . lang . String control = "" ; while ( iter . hasNext ( ) ) { control = iter . next ( ) ; } "<AssertPlaceHolder>" ; } next ( ) { java . math . BigInteger oldValue ; java . math . BigInteger newValue ; do { oldValue = ( ( java . math . BigInteger ) ( refCounter . get ( ) ) ) ; newValue = ( oldValue == null ) ? java . math . BigInteger . valueOf ( 1 ) : oldValue . shiftLeft ( 1 ) ; } while ( ! ( refCounter . compareAndSet ( oldValue , newValue ) ) ) ; return newValue ; } | org . junit . Assert . assertThat ( control , org . hamcrest . core . Is . is ( "second" ) ) |
decodeBooleanBytesIntoObject ( ) { stubValueMeta . setType ( 4 ) ; byte i = 1 ; java . lang . Object str = stubValueMeta . decodeColumnValue ( org . apache . hadoop . hbase . util . Bytes . toBytes ( i ) ) ; "<AssertPlaceHolder>" ; } toBytes ( double ) { return hBaseBytesUtilShim . toBytes ( var1 ) ; } | org . junit . Assert . assertNotNull ( str ) |
testListTypes ( ) { "<AssertPlaceHolder>" ; } listTypes ( ) { org . hibernate . Criteria criteria = currentSession ( ) . createCriteria ( uk . ac . bbsrc . tgac . miso . core . data . PartitionQCType . class ) ; @ uk . ac . bbsrc . tgac . miso . persistence . impl . SuppressWarnings ( "unchecked" ) java . util . List < uk . ac . bbsrc . tgac . miso . core . data . PartitionQCType > records = criteria . list ( ) ; return records ; } | org . junit . Assert . assertTrue ( ( ( dao . listTypes ( ) . size ( ) ) > 0 ) ) |
shouldMatchPresentElements ( ) { com . redhat . darcy . ui . matchers . ElementText < com . redhat . darcy . ui . api . elements . Text > matcher = new com . redhat . darcy . ui . matchers . ElementText ( org . hamcrest . Matchers . anything ( ) ) ; com . redhat . darcy . ui . api . elements . Text mockText = mock ( com . redhat . darcy . ui . api . elements . Text . class ) ; when ( mockText . isPresent ( ) ) . thenReturn ( true ) ; "<AssertPlaceHolder>" ; } matches ( java . lang . Object ) { return doesItemMatchAppropriateCondition ( item ) ; } | org . junit . Assert . assertTrue ( matcher . matches ( mockText ) ) |
testAutoIncrementedField ( ) { java . util . Date currentTime = new java . util . Date ( ) ; java . lang . String serviceName = "MapReduce1" ; java . lang . String clusterName = "test_cluster1" ; createService ( currentTime , serviceName , clusterName ) ; org . apache . ambari . server . orm . entities . ClusterServiceEntity clusterServiceEntity = clusterServiceDAO . findByClusterAndServiceNames ( clusterName , serviceName ) ; clusterServiceDAO . remove ( clusterServiceEntity ) ; "<AssertPlaceHolder>" ; } findByClusterAndServiceNames ( java . lang . String , java . lang . String ) { javax . persistence . TypedQuery < org . apache . ambari . server . orm . entities . ClusterServiceEntity > query = entityManagerProvider . get ( ) . createNamedQuery ( "clusterServiceByClusterAndServiceNames" , org . apache . ambari . server . orm . entities . ClusterServiceEntity . class ) ; query . setParameter ( "clusterName" , clusterName ) ; query . setParameter ( "serviceName" , serviceName ) ; try { return query . getSingleResult ( ) ; } catch ( javax . persistence . NoResultException ignored ) { return null ; } } | org . junit . Assert . assertNull ( clusterServiceDAO . findByClusterAndServiceNames ( clusterName , serviceName ) ) |
setFieldValueNullWithEmptyStringsDiffersFromNullTest ( ) { org . pentaho . di . trans . steps . nullif . NullIfMeta . Field field = new org . pentaho . di . trans . steps . nullif . NullIfMeta . Field ( ) ; java . lang . System . setProperty ( Const . KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL , "Y" ) ; field . setFieldValue ( null ) ; "<AssertPlaceHolder>" ; } getFieldValue ( ) { return fieldValue ; } | org . junit . Assert . assertEquals ( "" , field . getFieldValue ( ) ) |
testWithoutChgrp ( ) { final org . apache . oozie . fluentjob . api . action . FSActionBuilder builder = getBuilderInstance ( ) ; for ( final org . apache . oozie . fluentjob . api . action . Chgrp chgrp : org . apache . oozie . fluentjob . api . action . TestFSActionBuilder . CHGRPS ) { builder . withChgrp ( chgrp ) ; } builder . withoutChgrp ( org . apache . oozie . fluentjob . api . action . TestFSActionBuilder . CHGRPS [ 0 ] ) ; final org . apache . oozie . fluentjob . api . action . FSAction fsAction = builder . build ( ) ; final java . util . List < org . apache . oozie . fluentjob . api . action . Chgrp > expectedChgrps = java . util . Arrays . asList ( org . apache . oozie . fluentjob . api . action . TestFSActionBuilder . CHGRPS ) . subList ( 1 , org . apache . oozie . fluentjob . api . action . TestFSActionBuilder . CHGRPS . length ) ; "<AssertPlaceHolder>" ; } getChgrps ( ) { return attributes . getChgrps ( ) ; } | org . junit . Assert . assertEquals ( expectedChgrps , fsAction . getChgrps ( ) ) |
testRemoveLastSubscription_AllowingOnbehalf ( ) { java . lang . String subId = java . lang . Long . toString ( java . lang . System . currentTimeMillis ( ) ) ; final org . oscm . internal . vo . VOSubscription sub = subMgmt . subscribeToService ( org . oscm . test . data . Subscriptions . createVOSubscription ( subId ) , org . oscm . serviceprovisioningservice . assembler . ProductAssembler . toVOProduct ( testPrdOnbehalf , new org . oscm . i18nservice . bean . LocalizerFacade ( localizer , "en" ) ) , null , null , null , new java . util . ArrayList < org . oscm . internal . vo . VOUda > ( ) ) ; subMgmt . unsubscribeFromService ( subId ) ; runTX ( new java . util . concurrent . Callable < java . lang . Void > ( ) { @ org . oscm . subscriptionservice . bean . Override public org . oscm . subscriptionservice . bean . Void call ( ) throws org . oscm . subscriptionservice . bean . Exception { org . oscm . domobjects . Subscription subscription = mgr . find ( org . oscm . domobjects . Subscription . class , sub . getKey ( ) ) ; org . oscm . domobjects . Organization sourceOrganization = subscription . getProduct ( ) . getTechnicalProduct ( ) . getOrganization ( ) ; org . oscm . domobjects . Organization targetOrganization = subscription . getOrganization ( ) ; "<AssertPlaceHolder>" ; return null ; } } ) ; } getOrganizationReference ( org . oscm . domobjects . Organization , org . oscm . domobjects . Organization ) { for ( org . oscm . domobjects . OrganizationReference reference : targetOrganization . getSourcesForType ( OrganizationReferenceType . ON_BEHALF_ACTING ) ) { if ( ( ( reference . getSource ( ) . getKey ( ) ) == ( sourceOrganization . getKey ( ) ) ) && ( ( reference . getTargetKey ( ) ) == ( targetOrganization . getKey ( ) ) ) ) { return reference ; } } return null ; } | org . junit . Assert . assertNull ( getOrganizationReference ( sourceOrganization , targetOrganization ) ) |
testCopy ( ) { byte [ ] bytes = "deadbeefdeadbeef" . getBytes ( ) ; java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; com . spotify . sparkey . Util . copy ( bytes . length , new java . io . ByteArrayInputStream ( bytes ) , baos , new byte [ 5 ] ) ; "<AssertPlaceHolder>" ; } copy ( long , java . io . InputStream , java . io . OutputStream , byte [ ] ) { long full = len / ( buf . length ) ; while ( full > 0 ) { full -- ; com . spotify . sparkey . Util . readFully ( inputStream , buf , buf . length ) ; outputStream . write ( buf , 0 , buf . length ) ; } int tail = ( ( int ) ( len % ( buf . length ) ) ) ; com . spotify . sparkey . Util . readFully ( inputStream , buf , tail ) ; outputStream . write ( buf , 0 , tail ) ; } | org . junit . Assert . assertArrayEquals ( bytes , baos . toByteArray ( ) ) |
concat_boolean_arrays ( ) { boolean [ ] booleanArray1 = new boolean [ ] { true , false } ; boolean [ ] booleanArray2 = new boolean [ ] { true , false } ; boolean [ ] concatedArray = com . google . common . primitives . Booleans . concat ( booleanArray1 , booleanArray2 ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 4 , concatedArray . length ) |
shouldCountCustomMethodWithLike ( ) { java . lang . String documentId = randomNumeric ( 5 ) ; org . springframework . data . elasticsearch . entities . SampleEntity sampleEntity = new org . springframework . data . elasticsearch . entities . SampleEntity ( ) ; sampleEntity . setId ( documentId ) ; sampleEntity . setType ( "test" ) ; sampleEntity . setRate ( 10 ) ; sampleEntity . setMessage ( "foo" ) ; repository . save ( sampleEntity ) ; documentId = randomNumeric ( 5 ) ; org . springframework . data . elasticsearch . entities . SampleEntity sampleEntity2 = new org . springframework . data . elasticsearch . entities . SampleEntity ( ) ; sampleEntity2 . setId ( documentId ) ; sampleEntity2 . setType ( "test" ) ; sampleEntity2 . setRate ( 10 ) ; sampleEntity2 . setMessage ( "some<sp>message" ) ; repository . save ( sampleEntity2 ) ; long count = repository . countByMessageLike ( "fo" ) ; "<AssertPlaceHolder>" ; } is ( java . lang . Object ) { queryCriteria . add ( new org . springframework . data . elasticsearch . core . query . Criteria . CriteriaEntry ( org . springframework . data . elasticsearch . core . query . Criteria . OperationKey . EQUALS , o ) ) ; return this ; } | org . junit . Assert . assertThat ( count , is ( equalTo ( 1L ) ) ) |
testEndsWithZeroesSmallerThanBufferSize ( ) { final byte [ ] data = new byte [ 1024 ] ; for ( int i = 0 ; i < 1020 ; i ++ ) { data [ i ] = 'A' ; } java . nio . file . Files . write ( targetFile . toPath ( ) , data , StandardOpenOption . CREATE , StandardOpenOption . TRUNCATE_EXISTING ) ; final int zeroCount = org . apache . nifi . toolkit . repos . flowfile . RepairCorruptedFileEndings . countTrailingZeroes ( targetFile ) ; "<AssertPlaceHolder>" ; } countTrailingZeroes ( java . io . File ) { final java . io . RandomAccessFile raf = new java . io . RandomAccessFile ( partitionFile , "r" ) ; long startPos = ( partitionFile . length ( ) ) - 4096 ; int count = 0 ; boolean reachedStartOfFile = false ; while ( ! reachedStartOfFile ) { int bufferLength = 4096 ; if ( startPos < 0 ) { bufferLength = ( ( int ) ( startPos + 4096 ) ) ; startPos = 0 ; reachedStartOfFile = true ; } raf . seek ( startPos ) ; final byte [ ] buffer = new byte [ bufferLength ] ; final int read = org . apache . nifi . toolkit . repos . flowfile . RepairCorruptedFileEndings . fillBuffer ( raf , buffer ) ; for ( int i = read - 1 ; i >= 0 ; i -- ) { final byte b = buffer [ i ] ; if ( b == 0 ) { count ++ ; } else { return count ; } } startPos -= 4096 ; } return count ; } | org . junit . Assert . assertEquals ( 4 , zeroCount ) |
checkWontEquivalateToSeries ( ) { org . atlasapi . media . entity . Item item = new org . atlasapi . media . entity . Item ( ) ; item . setPublisher ( Publisher . ARQIVA ) ; item . setCanonicalUri ( "target" ) ; org . atlasapi . media . entity . Series candidate1 = seriesWithBroadcast ( new org . joda . time . DateTime ( ) . withHourOfDay ( 2 ) , new org . joda . time . DateTime ( ) . withHourOfDay ( 6 ) ) ; candidate1 . setPublisher ( Publisher . PA ) ; candidate1 . setCanonicalUri ( "candidate1" ) ; org . atlasapi . media . entity . Item candidate2 = itemWithBroadcast ( new org . joda . time . DateTime ( ) . withHourOfDay ( 4 ) , new org . joda . time . DateTime ( ) . withHourOfDay ( 5 ) ) ; candidate2 . setPublisher ( Publisher . PA ) ; candidate2 . setCanonicalUri ( "candidate2" ) ; java . util . List < org . atlasapi . equiv . results . scores . ScoredCandidates < org . atlasapi . media . entity . Identified > > equivalents = com . google . common . collect . ImmutableList . of ( org . atlasapi . equiv . results . scores . DefaultScoredCandidates . < org . atlasapi . media . entity . Identified > fromSource ( "A<sp>Source" ) . addEquivalent ( candidate1 , org . atlasapi . equiv . results . scores . Score . valueOf ( 5.0 ) ) . addEquivalent ( candidate2 , org . atlasapi . equiv . results . scores . Score . valueOf ( 4.8 ) ) . build ( ) ) ; org . atlasapi . equiv . results . EquivalenceResult equivalenceResult = resultBuilder . resultFor ( item , equivalents , new org . atlasapi . equiv . results . description . DefaultDescription ( ) , equivToTelescopeResults ) ; "<AssertPlaceHolder>" ; } strongEquivalences ( ) { return results . stream ( ) . map ( EquivalenceResult :: strongEquivalences ) . map ( Multimap :: values ) . flatMap ( Collection :: stream ) . map ( ScoredCandidate :: candidate ) . collect ( com . metabroadcast . common . stream . MoreCollectors . toImmutableSet ( ) ) ; } | org . junit . Assert . assertTrue ( ( ( equivalenceResult . strongEquivalences ( ) . values ( ) . size ( ) ) == 1 ) ) |
testApplyProxyHeadersWithXForwardedPortMatchingDefaultHTTPPort ( ) { edu . illinois . library . cantaloupe . http . Headers headers = new edu . illinois . library . cantaloupe . http . Headers ( ) ; headers . set ( "X-Forwarded-Port" , "80" ) ; edu . illinois . library . cantaloupe . http . Reference ref = new edu . illinois . library . cantaloupe . http . Reference ( "http://bogus/cats" ) ; ref . applyProxyHeaders ( headers ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( getVerb ( ) ) + "<sp>" ) + ( edu . illinois . library . cantaloupe . resource . api . APITask . getUUID ( ) ) ; } | org . junit . Assert . assertEquals ( "http://bogus/cats" , ref . toString ( ) ) |
capitalizeWithNull ( ) { "<AssertPlaceHolder>" ; } capitalize ( java . lang . String ) { if ( isEmpty ( s ) ) { return s ; } return ( s . substring ( 0 , 1 ) . toUpperCase ( ) ) + ( s . substring ( 1 ) . toLowerCase ( ) ) ; } | org . junit . Assert . assertEquals ( null , instance . capitalize ( null ) ) |
testCompareTo ( ) { final nl . bzk . migratiebrp . conversie . model . brp . attribuut . BrpSoortRelatieCode result = nl . bzk . migratiebrp . conversie . model . brp . attribuut . BrpSoortRelatieCode . wrap ( "1" , onderzoek ) ; final nl . bzk . migratiebrp . conversie . model . brp . attribuut . BrpSoortRelatieCode result2 = nl . bzk . migratiebrp . conversie . model . brp . attribuut . BrpSoortRelatieCode . wrap ( "1" , null ) ; "<AssertPlaceHolder>" ; } compareTo ( nl . bzk . brp . bijhouding . business . stappen . resultaat . ResultaatMelding ) { return com . google . common . collect . ComparisonChain . start ( ) . compare ( regel , that . regel ) . compare ( attribuutNaam , that . attribuutNaam , com . google . common . collect . Ordering . natural ( ) . nullsFirst ( ) ) . compare ( referentieID , that . referentieID ) . compare ( soort , that . soort , com . google . common . collect . Ordering . natural ( ) . nullsFirst ( ) ) . compare ( meldingTekst , that . meldingTekst , com . google . common . collect . Ordering . natural ( ) . nullsFirst ( ) ) . result ( ) ; } | org . junit . Assert . assertEquals ( 0 , result . compareTo ( result2 ) ) |
testThrowsExceptionIfFixtureCannotBeInstantiated ( ) { try { factory . getFixture ( info . novatec . testit . livingdoc . systemunderdevelopment . DefaultSystemUnderDevelopmentTest . BadTarget . class . getName ( ) ) ; org . junit . Assert . fail ( "Should<sp>have<sp>thrown<sp>an<sp>exception." ) ; } catch ( java . lang . Throwable e ) { "<AssertPlaceHolder>" ; } } getName ( ) { return name ; } | org . junit . Assert . assertTrue ( true ) |
stripLongWords ( ) { java . lang . String testDocument = "can<sp>a<sp>word<sp>be<sp>a<sp>b<sp>c<sp>d<sp>e<sp>f<sp>g<sp>or<sp>a<sp>superfragalisticexpaliadouciousmagicake" ; java . lang . String expectedResult = "can<sp>a<sp>word<sp>be<sp>a<sp>b<sp>c<sp>d<sp>e<sp>f<sp>g<sp>or<sp>a" ; edu . ucla . sspace . text . DocumentPreprocessor testProcessor = new edu . ucla . sspace . text . DocumentPreprocessor ( ) ; "<AssertPlaceHolder>" ; } process ( java . lang . String ) { return process ( document , false ) ; } | org . junit . Assert . assertEquals ( expectedResult , testProcessor . process ( testDocument ) ) |
getAnnotations ( ) { java . lang . reflect . Method method = getClass ( ) . getMethod ( "foo" , int . class ) ; java . util . List < java . lang . annotation . Annotation > annotations = org . junit . contrib . theories . ParameterSignature . signatures ( method ) . get ( 0 ) . getAnnotations ( ) ; "<AssertPlaceHolder>" ; } getAnnotations ( ) { java . lang . reflect . Method method = getClass ( ) . getMethod ( "foo" , int . class ) ; java . util . List < java . lang . annotation . Annotation > annotations = org . junit . contrib . theories . ParameterSignature . signatures ( method ) . get ( 0 ) . getAnnotations ( ) ; org . junit . Assert . assertThat ( annotations , org . hamcrest . CoreMatchers . < org . junit . contrib . theories . suppliers . TestedOn > hasItem ( isA ( org . junit . contrib . theories . suppliers . TestedOn . class ) ) ) ; } | org . junit . Assert . assertThat ( annotations , org . hamcrest . CoreMatchers . < org . junit . contrib . theories . suppliers . TestedOn > hasItem ( isA ( org . junit . contrib . theories . suppliers . TestedOn . class ) ) ) |
eersteSelectieDatumVoorBeginDatumMetHerhaling ( ) { dienst . setEersteSelectieDatum ( nl . bzk . algemeenbrp . util . common . DatumUtil . datumRondVandaag ( 15 ) ) ; dienst . setSelectieInterval ( 1 ) ; dienst . setEenheidSelectieInterval ( EenheidSelectieInterval . MAAND . getId ( ) ) ; java . util . Collection < nl . bzk . brp . beheer . service . selectie . SelectieTaakDTO > taken = selectieTaakBerekenService . berekenSelectieTaken ( java . time . LocalDate . now ( ) . minus ( 1 , ChronoUnit . DAYS ) , java . time . LocalDate . now ( ) . plus ( 1 , ChronoUnit . MONTHS ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; } | org . junit . Assert . assertThat ( taken . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) ) |
testDiseaseTypeGets ( ) { java . lang . String code = "" ; try { code = _setupTestDiseaseType ( false ) ; _checkDiseaseTypeIntoDb ( code ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; "<AssertPlaceHolder>" ; } return ; } _checkDiseaseTypeIntoDb ( java . lang . String ) { org . isf . distype . model . DiseaseType foundDiseaseType ; foundDiseaseType = ( ( org . isf . distype . model . DiseaseType ) ( org . isf . distype . test . Tests . jpa . find ( org . isf . distype . model . DiseaseType . class , code ) ) ) ; org . isf . distype . test . Tests . testDiseaseType . check ( foundDiseaseType ) ; return ; } | org . junit . Assert . assertEquals ( true , false ) |
testCreatePatient ( ) { ca . uhn . fhir . jaxrs . server . Patient toCreate = createPatient ( 1 ) ; ca . uhn . fhir . rest . api . MethodOutcome outcome = new ca . uhn . fhir . rest . api . MethodOutcome ( ) ; toCreate . getIdentifier ( ) . add ( new ca . uhn . fhir . jaxrs . server . Identifier ( ) . setValue ( "myIdentifier" ) ) ; outcome . setResource ( toCreate ) ; when ( mock . create ( patientCaptor . capture ( ) , isNull ( java . lang . String . class ) ) ) . thenReturn ( outcome ) ; ca . uhn . fhir . jaxrs . server . AbstractJaxRsResourceProviderDstu3Test . client . setEncoding ( EncodingEnum . JSON ) ; final ca . uhn . fhir . rest . api . MethodOutcome response = ca . uhn . fhir . jaxrs . server . AbstractJaxRsResourceProviderDstu3Test . client . create ( ) . resource ( toCreate ) . prefer ( PreferReturnEnum . REPRESENTATION ) . execute ( ) ; org . hl7 . fhir . instance . model . api . IBaseResource resource = response . getResource ( ) ; compareResultId ( 1 , resource ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return myValue ; } | org . junit . Assert . assertEquals ( "myIdentifier" , patientCaptor . getValue ( ) . getIdentifier ( ) . get ( 0 ) . getValue ( ) ) |
testConstructorWithStringForCert ( ) { com . microsoft . azure . sdk . iot . device . auth . IotHubX509 iotHubX509 = mockit . Deencapsulation . newInstance ( com . microsoft . azure . sdk . iot . device . auth . IotHubX509 . class , new java . lang . Class [ ] { java . lang . String . class , boolean . class , java . lang . String . class , boolean . class } , tests . unit . com . microsoft . azure . sdk . iot . device . auth . IotHubX509Test . someCert , false , tests . unit . com . microsoft . azure . sdk . iot . device . auth . IotHubX509Test . someKeyPath , true ) ; java . lang . String actualPublicKeyCert = mockit . Deencapsulation . getField ( iotHubX509 , "publicKeyCertificate" ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( tests . unit . com . microsoft . azure . sdk . iot . device . auth . IotHubX509Test . someCert , actualPublicKeyCert ) |
testGetProperty ( ) { java . util . Optional < ? > name = clientBindableDefinitionAdapter . getProperty ( model , org . kie . workbench . common . stunner . core . client . definition . adapter . binding . PROPERTY_NAME ) ; "<AssertPlaceHolder>" ; } get ( ) { return extractReturnToLinkFromDefinitions ( ) ; } | org . junit . Assert . assertEquals ( name . get ( ) , value ) |
containsCorrectFilterForOrientation1 ( ) { java . io . File sourceFile = new java . io . File ( "test-resources/Exif/source_1.jpg" ) ; net . coobird . thumbnailator . tasks . io . InputStreamImageSource source = new net . coobird . thumbnailator . tasks . io . InputStreamImageSource ( new java . io . FileInputStream ( sourceFile ) ) ; net . coobird . thumbnailator . ThumbnailParameter param = new net . coobird . thumbnailator . builders . ThumbnailParameterBuilder ( ) . size ( 20 , 20 ) . build ( ) ; source . setThumbnailParameter ( param ) ; source . read ( ) ; "<AssertPlaceHolder>" ; } getImageFilters ( ) { return filters ; } | org . junit . Assert . assertTrue ( param . getImageFilters ( ) . isEmpty ( ) ) |
testMinWithValidRangeWithNullCF ( ) { org . apache . hadoop . hbase . client . coprocessor . AggregationClient aClient = new org . apache . hadoop . hbase . client . coprocessor . AggregationClient ( org . apache . hadoop . hbase . coprocessor . TestAggregateProtocol . conf ) ; org . apache . hadoop . hbase . client . Scan scan = new org . apache . hadoop . hbase . client . Scan ( ) ; scan . setStartRow ( org . apache . hadoop . hbase . coprocessor . TestAggregateProtocol . ROWS [ 5 ] ) ; scan . setStopRow ( org . apache . hadoop . hbase . coprocessor . TestAggregateProtocol . ROWS [ 15 ] ) ; final org . apache . hadoop . hbase . coprocessor . ColumnInterpreter < java . lang . Long , java . lang . Long > ci = new org . apache . hadoop . hbase . client . coprocessor . LongColumnInterpreter ( ) ; java . lang . Long min = null ; try { min = aClient . min ( org . apache . hadoop . hbase . coprocessor . TestAggregateProtocol . TEST_TABLE , ci , scan ) ; } catch ( java . lang . Throwable e ) { } "<AssertPlaceHolder>" ; } min ( byte [ ] , org . apache . hadoop . hbase . coprocessor . ColumnInterpreter , org . apache . hadoop . hbase . client . Scan ) { validateParameters ( scan ) ; class MinCallBack implements org . apache . hadoop . hbase . client . coprocessor . Batch . Callback < R > { private R min = null ; public R getMinimum ( ) { return min ; } @ org . apache . hadoop . hbase . client . coprocessor . Override public synchronized void update ( byte [ ] region , byte [ ] row , R result ) { min = ( ( ( min ) == null ) || ( ( result != null ) && ( ( ci . compare ( result , min ) ) < 0 ) ) ) ? result : min ; } } MinCallBack minCallBack = new MinCallBack ( ) ; org . apache . hadoop . hbase . client . HTable table = null ; try { table = new org . apache . hadoop . hbase . client . HTable ( conf , tableName ) ; table . coprocessorExec ( org . apache . hadoop . hbase . coprocessor . AggregateProtocol . class , scan . getStartRow ( ) , scan . getStopRow ( ) , new Batch . Call < org . apache . hadoop . hbase . coprocessor . AggregateProtocol , R > ( ) { @ java . lang . Override public org . apache . hadoop . hbase . client . coprocessor . R call ( org . apache . hadoop . hbase . coprocessor . AggregateProtocol instance ) throws java . io . IOException { return instance . getMin ( ci , scan ) ; } } , minCallBack ) ; } finally { if ( table != null ) { table . close ( ) ; } } org . apache . hadoop . hbase . client . coprocessor . AggregationClient . log . debug ( ( "Min<sp>fom<sp>all<sp>regions<sp>is:<sp>" + ( minCallBack . getMinimum ( ) ) ) ) ; return minCallBack . getMinimum ( ) ; } | org . junit . Assert . assertEquals ( null , min ) |
convertNestedNotToCnfTest ( ) { org . s1ck . gdl . model . predicates . Predicate a = getComparison ( ) ; org . s1ck . gdl . model . predicates . Predicate nestedNot = new org . s1ck . gdl . model . predicates . booleans . Not ( a ) ; org . gradoop . flink . model . impl . operators . matching . common . query . predicates . booleans . NotPredicate notPredicate = new org . gradoop . flink . model . impl . operators . matching . common . query . predicates . booleans . NotPredicate ( new org . s1ck . gdl . model . predicates . booleans . Not ( nestedNot ) ) ; org . gradoop . flink . model . impl . operators . matching . common . query . predicates . CNF reference = org . gradoop . flink . model . impl . operators . matching . common . query . predicates . QueryPredicate . createFrom ( a ) . asCNF ( ) ; "<AssertPlaceHolder>" ; } asCNF ( ) { org . gradoop . flink . model . impl . operators . matching . common . query . predicates . CNF cnf = new org . gradoop . flink . model . impl . operators . matching . common . query . predicates . CNF ( ) ; org . gradoop . flink . model . impl . operators . matching . common . query . predicates . CNFElement cnfElement = new org . gradoop . flink . model . impl . operators . matching . common . query . predicates . CNFElement ( ) ; cnfElement . addPredicate ( this ) ; cnf . addPredicate ( cnfElement ) ; return cnf ; } | org . junit . Assert . assertEquals ( reference , notPredicate . asCNF ( ) ) |
test_SYNCHRONOUS_UNSAFE_DISPATCHER ( ) { final com . mycila . event . Dispatcher dispatcher = com . mycila . event . Dispatchers . synchronousUnsafe ( com . mycila . event . ErrorHandlers . rethrow ( ) ) ; final java . util . concurrent . CountDownLatch go = new java . util . concurrent . CountDownLatch ( 1 ) ; final java . util . concurrent . CountDownLatch finished = new java . util . concurrent . CountDownLatch ( 20 ) ; for ( int i = 0 ; i < 20 ; i ++ ) { new java . lang . Thread ( ( "T" + i ) ) { public void run ( ) { try { go . await ( ) ; } catch ( java . lang . InterruptedException e ) { java . lang . Thread . currentThread ( ) . interrupt ( ) ; } dispatcher . publish ( com . mycila . event . Topic . topic ( "a/b" ) , java . lang . Thread . currentThread ( ) . getName ( ) ) ; finished . countDown ( ) ; } } . start ( ) ; } final java . util . concurrent . atomic . AtomicBoolean inProcess = new java . util . concurrent . atomic . AtomicBoolean ( false ) ; final java . util . concurrent . atomic . AtomicInteger paralellCalls = new java . util . concurrent . atomic . AtomicInteger ( 0 ) ; for ( int i = 0 ; i < 20 ; i ++ ) { final int index = i ; dispatcher . subscribe ( com . mycila . event . Topic . only ( "a/b" ) , java . lang . String . class , new com . mycila . event . Subscriber < java . lang . String > ( ) { public void onEvent ( com . mycila . event . Event < java . lang . String > event ) throws java . lang . Exception { if ( inProcess . get ( ) ) paralellCalls . incrementAndGet ( ) ; inProcess . set ( true ) ; java . lang . Thread . sleep ( 200 ) ; inProcess . set ( false ) ; } } ) ; } go . countDown ( ) ; finished . await ( ) ; System . out . println ( ( "paralellCalls.get()=" + ( paralellCalls . get ( ) ) ) ) ; "<AssertPlaceHolder>" ; dispatcher . close ( ) ; } get ( ) { answerLatch . await ( ) ; return result ( ) ; } | org . junit . Assert . assertTrue ( ( ( paralellCalls . get ( ) ) > 10 ) ) |
testNoArgs ( ) { org . eclipse . ceylon . common . tool . ToolModel < org . eclipse . ceylon . tools . copy . CeylonCopyTool > model = pluginLoader . loadToolModel ( "copy" ) ; "<AssertPlaceHolder>" ; try { pluginFactory . bindArguments ( model , getMainTool ( ) , java . util . Collections . < java . lang . String > emptyList ( ) ) ; org . junit . Assert . fail ( ) ; } catch ( org . eclipse . ceylon . common . tool . OptionArgumentException e ) { } } | org . junit . Assert . assertNotNull ( model ) |
testBatchInsertIntoOneTable ( ) { net . paoding . rose . jade . BatchUpdateTest . UserDAO dao = getOneTable ( ) ; java . util . List < net . paoding . rose . jade . BatchUpdateTest . User > users = new java . util . LinkedList < net . paoding . rose . jade . BatchUpdateTest . User > ( ) ; net . paoding . rose . jade . BatchUpdateTest . User user = new net . paoding . rose . jade . BatchUpdateTest . User ( ) ; user . id = 1 ; user . name = "zhiliang.wang" ; users . add ( user ) ; user = new net . paoding . rose . jade . BatchUpdateTest . User ( ) ; user . id = 2 ; user . name = "helen.wang" ; users . add ( user ) ; user = new net . paoding . rose . jade . BatchUpdateTest . User ( ) ; user . id = 3 ; user . name = "bad<sp>boy" ; users . add ( user ) ; dao . insertIntoOneTable ( users ) ; java . util . List < net . paoding . rose . jade . BatchUpdateTest . User > usersFromDB = dao . findAll ( ) ; "<AssertPlaceHolder>" ; } add ( java . lang . Class ) { list . add ( a ) ; return this ; } | org . junit . Assert . assertEquals ( users , usersFromDB ) |
testRevert ( ) { org . apache . commons . math3 . geometry . euclidean . threed . Line line = new org . apache . commons . math3 . geometry . euclidean . threed . Line ( new org . apache . commons . math3 . geometry . euclidean . threed . Vector3D ( 1653345.6696423641 , 6170370.041579291 , 90000 ) , new org . apache . commons . math3 . geometry . euclidean . threed . Vector3D ( 1650757.5050732433 , 6160710.879908984 , 0.9 ) , 1.0E-10 ) ; org . apache . commons . math3 . geometry . euclidean . threed . Vector3D expected = line . getDirection ( ) . negate ( ) ; org . apache . commons . math3 . geometry . euclidean . threed . Line reverted = line . revert ( ) ; "<AssertPlaceHolder>" ; } toArray ( ) { return toArray ( ScriptRuntime . emptyArgs ) ; } | org . junit . Assert . assertArrayEquals ( expected . toArray ( ) , reverted . getDirection ( ) . toArray ( ) , 0 ) |
testImplicitPortalClosing ( ) { java . sql . Statement statement = conn . createStatement ( ) ; java . sql . ResultSet rs = statement . executeQuery ( "select<sp>session_id()" ) ; rs . next ( ) ; java . lang . String id = rs . getString ( 1 ) ; statement . close ( ) ; java . sql . PreparedStatement s = conn . prepareStatement ( "select<sp>1" ) ; s . executeQuery ( ) ; s . executeQuery ( ) ; s . executeQuery ( ) ; int runningCount = 0 ; for ( org . teiid . adminapi . impl . RequestMetadata request : org . teiid . transport . TestODBCSocketTransport . odbcServer . server . getDqp ( ) . getRequestsForSession ( id ) ) { if ( ( request . getState ( ) ) == ( org . teiid . adminapi . Request . ProcessingState . PROCESSING ) ) { runningCount ++ ; } } "<AssertPlaceHolder>" ; s . close ( ) ; } getState ( ) { return state ; } | org . junit . Assert . assertEquals ( 1 , runningCount ) |
testAnnotatedQuickReplyTemplateBot ( ) { java . lang . String json = "{\"sender\":{\"id\":\"1158621824216736\"},\"recipient\":{\"id\":\"1226565047419159\"},\"timestamp\":1490832021661,\"message\":{\"mid\":\"mid.$cAAUPCFn4ymdhTcignVbHH3rzpKd_\",\"seq\":844819,\"text\":\"quick<sp>replies\"}}" ; co . aurasphere . botmill . fb . model . incoming . MessageEnvelope envelope = co . aurasphere . botmill . fb . internal . util . json . FbBotMillJsonUtils . fromJson ( json , co . aurasphere . botmill . fb . model . incoming . MessageEnvelope . class ) ; co . aurasphere . botmill . fb . model . incoming . handler . IncomingToOutgoingMessageHandler . getInstance ( ) . process ( envelope ) ; "<AssertPlaceHolder>" ; } process ( co . aurasphere . botmill . fb . model . incoming . MessageEnvelope ) { if ( ( this . event ) == null ) { return false ; } boolean triggered = this . event . verifyEventCondition ( envelope ) ; if ( triggered ) { beforeReply ( envelope ) ; if ( ( this . reply ) != null ) { this . reply . reply ( envelope ) ; } afterReply ( envelope ) ; } return triggered ; } | org . junit . Assert . assertNotNull ( envelope ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.