input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testGetOrder ( ) { org . jfree . data . function . PolynomialFunction2D f = new org . jfree . data . function . PolynomialFunction2D ( new double [ ] { 1.0 , 2.0 } ) ; "<AssertPlaceHolder>" ; } getOrder ( ) { return ( this . coefficients . length ) - 1 ; } | org . junit . Assert . assertEquals ( 1 , f . getOrder ( ) ) |
testReadComposite ( ) { java . io . InputStream is = getClass ( ) . getResourceAsStream ( "Calculator.composite" ) ; javax . xml . stream . XMLStreamReader reader = org . apache . tuscany . sca . interfacedef . java . xml . ReadTestCase . inputFactory . createXMLStreamReader ( is ) ; org . apache . tuscany . sca . assembly . Composite composite = ( ( org . apache . tuscany . sca . assembly . Composite ) ( org . apache . tuscany . sca . interfacedef . java . xml . ReadTestCase . staxProcessor . read ( reader , org . apache . tuscany . sca . interfacedef . java . xml . ReadTestCase . context ) ) ) ; "<AssertPlaceHolder>" ; } read ( javax . xml . stream . XMLStreamReader , org . apache . tuscany . sca . contribution . processor . ProcessorContext ) { org . apache . tuscany . sca . interfacedef . java . JavaInterfaceContract javaInterfaceContract = javaFactory . createJavaInterfaceContract ( ) ; java . lang . String interfaceName = reader . getAttributeValue ( null , org . apache . tuscany . sca . interfacedef . java . xml . INTERFACE ) ; if ( interfaceName != null ) { org . apache . tuscany . sca . interfacedef . java . JavaInterface javaInterface = createJavaInterface ( interfaceName ) ; javaInterfaceContract . setInterface ( javaInterface ) ; } java . lang . String callbackInterfaceName = reader . getAttributeValue ( null , org . apache . tuscany . sca . interfacedef . java . xml . CALLBACK_INTERFACE ) ; if ( callbackInterfaceName != null ) { org . apache . tuscany . sca . interfacedef . java . JavaInterface javaCallbackInterface = createJavaInterface ( callbackInterfaceName ) ; javaInterfaceContract . setCallbackInterface ( javaCallbackInterface ) ; } java . lang . String remotable = reader . getAttributeValue ( null , org . apache . tuscany . sca . interfacedef . java . xml . REMOTABLE ) ; if ( remotable != null ) { javaInterfaceContract . getInterface ( ) . setRemotable ( java . lang . Boolean . parseBoolean ( remotable ) ) ; javaInterfaceContract . getInterface ( ) . setRemotableSetFromSCDL ( ) ; } policyProcessor . readPolicies ( javaInterfaceContract . getInterface ( ) , reader ) ; while ( reader . hasNext ( ) ) { if ( ( ( reader . next ( ) ) == ( javax . xml . stream . XMLStreamConstants . END_ELEMENT ) ) && ( org . apache . tuscany . sca . interfacedef . java . xml . INTERFACE_JAVA_QNAME . equals ( reader . getName ( ) ) ) ) { break ; } } return javaInterfaceContract ; } | org . junit . Assert . assertNotNull ( composite ) |
testStateSettingAndGetting ( ) { int taskId = this . dao . createTask ( "annotator1" , "dataset1" , "type1" , "matching1" , "id-456" ) ; int expectedState = new java . util . Random ( ) . nextInt ( ) ; this . dao . setExperimentState ( taskId , expectedState ) ; int retrievedState = this . dao . getExperimentState ( taskId ) ; "<AssertPlaceHolder>" ; } getExperimentState ( int ) { org . springframework . jdbc . core . namedparam . MapSqlParameterSource parameters = new org . springframework . jdbc . core . namedparam . MapSqlParameterSource ( ) ; parameters . addValue ( "id" , experimentTaskId ) ; java . util . List < java . lang . Integer > result = this . template . query ( org . aksw . gerbil . database . ExperimentDAOImpl . GET_TASK_STATE , parameters , new org . aksw . gerbil . database . IntegerRowMapper ( ) ) ; if ( ( result . size ( ) ) > 0 ) { return result . get ( 0 ) ; } else { return TASK_NOT_FOUND ; } } | org . junit . Assert . assertEquals ( expectedState , retrievedState ) |
runTest ( ) { boolean result = checkNoError ( "Social_Activities_Delete_Activity_Node" ) ; "<AssertPlaceHolder>" ; } getNoErrorMsg ( ) { return noErrorMsg ; } | org . junit . Assert . assertTrue ( getNoErrorMsg ( ) , result ) |
testPolygonWkt ( ) { java . lang . String test = "POLYGON<sp>((55.75474<sp>37.61823,<sp>55.75513<sp>37.61888,<sp>55.7535<sp>37.6222,<sp>55.75315<sp>37.62165))" ; org . traccar . geofence . GeofenceGeometry geofenceGeometry = new org . traccar . geofence . GeofencePolygon ( ) ; geofenceGeometry . fromWkt ( test ) ; "<AssertPlaceHolder>" ; } toWkt ( ) { java . lang . String wkt = "" ; wkt = "CIRCLE<sp>(" ; wkt += java . lang . String . valueOf ( centerLatitude ) ; wkt += "<sp>" ; wkt += java . lang . String . valueOf ( centerLongitude ) ; wkt += ",<sp>" ; java . text . DecimalFormat format = new java . text . DecimalFormat ( "0.#" ) ; wkt += format . format ( radius ) ; wkt += ")" ; return wkt ; } | org . junit . Assert . assertEquals ( geofenceGeometry . toWkt ( ) , test ) |
testSerialiseAndDeserialiseWhenEmpty ( ) { com . clearspring . analytics . stream . cardinality . HyperLogLogPlus hyperLogLogPlus = new com . clearspring . analytics . stream . cardinality . HyperLogLogPlus ( 5 , 5 ) ; long preSerialisationCardinality = hyperLogLogPlus . cardinality ( ) ; byte [ ] hyperLogLogPlusSerialised ; try { hyperLogLogPlusSerialised = serialiser . serialise ( hyperLogLogPlus ) ; } catch ( final uk . gov . gchq . gaffer . exception . SerialisationException exception ) { org . junit . Assert . fail ( "A<sp>Serialisation<sp>Exception<sp>Occurred" ) ; return ; } com . clearspring . analytics . stream . cardinality . HyperLogLogPlus hyperLogLogPlusDeserialised ; try { hyperLogLogPlusDeserialised = serialiser . deserialise ( hyperLogLogPlusSerialised ) ; } catch ( final uk . gov . gchq . gaffer . exception . SerialisationException exception ) { org . junit . Assert . fail ( "A<sp>Serialisation<sp>Exception<sp>Occurred" ) ; return ; } "<AssertPlaceHolder>" ; } deserialise ( byte [ ] ) { final int [ ] lastDelimiter = new int [ ] { 0 } ; final java . lang . String group = uk . gov . gchq . gaffer . serialisation . util . LengthValueBytesSerialiserUtil . deserialise ( stringSerialiser , bytes , lastDelimiter ) ; if ( group . isEmpty ( ) ) { throw new java . lang . IllegalArgumentException ( ( "Group<sp>is<sp>required<sp>for<sp>deserialising<sp>" + ( uk . gov . gchq . gaffer . data . element . GroupedProperties . class . getSimpleName ( ) ) ) ) ; } final uk . gov . gchq . gaffer . store . schema . SchemaElementDefinition elementDefinition = schema . getElement ( group ) ; if ( null == elementDefinition ) { throw new uk . gov . gchq . gaffer . exception . SerialisationException ( ( ( "No<sp>SchemaElementDefinition<sp>found<sp>for<sp>group<sp>" + group ) + ",<sp>is<sp>this<sp>group<sp>in<sp>your<sp>schema?" ) ) ; } final uk . gov . gchq . gaffer . data . element . GroupedProperties properties = new uk . gov . gchq . gaffer . data . element . GroupedProperties ( group ) ; deserialiseProperties ( bytes , properties , elementDefinition , lastDelimiter ) ; return properties ; } | org . junit . Assert . assertEquals ( preSerialisationCardinality , hyperLogLogPlusDeserialised . cardinality ( ) ) |
testQtz395_CopyConstructorMustPreserveTimeZone ( ) { java . util . TimeZone nonDefault = java . util . TimeZone . getTimeZone ( "Europe/Brussels" ) ; if ( nonDefault . equals ( java . util . TimeZone . getDefault ( ) ) ) { nonDefault = org . jboss . elasticsearch . river . jira . CronExpressionTest . EST_TIME_ZONE ; } org . jboss . elasticsearch . river . jira . CronExpression cronExpression = new org . jboss . elasticsearch . river . jira . CronExpression ( "0<sp>15<sp>10<sp>*<sp>*<sp>?<sp>2005" ) ; cronExpression . setTimeZone ( nonDefault ) ; org . jboss . elasticsearch . river . jira . CronExpression copyCronExpression = new org . jboss . elasticsearch . river . jira . CronExpression ( cronExpression ) ; "<AssertPlaceHolder>" ; } getTimeZone ( ) { if ( ( timeZone ) == null ) { timeZone = java . util . TimeZone . getDefault ( ) ; } return timeZone ; } | org . junit . Assert . assertEquals ( nonDefault , copyCronExpression . getTimeZone ( ) ) |
testHasNextFalse ( ) { java . sql . ResultSet resultSet = com . exigeninsurance . x4j . analytic . util . MockResultSet . create ( cols ( "A" , "B" , "C" , "D" ) , data ( ) ) ; com . exigeninsurance . x4j . analytic . xlsx . core . node . GroupAdapter adapter = new com . exigeninsurance . x4j . analytic . xlsx . core . node . GroupAdapter ( resultSet ) ; adapter . addGroup ( GroupAdapter . NO_GROUP , new com . exigeninsurance . x4j . analytic . xlsx . core . groups . OpenState ( ) ) ; boolean hasNext = adapter . next ( GroupAdapter . NO_GROUP ) ; "<AssertPlaceHolder>" ; } next ( java . lang . String ) { com . exigeninsurance . x4j . analytic . xlsx . core . groups . Group currentGroup = getCurrentGroup ( group ) ; com . exigeninsurance . x4j . analytic . xlsx . core . groups . GroupTransitionResult groupNext = currentGroup . next ( ) ; if ( groupNext . isSkipping ( ) ) { return groupNext . isNextAfterSkip ( ) ; } boolean next = ! ( dataEnd ( ) ) ; if ( ! next ) { return false ; } if ( ! ( handleGroups ( next , group , currentGroup ) ) ) { currentGroup . transitionOnNext ( next ) ; return false ; } moveNextForward ( currentGroup ) ; handleLast ( group ) ; return next ; } | org . junit . Assert . assertFalse ( hasNext ) |
testGoodMethod ( ) { final org . pac4j . core . matching . HttpMethodMatcher matcher = new org . pac4j . core . matching . HttpMethodMatcher ( HTTP_METHOD . POST ) ; final org . pac4j . core . context . MockWebContext context = org . pac4j . core . context . MockWebContext . create ( ) . setRequestMethod ( HTTP_METHOD . POST . name ( ) ) ; "<AssertPlaceHolder>" ; } matches ( org . pac4j . core . context . WebContext ) { org . pac4j . core . util . CommonHelper . assertNotNull ( "methods" , methods ) ; final java . lang . String requestMethod = context . getRequestMethod ( ) ; for ( final org . pac4j . core . matching . HTTP_METHOD method : methods ) { if ( method . name ( ) . equalsIgnoreCase ( requestMethod ) ) { return true ; } } return false ; } | org . junit . Assert . assertTrue ( matcher . matches ( context ) ) |
shouldProvideUserByUsernameEvenIfMidSetUsers ( ) { org . neo4j . server . security . auth . FileUserRepository users = new org . neo4j . server . security . auth . FileUserRepository ( fs , authFile , logProvider ) ; users . create ( new org . neo4j . kernel . impl . security . User . Builder ( "oskar" , org . neo4j . server . security . auth . LegacyCredential . forPassword ( "hidden" ) ) . build ( ) ) ; org . neo4j . test . DoubleLatch latch = new org . neo4j . test . DoubleLatch ( 2 ) ; java . util . concurrent . Future < java . lang . Object > setUsers = threading . execute ( ( o ) -> { users . setUsers ( new org . neo4j . server . security . auth . HangingListSnapshot ( latch , 10L , java . util . Collections . emptyList ( ) ) ) ; return null ; } , null ) ; latch . startAndWaitForAllToStart ( ) ; "<AssertPlaceHolder>" ; latch . finish ( ) ; setUsers . get ( ) ; } getUserByName ( java . lang . String ) { return username == null ? null : usersByName . get ( username ) ; } | org . junit . Assert . assertNotNull ( users . getUserByName ( "oskar" ) ) |
test_addDays ( ) { com . baeldung . gregorian . calendar . GregorianCalendarExample calendarDemo = new com . baeldung . gregorian . calendar . GregorianCalendarExample ( ) ; java . util . GregorianCalendar calendarActual = new java . util . GregorianCalendar ( 2018 , 6 , 28 ) ; java . util . GregorianCalendar calendarExpected = new java . util . GregorianCalendar ( 2018 , 6 , 28 ) ; calendarExpected . add ( Calendar . DATE , 1 ) ; java . util . Date expectedDate = calendarExpected . getTime ( ) ; "<AssertPlaceHolder>" ; } addDays ( java . util . GregorianCalendar , int ) { java . util . GregorianCalendar cal = calendar ; cal . add ( Calendar . DATE , daysToAdd ) ; return cal . getTime ( ) ; } | org . junit . Assert . assertEquals ( expectedDate , calendarDemo . addDays ( calendarActual , 1 ) ) |
testUpdateNameDrugChange ( ) { org . drugis . addis . presentation . wizard . StudyActivityPresentation pm1 = new org . drugis . addis . presentation . wizard . StudyActivityPresentation ( d_emptyList , null ) ; pm1 . getActivityModel ( ) . setValue ( pm1 . getTreatmentModel ( ) . getBean ( ) ) ; java . beans . PropertyChangeListener mockListener = org . drugis . common . JUnitUtil . mockListener ( pm1 . getNameModel ( ) , "value" , "MISSING" , d_drug . toString ( ) ) ; pm1 . getNameModel ( ) . addValueChangeListener ( mockListener ) ; pm1 . getTreatmentModel ( ) . getTreatmentModels ( ) . get ( 0 ) . getBean ( ) . setDrug ( d_drug ) ; "<AssertPlaceHolder>" ; verify ( mockListener ) ; } toString ( ) { return java . lang . Integer . toString ( weightedValue ) ; } | org . junit . Assert . assertEquals ( d_drug . toString ( ) , pm1 . getNameModel ( ) . getValue ( ) ) |
addUnusedStreamObjectsTest ( ) { java . lang . String filenameIn = "docWithUnusedObjects_3.pdf" ; com . itextpdf . kernel . pdf . PdfDocument pdfDocument = new com . itextpdf . kernel . pdf . PdfDocument ( new com . itextpdf . kernel . pdf . PdfWriter ( ( ( com . itextpdf . kernel . pdf . PdfDocumentTest . destinationFolder ) + filenameIn ) ) ) ; pdfDocument . addNewPage ( ) ; com . itextpdf . kernel . pdf . PdfDictionary unusedDictionary = new com . itextpdf . kernel . pdf . PdfDictionary ( ) ; com . itextpdf . kernel . pdf . PdfArray unusedArray = ( ( com . itextpdf . kernel . pdf . PdfArray ) ( new com . itextpdf . kernel . pdf . PdfArray ( ) . makeIndirect ( pdfDocument ) ) ) ; unusedArray . add ( new com . itextpdf . kernel . pdf . PdfNumber ( 42 ) ) ; com . itextpdf . kernel . pdf . PdfStream stream = new com . itextpdf . kernel . pdf . PdfStream ( new byte [ ] { 1 , 2 , 34 , 45 } , 0 ) ; unusedArray . add ( stream ) ; unusedDictionary . put ( new com . itextpdf . kernel . pdf . PdfName ( "testName" ) , unusedArray ) ; unusedDictionary . makeIndirect ( pdfDocument ) . flush ( ) ; pdfDocument . setFlushUnusedObjects ( true ) ; pdfDocument . close ( ) ; com . itextpdf . kernel . pdf . PdfDocument testerDocument = new com . itextpdf . kernel . pdf . PdfDocument ( new com . itextpdf . kernel . pdf . PdfReader ( ( ( com . itextpdf . kernel . pdf . PdfDocumentTest . destinationFolder ) + filenameIn ) ) ) ; "<AssertPlaceHolder>" ; testerDocument . close ( ) ; } getXref ( ) { return xref ; } | org . junit . Assert . assertEquals ( testerDocument . getXref ( ) . size ( ) , 9 ) |
shouldMapTransformerException ( ) { doThrow ( new javax . xml . transform . TransformerException ( "foo" ) ) . when ( transformer ) . transform ( any ( javax . xml . transform . Source . class ) , any ( javax . xml . transform . Result . class ) ) ; try { org . xmlunit . util . Convert . toInputSource ( new javax . xml . transform . dom . DOMSource ( org . xmlunit . util . ConvertTest . animalDocument ( ) ) , tFac ) ; org . junit . Assert . fail ( "should<sp>have<sp>thrown<sp>XMLUnitException" ) ; } catch ( org . xmlunit . XMLUnitException ex ) { "<AssertPlaceHolder>" ; } } animalDocument ( ) { javax . xml . parsers . DocumentBuilder b = javax . xml . parsers . DocumentBuilderFactory . newInstance ( ) . newDocumentBuilder ( ) ; return b . parse ( new java . io . File ( org . xmlunit . TestResources . ANIMAL_FILE ) ) ; } | org . junit . Assert . assertEquals ( org . xmlunit . XMLUnitException . class , ex . getClass ( ) ) |
testLargeMessages ( ) { final org . opennms . core . rpc . echo . EchoRequest request = new org . opennms . core . rpc . echo . EchoRequest ( ) ; request . setLocation ( org . opennms . core . ipc . rpc . kafka . RpcKafkaIT . REMOTE_LOCATION_NAME ) ; java . lang . String message = com . google . common . base . Strings . repeat ( "*" , java . lang . Integer . parseInt ( org . opennms . core . ipc . rpc . kafka . RpcKafkaIT . MAX_BUFFER_SIZE ) ) ; request . setBody ( message ) ; org . opennms . core . rpc . echo . EchoResponse expectedResponse = new org . opennms . core . rpc . echo . EchoResponse ( ) ; expectedResponse . setBody ( message ) ; org . opennms . core . rpc . echo . EchoResponse actualResponse = echoClient . execute ( request ) . get ( ) ; "<AssertPlaceHolder>" ; } get ( ) { try { return new org . opennms . netmgt . provision . detector . client . rpc . DetectorResponseDTO ( syncDetector . detect ( detectRequest ) ) ; } catch ( java . lang . Throwable t ) { return new org . opennms . netmgt . provision . detector . client . rpc . DetectorResponseDTO ( t ) ; } finally { syncDetector . dispose ( ) ; } } | org . junit . Assert . assertEquals ( expectedResponse , actualResponse ) |
should_return_empty_List_if_given_Collection_is_null ( ) { java . util . Collection < ? > c = null ; "<AssertPlaceHolder>" ; } nonNullElementsIn ( org . fest . util . Collection ) { if ( c == null ) { return org . fest . util . Lists . emptyList ( ) ; } org . fest . util . List < T > nonNull = new org . fest . util . ArrayList < T > ( ) ; for ( T element : c ) { if ( element != null ) { nonNull . add ( element ) ; } } return nonNull ; } | org . junit . Assert . assertTrue ( org . fest . util . Collections . nonNullElementsIn ( c ) . isEmpty ( ) ) |
testCleanAccesskeyFromJsonObjectAtStart ( ) { final java . lang . String input = "{\"accesskey\":\"test\",\"test\":\"blah\"}" ; final java . lang . String expected = "{\"test\":\"blah\"}" ; final java . lang . String result = com . cloud . utils . StringUtils . cleanString ( input ) ; "<AssertPlaceHolder>" ; } cleanString ( java . lang . String ) { java . lang . String cleanResult = "" ; if ( stringToClean != null ) { cleanResult = com . cloud . utils . StringUtils . REGEX_PASSWORD_QUERYSTRING . matcher ( stringToClean ) . replaceAll ( "" ) ; cleanResult = com . cloud . utils . StringUtils . REGEX_PASSWORD_JSON . matcher ( cleanResult ) . replaceAll ( "" ) ; final java . util . regex . Matcher detailsMatcher = com . cloud . utils . StringUtils . REGEX_PASSWORD_DETAILS . matcher ( cleanResult ) ; while ( detailsMatcher . find ( ) ) { final java . util . regex . Matcher detailsIndexMatcher = com . cloud . utils . StringUtils . REGEX_PASSWORD_DETAILS_INDEX . matcher ( detailsMatcher . group ( ) ) ; if ( detailsIndexMatcher . find ( ) ) { cleanResult = com . cloud . utils . StringUtils . cleanDetails ( cleanResult , detailsIndexMatcher . group ( ) ) ; } } } return cleanResult ; } | org . junit . Assert . assertEquals ( result , expected ) |
testDelete_3 ( ) { bottom . delete ( 7 , 11 ) ; bottom . delete ( 6 , 7 ) ; final java . lang . StringBuilder bottomRef = new java . lang . StringBuilder ( baseString ) ; bottomRef . delete ( 7 , 11 ) ; bottomRef . delete ( 6 , 7 ) ; "<AssertPlaceHolder>" ; } toString ( ) { return java . lang . String . format ( "[%s]<sp>%s" , ( ( source ) != null ? source . getSimpleName ( ) : "<unknown>" ) , message ) ; } | org . junit . Assert . assertEquals ( bottomRef . toString ( ) , bottom . get ( ) ) |
lockShouldReturnFalseIfTableIsEmpty ( ) { initShouldNotCreateTheSchemaIfItAlreadyExists ( ) ; reset ( connection , metaData , statement , preparedStatement , resultSet ) ; expect ( connection . isClosed ( ) ) . andReturn ( false ) ; expect ( connection . prepareStatement ( ( ( "SELECT<sp>*<sp>FROM<sp>" + ( tableName ) ) + "<sp>FOR<sp>UPDATE" ) ) ) . andReturn ( preparedStatement ) ; preparedStatement . setQueryTimeout ( 0 ) ; expect ( preparedStatement . execute ( ) ) . andReturn ( true ) ; preparedStatement . close ( ) ; expect ( connection . isClosed ( ) ) . andReturn ( false ) ; expect ( connection . prepareStatement ( ( ( "UPDATE<sp>" + ( tableName ) ) + "<sp>SET<sp>MOMENT<sp>=<sp>1" ) ) ) . andReturn ( preparedStatement ) ; preparedStatement . setQueryTimeout ( 0 ) ; expect ( preparedStatement . executeUpdate ( ) ) . andReturn ( 0 ) ; preparedStatement . close ( ) ; replay ( connection , metaData , statement , preparedStatement , resultSet ) ; boolean lockAquired = lock . lock ( ) ; verify ( connection , metaData , statement , preparedStatement , resultSet ) ; "<AssertPlaceHolder>" ; } lock ( ) { return aquireLock ( ) ; } | org . junit . Assert . assertFalse ( lockAquired ) |
test100getStringListFromUserRoleList ( ) { destroySession ( ) ; org . apache . ranger . view . VXStringList vXStringList = xUserMgr . getStringListFromUserRoleList ( null ) ; "<AssertPlaceHolder>" ; } getStringListFromUserRoleList ( java . util . List ) { if ( listXXPortalUserRole == null ) { return null ; } java . util . List < org . apache . ranger . biz . VXString > xStrList = new java . util . ArrayList < org . apache . ranger . biz . VXString > ( ) ; org . apache . ranger . biz . VXString vXStr = null ; for ( org . apache . ranger . entity . XXPortalUserRole userRole : listXXPortalUserRole ) { if ( userRole != null ) { vXStr = new org . apache . ranger . biz . VXString ( ) ; vXStr . setValue ( userRole . getUserRole ( ) ) ; xStrList . add ( vXStr ) ; } } org . apache . ranger . biz . VXStringList vXStringList = new org . apache . ranger . biz . VXStringList ( xStrList ) ; return vXStringList ; } | org . junit . Assert . assertNull ( vXStringList ) |
testXOR ( ) { org . roaringbitmap . BitmapContainer bc = new org . roaringbitmap . BitmapContainer ( 100 , 10000 ) ; org . roaringbitmap . BitmapContainer bc2 = new org . roaringbitmap . BitmapContainer ( ) ; org . roaringbitmap . BitmapContainer bc3 = new org . roaringbitmap . BitmapContainer ( ) ; for ( int i = 100 ; i < 10000 ; ++ i ) { if ( ( i % 2 ) == 0 ) bc2 = ( ( org . roaringbitmap . BitmapContainer ) ( bc2 . add ( ( ( short ) ( i ) ) ) ) ) ; else bc3 = ( ( org . roaringbitmap . BitmapContainer ) ( bc3 . add ( ( ( short ) ( i ) ) ) ) ) ; } bc = ( ( org . roaringbitmap . BitmapContainer ) ( bc . ixor ( bc2 ) ) ) ; "<AssertPlaceHolder>" ; } ixor ( org . roaringbitmap . RangeOperationBenchmark$BenchmarkState ) { org . roaringbitmap . Container result = state . bc . ixor ( state . rc ) ; return result . getCardinality ( ) ; } | org . junit . Assert . assertTrue ( ( ( bc . ixor ( bc3 ) . getCardinality ( ) ) == 0 ) ) |
testRemoveParameter4 ( ) { com . epimorphics . lda . renderers . common . EldaURL eu = new com . epimorphics . lda . renderers . common . EldaURL ( "http://foo.bar.com/fubar?a=b,c" ) ; java . lang . String newEu = eu . withParameter ( EldaURL . OPERATION . REMOVE , "a" , "d" ) . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { return "FakeSource:" + ( name ) ; } | org . junit . Assert . assertTrue ( "http://foo.bar.com/fubar?a=b,c" . equals ( newEu ) ) |
testSetGetBlueprintName ( ) { org . apache . ambari . server . orm . entities . BlueprintConfigEntityPK pk = new org . apache . ambari . server . orm . entities . BlueprintConfigEntityPK ( ) ; pk . setBlueprintName ( "foo" ) ; "<AssertPlaceHolder>" ; } getBlueprintName ( ) { return blueprintName ; } | org . junit . Assert . assertEquals ( "foo" , pk . getBlueprintName ( ) ) |
givenUserService_whenSearchForUserByEmailStartsWith_thenFound ( ) { expect ( userService . findByEmail ( startsWith ( "test" ) ) ) . andReturn ( java . util . Collections . emptyList ( ) ) ; replay ( userService ) ; java . util . List < com . baeldung . easymock . User > result = userService . findByEmail ( "test@example.com" ) ; verify ( userService ) ; "<AssertPlaceHolder>" ; } size ( ) { return elements . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , result . size ( ) ) |
testToJobBaseUrl_EmptyJobName ( ) { final java . lang . String fpath = "http://localhost/jobs/someFolder" ; final com . offbytwo . jenkins . model . FolderJob folderJob = new com . offbytwo . jenkins . model . FolderJob ( "someFolder" , fpath ) ; final java . lang . String expected = "http://localhost/jobs/someFolder/job/" ; "<AssertPlaceHolder>" ; } toJobBaseUrl ( com . offbytwo . jenkins . model . FolderJob , java . lang . String ) { final java . lang . StringBuilder sb = new java . lang . StringBuilder ( com . offbytwo . jenkins . client . util . UrlUtils . DEFAULT_BUFFER_SIZE ) ; sb . append ( com . offbytwo . jenkins . client . util . UrlUtils . toBaseUrl ( folder ) ) ; if ( ( sb . charAt ( ( ( sb . length ( ) ) - 1 ) ) ) != '/' ) sb . append ( '/' ) ; sb . append ( "job/" ) ; final java . lang . String [ ] jobNameParts = jobName . split ( "/" ) ; for ( int i = 0 ; i < ( jobNameParts . length ) ; i ++ ) { sb . append ( com . offbytwo . jenkins . client . util . EncodingUtils . encode ( jobNameParts [ i ] ) ) ; if ( i != ( ( jobNameParts . length ) - 1 ) ) sb . append ( '/' ) ; } return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( expected , com . offbytwo . jenkins . client . util . UrlUtils . toJobBaseUrl ( folderJob , "" ) ) |
testGetDoubleWithMaxValueAsString ( ) { org . apache . activemq . command . ActiveMQMapMessage msg = new org . apache . activemq . command . ActiveMQMapMessage ( ) ; msg . setString ( this . name , java . lang . String . valueOf ( Double . MAX_VALUE ) ) ; msg = ( ( org . apache . activemq . command . ActiveMQMapMessage ) ( msg . copy ( ) ) ) ; "<AssertPlaceHolder>" ; } getDouble ( java . lang . String ) { initializeReading ( ) ; java . lang . Object value = map . get ( name ) ; if ( value == null ) { return 0 ; } else if ( value instanceof java . lang . Double ) { return ( ( java . lang . Double ) ( value ) ) . doubleValue ( ) ; } else if ( value instanceof java . lang . Float ) { return ( ( java . lang . Float ) ( value ) ) . floatValue ( ) ; } else if ( value instanceof org . fusesource . hawtbuf . UTF8Buffer ) { return java . lang . Double . valueOf ( value . toString ( ) ) . doubleValue ( ) ; } else if ( value instanceof java . lang . String ) { return java . lang . Double . valueOf ( value . toString ( ) ) . doubleValue ( ) ; } else { throw new javax . jms . MessageFormatException ( ( "Cannot<sp>read<sp>a<sp>double<sp>from<sp>" + ( value . getClass ( ) . getName ( ) ) ) ) ; } } | org . junit . Assert . assertEquals ( Double . MAX_VALUE , msg . getDouble ( this . name ) , 1.0 ) |
createNewTableWithIfNotExists ( ) { java . lang . String sql = "CREATE<sp>TABLE<sp>IF<sp>NOT<sp>EXISTS<sp>t1<sp>(c1<sp>INT)" ; createTableSimpleGenerateAIS ( ) ; com . foundationdb . sql . parser . StatementNode createNode = parser . parseStatement ( sql ) ; "<AssertPlaceHolder>" ; com . foundationdb . sql . aisddl . TableDDL . createTable ( ddlFunctions , null , com . foundationdb . sql . aisddl . TableDDLTest . DEFAULT_SCHEMA , ( ( com . foundationdb . sql . parser . CreateTableNode ) ( createNode ) ) , null ) ; } createTableSimpleGenerateAIS ( ) { com . foundationdb . sql . aisddl . TableDDLTest . dropTable = com . foundationdb . ais . model . TableName . create ( com . foundationdb . sql . aisddl . TableDDLTest . DEFAULT_SCHEMA , com . foundationdb . sql . aisddl . TableDDLTest . DEFAULT_TABLE ) ; builder . table ( com . foundationdb . sql . aisddl . TableDDLTest . DEFAULT_SCHEMA , com . foundationdb . sql . aisddl . TableDDLTest . DEFAULT_TABLE ) ; builder . column ( com . foundationdb . sql . aisddl . TableDDLTest . DEFAULT_SCHEMA , com . foundationdb . sql . aisddl . TableDDLTest . DEFAULT_TABLE , "c1" , 0 , "MCOMPAT" , "int" , true ) ; builder . basicSchemaIsComplete ( ) ; builder . groupingIsComplete ( ) ; } | org . junit . Assert . assertTrue ( ( createNode instanceof com . foundationdb . sql . parser . CreateTableNode ) ) |
testMonotonicity ( ) { com . cloudera . flume . master . ZooKeeperCounter seq = new com . cloudera . flume . master . ZooKeeperCounter ( com . cloudera . flume . master . TestZooKeeperCounter . svc , "/seq-generator-test" ) ; for ( long i = 0 ; i < 1024 ; ++ i ) { "<AssertPlaceHolder>" ; } seq . shutdown ( ) ; } incrementAndGet ( ) { return incrementAndGetBy ( 1L ) ; } | org . junit . Assert . assertEquals ( i , seq . incrementAndGet ( ) ) |
testGetRequestPathWorksAsExpectedWithOutContext ( ) { when ( httpServletRequest . getContextPath ( ) ) . thenReturn ( "" ) ; when ( httpServletRequest . getRequestURI ( ) ) . thenReturn ( "/index" ) ; when ( httpServletRequest . getRequestURI ( ) ) . thenReturn ( "/myapp/is/here" ) ; context . init ( servletContext , httpServletRequest , httpServletResponse ) ; "<AssertPlaceHolder>" ; } getRequestPath ( ) { return wrapped . getRequestPath ( ) ; } | org . junit . Assert . assertEquals ( "/myapp/is/here" , context . getRequestPath ( ) ) |
testTrue ( ) { final java . util . Set < nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Relatie > relatieSet = java . util . Collections . singleton ( relatie ) ; org . mockito . Mockito . when ( persoon . getRelaties ( ) ) . thenReturn ( relatieSet ) ; org . mockito . Mockito . when ( relatie . getSoortRelatie ( ) ) . thenReturn ( SoortRelatie . HUWELIJK ) ; final nl . bzk . migratiebrp . bericht . model . sync . impl . VerwerkToevalligeGebeurtenisVerzoekBericht verzoek = new nl . bzk . migratiebrp . bericht . model . sync . impl . VerwerkToevalligeGebeurtenisVerzoekBericht ( ) ; final nl . bzk . migratiebrp . bericht . model . sync . generated . RelatieSoortGroepType relatieSoortGroep = new nl . bzk . migratiebrp . bericht . model . sync . generated . RelatieSoortGroepType ( ) ; relatieSoortGroep . setSoort ( SoortRelatieType . H ) ; final nl . bzk . migratiebrp . bericht . model . sync . generated . RelatieType . Sluiting sluiting = new nl . bzk . migratiebrp . bericht . model . sync . generated . RelatieType . Sluiting ( ) ; sluiting . setSoort ( relatieSoortGroep ) ; final nl . bzk . migratiebrp . bericht . model . sync . generated . RelatieType relatieType = new nl . bzk . migratiebrp . bericht . model . sync . generated . RelatieType ( ) ; relatieType . setSluiting ( sluiting ) ; verzoek . setRelatie ( relatieType ) ; "<AssertPlaceHolder>" ; } controleer ( nl . bzk . migratiebrp . synchronisatie . dal . domein . brp . kern . entity . Persoon , nl . bzk . migratiebrp . bericht . model . sync . impl . VerwerkToevalligeGebeurtenisVerzoekBericht ) { final nl . bzk . migratiebrp . bericht . model . sync . generated . PersoonType persoon = verzoek . getPersoon ( ) ; if ( persoon == null ) { return false ; } return rootPersoon . getPersoonOverlijdenHistorieSet ( ) . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( subject . controleer ( persoon , verzoek ) ) |
authorizeInteractionForPatientWhenPatientHasNoMissingConsents ( ) { when ( this . consentManager . getMissingConsentsForPatient ( this . patient ) ) . thenReturn ( java . util . Collections . < org . phenotips . consents . Consent > emptySet ( ) ) ; final boolean authorizeInteraction = this . component . authorizeInteraction ( this . patient ) ; "<AssertPlaceHolder>" ; } authorizeInteraction ( java . util . Set ) { java . util . Set < org . phenotips . consents . Consent > systemConsents = this . consentManager . getSystemConsents ( ) ; if ( org . apache . commons . collections4 . CollectionUtils . isEmpty ( systemConsents ) ) { return true ; } if ( org . apache . commons . collections4 . CollectionUtils . isEmpty ( grantedConsents ) ) { return containsRequiredConsents ( systemConsents ) ; } java . util . Set < org . phenotips . consents . Consent > missingConsents = new java . util . HashSet ( ) ; for ( org . phenotips . consents . Consent consent : systemConsents ) { if ( ! ( grantedConsents . contains ( consent . getId ( ) ) ) ) { missingConsents . add ( consent ) ; } } return containsRequiredConsents ( missingConsents ) ; } | org . junit . Assert . assertTrue ( authorizeInteraction ) |
testBootstrapThrowsMongoDbExecption ( ) { final com . allanbank . mongodb . MongoClientConfiguration config = new com . allanbank . mongodb . MongoClientConfiguration ( ) ; config . addServer ( "localhost:6547" ) ; final com . allanbank . mongodb . client . connection . proxy . ProxiedConnectionFactory mockFactory = createMock ( com . allanbank . mongodb . client . connection . proxy . ProxiedConnectionFactory . class ) ; final com . allanbank . mongodb . client . connection . Connection mockConnection = createMock ( com . allanbank . mongodb . client . connection . Connection . class ) ; expect ( mockFactory . connect ( anyObject ( com . allanbank . mongodb . client . state . Server . class ) , eq ( config ) ) ) . andReturn ( mockConnection ) . times ( 2 ) ; mockConnection . send ( anyObject ( com . allanbank . mongodb . client . message . IsMaster . class ) , com . allanbank . mongodb . client . connection . CallbackReply . cb ( ) ) ; expectLastCall ( ) . andThrow ( new com . allanbank . mongodb . MongoDbException ( "This<sp>is<sp>a<sp>test" ) ) . times ( 2 ) ; mockConnection . shutdown ( false ) ; expectLastCall ( ) ; mockConnection . close ( ) ; expectLastCall ( ) ; mockConnection . close ( ) ; expectLastCall ( ) ; replay ( mockFactory , mockConnection ) ; myTestFactory = new com . allanbank . mongodb . client . connection . sharded . ShardedConnectionFactory ( mockFactory , config ) ; "<AssertPlaceHolder>" ; verify ( mockFactory , mockConnection ) ; reset ( mockFactory , mockConnection ) ; } close ( ) { synchronized ( myForwardCallback ) { myClosed = true ; sendKill ( ) ; } } | org . junit . Assert . assertNotNull ( myTestFactory ) |
expirationTest ( ) { router . getRuleManager ( ) . addProxyAndOpenPortIfNew ( createTestServiceProxy ( ) ) ; java . util . concurrent . atomic . AtomicLong counter = new java . util . concurrent . atomic . AtomicLong ( 0 ) ; java . util . List < java . lang . Long > vals = new java . util . ArrayList ( ) ; com . predic8 . membrane . core . interceptor . AbstractInterceptorWithSession interceptor = defineInterceptor ( counter , vals ) ; router . addUserFeatureInterceptor ( interceptor ) ; router . addUserFeatureInterceptor ( testResponseInterceptor ( ) ) ; router . init ( ) ; interceptor . getSessionManager ( ) . setExpiresAfterSeconds ( 0 ) ; java . util . stream . IntStream . range ( 0 , 50 ) . forEach ( ( i ) -> sendRequest ( ) ) ; for ( int i = 0 ; i < 100 ; i += 2 ) "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return ( ( T ) ( getMultiple ( key ) . get ( key ) ) ) ; } | org . junit . Assert . assertEquals ( null , vals . get ( i ) ) |
test_get_all_principals ( ) { java . util . List < org . ikasan . security . model . IkasanPrincipal > principals = this . xaSecurityDao . getAllPrincipals ( ) ; "<AssertPlaceHolder>" ; } size ( ) { logger . debug ( "Size!<sp>" ) ; return 15000 ; } | org . junit . Assert . assertTrue ( ( ( principals . size ( ) ) == 8 ) ) |
testWaitForFinalResult_whenCancelled_thenReturnNull ( ) { doAnswer ( new org . mockito . stubbing . Answer < java . lang . Void > ( ) { @ com . facebook . datasource . Override public com . facebook . datasource . Void answer ( org . mockito . invocation . InvocationOnMock invocation ) throws java . lang . Throwable { final java . lang . Object [ ] args = invocation . getArguments ( ) ; com . facebook . datasource . DataSubscriber dataSubscriber = ( ( com . facebook . datasource . DataSubscriber ) ( args [ 0 ] ) ) ; dataSubscriber . onCancellation ( mDataSource ) ; return null ; } } ) . when ( mDataSource ) . subscribe ( any ( com . facebook . datasource . DataSubscriber . class ) , any ( java . util . concurrent . Executor . class ) ) ; final java . lang . Object actual = com . facebook . datasource . DataSources . waitForFinalResult ( mDataSource ) ; "<AssertPlaceHolder>" ; verify ( mCountDownLatch , times ( 1 ) ) . await ( ) ; verify ( mCountDownLatch , times ( 1 ) ) . countDown ( ) ; } waitForFinalResult ( com . facebook . datasource . DataSource ) { final java . util . concurrent . CountDownLatch latch = new java . util . concurrent . CountDownLatch ( 1 ) ; final com . facebook . datasource . DataSources . ValueHolder < T > resultHolder = new com . facebook . datasource . DataSources . ValueHolder < > ( ) ; final com . facebook . datasource . DataSources . ValueHolder < java . lang . Throwable > pendingException = new com . facebook . datasource . DataSources . ValueHolder < > ( ) ; dataSource . subscribe ( new com . facebook . datasource . DataSubscriber < T > ( ) { @ com . facebook . datasource . Override public void onNewResult ( com . facebook . datasource . DataSource < T > dataSource ) { if ( ! ( dataSource . isFinished ( ) ) ) { return ; } try { resultHolder . value = dataSource . getResult ( ) ; } finally { latch . countDown ( ) ; } } @ com . facebook . datasource . Override public void onFailure ( com . facebook . datasource . DataSource < T > dataSource ) { try { pendingException . value = dataSource . getFailureCause ( ) ; } finally { latch . countDown ( ) ; } } @ com . facebook . datasource . Override public void onCancellation ( com . facebook . datasource . DataSource < T > dataSource ) { latch . countDown ( ) ; } @ com . facebook . datasource . Override public void onProgressUpdate ( com . facebook . datasource . DataSource < T > dataSource ) { } } , new java . util . concurrent . Executor ( ) { @ com . facebook . datasource . Override public void execute ( java . lang . Runnable command ) { command . run ( ) ; } } ) ; latch . await ( ) ; if ( ( pendingException . value ) != null ) { throw pendingException . value ; } return resultHolder . value ; } | org . junit . Assert . assertEquals ( null , actual ) |
testWrite ( ) { java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; byte [ ] ba1 = "abc" . getBytes ( StandardCharsets . UTF_8 ) ; org . apache . fluo . api . data . Bytes little = org . apache . fluo . api . data . Bytes . of ( ba1 ) ; byte [ ] ba2 = new byte [ 1024 ] ; java . util . Arrays . fill ( ba2 , ( ( byte ) ( 42 ) ) ) ; org . apache . fluo . api . data . Bytes big = org . apache . fluo . api . data . Bytes . of ( ba2 ) ; little . writeTo ( out ) ; big . writeTo ( out ) ; byte [ ] expected = new byte [ ( ba1 . length ) + ( ba2 . length ) ] ; java . lang . System . arraycopy ( ba1 , 0 , expected , 0 , ba1 . length ) ; java . lang . System . arraycopy ( ba2 , 0 , expected , ba1 . length , ba2 . length ) ; "<AssertPlaceHolder>" ; out . close ( ) ; } writeTo ( java . io . OutputStream ) { if ( ( length ) <= 32 ) { int end = ( offset ) + ( length ) ; for ( int i = offset ; i < end ; i ++ ) { out . write ( data [ i ] ) ; } } else { out . write ( toArray ( ) ) ; } } | org . junit . Assert . assertArrayEquals ( expected , out . toByteArray ( ) ) |
retrieveService ( ) { org . societies . api . schema . servicelifecycle . model . Service retrievedService = null ; try { retrievedService = serReg . retrieveService ( servicesList . get ( 0 ) . getServiceIdentifier ( ) ) ; } catch ( org . societies . api . internal . servicelifecycle . serviceRegistry . exception . ServiceRetrieveException e ) { e . printStackTrace ( ) ; } "<AssertPlaceHolder>" ; } getServiceName ( ) { return serviceName ; } | org . junit . Assert . assertTrue ( retrievedService . getServiceName ( ) . equals ( servicesList . get ( 0 ) . getServiceName ( ) ) ) |
isSameReturnsTrueWithAnyArgument ( ) { final com . fundynamic . d2tm . game . terrain . impl . EmptyTerrain emptyTerrain = new com . fundynamic . d2tm . game . terrain . impl . EmptyTerrain ( null ) ; "<AssertPlaceHolder>" ; } isSame ( com . fundynamic . d2tm . game . terrain . Terrain ) { if ( terrain instanceof com . fundynamic . d2tm . game . terrain . impl . EmptyTerrain ) return true ; return this . getClass ( ) . equals ( terrain . getClass ( ) ) ; } | org . junit . Assert . assertTrue ( emptyTerrain . isSame ( org . mockito . Mockito . mock ( com . fundynamic . d2tm . game . terrain . Terrain . class ) ) ) |
circuitCollectionDeserializationTest ( ) { org . opennaas . extensions . genericnetwork . test . capability . nclprovisioner . CircuitCollectionSerializationTest . LOG . info ( "CircuitCollection<sp>Deserialization<sp>Test" ) ; java . lang . String expectedXml = org . apache . commons . io . IOUtils . toString ( this . getClass ( ) . getResourceAsStream ( org . opennaas . extensions . genericnetwork . test . capability . nclprovisioner . CircuitCollectionSerializationTest . FILE_PATH ) ) ; org . opennaas . extensions . genericnetwork . capability . nclprovisioner . api . CircuitCollection eCircuitCollection = ( ( org . opennaas . extensions . genericnetwork . capability . nclprovisioner . api . CircuitCollection ) ( org . opennaas . core . resources . ObjectSerializer . fromXml ( expectedXml , org . opennaas . extensions . genericnetwork . capability . nclprovisioner . api . CircuitCollection . class ) ) ) ; org . opennaas . extensions . genericnetwork . capability . nclprovisioner . api . CircuitCollection cCircuitCollection = generateSampleCircuitCollection ( ) ; "<AssertPlaceHolder>" ; } generateSampleCircuitCollection ( ) { org . opennaas . extensions . genericnetwork . capability . nclprovisioner . api . CircuitCollection circuitCollection = new org . opennaas . extensions . genericnetwork . capability . nclprovisioner . api . CircuitCollection ( ) ; java . util . Collection < org . opennaas . extensions . genericnetwork . model . circuit . Circuit > circuits = new java . util . ArrayList < org . opennaas . extensions . genericnetwork . model . circuit . Circuit > ( ) ; org . opennaas . extensions . genericnetwork . model . circuit . Circuit circuitA = generateSampleCircuit ( org . opennaas . extensions . genericnetwork . test . capability . nclprovisioner . CircuitCollectionSerializationTest . CIRCUIT_A_ID ) ; org . opennaas . extensions . genericnetwork . model . circuit . Circuit circuitB = generateSampleCircuit ( org . opennaas . extensions . genericnetwork . test . capability . nclprovisioner . CircuitCollectionSerializationTest . CIRCUIT_B_ID ) ; circuits . add ( circuitA ) ; circuits . add ( circuitB ) ; circuitCollection . setCircuits ( circuits ) ; return circuitCollection ; } | org . junit . Assert . assertEquals ( cCircuitCollection , eCircuitCollection ) |
testDalColumnMapRowMapperList ( ) { try { com . ctrip . platform . dal . dao . helper . StatementParameters parameters = new com . ctrip . platform . dal . dao . helper . StatementParameters ( ) ; com . ctrip . platform . dal . dao . helper . DalQueryDao dao = new com . ctrip . platform . dal . dao . helper . DalQueryDao ( com . ctrip . platform . dal . dao . helper . DalColumnMapRowMapperTest . DATABASE_NAME ) ; java . util . List < java . util . Map < java . lang . String , java . lang . Object > > result = dao . query ( sqlList , parameters , hints , new com . ctrip . platform . dal . dao . helper . DalColumnMapRowMapper ( ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( ) ; } } size ( ) { return allKeys . size ( ) ; } | org . junit . Assert . assertEquals ( 3 , result . size ( ) ) |
testCreateClientRequest ( ) { ru . codeinside . gws3417c . DummyContext ctx = new ru . codeinside . gws3417c . DummyContext ( ) ; ctx . setVariable ( "smevTest" , "0000" 4 ) ; ctx . setVariable ( "smevTest" 4 , "21" 7 ) ; ctx . setVariable ( "21" 8 , "0000" 2 ) ; ctx . setVariable ( "smevTest" 3 , "" ) ; ctx . setVariable ( "21" 4 , "0000" 5 ) ; ctx . setVariable ( "smevTest" 6 , "" ) ; ctx . setVariable ( "smevTest" 2 , "21" ) ; ctx . setVariable ( "smevTest" 8 , "21" 5 ) ; ctx . setVariable ( "0000" 6 , "21" 9 ) ; ctx . setVariable ( "smevTest" 1 , "00000000000" ) ; ctx . setVariable ( "0000" 0 , "01.01.1970" ) ; ctx . setVariable ( "21" 2 , "smevTest" 7 ) ; ctx . setVariable ( "iNameKind" , "" ) ; ctx . setVariable ( "0000" 1 , "0000" 5 ) ; ctx . setVariable ( "21" 0 , "" ) ; ctx . setVariable ( "0000" 3 , "smevTest" 9 ) ; ctx . setVariable ( "smevTest" 0 , "21" 6 ) ; ctx . setVariable ( "21" 3 , "0000" ) ; ctx . setVariable ( "21" 1 , "smevTest" 9 ) ; ctx . setVariable ( "endDate" , "01.01.2001" ) ; ru . codeinside . gws3417c . FssClient fss = new ru . codeinside . gws3417c . FssClient ( ) ; ru . codeinside . gws . api . ClientRequest request = fss . createClientRequest ( ctx ) ; "<AssertPlaceHolder>" ; } createClientRequest ( ru . codeinside . gws3456c . ExchangeContext ) { final java . lang . String originRequestId = ( ( java . lang . String ) ( ctx . getVariable ( "smevOriginRequestId" ) ) ) ; final java . lang . String requestId = ( ( java . lang . String ) ( ctx . getVariable ( "smevRequestId" ) ) ) ; final java . lang . Boolean smevPool = ( ( java . lang . Boolean ) ( ctx . getVariable ( "smevPool" ) ) ) ; final ru . codeinside . gws3456c . Packet packet = new ru . codeinside . gws3456c . Packet ( ) ; packet . recipient = new ru . codeinside . gws3456c . InfoSystem ( "MVDR01001" , "<sp>" ) ; packet . typeCode = Packet . Type . SERVICE ; packet . date = new java . util . Date ( ) ; packet . exchangeType = "2" ; packet . originRequestIdRef = originRequestId ; packet . testMsg = ( ( java . lang . String ) ( ctx . getVariable ( "smevTest" ) ) ) ; packet . serviceCode = "12345678901" ; final ru . codeinside . gws3456c . ClientRequest request = new ru . codeinside . gws3456c . ClientRequest ( ) ; if ( ( Boolean . TRUE ) == smevPool ) { packet . status = Packet . Status . PING ; packet . requestIdRef = requestId ; request . packet = packet ; request . action = new javax . xml . namespace . QName ( "getGIACResponse" 0 , "getGIACResponse" ) ; request . appData = createAppDataForGetResponseOperation ( ctx ) ; } else { java . math . BigInteger caseNumber = generateCaseNumber ( ) ; packet . caseNumber = caseNumber . toString ( ) ; ctx . setVariable ( ru . codeinside . gws3456c . MvdClient3456 . SMEV_INITIAL_REG_NUMBER , caseNumber ) ; ctx . setVariable ( ru . codeinside . gws3456c . MvdClient3456 . SMEV_INITIAL_REG_DATE , new java . util . Date ( ) ) ; request . packet = packet ; request . action = new javax . xml . namespace . QName ( "getGIACResponse" 0 , "sendGIACRequest" ) ; packet . status = Packet . Status . REQUEST ; request . appData = createAppDataForSendRequestOperation ( ctx ) ; } return request ; } | org . junit . Assert . assertTrue ( request . appData . startsWith ( "smevTest" 5 ) ) |
testEnumConstantClass ( ) { com . thoughtworks . qdox . model . JavaField enumConstant = mock ( com . thoughtworks . qdox . model . JavaField . class ) ; when ( enumConstant . isEnumConstant ( ) ) . thenReturn ( true ) ; when ( enumConstant . getName ( ) ) . thenReturn ( "PLUS" ) ; com . thoughtworks . qdox . model . JavaClass cls = mock ( com . thoughtworks . qdox . model . JavaClass . class ) ; com . thoughtworks . qdox . model . JavaMethod eval = mock ( com . thoughtworks . qdox . model . JavaMethod . class ) ; com . thoughtworks . qdox . model . JavaType doubleType = mock ( com . thoughtworks . qdox . model . JavaType . class ) ; when ( doubleType . getGenericCanonicalName ( ) ) . thenReturn ( "double" ) ; when ( eval . getReturnType ( ) ) . thenReturn ( doubleType ) ; when ( eval . getName ( ) ) . thenReturn ( "eval" ) ; java . util . List < com . thoughtworks . qdox . model . JavaParameter > params = new java . util . ArrayList < com . thoughtworks . qdox . model . JavaParameter > ( ) ; com . thoughtworks . qdox . model . JavaParameter x = mock ( com . thoughtworks . qdox . model . JavaParameter . class ) ; when ( x . getGenericCanonicalName ( ) ) . thenReturn ( "double" ) ; when ( x . getName ( ) ) . thenReturn ( "x" ) ; params . add ( x ) ; com . thoughtworks . qdox . model . JavaParameter y = mock ( com . thoughtworks . qdox . model . JavaParameter . class ) ; when ( y . getGenericCanonicalName ( ) ) . thenReturn ( "double" ) ; when ( y . getName ( ) ) . thenReturn ( "y" ) ; params . add ( y ) ; when ( eval . getParameters ( ) ) . thenReturn ( params ) ; when ( cls . getMethods ( ) ) . thenReturn ( java . util . Collections . singletonList ( eval ) ) ; when ( enumConstant . getEnumConstantClass ( ) ) . thenReturn ( cls ) ; java . lang . String expected = "PLUS<sp>{\n" + ( ( ( ( "\n" + "\tdouble<sp>eval(double<sp>x,<sp>double<sp>y);\n" ) + "\n" ) + "}\n" ) + ";\n" ) ; modelWriter . writeField ( enumConstant ) ; "<AssertPlaceHolder>" ; } toString ( ) { return "++" + ( getValue ( ) . toString ( ) ) ; } | org . junit . Assert . assertEquals ( expected , modelWriter . toString ( ) ) |
testGetAll ( ) { com . example . resource . TIResourceJtfTest . LOGGER . debug ( ">>Test<sp>Get<sp>All" ) ; final javax . ws . rs . client . Invocation . Builder invocationBuilder = target ( com . example . resource . TIResourceJtfTest . BASEURI ) . request ( ) ; final com . example . domain . Books result = invocationBuilder . get ( com . example . domain . Books . class ) ; com . example . resource . TIResourceJtfTest . LOGGER . debug ( result . getBookList ( ) ) ; "<AssertPlaceHolder>" ; com . example . resource . TIResourceJtfTest . LOGGER . debug ( "<<Test<sp>Get<sp>All" ) ; } get ( java . lang . String ) { com . example . domain . Device result = null ; if ( deviceIp != null ) { result = deviceDao . getDevice ( deviceIp ) ; } return result ; } | org . junit . Assert . assertNotNull ( result . getBookList ( ) ) |
canHandleMaximumValueIntegersAndMinimumValue ( ) { givenDivisionShare ( new org . libreplan . business . planner . entities . Share ( Integer . MIN_VALUE ) , new org . libreplan . business . planner . entities . Share ( Integer . MAX_VALUE ) , new org . libreplan . business . planner . entities . Share ( Integer . MAX_VALUE ) , new org . libreplan . business . planner . entities . Share ( Integer . MIN_VALUE ) , new org . libreplan . business . planner . entities . Share ( Integer . MIN_VALUE ) , new org . libreplan . business . planner . entities . Share ( Integer . MAX_VALUE ) ) ; org . libreplan . business . planner . entities . ShareDivision plus = shareDivision . plus ( 9 ) ; int [ ] difference = shareDivision . to ( plus ) ; "<AssertPlaceHolder>" ; } to ( org . libreplan . business . planner . entities . ShareDivision ) { org . apache . commons . lang3 . Validate . isTrue ( ( ( shares . size ( ) ) == ( newDivison . shares . size ( ) ) ) ) ; int [ ] result = new int [ shares . size ( ) ] ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { result [ i ] = ( newDivison . shares . get ( i ) . getHours ( ) ) - ( shares . get ( i ) . getHours ( ) ) ; } return result ; } | org . junit . Assert . assertArrayEquals ( new int [ ] { 3 , 0 , 0 , 3 , 3 , 0 } , difference ) |
testWithReduce ( ) { final java . lang . String reduce = "reduce" ; final org . apache . oozie . fluentjob . api . action . PipesBuilder builder = new org . apache . oozie . fluentjob . api . action . PipesBuilder ( ) ; builder . withReduce ( reduce ) ; final org . apache . oozie . fluentjob . api . action . Pipes pipes = builder . build ( ) ; "<AssertPlaceHolder>" ; } getReduce ( ) { return reduce ; } | org . junit . Assert . assertEquals ( reduce , pipes . getReduce ( ) ) |
verificationInputTest ( ) { org . openkilda . northbound . dto . v1 . flows . PingInput dto = new org . openkilda . northbound . dto . v1 . flows . PingInput ( 10 ) ; "<AssertPlaceHolder>" ; } pass ( T , java . lang . Class ) { return mapper . readValue ( mapper . writeValueAsString ( entity ) , clazz ) ; } | org . junit . Assert . assertEquals ( dto , pass ( dto , org . openkilda . northbound . dto . v1 . flows . PingInput . class ) ) |
testFilterByVersionAll ( ) { codeine . version . ViewNodesFilter tested = new codeine . version . ViewNodesFilter ( codeine . model . Constants . ALL_VERSION , 1 , null , 0 ) ; "<AssertPlaceHolder>" ; } filter ( java . lang . String , java . lang . String ) { codeine . version . ViewNodesFilter . log . debug ( ( "filterByVersion()<sp>-<sp>version<sp>is<sp>" + version ) ) ; if ( null != ( m_paramVersion ) ) { if ( ( versionNotMatch ( version ) ) || ( ( m_count ) >= ( m_paramMax ) ) ) { return true ; } } if ( null != ( regexp ) ) { if ( regexpNotMatch ( alias ) ) { return true ; } } if ( ( m_skipCount ) < ( paramSkip ) ) { ( m_skipCount ) ++ ; return true ; } ( m_count ) ++ ; return false ; } | org . junit . Assert . assertFalse ( tested . filter ( null , null ) ) |
testRandomString ( ) { java . util . Random random = new java . util . Random ( 42 ) ; java . util . Set < java . lang . String > strings = new java . util . TreeSet < java . lang . String > ( ) ; for ( int i = 0 ; i < 100000 ; i ++ ) { java . lang . String s = com . cedarsoftware . util . StringUtilities . getRandomString ( random , 3 , 9 ) ; strings . add ( s ) ; } for ( java . lang . String s : strings ) { "<AssertPlaceHolder>" ; } } add ( E ) { int size = map . size ( ) ; map . put ( e , e ) ; return ( map . size ( ) ) != size ; } | org . junit . Assert . assertTrue ( ( ( ( s . length ( ) ) >= 3 ) && ( ( s . length ( ) ) <= 9 ) ) ) |
testAddEmail ( ) { store . addEmail ( org . codice . ddf . catalog . ui . query . monitor . impl . SubscriptionsPersistentStoreImplTest . IDSTRING , org . codice . ddf . catalog . ui . query . monitor . impl . SubscriptionsPersistentStoreImplTest . EMAIL1 ) ; java . util . Set < java . lang . String > results = store . getEmails ( org . codice . ddf . catalog . ui . query . monitor . impl . SubscriptionsPersistentStoreImplTest . IDSTRING ) ; "<AssertPlaceHolder>" ; } getEmails ( java . lang . String ) { return java . util . Collections . singleton ( emailAddress ) ; } | org . junit . Assert . assertThat ( results , org . hamcrest . Matchers . is ( java . util . Collections . singleton ( org . codice . ddf . catalog . ui . query . monitor . impl . SubscriptionsPersistentStoreImplTest . EMAIL1 ) ) ) |
doNotCreateCenterWhenNorthIsOffCenter ( ) { org . openscience . cdk . interfaces . IAtom focus = org . openscience . cdk . stereo . FischerRecognitionTest . atom ( "C" , 0 , 0.8 , 0.42 ) ; org . openscience . cdk . interfaces . IAtom north = org . openscience . cdk . stereo . FischerRecognitionTest . atom ( "C" , 0 , 1.0 , 1.24 ) ; org . openscience . cdk . interfaces . IAtom east = org . openscience . cdk . stereo . FischerRecognitionTest . atom ( "O" , 1 , 1.63 , 0.42 ) ; org . openscience . cdk . interfaces . IAtom south = org . openscience . cdk . stereo . FischerRecognitionTest . atom ( "C" , 2 , 0.8 , ( - 0.41 ) ) ; org . openscience . cdk . interfaces . IAtom west = org . openscience . cdk . stereo . FischerRecognitionTest . atom ( "H" , 0 , ( - 0.02 ) , 0.42 ) ; org . openscience . cdk . interfaces . IBond [ ] bonds = new org . openscience . cdk . interfaces . IBond [ ] { new org . openscience . cdk . silent . Bond ( focus , north ) , new org . openscience . cdk . silent . Bond ( focus , south ) , new org . openscience . cdk . silent . Bond ( focus , west ) , new org . openscience . cdk . silent . Bond ( focus , east ) } ; org . openscience . cdk . interfaces . ITetrahedralChirality element = org . openscience . cdk . stereo . FischerRecognition . newTetrahedralCenter ( focus , bonds ) ; "<AssertPlaceHolder>" ; } newTetrahedralCenter ( org . openscience . cdk . interfaces . IAtom , org . openscience . cdk . interfaces . IBond [ ] ) { org . openscience . cdk . interfaces . IBond [ ] cardinalBonds = org . openscience . cdk . stereo . FischerRecognition . cardinalBonds ( focus , bonds ) ; if ( cardinalBonds == null ) return null ; if ( ( ! ( org . openscience . cdk . stereo . FischerRecognition . isPlanarSigmaBond ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . NORTH ] ) ) ) || ( ! ( org . openscience . cdk . stereo . FischerRecognition . isPlanarSigmaBond ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . SOUTH ] ) ) ) ) return null ; if ( ( ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . EAST ] ) == null ) && ( ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . WEST ] ) == null ) ) return null ; org . openscience . cdk . interfaces . IAtom [ ] neighbors = new org . openscience . cdk . interfaces . IAtom [ ] { cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . NORTH ] . getOther ( focus ) , focus , cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . SOUTH ] . getOther ( focus ) , focus } ; if ( org . openscience . cdk . stereo . FischerRecognition . isPlanarSigmaBond ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . EAST ] ) ) { neighbors [ org . openscience . cdk . stereo . FischerRecognition . EAST ] = cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . EAST ] . getOther ( focus ) ; } else if ( ( ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . EAST ] ) != null ) || ( ( bonds . length ) == 4 ) ) { return null ; } if ( org . openscience . cdk . stereo . FischerRecognition . isPlanarSigmaBond ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . WEST ] ) ) { neighbors [ org . openscience . cdk . stereo . FischerRecognition . WEST ] = cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . WEST ] . getOther ( focus ) ; } else if ( ( ( cardinalBonds [ org . openscience . cdk . stereo . FischerRecognition . WEST ] ) != null ) || ( ( bonds . length ) == 4 ) ) { return null ; } return new org . openscience . cdk . stereo . TetrahedralChirality ( focus , neighbors , Stereo . ANTI_CLOCKWISE ) ; } | org . junit . Assert . assertNull ( element ) |
testGetCodersWrong ( ) { java . util . List < org . apache . hadoop . io . erasurecode . rawcoder . RawErasureCoderFactory > coders = org . apache . hadoop . io . erasurecode . CodecRegistry . getInstance ( ) . getCoders ( "WRONG_CODEC" ) ; "<AssertPlaceHolder>" ; } getCoders ( java . lang . String ) { java . util . List < org . apache . hadoop . io . erasurecode . rawcoder . RawErasureCoderFactory > coders = coderMap . get ( codecName ) ; return coders ; } | org . junit . Assert . assertNull ( coders ) |
getRealm ( ) { com . ibm . websphere . simplicity . log . Log . info ( com . ibm . ws . security . wim . adapter . ldap . fat . URAPIs_ADLDAP_NoIdTest . c , "getRealm" , "Checking<sp>expected<sp>realm" ) ; "<AssertPlaceHolder>" ; } getRealm ( ) { com . ibm . websphere . simplicity . log . Log . info ( com . ibm . ws . security . wim . adapter . ldap . fat . URAPIs_ADLDAP_NoIdTest . c , "getRealm" , "Checking<sp>expected<sp>realm" ) ; org . junit . Assert . assertEquals ( "ADNoIdRealm" , com . ibm . ws . security . wim . adapter . ldap . fat . URAPIs_ADLDAP_NoIdTest . servlet . getRealm ( ) ) ; } | org . junit . Assert . assertEquals ( "ADNoIdRealm" , com . ibm . ws . security . wim . adapter . ldap . fat . URAPIs_ADLDAP_NoIdTest . servlet . getRealm ( ) ) |
testWrite ( ) { java . util . Map < java . lang . String , java . lang . String > ddmFormFieldsLabel = java . util . Collections . emptyMap ( ) ; java . util . List < java . util . Map < java . lang . String , java . lang . String > > ddmFormFieldValues = new java . util . ArrayList ( ) { { java . util . Map < java . lang . String , java . lang . String > map1 = new java . util . HashMap ( ) { { put ( "field1" , "2" ) ; } } ; add ( map1 ) ; java . util . Map < java . lang . String , java . lang . String > map2 = new java . util . HashMap ( ) { { put ( "field1" , "1" ) ; } } ; add ( map2 ) ; } } ; com . liferay . dynamic . data . mapping . io . exporter . DDMFormInstanceRecordWriterRequest . Builder builder = DDMFormInstanceRecordWriterRequest . Builder . newBuilder ( ddmFormFieldsLabel , ddmFormFieldValues ) ; com . liferay . dynamic . data . mapping . io . exporter . DDMFormInstanceRecordWriterRequest ddmFormInstanceRecordWriterRequest = builder . build ( ) ; com . liferay . dynamic . data . mapping . io . internal . exporter . DDMFormInstanceRecordXLSWriter ddmFormInstanceRecordXLSWriter = mock ( com . liferay . dynamic . data . mapping . io . internal . exporter . DDMFormInstanceRecordXLSWriter . class ) ; java . io . ByteArrayOutputStream byteArrayOutputStream = mock ( java . io . ByteArrayOutputStream . class ) ; when ( ddmFormInstanceRecordXLSWriter . createByteArrayOutputStream ( ) ) . thenReturn ( byteArrayOutputStream ) ; when ( byteArrayOutputStream . toByteArray ( ) ) . thenReturn ( new byte [ ] { 1 , 2 , 3 } ) ; org . apache . poi . ss . usermodel . Workbook workbook = mock ( org . apache . poi . ss . usermodel . Workbook . class ) ; when ( ddmFormInstanceRecordXLSWriter . createWorkbook ( ) ) . thenReturn ( workbook ) ; org . mockito . Mockito . doNothing ( ) . when ( workbook ) . write ( byteArrayOutputStream ) ; when ( ddmFormInstanceRecordXLSWriter . write ( ddmFormInstanceRecordWriterRequest ) ) . thenCallRealMethod ( ) ; com . liferay . dynamic . data . mapping . io . exporter . DDMFormInstanceRecordWriterResponse ddmFormInstanceRecordWriterResponse = ddmFormInstanceRecordXLSWriter . write ( builder . build ( ) ) ; "<AssertPlaceHolder>" ; org . mockito . InOrder inOrder = org . mockito . Mockito . inOrder ( ddmFormInstanceRecordXLSWriter , workbook , byteArrayOutputStream ) ; inOrder . verify ( workbook , org . mockito . Mockito . times ( 1 ) ) . createSheet ( ) ; inOrder . verify ( ddmFormInstanceRecordXLSWriter , org . mockito . Mockito . times ( 1 ) ) . createCellStyle ( org . mockito . Matchers . any ( org . apache . poi . ss . usermodel . Workbook . class ) , org . mockito . Matchers . anyBoolean ( ) , org . mockito . Matchers . anyString ( ) , org . mockito . Matchers . anyByte ( ) ) ; inOrder . verify ( ddmFormInstanceRecordXLSWriter , org . mockito . Mockito . times ( 1 ) ) . createRow ( org . mockito . Matchers . anyInt ( ) , org . mockito . Matchers . any ( org . apache . poi . ss . usermodel . CellStyle . class ) , org . mockito . Matchers . anyCollection ( ) , org . mockito . Matchers . any ( org . apache . poi . ss . usermodel . Sheet . class ) ) ; inOrder . verify ( ddmFormInstanceRecordXLSWriter , org . mockito . Mockito . times ( 1 ) ) . createCellStyle ( org . mockito . Matchers . any ( org . apache . poi . ss . usermodel . Workbook . class ) , org . mockito . Matchers . anyBoolean ( ) , org . mockito . Matchers . anyString ( ) , org . mockito . Matchers . anyByte ( ) ) ; inOrder . verify ( ddmFormInstanceRecordXLSWriter , org . mockito . Mockito . times ( 2 ) ) . createRow ( org . mockito . Matchers . anyInt ( ) , org . mockito . Matchers . any ( org . apache . poi . ss . usermodel . CellStyle . class ) , org . mockito . Matchers . anyCollection ( ) , org . mockito . Matchers . any ( org . apache . poi . ss . usermodel . Sheet . class ) ) ; inOrder . verify ( workbook , org . mockito . Mockito . times ( 1 ) ) . write ( byteArrayOutputStream ) ; inOrder . verify ( byteArrayOutputStream , org . mockito . Mockito . times ( 1 ) ) . toByteArray ( ) ; } getContent ( ) { return content ; } | org . junit . Assert . assertArrayEquals ( new byte [ ] { 1 , 2 , 3 } , ddmFormInstanceRecordWriterResponse . getContent ( ) ) |
testGetAll ( ) { final javax . ws . rs . client . Invocation . Builder invocationBuilder = target ( com . example . resource . TestNamingBinding . BASE_URI ) . request ( ) ; final com . example . domain . Books result = invocationBuilder . get ( com . example . domain . Books . class ) ; "<AssertPlaceHolder>" ; } getBookList ( ) { return bookList ; } | org . junit . Assert . assertNotNull ( result . getBookList ( ) ) |
testCompleteTask ( ) { org . camunda . bpm . engine . cdi . BusinessProcess businessProcess = getBeanInstance ( org . camunda . bpm . engine . cdi . BusinessProcess . class ) ; businessProcess . startProcessByKey ( "keyOfTheProcess" ) ; org . camunda . bpm . engine . task . Task task = taskService . createTaskQuery ( ) . singleResult ( ) ; businessProcess . startTask ( task . getId ( ) ) ; getBeanInstance ( org . camunda . bpm . engine . cdi . test . impl . beans . DeclarativeProcessController . class ) . completeTask ( ) ; "<AssertPlaceHolder>" ; } createTaskQuery ( ) { return new org . camunda . bpm . engine . impl . TaskQueryImpl ( commandExecutor ) ; } | org . junit . Assert . assertNull ( taskService . createTaskQuery ( ) . singleResult ( ) ) |
shouldFindPostsAllPostsWithDynamicSql ( ) { org . apache . ibatis . session . SqlSession session = org . apache . ibatis . session . SqlSessionTest . sqlMapper . openSession ( ) ; try { java . util . List < org . apache . ibatis . domain . blog . Post > posts = session . selectList ( "org.apache.ibatis.domain.blog.mappers.PostMapper.findPost" ) ; "<AssertPlaceHolder>" ; } finally { session . close ( ) ; } } size ( ) { return loaderMap . size ( ) ; } | org . junit . Assert . assertEquals ( 5 , posts . size ( ) ) |
testSort2 ( ) { int [ ] input = new int [ ] { 1 , 2 , 3 } ; int [ ] result = new int [ ] { 1 , 2 , 3 } ; chapter3 . bubblesort . JaegyuBubbleSort bubbleSort = new chapter3 . bubblesort . JaegyuBubbleSort ( ) ; "<AssertPlaceHolder>" ; } sort ( int [ ] ) { int p = 0 ; int r = ( input . length ) - 1 ; this . mergeSort ( input , p , r ) ; return input ; } | org . junit . Assert . assertArrayEquals ( result , bubbleSort . sort ( input ) ) |
testGetVariablePrefix ( ) { System . out . println ( "getVariablePrefix" ) ; kg . apc . jmeter . config . VariablesFromCSV instance = new kg . apc . jmeter . config . VariablesFromCSV ( ) ; java . lang . String expResult = "" ; java . lang . String result = instance . getVariablePrefix ( ) ; "<AssertPlaceHolder>" ; } getVariablePrefix ( ) { return getPropertyAsString ( kg . apc . jmeter . config . VariablesFromCSV . VARIABLE_PREFIX ) ; } | org . junit . Assert . assertEquals ( expResult , result ) |
equals_null ( ) { final net . sf . qualitycheck . immutableobject . domain . Interface a = net . sf . qualitycheck . immutableobject . domain . Interface . of ( java . io . Serializable . class ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } final net . sf . qualitycheck . ConditionalCheckTest . NotEqual other = ( ( net . sf . qualitycheck . ConditionalCheckTest . NotEqual ) ( obj ) ) ; if ( ( value ) != ( other . value ) ) { return false ; } return true ; } | org . junit . Assert . assertFalse ( a . equals ( null ) ) |
findAllTest ( ) { java . util . List < sample . springboot . mybatis . defaultconfig . service . Member > members = memberMapper . findAll ( ) ; sample . springboot . mybatis . defaultconfig . SpringDemoApplicationTests . log . debug ( "members<sp>:<sp>{}" , members ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertThat ( members . size ( ) , is ( 2 ) ) |
disallowWriteLockedPageToExplicitlyLowerModifiedFlag ( ) { pageList . unlockExclusive ( pageRef ) ; "<AssertPlaceHolder>" ; pageList . explicitlyMarkPageUnmodifiedUnderExclusiveLock ( pageRef ) ; } tryWriteLock ( long ) { long s ; long n ; for ( ; ; ) { s = org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . getState ( address ) ; boolean unwritablyLocked = ( s & ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . EXL_MASK ) ) != 0 ; boolean writeCountOverflow = ( s & ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . CNT_MASK ) ) == ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . CNT_MASK ) ; if ( unwritablyLocked | writeCountOverflow ) { return org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . failWriteLock ( s , writeCountOverflow ) ; } n = ( s + ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . CNT_UNIT ) ) | ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . MOD_MASK ) ; if ( org . neo4j . io . pagecache . impl . muninn . OffHeapPageLock . compareAndSetState ( address , s , n ) ) { org . neo4j . unsafe . impl . internal . dragons . UnsafeUtil . storeFence ( ) ; return true ; } } } | org . junit . Assert . assertTrue ( pageList . tryWriteLock ( pageRef ) ) |
testReadWithBuffer ( ) { java . lang . String script = "long<sp>do<sp>part<sp>123456789012345678901234567890\n" + ( "--//@UNDO\n" + "undo<sp>part\n" ) ; org . apache . ibatis . migration . MigrationReader reader = new org . apache . ibatis . migration . MigrationReader ( strToInputStream ( script , org . apache . ibatis . migration . MigrationReaderTest . charset ) , org . apache . ibatis . migration . MigrationReaderTest . charset , false , null ) ; try { java . lang . StringBuilder buffer = new java . lang . StringBuilder ( ) ; char [ ] cbuf = new char [ 30 ] ; int res ; while ( ( res = reader . read ( cbuf ) ) != ( - 1 ) ) { buffer . append ( ( res == ( cbuf . length ) ? cbuf : java . util . Arrays . copyOf ( cbuf , res ) ) ) ; } "<AssertPlaceHolder>" ; } finally { reader . close ( ) ; } } toString ( ) { return ( ( ( ( id ) + "<sp>" ) + ( ( appliedTimestamp ) == null ? "<sp>...pending...<sp>" : appliedTimestamp ) ) + "<sp>" ) + ( description ) ; } | org . junit . Assert . assertEquals ( "long<sp>do<sp>part<sp>123456789012345678901234567890\n" , buffer . toString ( ) ) |
testAbortShutdownWithReason ( ) { java . lang . String r = "dummy<sp>reason" ; final org . cytoscape . application . events . CyShutdownEvent e = new org . cytoscape . application . events . CyShutdownEvent ( source ) ; e . abortShutdown ( r ) ; "<AssertPlaceHolder>" ; } abortShutdownReason ( ) { return reason ; } | org . junit . Assert . assertEquals ( e . abortShutdownReason ( ) , r ) |
sendWithNullDateShouldForceAValue ( ) { net . jforum . entities . PrivateMessage pm = new net . jforum . entities . PrivateMessage ( ) ; pm . setFromUser ( new net . jforum . entities . User ( ) ) ; pm . setToUser ( new net . jforum . entities . User ( ) ) ; pm . setText ( "text" ) ; pm . setSubject ( "subject" ) ; pm . setDate ( null ) ; service . send ( pm ) ; "<AssertPlaceHolder>" ; } getDate ( ) { return this . date ; } | org . junit . Assert . assertNotNull ( pm . getDate ( ) ) |
shouldDisableCleanUpDuringProcess ( ) { final java . util . UUID stepMarker = java . util . UUID . randomUUID ( ) ; final org . talend . dataprep . maintenance . preparation . StepMarker marker = new org . talend . dataprep . maintenance . preparation . PreparationStepMarker ( ) ; final org . talend . dataprep . preparation . store . PreparationRepository repository = mock ( org . talend . dataprep . preparation . store . PreparationRepository . class ) ; when ( repository . exist ( eq ( org . talend . dataprep . api . preparation . Preparation . class ) , any ( ) ) ) . thenReturn ( false , true ) ; final org . talend . dataprep . api . preparation . Preparation preparation = new org . talend . dataprep . api . preparation . Preparation ( ) ; when ( repository . list ( eq ( org . talend . dataprep . api . preparation . Preparation . class ) ) ) . thenReturn ( java . util . stream . Stream . of ( preparation ) ) ; final org . talend . dataprep . maintenance . preparation . StepMarker . Result result = marker . mark ( repository , stepMarker ) ; "<AssertPlaceHolder>" ; verify ( repository , never ( ) ) . add ( org . mockito . Matchers . < java . util . Collection < org . talend . dataprep . api . preparation . Step > > any ( ) ) ; } mark ( org . talend . dataprep . preparation . store . PreparationRepository , java . util . UUID ) { if ( repository . exist ( org . talend . dataprep . api . preparation . Preparation . class , recentlyModified ( ) ) ) { org . talend . dataprep . maintenance . preparation . PreparationStepMarker . LOGGER . info ( "Not<sp>running<sp>clean<sp>up<sp>(at<sp>least<sp>a<sp>preparation<sp>modified<sp>within<sp>last<sp>hour)." ) ; logRecentlyModified ( repository ) ; return Result . INTERRUPTED ; } final java . util . concurrent . atomic . AtomicBoolean interrupted = new java . util . concurrent . atomic . AtomicBoolean ( false ) ; repository . list ( org . talend . dataprep . api . preparation . Preparation . class ) . filter ( ( p ) -> ! ( interrupted . get ( ) ) ) . forEach ( ( p ) -> { if ( repository . exist ( . class , recentlyModified ( ) ) ) { org . talend . dataprep . maintenance . preparation . PreparationStepMarker . LOGGER . info ( "Interrupting<sp>clean<sp>up<sp>(preparation<sp>modified<sp>within<sp>last<sp>hour)." ) ; logRecentlyModified ( repository ) ; interrupted . set ( true ) ; return ; } final Collection < org . talend . dataprep . api . preparation . Identifiable > markedSteps = p . getSteps ( ) . stream ( ) . filter ( ( s ) -> ! ( java . util . Objects . equals ( s , Step . ROOT_STEP ) ) ) . peek ( ( s ) -> s . setMarker ( marker . toString ( ) ) ) . collect ( java . util . stream . Collectors . toList ( ) ) ; repository . add ( markedSteps ) ; } ) ; return interrupted . get ( ) ? Result . INTERRUPTED : Result . COMPLETED ; } | org . junit . Assert . assertEquals ( StepMarker . Result . INTERRUPTED , result ) |
testSetsResponseInContextOnCacheHit ( ) { final org . apache . hc . client5 . http . impl . cache . DummyBackend backend = new org . apache . hc . client5 . http . impl . cache . DummyBackend ( ) ; final org . apache . hc . core5 . http . ClassicHttpResponse response = org . apache . hc . client5 . http . impl . cache . HttpTestUtils . make200Response ( ) ; response . setHeader ( "Cache-Control" , "max-age=3600" ) ; backend . setResponse ( response ) ; impl = createCachingExecChain ( new org . apache . hc . client5 . http . impl . cache . BasicHttpCache ( ) , CacheConfig . DEFAULT ) ; final org . apache . hc . client5 . http . protocol . HttpClientContext ctx = org . apache . hc . client5 . http . protocol . HttpClientContext . create ( ) ; impl . execute ( request , new org . apache . hc . client5 . http . classic . ExecChain . Scope ( "test" , route , request , mockEndpoint , context ) , backend ) ; final org . apache . hc . core5 . http . ClassicHttpResponse result = impl . execute ( request , new org . apache . hc . client5 . http . classic . ExecChain . Scope ( "test" , route , request , mockEndpoint , ctx ) , null ) ; if ( ! ( org . apache . hc . client5 . http . impl . cache . HttpTestUtils . equivalent ( result , ctx . getResponse ( ) ) ) ) { "<AssertPlaceHolder>" ; } } getResponse ( ) { return new java . lang . String ( org . apache . commons . codec . binary . Base64 . encodeBase64 ( getBytes ( ) ) , java . nio . charset . StandardCharsets . US_ASCII ) ; } | org . junit . Assert . assertSame ( result , ctx . getResponse ( ) ) |
following ( ) { java . util . List < com . foxinmy . weixin4j . mp . model . User > userList = userApi . getAllFollowing ( ) ; for ( com . foxinmy . weixin4j . mp . model . User user : userList ) { System . out . println ( user ) ; } "<AssertPlaceHolder>" ; } isEmpty ( ) { return this . headers . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( ( ! ( userList . isEmpty ( ) ) ) ) |
testVariableBuilder ( ) { org . androidtransfuse . gen . InjectionNode injectionNode = buildInjectionNode ( org . androidtransfuse . gen . VariableBuilderInjectable . class ) ; org . androidtransfuse . gen . ASTType containingType = astClassFactory . getType ( org . androidtransfuse . gen . VariableBuilderInjectable . class ) ; org . androidtransfuse . gen . ASTField field = getField ( "target" , containingType ) ; org . androidtransfuse . gen . FieldInjectionPoint fieldInjectionPoint = new org . androidtransfuse . gen . FieldInjectionPoint ( containingType , containingType , field , buildInjectionNode ( org . androidtransfuse . gen . VariableTarget . class ) ) ; getInjectionAspect ( injectionNode ) . addGroup ( ) . add ( fieldInjectionPoint ) ; injectionNodeBuilderRepository . putType ( org . androidtransfuse . gen . VariableTarget . class , new org . androidtransfuse . gen . variableBuilder . InjectionNodeBuilder ( ) { @ org . androidtransfuse . gen . Override public org . androidtransfuse . gen . InjectionNode buildInjectionNode ( org . androidtransfuse . gen . ASTBase target , org . androidtransfuse . gen . InjectionSignature signature , org . androidtransfuse . analysis . AnalysisContext context ) { return analyzer . analyze ( signature , context ) ; } } ) ; org . androidtransfuse . gen . VariableBuilderInjectable vbInjectable = buildInstance ( org . androidtransfuse . gen . VariableBuilderInjectable . class , injectionNode ) ; "<AssertPlaceHolder>" ; } getTarget ( ) { return target ; } | org . junit . Assert . assertNotNull ( vbInjectable . getTarget ( ) ) |
deleteDomainPresenceWithTimeCheck_doNotDelete_with_older_DateTime ( ) { org . joda . time . DateTime CREATION_DATETIME = org . joda . time . DateTime . now ( ) ; io . kubernetes . client . models . V1ObjectMeta domainMeta = createMetadata ( CREATION_DATETIME ) ; org . joda . time . DateTime DELETE_DATETIME = CREATION_DATETIME . minusMinutes ( 1 ) ; io . kubernetes . client . models . V1ObjectMeta domain2Meta = createMetadata ( DELETE_DATETIME ) ; "<AssertPlaceHolder>" ; } isFirstNewer ( io . kubernetes . client . models . V1ObjectMeta , io . kubernetes . client . models . V1ObjectMeta ) { if ( second == null ) return true ; if ( first == null ) return false ; org . joda . time . DateTime time1 = first . getCreationTimestamp ( ) ; org . joda . time . DateTime time2 = second . getCreationTimestamp ( ) ; if ( time1 . equals ( time2 ) ) { return ( oracle . kubernetes . operator . helpers . KubernetesUtils . getResourceVersion ( first ) ) > ( oracle . kubernetes . operator . helpers . KubernetesUtils . getResourceVersion ( second ) ) ; } else { return time1 . isAfter ( time2 ) ; } } | org . junit . Assert . assertTrue ( oracle . kubernetes . operator . helpers . KubernetesUtils . isFirstNewer ( domainMeta , domain2Meta ) ) |
testRemoveSchema3 ( ) { java . lang . String sql = "update<sp>testx.test<sp>set<sp>testx.name='abcd<sp>testx.aa'<sp>where<sp>testx.id=1" ; java . lang . String sqltrue = "update<sp>test<sp>set<sp>name='abcd<sp>testx.aa'<sp>where<sp>id=1" ; java . lang . String sqlnew = io . mycat . route . util . RouterUtil . removeSchema ( sql , "testx" ) ; "<AssertPlaceHolder>" ; } removeSchema ( java . lang . String , java . lang . String ) { final java . lang . String upStmt = stmt . toUpperCase ( ) ; final java . lang . String upSchema = ( schema . toUpperCase ( ) ) + "." ; final java . lang . String upSchema2 = new java . lang . StringBuilder ( "`" ) . append ( schema . toUpperCase ( ) ) . append ( "`." ) . toString ( ) ; int strtPos = 0 ; int indx = 0 ; int indx1 = upStmt . indexOf ( upSchema , strtPos ) ; int indx2 = upStmt . indexOf ( upSchema2 , strtPos ) ; boolean flag = ( indx1 < indx2 ) ? indx1 == ( - 1 ) : indx2 != ( - 1 ) ; indx = ( ! flag ) ? indx1 > 0 ? indx1 : indx2 : indx2 > 0 ? indx2 : indx1 ; if ( indx < 0 ) { return stmt ; } int firstE = upStmt . indexOf ( "'" ) ; int endE = upStmt . lastIndexOf ( "'" ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; while ( indx > 0 ) { sb . append ( stmt . substring ( strtPos , indx ) ) ; if ( flag ) { strtPos = indx + ( upSchema2 . length ( ) ) ; } else { strtPos = indx + ( upSchema . length ( ) ) ; } if ( ( ( indx > firstE ) && ( indx < endE ) ) && ( ( ( io . mycat . route . util . RouterUtil . countChar ( stmt , indx ) ) % 2 ) == 1 ) ) { sb . append ( stmt . substring ( indx , ( ( indx + ( schema . length ( ) ) ) + 1 ) ) ) ; } indx1 = upStmt . indexOf ( upSchema , strtPos ) ; indx2 = upStmt . indexOf ( upSchema2 , strtPos ) ; flag = ( indx1 < indx2 ) ? indx1 == ( - 1 ) : indx2 != ( - 1 ) ; indx = ( ! flag ) ? indx1 > 0 ? indx1 : indx2 : indx2 > 0 ? indx2 : indx1 ; } sb . append ( stmt . substring ( strtPos ) ) ; return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( "" , sqltrue , sqlnew ) |
testGetPath ( ) { net . holmes . core . business . configuration . model . ConfigurationNode node = new net . holmes . core . business . configuration . model . ConfigurationNode ( "id" , "label" , "path" ) ; "<AssertPlaceHolder>" ; } getPath ( ) { return path ; } | org . junit . Assert . assertEquals ( node . getPath ( ) , "path" ) |
testPutConcurrentModificationOnIteration ( ) { org . apache . hadoop . hbase . client . Put p = new org . apache . hadoop . hbase . client . Put ( org . apache . hadoop . hbase . client . TestPutDeleteEtcCellIteration . ROW ) ; for ( int i = 0 ; i < ( org . apache . hadoop . hbase . client . TestPutDeleteEtcCellIteration . COUNT ) ; i ++ ) { byte [ ] bytes = org . apache . hadoop . hbase . util . Bytes . toBytes ( i ) ; p . addColumn ( bytes , bytes , org . apache . hadoop . hbase . client . TestPutDeleteEtcCellIteration . TIMESTAMP , bytes ) ; } int index = 0 ; int trigger = 3 ; for ( org . apache . hadoop . hbase . CellScanner cellScanner = p . cellScanner ( ) ; cellScanner . advance ( ) ; ) { org . apache . hadoop . hbase . Cell cell = cellScanner . current ( ) ; byte [ ] bytes = org . apache . hadoop . hbase . util . Bytes . toBytes ( ( index ++ ) ) ; if ( trigger == 3 ) p . addColumn ( bytes , bytes , org . apache . hadoop . hbase . client . TestPutDeleteEtcCellIteration . TIMESTAMP , bytes ) ; cell . equals ( new org . apache . hadoop . hbase . KeyValue ( org . apache . hadoop . hbase . client . TestPutDeleteEtcCellIteration . ROW , bytes , bytes , org . apache . hadoop . hbase . client . TestPutDeleteEtcCellIteration . TIMESTAMP , bytes ) ) ; } "<AssertPlaceHolder>" ; } addColumn ( byte [ ] , byte [ ] , long , byte [ ] ) { if ( ts < 0 ) { throw new java . lang . IllegalArgumentException ( ( "Timestamp<sp>cannot<sp>be<sp>negative.<sp>ts=" + ts ) ) ; } java . util . List < org . apache . hadoop . hbase . Cell > list = getCellList ( family ) ; org . apache . hadoop . hbase . KeyValue kv = createPutKeyValue ( family , qualifier , ts , value ) ; list . add ( kv ) ; return this ; } | org . junit . Assert . assertEquals ( org . apache . hadoop . hbase . client . TestPutDeleteEtcCellIteration . COUNT , index ) |
testBCUT ( ) { java . lang . String filename = "data/hin/gravindex.hin" ; java . io . InputStream ins = this . getClass ( ) . getClassLoader ( ) . getResourceAsStream ( filename ) ; org . openscience . cdk . io . ISimpleChemObjectReader reader = new org . openscience . cdk . io . HINReader ( ins ) ; org . openscience . cdk . ChemFile content = ( ( org . openscience . cdk . ChemFile ) ( reader . read ( ( ( org . openscience . cdk . ChemObject ) ( new org . openscience . cdk . ChemFile ( ) ) ) ) ) ) ; java . util . List cList = org . openscience . cdk . tools . manipulator . ChemFileManipulator . getAllAtomContainers ( content ) ; org . openscience . cdk . interfaces . IAtomContainer ac = ( ( org . openscience . cdk . interfaces . IAtomContainer ) ( cList . get ( 0 ) ) ) ; java . lang . Object [ ] params = new java . lang . Object [ 3 ] ; params [ 0 ] = 2 ; params [ 1 ] = 2 ; params [ 2 ] = true ; descriptor . setParameters ( params ) ; org . openscience . cdk . qsar . DescriptorValue descriptorValue = descriptor . calculate ( ac ) ; org . openscience . cdk . qsar . result . DoubleArrayResult retval = ( ( org . openscience . cdk . qsar . result . DoubleArrayResult ) ( descriptorValue . getValue ( ) ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return this . value ; } | org . junit . Assert . assertNotNull ( retval ) |
remove_2arg_Existing_Different ( ) { java . lang . Long key = java . lang . System . currentTimeMillis ( ) ; java . lang . String value = "value" + key ; cache . put ( key , value ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertFalse ( cache . remove ( key , ( value + 1 ) ) ) |
startsWith_A$Seq$int_true ( ) { com . m3 . scalaflavor4j . Seq < java . lang . Integer > seq = com . m3 . scalaflavor4j . IndexedSeq . apply ( 1 , 2 , 3 ) ; com . m3 . scalaflavor4j . Seq < java . lang . Integer > that = com . m3 . scalaflavor4j . IndexedSeq . apply ( 2 , 3 ) ; int offset = 1 ; boolean actual = seq . startsWith ( that , offset ) ; boolean expected = true ; "<AssertPlaceHolder>" ; } startsWith ( com . m3 . scalaflavor4j . Seq , int ) { return false ; } | org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) ) |
testInstantiateWrongClass ( ) { io . cdap . cdap . proto . id . DatasetId pairs = DatasetFrameworkTestUtil . NAMESPACE_ID . dataset ( "pairs" ) ; createObjectStoreInstance ( pairs , new com . google . common . reflect . TypeToken < io . cdap . cdap . common . utils . ImmutablePair < java . lang . Integer , java . lang . String > > ( ) { } . getType ( ) ) ; final io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDataset < io . cdap . cdap . data2 . dataset2 . lib . table . Custom > store = io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDatasetTest . dsFrameworkUtil . getInstance ( pairs ) ; org . apache . tephra . TransactionExecutor storeTxnl = io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDatasetTest . dsFrameworkUtil . newTransactionExecutor ( store ) ; try { storeTxnl . execute ( new org . apache . tephra . TransactionExecutor . Subroutine ( ) { @ io . cdap . cdap . data2 . dataset2 . lib . table . Override public void apply ( ) throws io . cdap . cdap . data2 . dataset2 . lib . table . Exception { io . cdap . cdap . data2 . dataset2 . lib . table . Custom custom = new io . cdap . cdap . data2 . dataset2 . lib . table . Custom ( 42 , com . google . common . collect . Lists . newArrayList ( "one" , "two" ) ) ; store . write ( io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDatasetTest . a , custom ) ; } } ) ; org . junit . Assert . fail ( "write<sp>should<sp>have<sp>failed<sp>with<sp>incompatible<sp>type" ) ; } catch ( org . apache . tephra . TransactionFailureException e ) { } final io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDataset < io . cdap . cdap . common . utils . ImmutablePair < java . lang . Integer , java . lang . String > > pairStore = io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDatasetTest . dsFrameworkUtil . getInstance ( pairs ) ; org . apache . tephra . TransactionExecutor pairStoreTxnl = io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDatasetTest . dsFrameworkUtil . newTransactionExecutor ( pairStore ) ; final io . cdap . cdap . common . utils . ImmutablePair < java . lang . Integer , java . lang . String > pair = new io . cdap . cdap . common . utils . ImmutablePair ( 1 , "second" ) ; pairStoreTxnl . execute ( new org . apache . tephra . TransactionExecutor . Subroutine ( ) { @ io . cdap . cdap . data2 . dataset2 . lib . table . Override public void apply ( ) throws io . cdap . cdap . data2 . dataset2 . lib . table . Exception { pairStore . write ( io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDatasetTest . a , pair ) ; } } ) ; pairStoreTxnl . execute ( new org . apache . tephra . TransactionExecutor . Subroutine ( ) { @ io . cdap . cdap . data2 . dataset2 . lib . table . Override public void apply ( ) throws io . cdap . cdap . data2 . dataset2 . lib . table . Exception { io . cdap . cdap . common . utils . ImmutablePair < java . lang . Integer , java . lang . String > actualPair = pairStore . read ( io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDatasetTest . a ) ; "<AssertPlaceHolder>" ; } } ) ; try { storeTxnl . execute ( new org . apache . tephra . TransactionExecutor . Subroutine ( ) { @ io . cdap . cdap . data2 . dataset2 . lib . table . Override public void apply ( ) throws io . cdap . cdap . data2 . dataset2 . lib . table . Exception { io . cdap . cdap . data2 . dataset2 . lib . table . Custom custom = store . read ( io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDatasetTest . a ) ; com . google . common . base . Preconditions . checkNotNull ( custom ) ; } } ) ; org . junit . Assert . fail ( "write<sp>should<sp>have<sp>failed<sp>with<sp>class<sp>cast<sp>exception" ) ; } catch ( org . apache . tephra . TransactionFailureException e ) { } pairStoreTxnl . execute ( new org . apache . tephra . TransactionExecutor . Subroutine ( ) { @ io . cdap . cdap . data2 . dataset2 . lib . table . Override public void apply ( ) throws io . cdap . cdap . data2 . dataset2 . lib . table . Exception { deleteAndVerify ( pairStore , io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDatasetTest . a ) ; } } ) ; io . cdap . cdap . data2 . dataset2 . lib . table . ObjectStoreDatasetTest . dsFrameworkUtil . deleteInstance ( pairs ) ; } read ( java . lang . String ) { byte [ ] read = keyValueTable . read ( key ) ; return read == null ? null : io . cdap . cdap . api . common . Bytes . toLong ( read ) ; } | org . junit . Assert . assertEquals ( pair , actualPair ) |
testCreateNamespace ( ) { try ( com . salesforce . dva . argus . sdk . ArgusService argusService = new com . salesforce . dva . argus . sdk . ArgusService ( getMockedClient ( "/NamespaceServiceTest.json" ) ) ) { com . salesforce . dva . argus . sdk . NamespaceService namespaceService = argusService . getNamespaceService ( ) ; com . salesforce . dva . argus . sdk . entity . Namespace result = namespaceService . createNamespace ( _constructUnpersistedNamespace ( ) ) ; com . salesforce . dva . argus . sdk . entity . Namespace expected = _constructPersistedNamespace ( ) ; "<AssertPlaceHolder>" ; } } _constructPersistedNamespace ( ) { com . salesforce . dva . argus . sdk . entity . Namespace result = _constructUnpersistedNamespace ( ) ; result . setId ( BigInteger . ONE ) ; result . setCreatedById ( BigInteger . ONE ) ; result . setModifiedById ( BigInteger . ONE ) ; result . setModifiedDate ( new java . util . Date ( 1472282830936L ) ) ; result . setCreatedDate ( new java . util . Date ( 1472282830936L ) ) ; return result ; } | org . junit . Assert . assertEquals ( expected , result ) |
shouldSubsumeIfEqual ( ) { org . dcache . auth . attributes . Restriction restriction1 = new org . dcache . auth . attributes . MultiTargetedRestriction ( singleton ( new org . dcache . auth . attributes . MultiTargetedRestriction . Authorisation ( java . util . EnumSet . of ( Activity . DOWNLOAD ) , org . dcache . auth . attributes . MultiTargetedRestrictionTest . TARGET ) ) ) ; org . dcache . auth . attributes . Restriction restriction2 = new org . dcache . auth . attributes . MultiTargetedRestriction ( singleton ( new org . dcache . auth . attributes . MultiTargetedRestriction . Authorisation ( java . util . EnumSet . of ( Activity . DOWNLOAD ) , org . dcache . auth . attributes . MultiTargetedRestrictionTest . TARGET ) ) ) ; "<AssertPlaceHolder>" ; } isSubsumedBy ( org . dcache . auth . attributes . Restrictions$CompositeRestriction ) { for ( org . dcache . auth . attributes . Restriction r : restrictions ) { if ( ! ( other . subsumes ( r ) ) ) { return false ; } } return true ; } | org . junit . Assert . assertThat ( restriction1 . isSubsumedBy ( restriction2 ) , org . hamcrest . CoreMatchers . is ( true ) ) |
testMultipleSubscribers_SingleCluster ( ) { client1 = new net . xenqtt . client . AsyncMqttClient ( proxy . getProxyURI ( ) , listener , 1 ) ; client1 . connect ( "client1" , false ) ; verify ( listener , timeout ( 5000 ) ) . connected ( client1 , ConnectReturnCode . ACCEPTED ) ; client1 . subscribe ( new net . xenqtt . client . Subscription [ ] { new net . xenqtt . client . Subscription ( "topic1" , net . xenqtt . message . QoS . AT_LEAST_ONCE ) } ) ; verify ( listener , timeout ( 5000 ) ) . subscribed ( same ( client1 ) , any ( net . xenqtt . client . Subscription [ ] . class ) , any ( net . xenqtt . client . Subscription [ ] . class ) , eq ( true ) ) ; client2 = new net . xenqtt . client . AsyncMqttClient ( proxy . getProxyURI ( ) , listener , 1 ) ; client2 . connect ( "client1" , false ) ; verify ( listener , timeout ( 5000 ) ) . connected ( client2 , ConnectReturnCode . ACCEPTED ) ; client2 . subscribe ( new net . xenqtt . client . Subscription [ ] { new net . xenqtt . client . Subscription ( "topic1" , net . xenqtt . message . QoS . AT_LEAST_ONCE ) } ) ; verify ( listener , timeout ( 5000 ) ) . subscribed ( same ( client2 ) , any ( net . xenqtt . client . Subscription [ ] . class ) , any ( net . xenqtt . client . Subscription [ ] . class ) , eq ( true ) ) ; client3 = new net . xenqtt . client . AsyncMqttClient ( broker . getURI ( ) , listener , 1 ) ; client3 . connect ( "client3" , false ) ; verify ( listener , timeout ( 5000 ) ) . connected ( client3 , ConnectReturnCode . ACCEPTED ) ; for ( int i = 0 ; i < 10 ; i ++ ) { reset ( listener , handler ) ; net . xenqtt . client . PublishMessage sentMsg = new net . xenqtt . client . PublishMessage ( "topic1" , net . xenqtt . message . QoS . AT_LEAST_ONCE , new byte [ ] { 1 , 2 , 3 } ) ; client3 . publish ( sentMsg ) ; verify ( handler , timeout ( 5000 ) ) . publish ( any ( net . xenqtt . mockbroker . Client . class ) , ( ( net . xenqtt . message . PubMessage ) ( mqttMsgCaptor . capture ( ) ) ) ) ; net . xenqtt . message . PubMessage pubMessageAtBroker = ( ( net . xenqtt . message . PubMessage ) ( mqttMsgCaptor . getValue ( ) ) ) ; net . xenqtt . client . MqttClient client = ( ( i % 2 ) == 0 ) ? client1 : client2 ; verify ( listener , timeout ( 5000 ) ) . publishReceived ( same ( client ) , pubMsgCaptor . capture ( ) ) ; net . xenqtt . client . PublishMessage rcvdMsg = pubMsgCaptor . getValue ( ) ; rcvdMsg . ack ( ) ; verify ( handler , timeout ( 5000 ) ) . pubAck ( any ( net . xenqtt . mockbroker . Client . class ) , ( ( net . xenqtt . message . PubAckMessage ) ( mqttMsgCaptor . capture ( ) ) ) ) ; net . xenqtt . message . PubAckMessage pubAckAtBroker = ( ( net . xenqtt . message . PubAckMessage ) ( mqttMsgCaptor . getValue ( ) ) ) ; "<AssertPlaceHolder>" ; verify ( listener ) . published ( same ( client3 ) , same ( sentMsg ) ) ; } } getMessageId ( ) { return ( getQoSLevel ( ) ) == 0 ? 0 : ( buffer . getShort ( ( ( getPayloadIndex ( ) ) - 2 ) ) ) & 65535 ; } | org . junit . Assert . assertEquals ( pubMessageAtBroker . getMessageId ( ) , pubAckAtBroker . getMessageId ( ) ) |
testConstructor ( ) { datawave . common . io . Files files = new datawave . common . io . Files ( ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( files ) |
test1 ( ) { introclassJava . median_3b2376ab_003 mainClass = new introclassJava . median_3b2376ab_003 ( ) ; java . lang . String expected = "Please<sp>enter<sp>3<sp>numbers<sp>separated<sp>by<sp>spaces<sp>><sp>0<sp>is<sp>the<sp>median" ; mainClass . scanner = new java . util . Scanner ( "0<sp>0<sp>0" ) ; mainClass . exec ( ) ; java . lang . String out = mainClass . output . replace ( "\n" , "<sp>" ) . trim ( ) ; "<AssertPlaceHolder>" ; } replace ( int , java . lang . Object ) { org . mozilla . javascript . xmlimpl . XMLList xlChildToReplace = child ( index ) ; if ( ( xlChildToReplace . length ( ) ) > 0 ) { org . mozilla . javascript . xmlimpl . XML childToReplace = xlChildToReplace . item ( 0 ) ; insertChildAfter ( childToReplace , xml ) ; removeChild ( index ) ; } return this ; } | org . junit . Assert . assertEquals ( expected . replace ( "<sp>" , "" ) , out . replace ( "<sp>" , "" ) ) |
isEmpty_when_empty ( ) { io . ebeaninternal . server . querydefn . OrmQueryDetail detail = new io . ebeaninternal . server . querydefn . OrmQueryDetail ( ) ; "<AssertPlaceHolder>" . isTrue ( ) ; } isEmpty ( ) { return propSet . isEmpty ( ) ; } | org . junit . Assert . assertThat ( detail . isEmpty ( ) ) |
restoredFilesInTrashDeletedAfterRestoringInHomeDir_renameMode ( ) { org . pentaho . platform . web . http . api . resources . services . FileService fileService = mock ( org . pentaho . platform . web . http . api . resources . services . FileService . class ) ; mockSession ( fileService , org . pentaho . platform . web . http . api . resources . services . FileServiceTest . USER_NAME ) ; when ( fileService . doRestoreFilesInHomeDir ( org . pentaho . platform . web . http . api . resources . services . FileServiceTest . PARAMS , FileService . MODE_RENAME ) ) . thenCallRealMethod ( ) ; boolean restored = fileService . doRestoreFilesInHomeDir ( org . pentaho . platform . web . http . api . resources . services . FileServiceTest . PARAMS , FileService . MODE_RENAME ) ; verify ( fileService ) . doDeleteFilesPermanent ( org . pentaho . platform . web . http . api . resources . services . FileServiceTest . PARAMS ) ; "<AssertPlaceHolder>" ; } doDeleteFilesPermanent ( java . lang . String ) { try { fileService . doDeleteFilesPermanent ( params ) ; return buildOkResponse ( ) ; } catch ( java . lang . Throwable t ) { t . printStackTrace ( ) ; return buildServerErrorResponse ( t ) ; } } | org . junit . Assert . assertEquals ( restored , true ) |
testShouldNotBlowUpIfThereAreNoTagsInRepository ( ) { try ( org . eclipse . jgit . api . Git git = new org . eclipse . jgit . api . Git ( db ) ) { git . add ( ) . addFilepattern ( "*" ) . call ( ) ; git . commit ( ) . setMessage ( "initial<sp>commit" ) . call ( ) ; java . util . List < org . eclipse . jgit . lib . Ref > list = git . tagList ( ) . call ( ) ; "<AssertPlaceHolder>" ; } } size ( ) { return size ; } | org . junit . Assert . assertEquals ( 0 , list . size ( ) ) |
testNDArrayWritablesZeroIndex ( ) { org . nd4j . linalg . api . ndarray . INDArray arr2 = org . nd4j . linalg . factory . Nd4j . zeros ( 2 ) ; arr2 . putScalar ( 0 , 11 ) ; arr2 . putScalar ( 1 , 12 ) ; org . nd4j . linalg . api . ndarray . INDArray arr3 = org . nd4j . linalg . factory . Nd4j . zeros ( 3 ) ; arr3 . putScalar ( 0 , 0 ) ; arr3 . putScalar ( 1 , 1 ) ; arr3 . putScalar ( 2 , 0 ) ; java . util . List < org . datavec . api . writable . Writable > record = java . util . Arrays . asList ( ( ( org . datavec . api . writable . Writable ) ( new org . datavec . api . writable . DoubleWritable ( 1 ) ) ) , new org . datavec . api . writable . NDArrayWritable ( arr2 ) , new org . datavec . api . writable . IntWritable ( 2 ) , new org . datavec . api . writable . DoubleWritable ( 3 ) , new org . datavec . api . writable . NDArrayWritable ( arr3 ) , new org . datavec . api . writable . DoubleWritable ( 1 ) ) ; java . io . File tempFile = java . io . File . createTempFile ( "LibSvmRecordWriter" , ".txt" ) ; tempFile . setWritable ( true ) ; tempFile . deleteOnExit ( ) ; if ( tempFile . exists ( ) ) tempFile . delete ( ) ; java . lang . String lineOriginal = "1,3<sp>0:1.0<sp>1:11.0<sp>2:12.0<sp>3:2.0<sp>4:3.0" ; try ( org . datavec . api . records . writer . impl . misc . LibSvmRecordWriter writer = new org . datavec . api . records . writer . impl . misc . LibSvmRecordWriter ( ) ) { org . datavec . api . conf . Configuration configWriter = new org . datavec . api . conf . Configuration ( ) ; configWriter . setBoolean ( LibSvmRecordWriter . ZERO_BASED_INDEXING , true ) ; configWriter . setBoolean ( LibSvmRecordWriter . ZERO_BASED_LABEL_INDEXING , true ) ; configWriter . setBoolean ( LibSvmRecordWriter . MULTILABEL , true ) ; configWriter . setInt ( LibSvmRecordWriter . FEATURE_FIRST_COLUMN , 0 ) ; configWriter . setInt ( LibSvmRecordWriter . FEATURE_LAST_COLUMN , 3 ) ; org . datavec . api . split . FileSplit outputSplit = new org . datavec . api . split . FileSplit ( tempFile ) ; writer . initialize ( configWriter , outputSplit , new org . datavec . api . split . partition . NumberOfRecordsPartitioner ( ) ) ; writer . write ( record ) ; } java . lang . String lineNew = org . apache . commons . io . FileUtils . readFileToString ( tempFile ) . trim ( ) ; "<AssertPlaceHolder>" ; } write ( java . util . List ) { java . lang . StringBuilder result = new java . lang . StringBuilder ( ) ; int count = 0 ; for ( org . datavec . api . writable . Writable w : record ) { if ( count > 0 ) { boolean tabs = false ; result . append ( ( tabs ? "\t" : "<sp>" ) ) ; } result . append ( w . toString ( ) ) ; count ++ ; } out . write ( result . toString ( ) . getBytes ( ) ) ; out . write ( org . datavec . api . records . writer . impl . misc . NEW_LINE . getBytes ( ) ) ; return org . datavec . api . split . partition . PartitionMetaData . builder ( ) . numRecordsUpdated ( 1 ) . build ( ) ; } | org . junit . Assert . assertEquals ( lineOriginal , lineNew ) |
testOkOnduidelijk ( ) { final nl . moderniseringgba . isc . esb . message . sync . impl . SynchronisatieStrategieAntwoordBericht antwoord = new nl . moderniseringgba . isc . esb . message . sync . impl . SynchronisatieStrategieAntwoordBericht ( ) ; antwoord . setStatus ( StatusType . OK ) ; antwoord . setResultaat ( SearchResultaatType . ONDUIDELIJK ) ; final java . util . Map < java . lang . String , java . lang . Object > parameters = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; parameters . put ( "synchronisatieStrategieAntwoordBericht" , antwoord ) ; parameters . put ( "beheerderKeuze" , SearchResultaatType . VERVANGEN ) ; final java . lang . String result = subject . execute ( parameters ) ; "<AssertPlaceHolder>" ; } execute ( java . util . Map ) { nl . bzk . migratiebrp . isc . jbpm . uc1003 . MaakZoekPersoonBerichtAction . LOG . debug ( "execute(parameters={})" , parameters ) ; final java . lang . Long berichtId = ( ( java . lang . Long ) ( parameters . get ( "input" ) ) ) ; final nl . bzk . migratiebrp . bericht . model . lo3 . Lo3Bericht input = ( ( nl . bzk . migratiebrp . bericht . model . lo3 . Lo3Bericht ) ( berichtenDao . leesBericht ( berichtId ) ) ) ; final nl . bzk . migratiebrp . bericht . model . sync . SyncBericht verzoek = maakZoekPersoonVerzoekBericht ( input ) ; final java . lang . Long verzoekId = berichtenDao . bewaarBericht ( verzoek ) ; final java . util . Map < java . lang . String , java . lang . Object > result = new java . util . HashMap ( ) ; result . put ( "zoekPersoonVerzoek" , verzoekId ) ; nl . bzk . migratiebrp . isc . jbpm . uc1003 . MaakZoekPersoonBerichtAction . LOG . debug ( "result:<sp>{}" , result ) ; return result ; } | org . junit . Assert . assertEquals ( null , result ) |
testMaxAttemptOneMeansOne ( ) { getConf ( ) . setInt ( YarnConfiguration . RM_AM_MAX_ATTEMPTS , 1 ) ; getConf ( ) . setBoolean ( YarnConfiguration . RECOVERY_ENABLED , true ) ; getConf ( ) . set ( YarnConfiguration . RM_STORE , org . apache . hadoop . yarn . server . resourcemanager . recovery . MemoryRMStateStore . class . getName ( ) ) ; org . apache . hadoop . yarn . server . resourcemanager . MockRM rm1 = new org . apache . hadoop . yarn . server . resourcemanager . MockRM ( getConf ( ) ) ; rm1 . start ( ) ; org . apache . hadoop . yarn . server . resourcemanager . MockNM nm1 = new org . apache . hadoop . yarn . server . resourcemanager . MockNM ( "127.0.0.1:1234" , 8000 , rm1 . getResourceTrackerService ( ) ) ; nm1 . registerNode ( ) ; org . apache . hadoop . yarn . server . resourcemanager . rmapp . RMApp app1 = rm1 . submitApp ( 200 ) ; org . apache . hadoop . yarn . server . resourcemanager . rmapp . attempt . RMAppAttempt attempt1 = app1 . getCurrentAppAttempt ( ) ; org . apache . hadoop . yarn . server . resourcemanager . MockAM am1 = org . apache . hadoop . yarn . server . resourcemanager . MockRM . launchAndRegisterAM ( app1 , rm1 , nm1 ) ; org . apache . hadoop . yarn . server . resourcemanager . scheduler . AbstractYarnScheduler scheduler = ( ( org . apache . hadoop . yarn . server . resourcemanager . scheduler . AbstractYarnScheduler ) ( rm1 . getResourceScheduler ( ) ) ) ; org . apache . hadoop . yarn . api . records . ContainerId amContainer = org . apache . hadoop . yarn . api . records . ContainerId . newContainerId ( am1 . getApplicationAttemptId ( ) , 1 ) ; scheduler . killContainer ( scheduler . getRMContainer ( amContainer ) ) ; rm1 . waitForState ( am1 . getApplicationAttemptId ( ) , RMAppAttemptState . FAILED ) ; org . apache . hadoop . yarn . server . resourcemanager . scheduler . TestSchedulerUtils . waitSchedulerApplicationAttemptStopped ( scheduler , am1 . getApplicationAttemptId ( ) ) ; rm1 . waitForState ( app1 . getApplicationId ( ) , RMAppState . FAILED ) ; "<AssertPlaceHolder>" ; rm1 . stop ( ) ; } getAppAttempts ( ) { this . readLock . lock ( ) ; try { return java . util . Collections . unmodifiableMap ( this . attempts ) ; } finally { this . readLock . unlock ( ) ; } } | org . junit . Assert . assertEquals ( 1 , app1 . getAppAttempts ( ) . size ( ) ) |
empty ( ) { java . io . File file = folder . newFile ( "testing" ) ; java . lang . StringBuilder buf = new java . lang . StringBuilder ( ) ; try ( com . asakusafw . windgate . stream . StreamSourceDriver < java . lang . StringBuilder > driver = new com . asakusafw . windgate . stream . StreamSourceDriver ( "streaming" , "testing" , wrap ( new com . asakusafw . windgate . stream . StreamSourceDriverTest . FileInputStreamProvider ( file ) ) , new com . asakusafw . windgate . stream . StringBuilderSupport ( ) , buf ) ) { driver . prepare ( ) ; "<AssertPlaceHolder>" ; } } next ( ) { if ( input . readTo ( object ) ) { return definition . toReflection ( object ) ; } return null ; } | org . junit . Assert . assertThat ( driver . next ( ) , is ( false ) ) |
iterateOverNothing ( ) { consumer = new org . apache . kafka . clients . consumer . KafkaConsumer < java . lang . String , java . lang . String > ( consumerProps , new org . apache . crunch . kafka . ClusterTest . StringSerDe ( ) , new org . apache . crunch . kafka . ClusterTest . StringSerDe ( ) ) ; int loops = 10 ; int numPerLoop = 100 ; org . apache . crunch . kafka . ClusterTest . writeData ( props , topic , "batch" , loops , numPerLoop ) ; startOffsets = org . apache . crunch . kafka . KafkaRecordsIterableIT . getStartOffsets ( props , topic ) ; stopOffsets = org . apache . crunch . kafka . KafkaRecordsIterableIT . getStartOffsets ( props , topic ) ; java . util . Map < org . apache . kafka . common . TopicPartition , org . apache . crunch . Pair < java . lang . Long , java . lang . Long > > offsets = new java . util . HashMap ( ) ; for ( Map . Entry < org . apache . kafka . common . TopicPartition , java . lang . Long > entry : startOffsets . entrySet ( ) ) { offsets . put ( entry . getKey ( ) , org . apache . crunch . Pair . of ( entry . getValue ( ) , stopOffsets . get ( entry . getKey ( ) ) ) ) ; } java . lang . Iterable < org . apache . crunch . Pair < java . lang . String , java . lang . String > > data = new org . apache . crunch . kafka . KafkaRecordsIterable ( consumer , offsets , new java . util . Properties ( ) ) ; int count = 0 ; for ( org . apache . crunch . Pair < java . lang . String , java . lang . String > event : data ) { count ++ ; } "<AssertPlaceHolder>" ; } get ( int ) { switch ( index ) { case 0 : return first ; case 1 : return second ; case 2 : return third ; default : throw new java . lang . ArrayIndexOutOfBoundsException ( ) ; } } | org . junit . Assert . assertThat ( count , org . hamcrest . core . Is . is ( 0 ) ) |
shouldGetActiveConditions ( ) { org . openmrs . Patient patient = new org . openmrs . Patient ( 2 ) ; java . util . List < org . openmrs . Condition > active = dao . getActiveConditions ( patient ) ; "<AssertPlaceHolder>" ; } size ( ) { return getMemberships ( ) . stream ( ) . filter ( ( m ) -> ! ( m . getVoided ( ) ) ) . collect ( java . util . stream . Collectors . toList ( ) ) . size ( ) ; } | org . junit . Assert . assertEquals ( 2 , active . size ( ) ) |
testCallSoapClient ( ) { com . google . api . ads . common . lib . client . RemoteCallReturn expectedRemoteCallReturn = new com . google . api . ads . common . lib . client . RemoteCallReturn . Builder ( ) . build ( ) ; com . google . api . ads . common . lib . soap . SoapCall < java . lang . Object > soapCall = org . mockito . Mockito . mock ( com . google . api . ads . common . lib . soap . SoapCall . class ) ; when ( soapClientHandler . invokeSoapCall ( soapCall ) ) . thenReturn ( expectedRemoteCallReturn ) ; com . google . api . ads . common . lib . client . RemoteCallReturn remoteCallReturn = soapServiceClient . callSoapClient ( soapCall ) ; "<AssertPlaceHolder>" ; } callSoapClient ( com . google . api . ads . common . lib . soap . SoapCall ) { return soapClientHandler . invokeSoapCall ( soapCall ) ; } | org . junit . Assert . assertSame ( expectedRemoteCallReturn , remoteCallReturn ) |
testLocalTimeTypeSmallNano ( ) { java . time . LocalTime time = org . neo4j . values . storable . LocalTimeValue . localTime ( 0 , 0 , 0 , 37 ) . asObjectCopy ( ) ; java . lang . String key = "dt" ; node1 . setProperty ( key , time ) ; newTransaction ( ) ; java . lang . Object property = node1 . getProperty ( key ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { if ( null == key ) { throw new java . lang . IllegalArgumentException ( "(null)<sp>property<sp>key<sp>is<sp>not<sp>allowed" ) ; } org . neo4j . kernel . api . KernelTransaction transaction = spi . kernelTransaction ( ) ; int propertyKey = transaction . tokenRead ( ) . propertyKey ( key ) ; if ( propertyKey == ( org . neo4j . internal . kernel . api . TokenRead . NO_TOKEN ) ) { throw new org . neo4j . graphdb . NotFoundException ( java . lang . String . format ( "No<sp>such<sp>property,<sp>'%s'." , key ) ) ; } org . neo4j . internal . kernel . api . RelationshipScanCursor relationships = transaction . ambientRelationshipCursor ( ) ; org . neo4j . internal . kernel . api . PropertyCursor properties = transaction . ambientPropertyCursor ( ) ; singleRelationship ( transaction , relationships ) ; relationships . properties ( properties ) ; while ( properties . next ( ) ) { if ( propertyKey == ( properties . propertyKey ( ) ) ) { org . neo4j . values . storable . Value value = properties . propertyValue ( ) ; if ( value == ( org . neo4j . values . storable . Values . NO_VALUE ) ) { throw new org . neo4j . graphdb . NotFoundException ( java . lang . String . format ( "No<sp>such<sp>property,<sp>'%s'." , key ) ) ; } return value . asObjectCopy ( ) ; } } throw new org . neo4j . graphdb . NotFoundException ( java . lang . String . format ( "No<sp>such<sp>property,<sp>'%s'." , key ) ) ; } | org . junit . Assert . assertEquals ( time , property ) |
theUnitsAmoutCanBeRetrieved ( ) { org . libreplan . business . workingday . ResourcesPerDay units = org . libreplan . business . workingday . ResourcesPerDay . amount ( 2 ) ; "<AssertPlaceHolder>" ; } readsAs ( int , int ) { return new org . hamcrest . BaseMatcher < org . libreplan . business . workingday . ResourcesPerDay > ( ) { @ org . libreplan . business . test . workingday . Override public boolean matches ( java . lang . Object arg ) { if ( arg instanceof org . libreplan . business . workingday . ResourcesPerDay ) { org . libreplan . business . workingday . ResourcesPerDay r = ( ( org . libreplan . business . workingday . ResourcesPerDay ) ( arg ) ) ; return ( ( r . getAmount ( ) . intValue ( ) ) == integerPart ) && ( ( getDecimalPart ( r ) ) == decimalPart ) ; } return false ; } private int getDecimalPart ( org . libreplan . business . workingday . ResourcesPerDay r ) { java . math . BigDecimal onlyDecimal = r . getAmount ( ) . subtract ( new java . math . BigDecimal ( r . getAmount ( ) . intValue ( ) ) ) ; java . math . BigDecimal decimalPartAsInt = onlyDecimal . movePointRight ( 4 ) ; int result = decimalPartAsInt . intValue ( ) ; return result ; } @ org . libreplan . business . test . workingday . Override public void describeTo ( org . hamcrest . Description description ) { description . appendText ( ( ( "must<sp>have<sp>an<sp>integer<sp>part<sp>of<sp>" + integerPart ) + "<sp>and<sp>" ) ) ; description . appendText ( ( ( "must<sp>have<sp>" + decimalPart ) + "<sp>as<sp>decimal<sp>part" ) ) ; } } ; } | org . junit . Assert . assertThat ( units , readsAs ( 2 , 0 ) ) |
resourceLookup ( ) { java . lang . Object connection = context . lookup ( "java:jboss/neo4jdriver/test" ) ; "<AssertPlaceHolder>" ; } lookup ( java . lang . String ) { return new org . wildfly . swarm . microprofile . faulttolerance . deployment . MicroProfileFaultToleranceExtension . ResourceLiteral ( null , lookup , null , null , null , null , null ) ; } | org . junit . Assert . assertNotNull ( connection ) |
testEmptyStringToIntegerConversion ( ) { org . jboss . forge . addon . convert . Converter < java . lang . String , java . lang . Integer > converter = converterFactory . getConverter ( java . lang . String . class , org . jboss . forge . addon . convert . exported . Integer . class ) ; "<AssertPlaceHolder>" ; } convert ( java . lang . String ) { final java . lang . String result ; if ( ( org . jboss . forge . furnace . util . Strings . isNullOrEmpty ( source ) ) || ( ( contextProvider . getUIContext ( ) ) == null ) ) { result = source ; } else { org . jboss . forge . addon . ui . context . UIContext context = contextProvider . getUIContext ( ) ; org . jboss . forge . addon . projects . Project selectedProject = org . jboss . forge . addon . projects . Projects . getSelectedProject ( projectFactory , context ) ; if ( ( selectedProject != null ) && ( selectedProject . hasFacet ( org . jboss . forge . addon . parser . java . facets . JavaSourceFacet . class ) ) ) { java . lang . String basePackage = selectedProject . getFacet ( org . jboss . forge . addon . parser . java . facets . JavaSourceFacet . class ) . getBasePackage ( ) ; java . lang . String fullPackage = source . replaceAll ( "\\~" , basePackage ) ; result = fullPackage ; } else { result = source ; } } return result ; } | org . junit . Assert . assertNull ( converter . convert ( "" ) ) |
testAspectRatio ( ) { com . bixly . pastevid . models . ScreenSizeTest . log ( "ScreenSize.aspectRatio" ) ; com . bixly . pastevid . models . ScreenSize instance = new com . bixly . pastevid . models . ScreenSize ( "Name" , 0 , 0 , 0 ) ; double expResult = 0.75 ; instance . setAspectRatio ( expResult ) ; double result = instance . getAspectRatio ( ) ; "<AssertPlaceHolder>" ; } getAspectRatio ( ) { return aspectRatio ; } | org . junit . Assert . assertEquals ( expResult , result , 0.0 ) |
testAdvance_normal ( ) { boolean result = fixture . advance ( ) ; "<AssertPlaceHolder>" ; } advance ( ) { final org . eclipse . tracecompass . tmf . ctf . core . context . CtfLocationInfo curLocationData = fCurLocation . getLocationInfo ( ) ; org . eclipse . tracecompass . internal . tmf . ctf . core . trace . iterator . CtfIterator iterator = getIterator ( ) ; if ( iterator == null ) { return false ; } boolean retVal = iterator . advance ( ) ; org . eclipse . tracecompass . tmf . ctf . core . event . CtfTmfEvent currentEvent = iterator . getCurrentEvent ( ) ; if ( currentEvent != null ) { final long timestampValue = iterator . getCurrentTimestamp ( ) ; if ( ( curLocationData . getTimestamp ( ) ) == timestampValue ) { fCurLocation = new org . eclipse . tracecompass . tmf . ctf . core . context . CtfLocation ( timestampValue , ( ( curLocationData . getIndex ( ) ) + 1 ) ) ; } else { fCurLocation = new org . eclipse . tracecompass . tmf . ctf . core . context . CtfLocation ( timestampValue , 0L ) ; } } else { fCurLocation = new org . eclipse . tracecompass . tmf . ctf . core . context . CtfLocation ( CtfLocation . INVALID_LOCATION ) ; } return retVal ; } | org . junit . Assert . assertTrue ( result ) |
shouldConvertToDoubleCorrectly ( ) { final java . lang . Double d = io . confluent . ksql . serde . util . SerdeUtils . toDouble ( 1.0 ) ; "<AssertPlaceHolder>" ; } toDouble ( java . lang . Object ) { java . util . Objects . requireNonNull ( object , "Object<sp>cannot<sp>be<sp>null" ) ; if ( object instanceof java . lang . Double ) { return ( ( java . lang . Double ) ( object ) ) ; } if ( object instanceof java . lang . Number ) { return ( ( java . lang . Number ) ( object ) ) . doubleValue ( ) ; } if ( object instanceof java . lang . String ) { try { return java . lang . Double . parseDouble ( ( ( java . lang . String ) ( object ) ) ) ; } catch ( final java . lang . NumberFormatException e ) { throw new io . confluent . ksql . util . KsqlException ( ( ( "Cannot<sp>convert<sp>" + object ) + "<sp>to<sp>DOUBLE." ) , e ) ; } } throw new java . lang . IllegalArgumentException ( "This<sp>Object<sp>doesn't<sp>represent<sp>a<sp>double" ) ; } | org . junit . Assert . assertThat ( d , org . hamcrest . CoreMatchers . equalTo ( 1.0 ) ) |
testFetchByPrimaryKeyMissing ( ) { long pk = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; com . liferay . portal . kernel . model . ServiceComponent missingServiceComponent = _persistence . fetchByPrimaryKey ( pk ) ; "<AssertPlaceHolder>" ; } fetchByPrimaryKey ( long ) { return com . liferay . adaptive . media . image . service . persistence . AMImageEntryUtil . getPersistence ( ) . fetchByPrimaryKey ( amImageEntryId ) ; } | org . junit . Assert . assertNull ( missingServiceComponent ) |
test ( ) { final cz . habarta . typescript . generator . Settings settings = cz . habarta . typescript . generator . TestUtils . settings ( ) ; final java . lang . String output = new cz . habarta . typescript . generator . TypeScriptGenerator ( settings ) . generateTypeScript ( cz . habarta . typescript . generator . Input . from ( cz . habarta . typescript . generator . JsonUnwrappedTest . Person . class ) ) ; final java . lang . String expected = "<sp>BageB:<sp>number;\n" 2 + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "interface<sp>Person<sp>{\n" + "<sp>AageA:<sp>number;\n" ) + "<sp>AfirstA:<sp>string;\n" ) + "<sp>AlastA:<sp>string;\n" ) + "<sp>Bname3B:<sp>Name;\n" 9 ) + "<sp>BageB:<sp>number;\n" 0 ) + "<sp>Bname3B:<sp>Name;\n" 4 ) + "<sp>BageB:<sp>number;\n" ) + "<sp>Bname3B:<sp>Name;\n" 7 ) + "<sp>Bname3B:<sp>Name;\n" 5 ) + "<sp>B_first2B:<sp>string;\n" ) + "<sp>Bname3B:<sp>Name;\n" 3 ) + "<sp>Bname3B:<sp>Name;\n" ) + "<sp>Bname3B:<sp>Name;\n" 8 ) + "<sp>BageB:<sp>number;\n" 2 ) + "<sp>BageB:<sp>number;\n" 3 ) + "<sp>Bname3B:<sp>Name;\n" 1 ) + "<sp>Bname3B:<sp>Name;\n" 0 ) + "<sp>last:<sp>string;\n" ) + "<sp>_first2:<sp>string;\n" ) + "<sp>Bname3B:<sp>Name;\n" 6 ) + "<sp>BageB:<sp>number;\n" 1 ) + "<sp>Bname3B:<sp>Name;\n" 8 ) + "<sp>BageB:<sp>number;\n" 2 ) + "interface<sp>Name<sp>{\n" ) + "<sp>Bname3B:<sp>Name;\n" 0 ) + "<sp>last:<sp>string;\n" ) + "<sp>Bname3B:<sp>Name;\n" 8 ) + "<sp>Bname3B:<sp>Name;\n" 2 ) ; "<AssertPlaceHolder>" ; } from ( java . lang . reflect . Type [ ] ) { java . util . Objects . requireNonNull ( types , "types" ) ; final java . util . List < cz . habarta . typescript . generator . parser . SourceType < java . lang . reflect . Type > > sourceTypes = new java . util . ArrayList ( ) ; for ( java . lang . reflect . Type type : types ) { sourceTypes . add ( new cz . habarta . typescript . generator . parser . SourceType ( type ) ) ; } return new cz . habarta . typescript . generator . Input ( sourceTypes ) ; } | org . junit . Assert . assertEquals ( expected . trim ( ) , output . trim ( ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.