input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testDistanceOfEqualChromosomes ( ) { org . evosuite . ga . metaheuristics . SPEA2 < org . evosuite . ga . Chromosome > algorithm = new org . evosuite . ga . metaheuristics . SPEA2 < org . evosuite . ga . Chromosome > ( null ) ; org . evosuite . coverage . branch . BranchCoverageSuiteFitness branch = new org . evosuite . coverage . branch . BranchCoverageSuiteFitness ( ) ; org . evosuite . coverage . line . LineCoverageSuiteFitness line = new org . evosuite . coverage . line . LineCoverageSuiteFitness ( ) ; org . evosuite . testsuite . TestSuiteChromosome t1 = new org . evosuite . testsuite . TestSuiteChromosome ( ) ; t1 . setFitness ( branch , 0.5 ) ; t1 . setFitness ( line , 0.3 ) ; org . evosuite . testsuite . TestSuiteChromosome t2 = new org . evosuite . testsuite . TestSuiteChromosome ( ) ; t2 . setFitness ( branch , 0.5 ) ; t2 . setFitness ( line , 0.3 ) ; "<AssertPlaceHolder>" ; } distanceBetweenObjectives ( T extends org . evosuite . ga . Chromosome , T extends org . evosuite . ga . Chromosome ) { double distance = 0.0 ; for ( org . evosuite . ga . FitnessFunction < ? > ff : t1 . getFitnessValues ( ) . keySet ( ) ) { double diff = ( t1 . getFitness ( ff ) ) - ( t2 . getFitness ( ff ) ) ; distance += java . lang . Math . pow ( diff , 2.0 ) ; } return java . lang . Math . sqrt ( distance ) ; } | org . junit . Assert . assertEquals ( 0.0 , algorithm . distanceBetweenObjectives ( t1 , t2 ) , 0.0 ) |
testNothing ( ) { org . jboss . msc . service . ServiceController < ? > serviceController = this . registry . getService ( org . jboss . msc . service . ServiceName . parse ( "jboss.security.security-management" ) ) ; "<AssertPlaceHolder>" ; } parse ( java . net . URL ) { final java . util . List < org . jboss . dmr . ModelNode > operationList = new java . util . ArrayList ( ) ; try ( java . io . InputStream input = xml . openStream ( ) ) { final javax . xml . stream . XMLStreamReader reader = javax . xml . stream . XMLInputFactory . newInstance ( ) . createXMLStreamReader ( input ) ; org . wildfly . swarm . container . runtime . xmlconfig . WrappedXMLStreamReader wrappedReader = new org . wildfly . swarm . container . runtime . xmlconfig . WrappedXMLStreamReader ( reader , this . recognizedNames , xmlMapper ) ; xmlMapper . parseDocument ( operationList , wrappedReader ) ; } return operationList ; } | org . junit . Assert . assertNotNull ( serviceController ) |
testProperSplashScreenShutdownOnPartClose ( ) { org . uberfire . mvp . PlaceRequest oz = new org . uberfire . mvp . impl . DefaultPlaceRequest ( "oz" ) ; org . uberfire . client . workbench . panels . impl . WorkbenchScreenActivity ozActivity = mock ( org . uberfire . client . workbench . panels . impl . WorkbenchScreenActivity . class ) ; when ( activityManager . getActivities ( oz ) ) . thenReturn ( singleton ( ( ( org . uberfire . client . workbench . panels . impl . Activity ) ( ozActivity ) ) ) ) ; final org . uberfire . client . workbench . panels . impl . SplashScreenActivity lollipopGuildActivity = mock ( org . uberfire . client . workbench . panels . impl . SplashScreenActivity . class ) ; when ( lollipopGuildActivity . isType ( ActivityResourceType . SPLASH . name ( ) ) ) . thenReturn ( true ) ; when ( activityManager . getSplashScreenInterceptor ( oz ) ) . thenReturn ( lollipopGuildActivity ) ; when ( ozActivity . isType ( ActivityResourceType . SCREEN . name ( ) ) ) . thenReturn ( true ) ; placeManager . goTo ( oz , ( ( org . uberfire . client . workbench . panels . impl . PanelDefinition ) ( null ) ) ) ; placeManager . closePlace ( oz ) ; "<AssertPlaceHolder>" ; verify ( lollipopGuildActivity ) . closeIfOpen ( ) ; verify ( activityManager ) . destroyActivity ( lollipopGuildActivity ) ; } getActiveSplashScreens ( ) { throw new java . lang . UnsupportedOperationException ( "Not<sp>implemented." ) ; } | org . junit . Assert . assertTrue ( placeManager . getActiveSplashScreens ( ) . isEmpty ( ) ) |
readAtLeastOne ( ) { final org . graylog2 . shared . journal . Journal journal = new org . graylog2 . shared . journal . KafkaJournal ( journalDirectory . toPath ( ) , scheduler , com . github . joschi . jadconfig . util . Size . megabytes ( 100L ) , org . joda . time . Duration . standardHours ( 1 ) , com . github . joschi . jadconfig . util . Size . megabytes ( 5L ) , org . joda . time . Duration . standardHours ( 1 ) , 1000000 , org . joda . time . Duration . standardMinutes ( 1 ) , 100 , new com . codahale . metrics . MetricRegistry ( ) , serverStatus ) ; final byte [ ] idBytes = "id" . getBytes ( org . graylog2 . shared . journal . UTF_8 ) ; final byte [ ] messageBytes = "message1" . getBytes ( org . graylog2 . shared . journal . UTF_8 ) ; final long position = journal . write ( idBytes , messageBytes ) ; final java . util . List < org . graylog2 . shared . journal . Journal . JournalReadEntry > messages = journal . read ( 0 ) ; final org . graylog2 . shared . journal . Journal . JournalReadEntry firstMessage = com . google . common . collect . Iterators . getOnlyElement ( messages . iterator ( ) ) ; "<AssertPlaceHolder>" ; } getPayload ( ) { return payload ; } | org . junit . Assert . assertEquals ( "message1" , new java . lang . String ( firstMessage . getPayload ( ) , UTF_8 ) ) |
testSampleRowKeys ( ) { java . util . List < com . google . cloud . bigtable . data . v2 . models . KeyOffset > expectedKeyOff = com . google . common . collect . ImmutableList . of ( com . google . cloud . bigtable . data . v2 . models . KeyOffset . create ( com . google . protobuf . ByteString . copyFromUtf8 ( com . google . cloud . bigtable . grpc . TestBigtableDataGCJClient . ROW_KEY ) , 10 ) ) ; when ( dataClientV2 . sampleRowKeys ( com . google . cloud . bigtable . grpc . TestBigtableDataGCJClient . TABLE_ID ) ) . thenReturn ( expectedKeyOff ) ; java . util . List < com . google . cloud . bigtable . data . v2 . models . KeyOffset > keyOffSets = dataGCJClient . sampleRowKeys ( com . google . cloud . bigtable . grpc . TestBigtableDataGCJClient . TABLE_ID ) ; "<AssertPlaceHolder>" ; verify ( dataClientV2 ) . sampleRowKeys ( com . google . cloud . bigtable . grpc . TestBigtableDataGCJClient . TABLE_ID ) ; } sampleRowKeys ( java . lang . String ) { java . lang . String fullTableName = com . google . cloud . bigtable . data . v2 . internal . NameUtil . formatTableName ( requestContext . getProjectId ( ) , requestContext . getInstanceId ( ) , tableId ) ; com . google . bigtable . v2 . SampleRowKeysRequest requestProto = com . google . bigtable . v2 . SampleRowKeysRequest . newBuilder ( ) . setTableName ( fullTableName ) . build ( ) ; java . util . List < com . google . bigtable . v2 . SampleRowKeysResponse > responseProto = delegate . sampleRowKeys ( requestProto ) ; com . google . common . collect . ImmutableList . Builder < com . google . cloud . bigtable . data . v2 . models . KeyOffset > keyOffsetBuilder = com . google . common . collect . ImmutableList . builderWithExpectedSize ( responseProto . size ( ) ) ; for ( com . google . bigtable . v2 . SampleRowKeysResponse rowKeys : responseProto ) { keyOffsetBuilder . add ( com . google . cloud . bigtable . data . v2 . models . KeyOffset . create ( rowKeys . getRowKey ( ) , rowKeys . getOffsetBytes ( ) ) ) ; } return keyOffsetBuilder . build ( ) ; } | org . junit . Assert . assertEquals ( expectedKeyOff , keyOffSets ) |
testUpdateMarketingProductWithEmptyDesc ( ) { org . oscm . internal . vo . VOTechnicalService tp = createTechnicalProduct ( svcProv ) ; org . oscm . internal . vo . VOService product = new org . oscm . internal . vo . VOService ( ) ; product . setDescription ( "" ) ; product . setServiceId ( "modifiedProductWithEmptyDesc" ) ; java . util . List < org . oscm . internal . vo . VOParameter > parameters = new java . util . ArrayList < org . oscm . internal . vo . VOParameter > ( ) ; java . util . List < org . oscm . internal . vo . VOParameterDefinition > parameterDefinitions = tp . getParameterDefinitions ( ) ; org . oscm . internal . vo . VOParameterDefinition enumParamDefi = null ; for ( org . oscm . internal . vo . VOParameterDefinition parameterDef : parameterDefinitions ) { if ( ( parameterDef . getValueType ( ) ) == ( org . oscm . internal . types . enumtypes . ParameterValueType . ENUMERATION ) ) { enumParamDefi = parameterDef ; break ; } } if ( enumParamDefi != null ) { org . oscm . internal . vo . VOParameter parameter = new org . oscm . internal . vo . VOParameter ( enumParamDefi ) ; parameter . setConfigurable ( false ) ; parameter . setValue ( "1" ) ; parameters . add ( parameter ) ; product . setParameters ( parameters ) ; container . login ( supplierUserKey , org . oscm . serviceprovisioningservice . bean . ROLE_SERVICE_MANAGER , org . oscm . serviceprovisioningservice . bean . ROLE_TECHNOLOGY_MANAGER ) ; org . oscm . internal . vo . VOServiceDetails createdProduct = svcProv . createService ( tp , product , null ) ; parameters = createdProduct . getParameters ( ) ; org . oscm . internal . vo . VOParameter newParam = new org . oscm . internal . vo . VOParameter ( parameterDefinitions . get ( 1 ) ) ; newParam . setValue ( "5555" ) ; parameter . setConfigurable ( false ) ; parameters . add ( newParam ) ; parameters = createdProduct . getParameters ( ) ; newParam = new org . oscm . internal . vo . VOParameter ( parameterDefinitions . get ( 2 ) ) ; newParam . setValue ( "86400000" ) ; parameter . setConfigurable ( false ) ; parameters . add ( newParam ) ; org . oscm . internal . vo . VOParameter parameterWithEnumValues = parameters . get ( 0 ) ; parameterWithEnumValues . setValue ( "3" ) ; createdProduct = svcProv . updateService ( createdProduct , null ) ; "<AssertPlaceHolder>" ; } } getDescription ( ) { return description ; } | org . junit . Assert . assertEquals ( product . getDescription ( ) , "" ) |
testSetArray ( ) { final org . scijava . util . IntArray array = new org . scijava . util . IntArray ( ) ; final int [ ] raw = new int [ ] { 1 , 2 , 3 , 5 , 8 , 13 , 21 } ; array . setArray ( raw ) ; "<AssertPlaceHolder>" ; } getArray ( ) { return array ; } | org . junit . Assert . assertSame ( raw , array . getArray ( ) ) |
testExactSubjectMatch ( ) { _messageBus . subscribe ( "Host" , new com . cloud . framework . messagebus . MessageSubscriber ( ) { @ com . cloud . messagebus . Override public void onPublishMessage ( final java . lang . String senderAddress , final java . lang . String subject , final java . lang . Object args ) { "<AssertPlaceHolder>" ; } } ) ; _messageBus . publish ( null , "Host" , PublishScope . LOCAL , null ) ; _messageBus . publish ( null , "VM" , PublishScope . LOCAL , null ) ; _messageBus . clearAll ( ) ; } onPublishMessage ( java . lang . String , java . lang . String , java . lang . Object ) { com . cloud . framework . messagebus . MessageDispatcher . dispatch ( _targetObject , subject , senderAddress , args ) ; } | org . junit . Assert . assertEquals ( subject , "Host" ) |
parseGpRmcTest ( ) { java . lang . String line = "$GPRMC,101134,A,5153.5205,N,00125.2184,E,003.1,194.1,010313,0,E*68" ; dk . dma . epd . common . prototype . sensor . nmea . RmcSentence sentence = new dk . dma . epd . common . prototype . sensor . nmea . RmcSentence . GpRmcSentence ( ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { java . lang . String [ ] fields = msg . split ( ",|\\*" ) ; if ( ( fields . length ) != 5 ) { throw new dk . dma . ais . sentence . SentenceException ( ( "Not<sp>four<sp>fields<sp>i<sp>PSTT<sp>sentence:<sp>" + msg ) ) ; } if ( ( fields [ 2 ] . equals ( "00000000" ) ) || ( fields [ 3 ] . equals ( "999999" ) ) ) { return false ; } java . lang . String dateStr = ( ( fields [ 2 ] ) + "<sp>" ) + ( fields [ 3 ] ) ; try { java . text . SimpleDateFormat dateFormat = new java . text . SimpleDateFormat ( "yyyyMMdd<sp>HHmmss" ) ; dateFormat . setTimeZone ( java . util . TimeZone . getTimeZone ( "GMT+0000" ) ) ; java . util . Date d = dateFormat . parse ( dateStr ) ; pntMessage = new dk . dma . epd . common . prototype . sensor . nmea . PntMessage ( PntSource . GPS , d . getTime ( ) ) ; } catch ( java . text . ParseException e ) { throw new dk . dma . ais . sentence . SentenceException ( ( "Wrong<sp>date<sp>format<sp>in<sp>PSTT<sp>sentence:<sp>" + msg ) ) ; } return true ; } | org . junit . Assert . assertEquals ( sentence . parse ( line ) , 0 ) |
testGetSchemaWithValidEncoding ( ) { final org . apache . nifi . schema . access . SchemaAccessStrategy schemaAccessStrategy = new org . apache . nifi . schema . access . HortonworksEncodedSchemaReferenceStrategy ( schemaRegistry ) ; final int protocol = 1 ; final long schemaId = 123456 ; final int version = 2 ; try ( final java . io . ByteArrayOutputStream bytesOut = new java . io . ByteArrayOutputStream ( ) ; final java . io . DataOutputStream out = new java . io . DataOutputStream ( bytesOut ) ) { out . write ( protocol ) ; out . writeLong ( schemaId ) ; out . writeInt ( version ) ; out . flush ( ) ; try ( final java . io . ByteArrayInputStream in = new java . io . ByteArrayInputStream ( bytesOut . toByteArray ( ) ) ) { final org . apache . nifi . serialization . record . SchemaIdentifier expectedSchemaIdentifier = org . apache . nifi . serialization . record . SchemaIdentifier . builder ( ) . id ( schemaId ) . version ( version ) . build ( ) ; when ( schemaRegistry . retrieveSchema ( argThat ( new org . apache . nifi . schema . access . SchemaIdentifierMatcher ( expectedSchemaIdentifier ) ) ) ) . thenReturn ( recordSchema ) ; final org . apache . nifi . serialization . record . RecordSchema retrievedSchema = schemaAccessStrategy . getSchema ( java . util . Collections . emptyMap ( ) , in , recordSchema ) ; "<AssertPlaceHolder>" ; } } } getSchema ( java . util . Map , java . io . InputStream , org . apache . nifi . serialization . record . RecordSchema ) { if ( ( this . context ) == null ) { throw new org . apache . nifi . schema . access . SchemaNotFoundException ( "Schema<sp>Access<sp>Strategy<sp>intended<sp>only<sp>for<sp>validation<sp>purposes<sp>and<sp>cannot<sp>obtain<sp>schema" ) ; } try { final org . apache . commons . csv . CSVFormat csvFormat = org . apache . nifi . csv . CSVUtils . createCSVFormat ( context ) . withFirstRecordAsHeader ( ) ; try ( final java . io . Reader reader = new java . io . InputStreamReader ( new org . apache . commons . io . input . BOMInputStream ( contentStream ) ) ; final org . apache . commons . csv . CSVParser csvParser = new org . apache . commons . csv . CSVParser ( reader , csvFormat ) ) { final java . util . List < org . apache . nifi . serialization . record . RecordField > fields = new java . util . ArrayList ( ) ; for ( final java . lang . String columnName : csvParser . getHeaderMap ( ) . keySet ( ) ) { fields . add ( new org . apache . nifi . serialization . record . RecordField ( columnName , RecordFieldType . STRING . getDataType ( ) , true ) ) ; } return new org . apache . nifi . serialization . SimpleRecordSchema ( fields ) ; } } catch ( final java . lang . Exception e ) { throw new org . apache . nifi . schema . access . SchemaNotFoundException ( "Failed<sp>to<sp>read<sp>Header<sp>line<sp>from<sp>CSV" , e ) ; } } | org . junit . Assert . assertNotNull ( retrievedSchema ) |
testConceptNameFailoverToDefaultClient ( ) { org . openmrs . Concept concept = new org . openmrs . Concept ( ) ; org . openmrs . ConceptName en = makePreferred ( "name<sp>en" , ClientConceptNamer . DEFAULT ) ; org . openmrs . ConceptName enClient = makePreferred ( "name<sp>en<sp>client" , ClientConceptNamer . DEFAULT_CLIENT ) ; concept . setNames ( java . util . Arrays . asList ( en , enClient ) ) ; java . lang . String name = new org . openmrs . projectbuendia . ClientConceptNamer ( new java . util . Locale ( "fr" ) ) . getClientName ( concept ) ; "<AssertPlaceHolder>" ; } getClientName ( org . openmrs . Concept ) { java . lang . String variant = locale . getVariant ( ) ; java . util . Locale . Builder builder = new java . util . Locale . Builder ( ) . setLocale ( locale ) ; if ( ! ( org . openmrs . projectbuendia . ClientConceptNamer . VARIANT . equals ( variant ) ) ) { builder . setVariant ( org . openmrs . projectbuendia . ClientConceptNamer . VARIANT ) ; if ( "" . equals ( locale . getCountry ( ) ) ) { builder . setRegion ( org . openmrs . projectbuendia . ClientConceptNamer . CLIENT_REGION ) ; } } java . lang . String name = getPreferredStringInLocaleOrNull ( concept , builder . build ( ) ) ; if ( name != null ) return name ; name = getPreferredStringInLocaleOrNull ( concept , locale ) ; if ( name != null ) return name ; if ( "" . equals ( locale . getCountry ( ) ) ) { name = getPreferredStringInLocaleOrNull ( concept , new java . util . Locale ( locale . getLanguage ( ) ) ) ; if ( name != null ) return name ; } name = getPreferredStringInLocaleOrNull ( concept , org . openmrs . projectbuendia . ClientConceptNamer . DEFAULT_CLIENT ) ; if ( name != null ) return name ; name = getPreferredStringInLocaleOrNull ( concept , org . openmrs . projectbuendia . ClientConceptNamer . DEFAULT ) ; if ( name != null ) return name ; org . openmrs . ConceptName defaultName = concept . getName ( ) ; if ( defaultName == null ) { org . openmrs . projectbuendia . ClientConceptNamer . log . error ( ( ( ( "No<sp>name<sp>found<sp>for<sp>concept:<sp>uuid=" + ( concept . getUuid ( ) ) ) + ",<sp>id=" ) + ( concept . getId ( ) ) ) ) ; return ( "[Concept<sp>" + ( concept . getId ( ) ) ) + "]" ; } return defaultName . getName ( ) ; } | org . junit . Assert . assertEquals ( "name<sp>en<sp>client" , name ) |
deflateAndBase64Encode_emptyInput ( ) { java . lang . String encodedString = encodingUtils . encodeForRedirectBinding ( "" ) ; "<AssertPlaceHolder>" ; } encodeForRedirectBinding ( java . lang . String ) { byte [ ] deflatedInput = deflate ( input ) ; java . lang . String base64String = new java . lang . String ( org . apache . commons . codec . binary . Base64 . encodeBase64 ( deflatedInput , false ) , "UTF-8" ) ; java . lang . String encodedString = java . net . URLEncoder . encode ( base64String , "UTF-8" ) ; return encodedString ; } | org . junit . Assert . assertEquals ( "" , encodedString ) |
testIndexer_Morphline_With_DryRun ( ) { writeHBaseRecord ( "--zk-host" 5 , com . google . common . collect . ImmutableMap . of ( "firstname" , "--morphline-id" 0 , "--zk-host" 4 , "Doe" ) ) ; indexerToolConf . set ( "--zk-host" 2 , "forcedBaz" ) ; indexerToolConf . set ( "--zk-host" 3 , "myBar" ) ; java . io . File indexerConfigFile = com . ngdata . hbaseindexer . mr . MRTestUtil . substituteZkHost ( new java . io . File ( "--zk-host" 1 ) , com . ngdata . hbaseindexer . mr . HBaseMapReduceIndexerToolDirectWriteTest . SOLR_TEST_UTILITY . getZkConnectString ( ) ) ; com . ngdata . hbaseindexer . mr . HBaseMapReduceIndexerToolDirectWriteTest . MR_TEST_UTIL . runTool ( "--hbase-indexer-file" , indexerConfigFile . toString ( ) , "--morphline-file" , new java . io . File ( "--zk-host" 6 ) . toString ( ) , "--morphline-id" , "--zk-host" 9 , "--zk-host" 0 , "0" , "--collection" , "--zk-host" 7 , "--zk-host" , com . ngdata . hbaseindexer . mr . HBaseMapReduceIndexerToolDirectWriteTest . SOLR_ZK , "--zk-host" 8 ) ; "<AssertPlaceHolder>" ; } executeSolrQuery ( java . lang . String ) { return executeSolrQuery ( com . ngdata . hbaseindexer . mr . HBaseMapReduceIndexerToolDirectWriteTest . COLLECTION1 , queryString ) ; } | org . junit . Assert . assertEquals ( 0 , executeSolrQuery ( "--morphline-id" 1 ) . size ( ) ) |
testMaxFeatures ( ) { org . geotools . data . Query query = new org . geotools . data . Query ( "Record" ) ; query . setMaxFeatures ( 2 ) ; org . geotools . feature . FeatureCollection records = store . getRecords ( query , Transaction . AUTO_COMMIT ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( featureCache ) != null ) { return featureCache . size ( ) ; } if ( ( org . geoserver . wfs . FeatureSizeFeatureCollection . FEATURE_CACHE_LIMIT ) > 0 ) { try { int count = featureSource . getCount ( query ) ; if ( count == 0 ) { featureCache = new java . util . ArrayList ( ) ; return count ; } if ( count > 0 ) { return count ; } java . util . List < org . opengis . feature . simple . SimpleFeature > tempFeatureCache = new java . util . ArrayList ( ) ; try ( org . geotools . data . simple . SimpleFeatureIterator it = featureSource . getFeatures ( query ) . features ( ) ) { count = 0 ; while ( it . hasNext ( ) ) { org . opengis . feature . simple . SimpleFeature feature = it . next ( ) ; if ( ( tempFeatureCache . size ( ) ) < ( org . geoserver . wfs . FeatureSizeFeatureCollection . FEATURE_CACHE_LIMIT ) ) { tempFeatureCache . add ( feature ) ; } count ++ ; } if ( count <= ( org . geoserver . wfs . FeatureSizeFeatureCollection . FEATURE_CACHE_LIMIT ) ) { featureCache = tempFeatureCache ; } else { tempFeatureCache . clear ( ) ; } return count ; } } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } } return super . size ( ) ; } | org . junit . Assert . assertEquals ( 2 , records . size ( ) ) |
testCreateLogicalRouterv6Template ( ) { template = "/VM_files/createStaticRoutev6.vm" ; java . util . Map < java . lang . String , java . lang . Object > extraParams = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; extraParams . put ( "disabledState" , EnabledState . DISABLED . toString ( ) ) ; extraParams . put ( "enabledState" , EnabledState . ENABLED . toString ( ) ) ; extraParams . put ( "elementName" , "" ) ; org . opennaas . extensions . router . capabilities . api . model . staticroute . StaticRoute staticRoute = getIPv6StaticRoute ( ) ; extraParams . put ( "nextHopSet" , ( ( ( staticRoute . getNextHopIpAddress ( ) ) != null ) && ( ! ( staticRoute . getNextHopIpAddress ( ) . isEmpty ( ) ) ) ) ) ; extraParams . put ( "discardSet" , staticRoute . isDiscard ( ) ) ; extraParams . put ( "preferenceSet" , ( ( ( staticRoute . getPreference ( ) ) != null ) && ( ( staticRoute . getPreference ( ) ) != ( org . opennaas . extensions . router . capability . staticroute . StaticRouteCapability . PREFERENCE_DEFAULT_VALUE ) ) ) ) ; java . lang . String expected = textFileToString ( "/actions/createStaticRoutev6.xml" ) ; java . lang . String message = callVelocity ( template , staticRoute , extraParams ) ; "<AssertPlaceHolder>" ; log . info ( org . opennaas . core . resources . helpers . XmlHelper . formatXML ( message ) ) ; } formatXML ( java . lang . String ) { if ( unformatted == null ) return null ; java . lang . String unformattedNoWhiteSpaces = unformatted . toString ( ) . replaceAll ( ">[\\s]+<" , "><" ) ; javax . xml . transform . Source xmlInput = new javax . xml . transform . stream . StreamSource ( new java . io . StringReader ( unformattedNoWhiteSpaces ) ) ; javax . xml . transform . stream . StreamResult xmlOutput = new javax . xml . transform . stream . StreamResult ( new java . io . StringWriter ( ) ) ; javax . xml . transform . Transformer transformer = javax . xml . transform . TransformerFactory . newInstance ( ) . newTransformer ( ) ; transformer . setOutputProperty ( OutputKeys . OMIT_XML_DECLARATION , "yes" ) ; transformer . setOutputProperty ( OutputKeys . INDENT , "yes" ) ; transformer . setOutputProperty ( "{http://xml.apache.org/xslt}indent-amount" , "2" ) ; transformer . transform ( xmlInput , xmlOutput ) ; java . lang . String formatted = xmlOutput . getWriter ( ) . toString ( ) ; return formatted ; } | org . junit . Assert . assertEquals ( org . opennaas . core . resources . helpers . XmlHelper . formatXML ( expected ) , org . opennaas . core . resources . helpers . XmlHelper . formatXML ( message ) ) |
testSerialization ( ) { org . jfree . chart . renderer . category . LevelRenderer r1 = new org . jfree . chart . renderer . category . LevelRenderer ( ) ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( r1 ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; org . jfree . chart . renderer . category . LevelRenderer r2 = ( ( org . jfree . chart . renderer . category . LevelRenderer ) ( in . readObject ( ) ) ) ; in . close ( ) ; "<AssertPlaceHolder>" ; } close ( ) { try { this . connection . close ( ) ; } catch ( java . lang . Exception e ) { System . err . println ( "JdbcXYDataset:<sp>swallowing<sp>exception." ) ; } } | org . junit . Assert . assertEquals ( r1 , r2 ) |
testCites ( ) { java . lang . String citesString = "164\n" + ( ( ( ( ( ( ( "ABILITY\tGPQ\tPREPROD\tQFJ\tSEX\tCITES\tPUBS\n" + ".29\t.25\t.34\t.37\t.13\t1.0\n" 0 ) + ".29\t.25\t.34\t.37\t.13\t1.0\n" 4 ) + ".25\t.09\t1.0\n" ) + ".29\t.25\t.34\t.37\t.13\t1.0\n" 5 ) + "-.10\t.00\t.03\t.10\t1.0\n" ) + ".29\t.25\t.34\t.37\t.13\t1.0\n" ) + ".18\t.15\t.19\t.41\t.43\t.55\t1.0" ) ; char [ ] citesChars = citesString . toCharArray ( ) ; edu . cmu . tetrad . test . DataReader reader = new edu . cmu . tetrad . test . DataReader ( ) ; edu . cmu . tetrad . test . ICovarianceMatrix dataSet = reader . parseCovariance ( citesChars ) ; edu . cmu . tetrad . test . IKnowledge knowledge = new edu . cmu . tetrad . test . Knowledge2 ( ) ; knowledge . addToTier ( 1 , "ABILITY" ) ; knowledge . addToTier ( 2 , ".29\t.25\t.34\t.37\t.13\t1.0\n" 2 ) ; knowledge . addToTier ( 3 , ".29\t.25\t.34\t.37\t.13\t1.0\n" 3 ) ; knowledge . addToTier ( 3 , "PREPROD" ) ; knowledge . addToTier ( 4 , "SEX" ) ; knowledge . addToTier ( 5 , ".29\t.25\t.34\t.37\t.13\t1.0\n" 1 ) ; knowledge . addToTier ( 6 , "CITES" ) ; edu . cmu . tetrad . test . Pc pc = new edu . cmu . tetrad . test . Pc ( new edu . cmu . tetrad . test . IndTestFisherZ ( dataSet , 0.11 ) ) ; pc . setKnowledge ( knowledge ) ; edu . cmu . tetrad . test . Graph pattern = pc . search ( ) ; edu . cmu . tetrad . test . Graph _true = new edu . cmu . tetrad . test . EdgeListGraph ( pattern . getNodes ( ) ) ; _true . addDirectedEdge ( pattern . getNode ( "ABILITY" ) , pattern . getNode ( "CITES" ) ) ; _true . addDirectedEdge ( pattern . getNode ( "ABILITY" ) , pattern . getNode ( ".29\t.25\t.34\t.37\t.13\t1.0\n" 2 ) ) ; _true . addDirectedEdge ( pattern . getNode ( "ABILITY" ) , pattern . getNode ( "PREPROD" ) ) ; _true . addDirectedEdge ( pattern . getNode ( ".29\t.25\t.34\t.37\t.13\t1.0\n" 2 ) , pattern . getNode ( ".29\t.25\t.34\t.37\t.13\t1.0\n" 3 ) ) ; _true . addDirectedEdge ( pattern . getNode ( "PREPROD" ) , pattern . getNode ( "CITES" ) ) ; _true . addDirectedEdge ( pattern . getNode ( "PREPROD" ) , pattern . getNode ( ".29\t.25\t.34\t.37\t.13\t1.0\n" 1 ) ) ; _true . addDirectedEdge ( pattern . getNode ( ".29\t.25\t.34\t.37\t.13\t1.0\n" 1 ) , pattern . getNode ( "CITES" ) ) ; _true . addDirectedEdge ( pattern . getNode ( ".29\t.25\t.34\t.37\t.13\t1.0\n" 3 ) , pattern . getNode ( "CITES" ) ) ; _true . addDirectedEdge ( pattern . getNode ( ".29\t.25\t.34\t.37\t.13\t1.0\n" 3 ) , pattern . getNode ( ".29\t.25\t.34\t.37\t.13\t1.0\n" 1 ) ) ; _true . addDirectedEdge ( pattern . getNode ( "SEX" ) , pattern . getNode ( ".29\t.25\t.34\t.37\t.13\t1.0\n" 1 ) ) ; System . out . println ( pattern ) ; "<AssertPlaceHolder>" ; } println ( java . lang . String ) { System . out . println ( s ) ; if ( ( out ) != null ) { out . println ( s ) ; out . flush ( ) ; } } | org . junit . Assert . assertEquals ( pattern , _true ) |
testRequestStatusShouldBeFailedAfterError ( ) { com . vmware . admiral . compute . container . ContainerDescriptionService . ContainerDescription desc1 = com . vmware . admiral . request . util . TestRequestStateFactory . createContainerDescription ( "name1" ) ; com . vmware . admiral . compute . container . ContainerDescriptionService . ContainerDescription desc2 = com . vmware . admiral . request . util . TestRequestStateFactory . createContainerDescription ( "name2" ) ; desc2 . portBindings = null ; desc2 . affinity = new java . lang . String [ ] { desc1 . name } ; com . vmware . admiral . compute . container . CompositeDescriptionService . CompositeDescription compositeDesc = createCompositeDesc ( desc1 , desc2 ) ; com . vmware . xenon . common . Service service = new com . vmware . admiral . service . test . MockDockerAdapterService ( ) ; service . setSelfLink ( MockDockerAdapterService . SELF_LINK ) ; stopService ( service ) ; com . vmware . admiral . request . RequestBrokerService . RequestBrokerState request = com . vmware . admiral . request . util . TestRequestStateFactory . createRequestState ( ResourceType . COMPOSITE_COMPONENT_TYPE . getName ( ) , compositeDesc . documentSelfLink ) ; request . tenantLinks = groupPlacementState . tenantLinks ; request = startRequest ( request ) ; waitForRequestToFail ( request ) ; requestId = extractId ( request . documentSelfLink ) ; waitFor ( ( ) -> { com . vmware . admiral . request . RequestStatusService . RequestStatus status = getRequestStatus ( requestId ) ; return ( com . vmware . xenon . common . TaskState . isFailed ( status . taskInfo ) ) && ( ( status . progress . intValue ( ) ) < 100 ) ; } ) ; com . vmware . admiral . request . RequestStatusService . RequestStatus requestStatus = getRequestStatus ( requestId ) ; for ( java . util . Map < java . lang . String , java . lang . Integer > value : requestStatus . requestProgressByComponent . values ( ) ) { value . replaceAll ( ( k , v ) -> 100 ) ; } requestStatus . documentSelfLink = ( requestId ) + "-name2" ; requestStatus . taskInfo = com . vmware . xenon . common . TaskState . createAsStarted ( ) ; requestStatus . progress = 100 ; requestStatus . subStage = DefaultSubStage . ERROR . name ( ) ; requestStatus . phase = "Container<sp>Allocation" ; doOperation ( requestStatus , com . vmware . xenon . common . UriUtils . buildUri ( host , getRequestStatus ( requestId ) . documentSelfLink ) , false , Action . PATCH ) ; waitFor ( ( ) -> { com . vmware . admiral . request . RequestStatusService . RequestStatus state = getRequestStatus ( requestId ) ; return ( DefaultSubStage . ERROR . name ( ) . equals ( state . subStage ) ) && ( ( state . progress . intValue ( ) ) == 100 ) ; } ) ; requestStatus . taskInfo = com . vmware . xenon . common . TaskState . createAsFinished ( ) ; doOperation ( requestStatus , com . vmware . xenon . common . UriUtils . buildUri ( host , getRequestStatus ( requestId ) . documentSelfLink ) , false , Action . PATCH ) ; com . vmware . admiral . request . RequestStatusService . RequestStatus finalStatus = getRequestStatus ( requestId ) ; "<AssertPlaceHolder>" ; } isFailed ( com . vmware . admiral . test . integration . client . TaskState ) { return ( taskInfo . stage ) == ( com . vmware . admiral . test . integration . client . TaskState . TaskStage . FAILED ) ; } | org . junit . Assert . assertTrue ( com . vmware . xenon . common . TaskState . isFailed ( finalStatus . taskInfo ) ) |
testGetProjectFromIndexPatternWhenUserCreated ( ) { "<AssertPlaceHolder>" ; } getProjectFromIndexPattern ( java . lang . String ) { if ( org . apache . commons . lang . StringUtils . isEmpty ( index ) ) { return io . fabric8 . elasticsearch . plugin . model . Project . EMPTY ; } java . util . regex . Matcher matcher = reIndexPattern . matcher ( index ) ; if ( matcher . matches ( ) ) { return new io . fabric8 . elasticsearch . plugin . model . Project ( matcher . group ( "name" ) , matcher . group ( "uid" ) ) ; } return new io . fabric8 . elasticsearch . plugin . model . Project ( index , null ) ; } | org . junit . Assert . assertEquals ( new io . fabric8 . elasticsearch . plugin . model . Project ( "foo" , null ) , utils . getProjectFromIndexPattern ( "foo" ) ) |
scanIndexForwardFalseTest ( ) { createTable ( hashRangeTableName , createStringAttributeDefinition ( "hashCode" ) , createStringAttributeDefinition ( "rangeCode" ) ) ; { com . michelboudreau . testv2 . TestClassWithHashRangeKey c = new com . michelboudreau . testv2 . TestClassWithHashRangeKey ( ) ; c . setHashCode ( "code" ) ; c . setRangeCode ( "1" ) ; c . setStringData ( "first" ) ; mapper . save ( c ) ; } { com . michelboudreau . testv2 . TestClassWithHashRangeKey c = new com . michelboudreau . testv2 . TestClassWithHashRangeKey ( ) ; c . setHashCode ( "code" ) ; c . setRangeCode ( "2" ) ; c . setStringData ( "second" ) ; mapper . save ( c ) ; } java . lang . String code = "code" ; com . michelboudreau . testv2 . TestClassWithHashRangeKey hashKeyTemplate = new com . michelboudreau . testv2 . TestClassWithHashRangeKey ( ) ; hashKeyTemplate . setHashCode ( code ) ; java . util . Map < java . lang . String , com . amazonaws . services . dynamodbv2 . model . Condition > emptyRangeConditions = new java . util . HashMap < java . lang . String , com . amazonaws . services . dynamodbv2 . model . Condition > ( ) ; com . amazonaws . services . dynamodbv2 . datamodeling . DynamoDBQueryExpression < com . michelboudreau . testv2 . TestClassWithHashRangeKey > query = new com . amazonaws . services . dynamodbv2 . datamodeling . DynamoDBQueryExpression < com . michelboudreau . testv2 . TestClassWithHashRangeKey > ( ) . withHashKeyValues ( hashKeyTemplate ) . withRangeKeyConditions ( emptyRangeConditions ) . withScanIndexForward ( false ) . withLimit ( 1 ) ; com . michelboudreau . testv2 . TestClassWithHashRangeKey res = mapper . query ( com . michelboudreau . testv2 . TestClassWithHashRangeKey . class , query ) . get ( 0 ) ; "<AssertPlaceHolder>" ; } getStringData ( ) { return stringData ; } | org . junit . Assert . assertEquals ( "second" , res . getStringData ( ) ) |
testRead ( ) { final java . util . Set < java . lang . String > fields = com . yahoo . ycsb . db . elasticsearch5 . ElasticsearchIntegTestBase . MOCK_DATA . keySet ( ) ; final java . util . HashMap < java . lang . String , com . yahoo . ycsb . ByteIterator > resultParam = new java . util . HashMap ( 10 ) ; final com . yahoo . ycsb . Status result = db . read ( com . yahoo . ycsb . db . elasticsearch5 . ElasticsearchIntegTestBase . MOCK_TABLE , "1" , fields , resultParam ) ; "<AssertPlaceHolder>" ; } read ( java . lang . String , java . lang . String , com . yahoo . ycsb . db . rocksdb . Set , com . yahoo . ycsb . db . rocksdb . Map ) { try { if ( ! ( com . yahoo . ycsb . db . rocksdb . RocksDBClient . COLUMN_FAMILIES . containsKey ( table ) ) ) { createColumnFamily ( table ) ; } final com . yahoo . ycsb . db . rocksdb . ColumnFamilyHandle cf = com . yahoo . ycsb . db . rocksdb . RocksDBClient . COLUMN_FAMILIES . get ( table ) . getHandle ( ) ; final byte [ ] values = com . yahoo . ycsb . db . rocksdb . RocksDBClient . rocksDb . get ( cf , key . getBytes ( com . yahoo . ycsb . db . rocksdb . UTF_8 ) ) ; if ( values == null ) { return com . yahoo . ycsb . Status . NOT_FOUND ; } deserializeValues ( values , fields , result ) ; return com . yahoo . ycsb . Status . OK ; } catch ( final com . yahoo . ycsb . db . rocksdb . RocksDBException e ) { com . yahoo . ycsb . db . rocksdb . RocksDBClient . LOGGER . error ( e . getMessage ( ) , e ) ; return com . yahoo . ycsb . Status . ERROR ; } } | org . junit . Assert . assertEquals ( Status . OK , result ) |
testZeroRequestWitKeyWithoutSemiColon ( ) { org . apache . pig . data . Tuple input = tupleFactory . newTuple ( 2 ) ; input . set ( 0 , "http://en.m.wikipedia.org/wiki/The_Slave_Hunters" ) ; input . set ( 1 , "zero=420-01" ) ; org . wikimedia . analytics . kraken . pig . ZeroFilterFunc zero = new org . wikimedia . analytics . kraken . pig . ZeroFilterFunc ( "default" ) ; "<AssertPlaceHolder>" ; } exec ( org . apache . pig . data . Tuple ) { if ( ( input == null ) || ( ( input . get ( 0 ) ) == null ) ) { return null ; } java . lang . String url = ( ( java . lang . String ) ( input . get ( 0 ) ) ) ; java . lang . String referer = ( ( java . lang . String ) ( input . get ( 1 ) ) ) ; java . lang . String userAgent = ( ( input . get ( 2 ) ) != null ) ? ( ( java . lang . String ) ( input . get ( 2 ) ) ) : "-" ; java . lang . String statusCode = ( ( input . get ( 3 ) ) != null ) ? ( ( java . lang . String ) ( input . get ( 3 ) ) ) : "-" ; java . lang . String ip = ( ( input . get ( 4 ) ) != null ) ? ( ( java . lang . String ) ( input . get ( 4 ) ) ) : "-" ; java . lang . String mimeType = ( ( input . get ( 5 ) ) != null ) ? ( ( java . lang . String ) ( input . get ( 5 ) ) ) : "-" ; java . lang . String requestMethod = ( ( input . get ( 6 ) ) != null ) ? ( ( java . lang . String ) ( input . get ( 6 ) ) ) : "-" ; org . wikimedia . analytics . kraken . pageview . Pageview pageview = new org . wikimedia . analytics . kraken . pageview . Pageview ( url , referer , userAgent , statusCode , ip , mimeType , requestMethod ) ; output = tupleFactory . newTuple ( 3 ) ; output . set ( 0 , ( pageview . isPageview ( ) ? 1 : 0 ) ) ; output . set ( 1 , ( pageview . isWebstatscollectorPageview ( ) ? 1 : 0 ) ) ; output . set ( 2 , ( pageview . isWikistatsMobileReportPageview ( ) ? 1 : 0 ) ) ; return output ; } | org . junit . Assert . assertTrue ( zero . exec ( input ) ) |
testMemFactor ( ) { double expectedMemFactor = 1024.0 * 1024.0 ; double actualMemFactor = com . github . aureliano . evtbridge . core . profile . ProfileConstants . MEM_FACTOR ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( expectedMemFactor , actualMemFactor , 0 ) |
multibyteCharacters ( ) { java . lang . String json = "{\"value\":\"這或是因\"}" ; java . util . Map < java . lang . String , java . lang . Object > obj = ( ( java . util . Map < java . lang . String , java . lang . Object > ) ( org . glassfish . admingui . common . util . JSONUtil . jsonToJava ( json ) ) ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return org . glassfish . flashlight . impl . client . Strings . strings . get ( indexString ) ; } | org . junit . Assert . assertEquals ( "" , obj . get ( "value" ) ) |
testGetFullName_with_valid_input ( ) { instance = new com . captaindebug . name . Name ( "John" , "Stephen" , "Smith" ) ; final java . lang . String expected = "John<sp>Stephen<sp>Smith" ; java . lang . String result = instance . getFullName ( ) ; "<AssertPlaceHolder>" ; } getFullName ( ) { if ( ( ( isValidString ( firstName ) ) && ( isValidString ( middleName ) ) ) && ( isValidString ( surname ) ) ) { return ( ( ( ( firstName ) + "<sp>" ) + ( middleName ) ) + "<sp>" ) + ( surname ) ; } else { throw new java . lang . RuntimeException ( "Invalid<sp>Name<sp>Values" ) ; } } | org . junit . Assert . assertEquals ( expected , result ) |
testCancelCheckout2 ( ) { org . apache . chemistry . opencmis . commons . data . ObjectData ob = getObjectByPath ( "/testfolder1/testfile2" ) ; java . lang . String id = ob . getId ( ) ; org . apache . chemistry . opencmis . commons . data . Properties props = createProperties ( "dc:title" , "newtitle" ) ; byte [ ] bytes = "foo-bar" . getBytes ( "UTF-8" ) ; java . io . ByteArrayInputStream in = new java . io . ByteArrayInputStream ( bytes ) ; org . apache . chemistry . opencmis . commons . data . ContentStream cs = new org . apache . chemistry . opencmis . commons . impl . dataobjects . ContentStreamImpl ( "test.txt" , java . math . BigInteger . valueOf ( bytes . length ) , "text/plain" , in ) ; org . apache . chemistry . opencmis . commons . spi . Holder < java . lang . String > idHolder = new org . apache . chemistry . opencmis . commons . spi . Holder ( id ) ; verService . checkIn ( repositoryId , idHolder , Boolean . TRUE , props , cs , "comment" , null , null , null , null ) ; java . lang . String vid = idHolder . getValue ( ) ; org . apache . chemistry . opencmis . commons . data . ObjectData ver = getObject ( vid ) ; checkValue ( PropertyIds . IS_LATEST_VERSION , Boolean . TRUE , ver ) ; checkValue ( PropertyIds . VERSION_LABEL , "1.0" , ver ) ; checkValue ( PropertyIds . CHECKIN_COMMENT , "comment" , ver ) ; checkValue ( "dc:title" , "newtitle" , ver ) ; verService . checkOut ( repositoryId , idHolder , null , null ) ; java . lang . String pwcId = idHolder . getValue ( ) ; org . apache . chemistry . opencmis . commons . data . ObjectData pwc = getObject ( pwcId ) ; checkValue ( PropertyIds . VERSION_LABEL , null , pwc ) ; checkValue ( PropertyIds . VERSION_SERIES_ID , NOT_NULL , pwc ) ; checkValue ( PropertyIds . IS_VERSION_SERIES_CHECKED_OUT , Boolean . TRUE , pwc ) ; waitForAsyncCompletion ( ) ; verService . cancelCheckOut ( repositoryId , pwcId , null ) ; ob = getObject ( id ) ; "<AssertPlaceHolder>" ; checkValue ( PropertyIds . VERSION_LABEL , "1.0" , ob ) ; checkValue ( PropertyIds . VERSION_SERIES_ID , NOT_NULL , ob ) ; checkValue ( PropertyIds . IS_VERSION_SERIES_CHECKED_OUT , Boolean . FALSE , ob ) ; } getId ( ) { return binaryManager . getStorageDir ( ) . toURI ( ) . toString ( ) ; } | org . junit . Assert . assertEquals ( id , ob . getId ( ) ) |
tryExtractFromMapNoMetadataSucceed ( ) { java . lang . Object metadata = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) { { put ( "key1" , "value1" ) ; put ( "key2" , "value2" ) ; } } ; com . microsoft . azure . sdk . iot . deps . twin . TwinMetadata twinMetadata = mockit . Deencapsulation . invoke ( com . microsoft . azure . sdk . iot . deps . twin . TwinMetadata . class , "tryExtractFromMap" , new java . lang . Class [ ] { java . lang . Object . class } , metadata ) ; "<AssertPlaceHolder>" ; } put ( java . lang . String , java . lang . Object ) { if ( ( key == null ) || ( key . isEmpty ( ) ) ) { if ( ( ! ( key . equals ( com . microsoft . azure . sdk . iot . provisioning . service . configs . TwinCollection . VERSION_TAG ) ) ) && ( ! ( key . equals ( com . microsoft . azure . sdk . iot . provisioning . service . configs . TwinCollection . METADATA_TAG ) ) ) ) { com . microsoft . azure . sdk . iot . deps . serializer . ParserUtility . validateMap ( this , com . microsoft . azure . sdk . iot . provisioning . service . configs . TwinCollection . MAX_TWIN_LEVEL , true ) ; } return last ; } | org . junit . Assert . assertNull ( twinMetadata ) |
insert ( ) { com . dexcoder . test . model . User user = new com . dexcoder . test . model . User ( ) ; user . setLoginName ( "selfly_12" ) ; user . setPassword ( "123456" ) ; user . setEmail ( "javaer@live.com" ) ; user . setUserAge ( 18 ) ; user . setUserType ( "1" ) ; user . setGmtCreate ( new java . util . Date ( ) ) ; java . lang . Long id = jdbcDao . insert ( user ) ; "<AssertPlaceHolder>" ; } insert ( java . lang . Class ) { return new com . dexcoder . dal . build . Criteria ( clazz , new com . dexcoder . dal . build . InsertBuilder ( clazz ) ) ; } | org . junit . Assert . assertNotNull ( id ) |
validTrueBoolean ( ) { boolean result = org . kaazing . gateway . util . Utils . parseBoolean ( "bushells" , "true" , false ) ; "<AssertPlaceHolder>" ; } parseBoolean ( java . lang . String , java . lang . String , boolean ) { boolean result = defaultValue ; if ( value != null ) { boolean valid = true ; result = java . lang . Boolean . parseBoolean ( value ) ; if ( ! result ) { if ( ! ( Boolean . FALSE . toString ( ) . equalsIgnoreCase ( value ) ) ) { valid = false ; } } if ( ! valid ) { java . lang . String message = java . lang . String . format ( "Invalid<sp>value<sp>\"%s\"<sp>for<sp>%s,<sp>must<sp>be<sp>\"%s\"<sp>or<sp>\"%s\"" , value , valueName , Boolean . TRUE . toString ( ) , Boolean . FALSE . toString ( ) ) ; throw new java . lang . IllegalArgumentException ( message ) ; } } return result ; } | org . junit . Assert . assertEquals ( true , result ) |
current_quarter_with_java ( ) { java . util . Calendar cal = java . util . Calendar . getInstance ( ) ; cal . set ( Calendar . MONTH , 3 ) ; int month = cal . get ( Calendar . MONTH ) ; int quarter = 0 ; if ( month <= 3 ) { quarter = 1 ; } else if ( month <= 6 ) { quarter = 2 ; } else if ( month <= 9 ) { quarter = 3 ; } else { quarter = 4 ; } "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( 1 , quarter ) |
testGetMainSchemaFromInputConnector ( ) { org . talend . components . jdbc . tjdbcoutput . TJDBCOutputProperties properties = new org . talend . components . jdbc . tjdbcoutput . TJDBCOutputProperties ( "output" ) ; properties . init ( ) ; org . apache . avro . Schema schema = org . talend . components . jdbc . CommonUtils . getMainSchemaFromInputConnector ( properties ) ; "<AssertPlaceHolder>" ; } getMainSchemaFromInputConnector ( org . talend . components . api . properties . ComponentProperties ) { java . util . Set < ? extends org . talend . components . api . component . Connector > inputConnectors = properties . getPossibleConnectors ( false ) ; if ( inputConnectors == null ) { return null ; } for ( org . talend . components . api . component . Connector connector : inputConnectors ) { if ( Connector . MAIN_NAME . equals ( connector . getName ( ) ) ) { return properties . getSchema ( connector , false ) ; } } return null ; } | org . junit . Assert . assertNotNull ( schema ) |
testDefaultWindowCount ( ) { "<AssertPlaceHolder>" ; } getWindowHandles ( ) { return com . google . common . collect . ImmutableList . copyOf ( windows . asStack ( ) ) ; } | org . junit . Assert . assertTrue ( ( ( driver . getWindowHandles ( ) . size ( ) ) >= 1 ) ) |
testCustomSpringMvnPlugin ( ) { com . mangofactory . swagger . configuration . SpringSwaggerConfig springSwaggerConfig = new com . mangofactory . swagger . configuration . SpringSwaggerConfig ( ) ; org . lnu . configuration . converters . CustomSwaggerSpringMvcPlugin unit = new org . lnu . configuration . converters . CustomSwaggerSpringMvcPlugin ( springSwaggerConfig ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( unit ) |
testGroovyVersionSupportsActionFalse ( ) { doReturn ( org . codehaus . gmavenplus . model . Version . parseFromString ( "1.0" ) ) . when ( generateStubsMojo . classWrangler ) . getGroovyVersion ( ) ; "<AssertPlaceHolder>" ; } groovyVersionSupportsAction ( ) { return ( ( classWrangler . getGroovyVersion ( ) ) != null ) && ( groovyAtLeast ( minGroovyVersion ) ) ; } | org . junit . Assert . assertFalse ( generateStubsMojo . groovyVersionSupportsAction ( ) ) |
testPointInt ( ) { final net . imglib2 . Point p = new net . imglib2 . Point ( 3 ) ; "<AssertPlaceHolder>" ; } numDimensions ( ) { return sourceInterval . numDimensions ( ) ; } | org . junit . Assert . assertEquals ( p . numDimensions ( ) , 3 ) |
keySet_toArray_withSmallTarget ( ) { org . eclipse . collections . impl . map . sorted . immutable . ImmutableTreeMap < java . lang . Integer , java . lang . String > immutableSortedMap = new org . eclipse . collections . impl . map . sorted . immutable . ImmutableTreeMap ( SortedMaps . mutable . of ( 1 , "1" , 2 , "2" , 3 , "3" , 4 , "4" ) ) ; java . lang . Integer [ ] destination = new java . lang . Integer [ 2 ] ; java . lang . Integer [ ] result = immutableSortedMap . keySet ( ) . toArray ( destination ) ; java . util . Arrays . sort ( result ) ; "<AssertPlaceHolder>" ; } sort ( java . util . Comparator ) { this . insertionSort ( org . eclipse . collections . impl . block . factory . Comparators . comparableComparatorIfNull ( comparator ) ) ; } | org . junit . Assert . assertArrayEquals ( new java . lang . Integer [ ] { 1 , 2 , 3 , 4 } , result ) |
parseNoWikiArticles ( ) { java . util . Hashtable < java . lang . String , org . wikireverse . commoncrawl . LinkWritable > links = createResults ( TestHelper . RESULT_1 , TestHelper . WIKI_TEXT_NO_WIKI_ARTICLES ) ; "<AssertPlaceHolder>" ; } createResults ( java . lang . String , java . lang . String ) { org . apache . hadoop . io . Text metadata = org . wikireverse . commoncrawl . test . TestHelper . getMetadata ( testFileName ) ; org . apache . hadoop . mapred . Reporter reporter = mock ( org . apache . hadoop . mapred . Reporter . class ) ; org . wikireverse . commoncrawl . Page page = org . wikireverse . commoncrawl . MetadataParser . parse ( new org . wikireverse . commoncrawl . Page ( url ) , metadata , TestHelper . LINK_TYPE , TestHelper . WIKIPEDIA_DOMAIN ) ; org . wikireverse . commoncrawl . WikiMetadata wikiMetadata = new org . wikireverse . commoncrawl . WikiMetadata ( ) ; return wikiMetadata . createResults ( page , reporter ) ; } | org . junit . Assert . assertEquals ( 0 , links . size ( ) ) |
testUnlimitedQuantity ( ) { consumer . setFact ( org . candlepin . policy . js . quantity . QuantityRulesTest . SOCKET_FACT , "8" ) ; pool . getProduct ( ) . setAttribute ( org . candlepin . policy . js . quantity . QuantityRulesTest . SOCKET_ATTRIBUTE , "2" ) ; pool . setQuantity ( new java . lang . Long ( ( - 1 ) ) ) ; org . candlepin . dto . rules . v1 . SuggestedQuantityDTO suggested = quantityRules . getSuggestedQuantity ( pool , consumer , new java . util . Date ( ) ) ; "<AssertPlaceHolder>" ; } getSuggested ( ) { return suggested ; } | org . junit . Assert . assertEquals ( new java . lang . Long ( 4 ) , suggested . getSuggested ( ) ) |
testJoinClauseListAsEmpty ( ) { setUp ( new java . util . ArrayList < org . apache . olingo . odata2 . jpa . processor . api . access . JPAJoinClause > ( ) ) ; org . apache . olingo . odata2 . jpa . processor . core . jpql . JPQLJoinStatementBuilder jpqlJoinStatementBuilder = new org . apache . olingo . odata2 . jpa . processor . core . jpql . JPQLJoinStatementBuilder ( context ) ; try { jpqlJoinStatementBuilder . build ( ) ; org . junit . Assert . fail ( "Should<sp>not<sp>have<sp>come<sp>here" ) ; } catch ( org . apache . olingo . odata2 . jpa . processor . api . exception . ODataJPARuntimeException e ) { "<AssertPlaceHolder>" ; } } build ( ) { return properties ; } | org . junit . Assert . assertTrue ( true ) |
testChooseAlternative ( ) { org . apache . cxf . message . Message m = new org . apache . cxf . message . MessageImpl ( ) ; org . apache . cxf . ws . policy . EffectivePolicyImpl epi = new org . apache . cxf . ws . policy . EffectivePolicyImpl ( ) ; org . apache . neethi . Policy policy = new org . apache . neethi . Policy ( ) ; epi . setPolicy ( policy ) ; org . apache . cxf . ws . policy . PolicyEngineImpl engine = control . createMock ( org . apache . cxf . ws . policy . PolicyEngineImpl . class ) ; org . apache . cxf . ws . policy . Assertor assertor = control . createMock ( org . apache . cxf . ws . policy . Assertor . class ) ; org . apache . cxf . ws . policy . AlternativeSelector selector = control . createMock ( org . apache . cxf . ws . policy . AlternativeSelector . class ) ; org . easymock . EasyMock . expect ( engine . getAlternativeSelector ( ) ) . andReturn ( selector ) ; org . easymock . EasyMock . expect ( selector . selectAlternative ( policy , engine , assertor , null , m ) ) . andReturn ( null ) ; control . replay ( ) ; try { epi . chooseAlternative ( engine , assertor , m ) ; org . junit . Assert . fail ( "Expected<sp>PolicyException<sp>not<sp>thrown." ) ; } catch ( org . apache . cxf . ws . policy . PolicyException ex ) { } control . verify ( ) ; control . reset ( ) ; org . easymock . EasyMock . expect ( engine . getAlternativeSelector ( ) ) . andReturn ( selector ) ; java . util . Collection < org . apache . neethi . Assertion > alternative = new java . util . ArrayList ( ) ; org . easymock . EasyMock . expect ( selector . selectAlternative ( policy , engine , assertor , null , m ) ) . andReturn ( alternative ) ; control . replay ( ) ; epi . chooseAlternative ( engine , assertor , m ) ; java . util . Collection < org . apache . neethi . Assertion > choice = epi . getChosenAlternative ( ) ; "<AssertPlaceHolder>" ; control . verify ( ) ; } getChosenAlternative ( ) { return chosenAlternative ; } | org . junit . Assert . assertSame ( choice , alternative ) |
testAccessGetServiceWithRights ( ) { net . maritimecloud . identityregistry . model . database . entities . Service service = new net . maritimecloud . identityregistry . model . database . entities . Service ( ) ; service . setMrn ( "urn:mrn:mcl:service:instance:dma:nw-nm" ) ; service . setName ( "urn:mrn:mcl:service:instance:dma:nw-nm" 2 ) ; service . setInstanceVersion ( "0.3.4" ) ; service . setIdOrganization ( 1L ) ; java . lang . String serviceJson = serialize ( service ) ; net . maritimecloud . identityregistry . model . database . Organization org = spy ( net . maritimecloud . identityregistry . model . database . Organization . class ) ; org . setMrn ( "urn:mrn:mcl:org:dma" ) ; org . setAddress ( "Carl<sp>Jakobsensvej<sp>31,<sp>2500<sp>Valby" ) ; org . setCountry ( "Denmark" ) ; org . setUrl ( "http://dma.dk" ) ; org . setEmail ( "dma@dma.dk" ) ; org . setName ( "Danish<sp>Maritime<sp>Authority" ) ; java . util . Set < net . maritimecloud . identityregistry . model . database . IdentityProviderAttribute > identityProviderAttributes = new java . util . HashSet ( ) ; org . setIdentityProviderAttributes ( identityProviderAttributes ) ; org . keycloak . adapters . springsecurity . token . KeycloakAuthenticationToken auth = net . maritimecloud . identityregistry . controllers . TokenGenerator . generateKeycloakToken ( "urn:mrn:mcl:org:dma" , "urn:mrn:mcl:service:instance:dma:nw-nm" 3 , "urn:mrn:mcl:service:instance:dma:nw-nm" 0 ) ; given ( this . organizationService . getOrganizationByMrn ( "urn:mrn:mcl:org:dma" ) ) . willReturn ( org ) ; given ( ( ( net . maritimecloud . identityregistry . services . ServiceService ) ( this . entityService ) ) . getServiceByMrnAndVersion ( "urn:mrn:mcl:service:instance:dma:nw-nm" , "0.3.4" ) ) . willReturn ( service ) ; when ( org . getId ( ) ) . thenReturn ( 1L ) ; try { mvc . perform ( get ( "/oidc/api/org/urn:mrn:mcl:org:dma/service/urn:mrn:mcl:service:instance:dma:nw-nm/0.3.4" ) . with ( authentication ( auth ) ) . header ( "urn:mrn:mcl:service:instance:dma:nw-nm" 1 , "bla" ) ) . andExpect ( status ( ) . isOk ( ) ) . andExpect ( content ( ) . json ( serviceJson , false ) ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; "<AssertPlaceHolder>" ; } verify ( ( ( net . maritimecloud . identityregistry . services . ServiceService ) ( this . entityService ) ) , atLeastOnce ( ) ) . getServiceByMrnAndVersion ( "urn:mrn:mcl:service:instance:dma:nw-nm" , "0.3.4" ) ; } getId ( ) { return id ; } | org . junit . Assert . assertTrue ( false ) |
testIsDiscretionaryProperty ( ) { org . camunda . bpm . engine . impl . cmmn . model . CmmnActivity activity = handler . handleElement ( discretionaryItem , context ) ; java . lang . Boolean discretionary = ( ( java . lang . Boolean ) ( activity . getProperty ( org . camunda . bpm . engine . test . cmmn . handler . PROPERTY_DISCRETIONARY ) ) ) ; "<AssertPlaceHolder>" ; } getProperty ( java . lang . String ) { return map . get ( property ) ; } | org . junit . Assert . assertTrue ( discretionary ) |
test04 ( ) { javax . sql . DataSource ds = DatasourceConfig . DATA_SOURCES . get ( "-" 3 ) ; com . alibaba . otter . canal . client . adapter . es . test . sync . Common . sqlExe ( ds , "delete<sp>from<sp>role<sp>where<sp>id=1" ) ; com . alibaba . otter . canal . client . adapter . support . Dml dml = new com . alibaba . otter . canal . client . adapter . support . Dml ( ) ; dml . setDestination ( "example" ) ; dml . setTs ( new java . util . Date ( ) . getTime ( ) ) ; dml . setType ( "-" 1 ) ; dml . setDatabase ( "-" 2 ) ; dml . setTable ( "role" ) ; java . util . List < java . util . Map < java . lang . String , java . lang . Object > > dataList = new java . util . ArrayList ( ) ; java . util . Map < java . lang . String , java . lang . Object > data = new java . util . LinkedHashMap ( ) ; dataList . add ( data ) ; data . put ( "id" , 1L ) ; data . put ( "role_name" , "admin" ) ; dml . setData ( dataList ) ; java . lang . String database = dml . getDatabase ( ) ; java . lang . String table = dml . getTable ( ) ; java . util . Map < java . lang . String , com . alibaba . otter . canal . client . adapter . es . config . ESSyncConfig > esSyncConfigs = esAdapter . getDbTableEsSyncConfig ( ) . get ( ( ( database + "-" ) + table ) ) ; esAdapter . getEsSyncService ( ) . sync ( esSyncConfigs . values ( ) , dml ) ; org . elasticsearch . action . get . GetResponse response = esAdapter . getTransportClient ( ) . prepareGet ( "mytest_user" , "_doc" , "1" ) . get ( ) ; "<AssertPlaceHolder>" ; } getSource ( ) { return this . source ; } | org . junit . Assert . assertNull ( response . getSource ( ) . get ( "-" 0 ) ) |
testMBeanInterfaceCompatibility ( ) { java . util . Set < java . lang . String > expected = getDeclaredMethods ( org . jacoco . agent . rt . IAgent . class ) ; java . util . Set < java . lang . String > actual = getDeclaredMethods ( MBeanClient . IProxy . class ) ; "<AssertPlaceHolder>" ; } getDeclaredMethods ( java . lang . Class ) { java . util . Set < java . lang . String > methods = new java . util . HashSet < java . lang . String > ( ) ; for ( java . lang . reflect . Method m : clazz . getDeclaredMethods ( ) ) { methods . add ( java . lang . String . format ( "%s<sp>%s(%s)" , m . getReturnType ( ) . getName ( ) , m . getName ( ) , java . util . Arrays . asList ( m . getParameterTypes ( ) ) ) ) ; } return methods ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testGetRecordEngineWhenRecordEngineIsNotNull ( ) { final org . kie . workbench . common . dmn . client . editors . common . persistence . RecordEngine < org . kie . workbench . common . dmn . client . editors . common . persistence . ActiveRecordTest . Data > expectedRecordEngine = makeRecordEngine ( ) ; final org . kie . workbench . common . dmn . client . editors . common . persistence . ActiveRecord < org . kie . workbench . common . dmn . client . editors . common . persistence . ActiveRecordTest . Data > activeRecord = new org . kie . workbench . common . dmn . client . editors . common . persistence . ActiveRecord < org . kie . workbench . common . dmn . client . editors . common . persistence . ActiveRecordTest . Data > ( expectedRecordEngine ) { @ org . kie . workbench . common . dmn . client . editors . common . persistence . Override protected org . kie . workbench . common . dmn . client . editors . common . persistence . ActiveRecordTest . Data getRecord ( ) { return null ; } } ; final org . kie . workbench . common . dmn . client . editors . common . persistence . RecordEngine < org . kie . workbench . common . dmn . client . editors . common . persistence . ActiveRecordTest . Data > actualRecordEngine = activeRecord . getRecordEngine ( ) ; "<AssertPlaceHolder>" ; } getRecordEngine ( ) { return recordEngine ; } | org . junit . Assert . assertEquals ( expectedRecordEngine , actualRecordEngine ) |
testArrayPython3 ( ) { short [ ] testi = new short [ ] { 1 , 2 , 3 } ; short [ ] arrayi = ( ( short [ ] ) ( U ( "carray\n_array_reconstructor\nq | org . junit . Assert . assertArrayEquals ( testi , arrayi ) |
testSubstitute3 ( ) { cc . redberry . rings . IntegersZp domain = new cc . redberry . rings . IntegersZp ( 1321349 ) ; cc . redberry . rings . poly . multivar . MultivariatePolynomial . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > poly = parse ( "7*a*b^3*c^5*d^5*e^4<sp>+<sp>2*a^2*c^2*d^3*e^4" , domain ) ; cc . redberry . rings . poly . multivar . MultivariatePolynomial . MultivariatePolynomial < cc . redberry . rings . bigint . BigInteger > expected = parse ( "8*a^2*d^3*e^4<sp>+<sp>8*a^2*c*d^3*e^4<sp>+<sp>2*a^2*c^2*d^3*e^4<sp>+<sp>224*a*b^3*d^5*e^4<sp>+<sp>560*a*b^3*c*d^5*e^4<sp>+<sp>560*a*b^3*c^2*d^5*e^4<sp>+<sp>280*a*b^3*c^3*d^5*e^4<sp>+<sp>70*a*b^3*c^4*d^5*e^4<sp>+<sp>7*a*b^3*c^5*d^5*e^4" , domain ) ; "<AssertPlaceHolder>" ; } shift ( int , long ) { if ( shift == 0 ) return clone ( ) ; cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 . lUSubstitution shifts = new cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 . lUSubstitution ( cc . redberry . rings . poly . univar . UnivariatePolynomialZ64 . create ( shift , 1 ) . modulus ( ring ) , variable , nVariables , ordering ) ; cc . redberry . rings . poly . multivar . MultivariatePolynomialZp64 result = createZero ( ) ; for ( cc . redberry . rings . poly . multivar . MonomialZp64 term : this ) { int exponent = term . exponents [ variable ] ; if ( exponent == 0 ) { result . add ( term ) ; continue ; } result . add ( shifts . pow ( exponent ) . multiply ( term . setZero ( variable ) ) ) ; } return result ; } | org . junit . Assert . assertEquals ( expected , poly . shift ( 2 , 2 ) ) |
testVarByteBuffer ( ) { com . questdb . store . MemoryFile df1 = new com . questdb . store . MemoryFile ( dataFile , 12 , JournalMode . APPEND , false ) ; com . questdb . store . MemoryFile idxFile1 = new com . questdb . store . MemoryFile ( indexFile , 12 , JournalMode . APPEND , false ) ; final com . questdb . std . Rnd random = new com . questdb . std . Rnd ( java . lang . System . currentTimeMillis ( ) , java . lang . System . currentTimeMillis ( ) ) ; final int len = 5024 ; try ( com . questdb . store . VariableColumn col = new com . questdb . store . VariableColumn ( df1 , idxFile1 ) ) { java . nio . ByteBuffer buf = java . nio . ByteBuffer . allocate ( len ) ; java . lang . String s = random . nextString ( ( ( buf . remaining ( ) ) / 2 ) ) ; com . questdb . std . ByteBuffers . putStr ( buf , s ) ; buf . flip ( ) ; col . putBin ( buf ) ; col . commit ( ) ; java . nio . ByteBuffer bb = java . nio . ByteBuffer . allocate ( col . getBinLen ( 0 ) ) ; col . getBin ( 0 , bb ) ; bb . flip ( ) ; char [ ] chars = new char [ ( bb . remaining ( ) ) / 2 ] ; for ( int i = 0 ; i < ( chars . length ) ; i ++ ) { chars [ i ] = bb . getChar ( ) ; } java . lang . String actual = new java . lang . String ( chars ) ; "<AssertPlaceHolder>" ; } } getBin ( com . questdb . store . Record , java . io . OutputStream ) { rec . getBin ( index , s ) ; } | org . junit . Assert . assertEquals ( s , actual ) |
txnId_1 ( ) { org . apache . jena . dboe . transaction . txn . TxnId id1 = org . apache . jena . dboe . transaction . txn . TxnIdFactory . createSimple ( ) ; "<AssertPlaceHolder>" ; } createSimple ( ) { return org . apache . jena . dboe . transaction . txn . TxnIdFactory . txnIdGenSimple . generate ( ) ; } | org . junit . Assert . assertNotNull ( id1 ) |
invokeAllPropagatesExceptionWithTimeout ( ) { int numTasks = 5 ; final java . util . concurrent . atomic . AtomicInteger id = new java . util . concurrent . atomic . AtomicInteger ( ) ; java . util . List < java . util . concurrent . Callable < java . lang . Void > > tasks = new java . util . ArrayList ( ) ; final java . lang . Exception testException = new java . lang . Exception ( "test<sp>message" ) ; for ( int i = 0 ; i < numTasks ; i ++ ) { tasks . add ( ( ) -> { int myId = id . incrementAndGet ( ) ; if ( myId == 3 ) { throw testException ; } else { java . lang . Thread . sleep ( ( 10 * Constants . SECOND_MS ) ) ; } return null ; } ) ; } try { alluxio . util . CommonUtils . invokeAll ( tasks , 500 ) ; org . junit . Assert . fail ( "Expected<sp>an<sp>exception<sp>to<sp>be<sp>thrown" ) ; } catch ( java . util . concurrent . ExecutionException e ) { "<AssertPlaceHolder>" ; } } getCause ( ) { return mCause ; } | org . junit . Assert . assertSame ( testException , e . getCause ( ) ) |
shouldReturnBoundaryForPercent ( ) { edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType type = edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . getType ( 0 , '%' , 1 ) ; "<AssertPlaceHolder>" ; } getType ( int , char , int ) { if ( java . lang . Character . isUpperCase ( ch ) ) { return edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . UPPER_CASE_LETTER ; } else if ( java . lang . Character . isLowerCase ( ch ) ) { return edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . LETTER ; } else if ( java . lang . Character . isDigit ( ch ) ) { return edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . DIGIT ; } else if ( ( index == 0 ) && ( ch == ( edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . SINGLE_QUOTE ) ) ) { return edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . ESCAPING_QUOTE ; } else if ( ( index == ( length - 1 ) ) && ( ch == ( edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . SINGLE_QUOTE ) ) ) { return edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . ESCAPING_QUOTE ; } else if ( ch == '-' ) { return edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . LETTER ; } else if ( ch == ( edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . SINGLE_QUOTE ) ) { return edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . LETTER ; } else if ( ch == '<sp>' ) { return edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . BOUNDARY ; } else if ( ( 33 <= ch ) && ( ch <= 47 ) ) { return edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . BOUNDARY ; } else if ( ( 58 <= ch ) && ( ch <= 64 ) ) { return edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . BOUNDARY ; } else if ( ( 91 <= ch ) && ( ch <= 96 ) ) { return edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . BOUNDARY ; } else if ( ( 123 <= ch ) && ( ch <= 126 ) ) { return edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . BOUNDARY ; } else if ( ch == '\t' ) { return edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . BOUNDARY ; } else if ( ch == '\n' ) { return edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . BOUNDARY ; } else { return edu . stanford . bmir . protege . web . shared . entity . EntityNameCharType . LETTER ; } } | org . junit . Assert . assertEquals ( EntityNameCharType . BOUNDARY , type ) |
testHTTPMethodEnumStaticAccess ( ) { for ( com . digi . xbee . api . models . HTTPMethodEnum httpMethodEnum : httpMethodValues ) { "<AssertPlaceHolder>" ; } } get ( int ) { return com . digi . xbee . api . models . HTTPMethodEnum . lookupTable . get ( value ) ; } | org . junit . Assert . assertEquals ( httpMethodEnum , com . digi . xbee . api . models . HTTPMethodEnum . get ( httpMethodEnum . getValue ( ) ) ) |
testCreateWithNewIdCreatesANewIdentifier ( ) { final org . jsoar . kernel . symbols . Symbol s = org . jsoar . kernel . symbols . Symbols . create ( syms , Symbols . NEW_ID ) ; "<AssertPlaceHolder>" ; } asIdentifier ( ) { return null ; } | org . junit . Assert . assertNotNull ( s . asIdentifier ( ) ) |
testDubiousRegionGetsExcludedBecauseOfSV ( ) { final com . hartwig . hmftools . common . purple . region . FittedRegion somaticLeft = com . hartwig . hmftools . common . purple . copynumber . ExtendDiploidTest . createValidSomatic ( 1 , 10000 , 3.0 , 50 , SegmentSupport . BND ) ; final com . hartwig . hmftools . common . purple . region . FittedRegion dubious = com . hartwig . hmftools . common . purple . copynumber . ExtendDiploidTest . createDubiousRegion ( 10001 , 20000 , 2.0 , 10 ) ; final com . hartwig . hmftools . common . purple . region . FittedRegion somaticRight = com . hartwig . hmftools . common . purple . copynumber . ExtendDiploidTest . createValidSomatic ( 20001 , 30000 , 3.0 , 40 , SegmentSupport . BND ) ; final java . util . List < com . hartwig . hmftools . common . purple . copynumber . CombinedRegion > result = com . hartwig . hmftools . common . purple . copynumber . ExtendDiploidTest . PURE_VICTIM . extendDiploid ( com . google . common . collect . Lists . newArrayList ( somaticLeft , dubious , somaticRight ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return ( maxheap . size ( ) ) + ( minheap . size ( ) ) ; } | org . junit . Assert . assertEquals ( 3 , result . size ( ) ) |
testShouldFindExistingMandatorySavingsAccountsForGroupsWithCompleteGroupStatusWhenCenterIsTopOfCustomerHierarchy ( ) { savingsProduct = new org . mifos . domain . builders . SavingsProductBuilder ( ) . mandatory ( ) . appliesToGroupsOnly ( ) . buildForIntegrationTests ( ) ; savingsAccount = new org . mifos . domain . builders . SavingsAccountBuilder ( ) . withSavingsProduct ( savingsProduct ) . withCustomer ( group ) . withCreatedBy ( org . mifos . framework . util . helpers . IntegrationTestObjectMother . testUser ( ) ) . build ( ) ; org . mifos . framework . util . helpers . IntegrationTestObjectMother . saveSavingsProductAndAssociatedSavingsAccounts ( savingsProduct , savingsAccount ) ; java . util . List < org . mifos . application . servicefacade . CollectionSheetCustomerSavingDto > mandatorySavingAccounts = savingsDao . findAllMandatorySavingAccountsForClientsOrGroupsWithCompleteGroupStatusForCustomerHierarchy ( customerHierarchyParams ) ; "<AssertPlaceHolder>" ; } size ( ) { return fieldErrors . size ( ) ; } | org . junit . Assert . assertThat ( mandatorySavingAccounts . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) ) |
sendAndReceiveWithContext ( ) { int numThreads = 5 ; int numMessages = 10 ; launcher . start ( numThreads , numMessages ) ; int receivedMessages = 0 ; try ( javax . jms . JMSContext context = factory . createContext ( ) ) { javax . jms . JMSConsumer consumer = context . createConsumer ( queue ) ; javax . jms . Message m ; do { m = consumer . receive ( 1000 ) ; if ( m != null ) { receivedMessages ++ ; } } while ( m != null ) ; } "<AssertPlaceHolder>" ; } receive ( byte [ ] ) { this . broadcasts . add ( broadcast ) ; } | org . junit . Assert . assertEquals ( ( numThreads * numMessages ) , receivedMessages ) |
testGravesLSTMForwardPassHelper ( ) { org . nd4j . linalg . factory . Nd4j . getRandom ( ) . setSeed ( 12345 ) ; int nIn = 10 ; int layerSize = 15 ; int miniBatchSize = 4 ; int timeSeriesLength = 7 ; org . deeplearning4j . nn . conf . NeuralNetConfiguration conf = new org . deeplearning4j . nn . conf . NeuralNetConfiguration . Builder ( ) . layer ( new org . deeplearning4j . nn . conf . layers . GravesLSTM . Builder ( ) . nIn ( nIn ) . nOut ( layerSize ) . dist ( new org . deeplearning4j . nn . conf . distribution . UniformDistribution ( 0 , 1 ) ) . activation ( Activation . TANH ) . build ( ) ) . build ( ) ; lombok . val numParams = conf . getLayer ( ) . initializer ( ) . numParams ( conf ) ; org . nd4j . linalg . api . ndarray . INDArray params = org . nd4j . linalg . factory . Nd4j . create ( 1 , numParams ) ; org . deeplearning4j . nn . layers . recurrent . GravesLSTM lstm = ( ( org . deeplearning4j . nn . layers . recurrent . GravesLSTM ) ( conf . getLayer ( ) . instantiate ( conf , null , 0 , params , true ) ) ) ; org . nd4j . linalg . api . ndarray . INDArray input = org . nd4j . linalg . factory . Nd4j . rand ( new int [ ] { miniBatchSize , nIn , timeSeriesLength } ) ; lstm . setInput ( input , org . deeplearning4j . nn . workspace . LayerWorkspaceMgr . noWorkspaces ( ) ) ; java . lang . reflect . Method actHelper = org . deeplearning4j . nn . layers . recurrent . GravesLSTM . class . getDeclaredMethod ( "activateHelper" , boolean . class , org . nd4j . linalg . api . ndarray . INDArray . class , org . nd4j . linalg . api . ndarray . INDArray . class , boolean . class , org . deeplearning4j . nn . workspace . LayerWorkspaceMgr . class ) ; actHelper . setAccessible ( true ) ; java . lang . Class < ? > innerClass = java . lang . Class . forName ( "org.deeplearning4j.nn.layers.recurrent.FwdPassReturn" ) ; java . lang . Object oFalse = actHelper . invoke ( lstm , false , null , null , false , org . deeplearning4j . nn . workspace . LayerWorkspaceMgr . noWorkspacesImmutable ( ) ) ; java . lang . Object oTrue = actHelper . invoke ( lstm , false , null , null , true , org . deeplearning4j . nn . workspace . LayerWorkspaceMgr . noWorkspacesImmutable ( ) ) ; java . lang . reflect . Field fwdPassOutput = innerClass . getDeclaredField ( "fwdPassOutput" ) ; fwdPassOutput . setAccessible ( true ) ; java . lang . reflect . Field fwdPassOutputAsArrays = innerClass . getDeclaredField ( "fwdPassOutputAsArrays" ) ; fwdPassOutputAsArrays . setAccessible ( true ) ; org . nd4j . linalg . api . ndarray . INDArray fwdPassFalse = ( ( org . nd4j . linalg . api . ndarray . INDArray ) ( fwdPassOutput . get ( oFalse ) ) ) ; org . nd4j . linalg . api . ndarray . INDArray [ ] fwdPassTrue = ( ( org . nd4j . linalg . api . ndarray . INDArray [ ] ) ( fwdPassOutputAsArrays . get ( oTrue ) ) ) ; for ( int i = 0 ; i < timeSeriesLength ; i ++ ) { org . nd4j . linalg . api . ndarray . INDArray sliceFalse = fwdPassFalse . tensorAlongDimension ( i , 1 , 0 ) ; org . nd4j . linalg . api . ndarray . INDArray sliceTrue = fwdPassTrue [ i ] ; "<AssertPlaceHolder>" ; } } equals ( java . lang . Object ) { if ( ( this ) == o ) return true ; if ( ( o == null ) || ( ( getClass ( ) ) != ( o . getClass ( ) ) ) ) return false ; org . nd4j . util . Index index = ( ( org . nd4j . util . Index ) ( o ) ) ; if ( ( objects ) != null ? ! ( objects . equals ( index . objects ) ) : ( index . objects ) != null ) return false ; return ! ( ( indexes ) != null ? ! ( indexes . equals ( index . indexes ) ) : ( index . indexes ) != null ) ; } | org . junit . Assert . assertTrue ( sliceFalse . equals ( sliceTrue ) ) |
duplicateFirmwaresHashWithoutRestrictions ( ) { java . lang . String changelog = "changelog" ; java . lang . String description = "model" 0 ; java . lang . String model = "model" ; boolean modelRestricted = true ; java . net . URL onlineChangelog = new java . net . URL ( "https://secure.com/changelog" ) ; java . lang . String prerequisiteVersion = "0.1" ; java . lang . String vendor = "vendor" ; java . util . Map < java . lang . String , java . lang . String > properties = new java . util . HashMap ( ) ; properties . put ( "prop1" , "val1" ) ; properties . put ( "prop2" , "val2" ) ; java . io . InputStream openStream = bundleContext . getBundle ( ) . getResource ( org . eclipse . smarthome . core . thing . binding . firmware . FirmwareTest . FILE_NAME ) . openStream ( ) ; org . eclipse . smarthome . core . thing . binding . firmware . Firmware firmware1 = org . eclipse . smarthome . core . thing . binding . firmware . FirmwareBuilder . create ( org . eclipse . smarthome . core . thing . binding . firmware . FirmwareTest . thingTypeUID , "1" ) . withInputStream ( openStream ) . withChangelog ( changelog ) . withDescription ( description ) . withModel ( model ) . withModelRestricted ( modelRestricted ) . withOnlineChangelog ( onlineChangelog ) . withPrerequisiteVersion ( prerequisiteVersion ) . withVendor ( vendor ) . withProperties ( properties ) . build ( ) ; org . eclipse . smarthome . core . thing . binding . firmware . Firmware firmware2 = org . eclipse . smarthome . core . thing . binding . firmware . FirmwareBuilder . create ( org . eclipse . smarthome . core . thing . binding . firmware . FirmwareTest . thingTypeUID , "1" ) . withInputStream ( openStream ) . withChangelog ( changelog ) . withDescription ( description ) . withModel ( model ) . withModelRestricted ( modelRestricted ) . withOnlineChangelog ( onlineChangelog ) . withPrerequisiteVersion ( prerequisiteVersion ) . withVendor ( vendor ) . withProperties ( properties ) . build ( ) ; "<AssertPlaceHolder>" ; } hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( actionProvider ) == null ? 0 : actionProvider . hashCode ( ) ) ; result = ( prime * result ) + ( ( configName ) == null ? 0 : configName . hashCode ( ) ) ; result = ( prime * result ) + ( ( description ) == null ? 0 : description . hashCode ( ) ) ; result = ( prime * result ) + ( ( label ) == null ? 0 : label . hashCode ( ) ) ; result = ( prime * result ) + ( ( method ) == null ? 0 : method . hashCode ( ) ) ; result = ( prime * result ) + ( ( thingUID ) == null ? 0 : thingUID . hashCode ( ) ) ; result = ( prime * result ) + ( ( uid ) == null ? 0 : uid . hashCode ( ) ) ; result = ( prime * result ) + ( ( visibility ) == null ? 0 : visibility . hashCode ( ) ) ; return result ; } | org . junit . Assert . assertThat ( firmware1 . hashCode ( ) , org . hamcrest . CoreMatchers . is ( firmware2 . hashCode ( ) ) ) |
writableColumnsShouldBeInValueMap_shouldReturnTrue ( ) { com . vaadin . v7 . data . util . sqlcontainer . ColumnProperty property = new com . vaadin . v7 . data . util . sqlcontainer . ColumnProperty ( "NAME" , false , true , true , false , "Ville" , java . lang . String . class ) ; "<AssertPlaceHolder>" ; } isPersistent ( ) { if ( isVersionColumn ( ) ) { return false ; } return ( isReadOnlyChangeAllowed ( ) ) && ( ! ( isReadOnly ( ) ) ) ; } | org . junit . Assert . assertTrue ( property . isPersistent ( ) ) |
getReportingUnitsShouldReturnInch ( ) { target . rawResponseListener ( "$13=1" ) ; "<AssertPlaceHolder>" ; } getReportingUnits ( ) { if ( isReportingUnits ( ) ) { if ( "0" . equals ( value ) ) { return UnitUtils . Units . MM ; } else if ( "1" . equals ( value ) ) { return UnitUtils . Units . INCH ; } } return UnitUtils . Units . UNKNOWN ; } | org . junit . Assert . assertEquals ( UnitUtils . Units . INCH , target . getReportingUnits ( ) ) |
isSearchAvailable_NoUser ( ) { doReturn ( null ) . when ( bean ) . getUserFromSessionWithoutException ( ) ; config . setRestricted ( true ) ; boolean rc = bean . isSearchAvailable ( ) ; "<AssertPlaceHolder>" ; } isSearchAvailable ( ) { boolean isRestricted = getConfig ( ) . isRestricted ( ) ; if ( ! isRestricted ) { return true ; } org . oscm . internal . vo . VOUserDetails user = getUserFromSessionWithoutException ( ) ; if ( user != null ) { java . lang . String org = user . getOrganizationId ( ) ; if ( org != null ) { return getConfig ( ) . getAllowedOrganizations ( ) . contains ( org ) ; } } return true ; } | org . junit . Assert . assertTrue ( rc ) |
testGetUriWithDocIdStringValidObjectId ( ) { org . restheart . handlers . RequestContext context = prepareRequestContext ( ) ; java . lang . String expResult = "/dbName/collName/54d13711c2e692941728e1d3?id_type=STRING" ; java . lang . String result ; try { result = org . restheart . utils . URLUtils . getUriWithDocId ( context , "dbName" , "collName" , new org . bson . BsonString ( "54d13711c2e692941728e1d3" ) ) ; "<AssertPlaceHolder>" ; } catch ( org . restheart . hal . UnsupportedDocumentIdException ex ) { org . junit . Assert . fail ( ex . getMessage ( ) ) ; } } getUriWithDocId ( org . restheart . handlers . RequestContext , java . lang . String , java . lang . String , org . bson . BsonValue ) { org . restheart . handlers . RequestContext . DOC_ID_TYPE docIdType = org . restheart . utils . URLUtils . checkId ( id ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "/" ) . append ( dbName ) . append ( "/" ) . append ( collName ) . append ( "/" ) . append ( org . restheart . utils . URLUtils . getIdAsStringNoBrachets ( id ) ) ; if ( ( docIdType == ( org . restheart . handlers . RequestContext . DOC_ID_TYPE . STRING ) ) && ( org . bson . types . ObjectId . isValid ( id . asString ( ) . getValue ( ) ) ) ) { sb . append ( "?id_type=STRING" ) ; } else if ( ( docIdType != ( org . restheart . handlers . RequestContext . DOC_ID_TYPE . STRING ) ) && ( docIdType != ( org . restheart . handlers . RequestContext . DOC_ID_TYPE . OID ) ) ) { sb . append ( "?id_type=" ) . append ( docIdType . name ( ) ) ; } return context . mapUri ( sb . toString ( ) ) ; } | org . junit . Assert . assertEquals ( expResult , result ) |
testGetMessage ( ) { com . dianping . swallow . common . internal . message . SwallowMessage expectedMessage = com . dianping . swallow . common . internal . dao . impl . mongodb . MessageDAOImplTest . createMessage ( ) ; expectedMessage . setContent ( "content<sp>in<sp>testGetMessage" ) ; messageDAO . saveMessage ( com . dianping . swallow . common . internal . dao . impl . mongodb . TOPIC_NAME , expectedMessage ) ; java . lang . Long maxMessageId = messageDAO . getMaxMessageId ( com . dianping . swallow . common . internal . dao . impl . mongodb . TOPIC_NAME ) ; com . dianping . swallow . common . internal . message . SwallowMessage actualMessage = messageDAO . getMessage ( com . dianping . swallow . common . internal . dao . impl . mongodb . TOPIC_NAME , maxMessageId ) ; "<AssertPlaceHolder>" ; } equalsWithoutMessageId ( java . lang . Object ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ! ( obj instanceof com . dianping . swallow . common . internal . message . SwallowMessage ) ) { return false ; } com . dianping . swallow . common . internal . message . SwallowMessage other = ( ( com . dianping . swallow . common . internal . message . SwallowMessage ) ( obj ) ) ; if ( ( content ) == null ) { if ( ( other . content ) != null ) { return false ; } } else if ( ! ( content . equals ( other . content ) ) ) { return false ; } if ( ( generatedTime ) == null ) { if ( ( other . generatedTime ) != null ) { return false ; } } else if ( ! ( generatedTime . equals ( other . generatedTime ) ) ) { return false ; } if ( ( properties ) == null ) { if ( ( other . properties ) != null ) { return false ; } } else if ( ! ( properties . equals ( other . properties ) ) ) { return false ; } if ( ( internalProperties ) == null ) { if ( ( other . internalProperties ) != null ) { return false ; } } else if ( ! ( internalProperties . equals ( other . internalProperties ) ) ) { return false ; } if ( ( sha1 ) == null ) { if ( ( other . sha1 ) != null ) { return false ; } } else if ( ! ( sha1 . equals ( other . sha1 ) ) ) { return false ; } if ( ( sourceIp ) == null ) { if ( ( other . sourceIp ) != null ) { return false ; } } else if ( ! ( sourceIp . equals ( other . sourceIp ) ) ) { return false ; } if ( ( type ) == null ) { if ( ( other . type ) != null ) { return false ; } } else if ( ! ( type . equals ( other . type ) ) ) { return false ; } if ( ( version ) == null ) { if ( ( other . version ) != null ) { return false ; } } else if ( ! ( version . equals ( other . version ) ) ) { return false ; } return true ; } | org . junit . Assert . assertTrue ( expectedMessage . equalsWithoutMessageId ( actualMessage ) ) |
validIntegerGreaterThanShouldNotCreateViolations ( ) { java . util . Set < javax . validation . ConstraintViolation < org . alien4cloud . tosca . model . definitions . PropertyDefinition > > violations = validator . validate ( createGreaterThanDefinition ( ToscaTypes . INTEGER . toString ( ) , 10L , "20" ) , alien4cloud . tosca . container . validation . ToscaSequence . class ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( "name:<sp>[" + ( name ) ) + "],<sp>value:<sp>[" ) + ( value ) ) + "]" ; } | org . junit . Assert . assertEquals ( 0 , violations . size ( ) ) |
givenEmptyBoard_whenLevel1VsLevel3_thenLevel3WinsOrDraw ( ) { com . baeldung . algorithms . mcts . tictactoe . Board board = new com . baeldung . algorithms . mcts . tictactoe . Board ( ) ; com . baeldung . algorithms . mcts . montecarlo . MonteCarloTreeSearch mcts1 = new com . baeldung . algorithms . mcts . montecarlo . MonteCarloTreeSearch ( ) ; mcts1 . setLevel ( 1 ) ; com . baeldung . algorithms . mcts . montecarlo . MonteCarloTreeSearch mcts3 = new com . baeldung . algorithms . mcts . montecarlo . MonteCarloTreeSearch ( ) ; mcts3 . setLevel ( 3 ) ; int player = com . baeldung . algorithms . mcts . tictactoe . Board . P1 ; int totalMoves = ( com . baeldung . algorithms . mcts . tictactoe . Board . DEFAULT_BOARD_SIZE ) * ( com . baeldung . algorithms . mcts . tictactoe . Board . DEFAULT_BOARD_SIZE ) ; for ( int i = 0 ; i < totalMoves ; i ++ ) { if ( player == ( com . baeldung . algorithms . mcts . tictactoe . Board . P1 ) ) board = mcts3 . findNextMove ( board , player ) ; else board = mcts1 . findNextMove ( board , player ) ; if ( ( board . checkStatus ( ) ) != ( - 1 ) ) { break ; } player = 3 - player ; } int winStatus = board . checkStatus ( ) ; "<AssertPlaceHolder>" ; } checkStatus ( ) { int boardSize = boardValues . length ; int maxIndex = boardSize - 1 ; int [ ] diag1 = new int [ boardSize ] ; int [ ] diag2 = new int [ boardSize ] ; for ( int i = 0 ; i < boardSize ; i ++ ) { int [ ] row = boardValues [ i ] ; int [ ] col = new int [ boardSize ] ; for ( int j = 0 ; j < boardSize ; j ++ ) { col [ j ] = boardValues [ j ] [ i ] ; } int checkRowForWin = checkForWin ( row ) ; if ( checkRowForWin != 0 ) return checkRowForWin ; int checkColForWin = checkForWin ( col ) ; if ( checkColForWin != 0 ) return checkColForWin ; diag1 [ i ] = boardValues [ i ] [ i ] ; diag2 [ i ] = boardValues [ ( maxIndex - i ) ] [ i ] ; } int checkDia1gForWin = checkForWin ( diag1 ) ; if ( checkDia1gForWin != 0 ) return checkDia1gForWin ; int checkDiag2ForWin = checkForWin ( diag2 ) ; if ( checkDiag2ForWin != 0 ) return checkDiag2ForWin ; if ( ( getEmptyPositions ( ) . size ( ) ) > 0 ) return com . baeldung . algorithms . mcts . tictactoe . Board . IN_PROGRESS ; else return com . baeldung . algorithms . mcts . tictactoe . Board . DRAW ; } | org . junit . Assert . assertTrue ( ( ( winStatus == ( com . baeldung . algorithms . mcts . tictactoe . Board . DRAW ) ) || ( winStatus == ( com . baeldung . algorithms . mcts . tictactoe . Board . P1 ) ) ) ) |
testSetup ( ) { final org . jbpm . workbench . wi . dd . model . DeploymentDescriptorModel model = new org . jbpm . workbench . wi . dd . model . DeploymentDescriptorModel ( ) ; presenter . setup ( model ) ; "<AssertPlaceHolder>" ; verify ( remoteableClassListPresenter ) . setup ( any ( ) , any ( ) , any ( ) ) ; } getRemotableClasses ( ) { return remotableClasses ; } | org . junit . Assert . assertNotNull ( model . getRemotableClasses ( ) ) |
testHstackConcatSimple ( ) { int rows = 10 ; org . nd4j . linalg . api . ndarray . INDArray [ ] arr = new org . nd4j . linalg . api . ndarray . INDArray [ 5 ] ; for ( int i = 0 ; i < ( arr . length ) ; i ++ ) { arr [ i ] = org . nd4j . linalg . factory . Nd4j . linspace ( ( i * rows ) , ( ( ( i + 1 ) * rows ) - 1 ) , rows ) ; } org . nd4j . linalg . api . ndarray . INDArray expected = org . nd4j . linalg . factory . Nd4j . linspace ( 0 , ( ( ( arr . length ) * rows ) - 1 ) , ( ( arr . length ) * rows ) ) ; org . nd4j . linalg . api . ndarray . INDArray actual = org . nd4j . linalg . factory . Nd4j . hstack ( arr ) ; System . out . println ( expected ) ; System . out . println ( ) ; System . out . println ( actual ) ; "<AssertPlaceHolder>" ; } hstack ( org . nd4j . linalg . factory . INDArray [ ] ) { org . nd4j . linalg . factory . INDArray ret = org . nd4j . linalg . factory . Nd4j . INSTANCE . hstack ( arrs ) ; org . nd4j . linalg . factory . Nd4j . logCreationIfNecessary ( ret ) ; return ret ; } | org . junit . Assert . assertEquals ( expected , actual ) |
getComputationDurationForDate_shouldReturnZeroIfNoneMatched ( ) { long milliseconds = logEntryDAO . getComputationDurationForDate ( org . easyrec . store . dao . plugin . impl . LogEntryDAOMysqlImplTest . date ( "2011-02-24<sp>00:00:01" ) ) ; "<AssertPlaceHolder>" ; } date ( java . lang . String ) { try { return org . easyrec . store . dao . plugin . impl . LogEntryDAOMysqlImplTest . DATE_FORMAT . parse ( date ) ; } catch ( java . text . ParseException e ) { org . junit . Assert . fail ( "Could<sp>not<sp>parse<sp>date!" ) ; return null ; } } | org . junit . Assert . assertThat ( milliseconds , is ( 0L ) ) |
shouldNotAutomaticallyPropagateToSetMembersIfExcludingOrderSet ( ) { executeDataSet ( org . openmrs . api . OrderSetServiceTest . ORDER_SET ) ; java . util . List < org . openmrs . OrderSet > orderSets = orderSetService . getOrderSets ( false ) ; java . lang . Integer numberOfOrderSetMembers = 0 ; for ( org . openmrs . OrderSet oS : orderSets ) { numberOfOrderSetMembers = numberOfOrderSetMembers + ( oS . getOrderSetMembers ( ) . size ( ) ) ; } "<AssertPlaceHolder>" ; } size ( ) { return allergies . size ( ) ; } | org . junit . Assert . assertEquals ( new java . lang . Integer ( 4 ) , numberOfOrderSetMembers ) |
shouldReturnUndoContentsOfFile ( ) { java . io . File file = createTemporaryFileWithContent ( ( "Hello\n" + ( ( "There!\n" + "--//@UNDO\n" ) + "This<sp>is<sp>after<sp>the<sp>undo<sp>marker!\n" ) ) ) ; com . dbdeploy . scripts . ChangeScript changeScript = new com . dbdeploy . scripts . ChangeScript ( 5 , file , "UTF-8" ) ; "<AssertPlaceHolder>" ; } getUndoContent ( ) { return getFileContents ( true ) ; } | org . junit . Assert . assertThat ( changeScript . getUndoContent ( ) , is ( "This<sp>is<sp>after<sp>the<sp>undo<sp>marker!\n" ) ) |
shouldMarkTransitionFromSuperadminToAnyAsInvalid ( ) { stubSecurityContextWithAuthentication ( ) ; stubRoleTransition ( com . qcadoo . security . internal . validators . ROLE_SUPERADMIN , "99anyOtherRole" ) ; final boolean isValid = userRoleValidationService . checkUserCreatingSuperadmin ( userDataDefMock , userEntityMock ) ; "<AssertPlaceHolder>" ; verify ( userEntityMock ) . addError ( org . mockito . Mockito . eq ( userRoleFieldDefMock ) , org . mockito . Mockito . anyString ( ) ) ; } checkUserCreatingSuperadmin ( com . qcadoo . model . api . DataDefinition , com . qcadoo . model . api . Entity ) { java . lang . Boolean isRoleSuperadminInNewGroup = securityService . hasRole ( entity , QcadooSecurityConstants . ROLE_SUPERADMIN ) ; java . lang . Boolean isRoleSuperadminInOldGroup = ( ( entity . getId ( ) ) == null ) ? false : securityService . hasRole ( dataDefinition . get ( entity . getId ( ) ) , QcadooSecurityConstants . ROLE_SUPERADMIN ) ; if ( ( com . google . common . base . Objects . equal ( isRoleSuperadminInOldGroup , isRoleSuperadminInNewGroup ) ) || ( isCurrentUserShopOrSuperAdmin ( dataDefinition ) ) ) { return true ; } entity . addError ( dataDefinition . getField ( UserFields . GROUP ) , "qcadooUsers.validate.global.error.forbiddenRole" ) ; return false ; } | org . junit . Assert . assertFalse ( isValid ) |
testEqualsIgnoreCase1 ( ) { final java . lang . String a = "FOO" ; "<AssertPlaceHolder>" ; } equalsIgnoreCase ( java . lang . String , java . lang . String ) { if ( a == b ) return true ; if ( ( a . length ( ) ) != ( b . length ( ) ) ) return false ; for ( int i = 0 ; i < ( a . length ( ) ) ; i ++ ) { if ( ( org . eclipse . jgit . util . StringUtils . toLowerCase ( a . charAt ( i ) ) ) != ( org . eclipse . jgit . util . StringUtils . toLowerCase ( b . charAt ( i ) ) ) ) return false ; } return true ; } | org . junit . Assert . assertTrue ( org . eclipse . jgit . util . StringUtils . equalsIgnoreCase ( a , a ) ) |
testSocketReadEof ( ) { final java . lang . String TEST_PATH = new java . io . File ( org . apache . hadoop . net . unix . TestDomainSocket . sockDir . getDir ( ) , "testSocketReadEof" ) . getAbsolutePath ( ) ; final org . apache . hadoop . net . unix . DomainSocket serv = org . apache . hadoop . net . unix . DomainSocket . bindAndListen ( TEST_PATH ) ; java . util . concurrent . ExecutorService exeServ = java . util . concurrent . Executors . newSingleThreadExecutor ( ) ; java . util . concurrent . Callable < java . lang . Void > callable = new java . util . concurrent . Callable < java . lang . Void > ( ) { public org . apache . hadoop . net . unix . Void call ( ) { org . apache . hadoop . net . unix . DomainSocket conn ; try { conn = serv . accept ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( "unexpected<sp>IOException" , e ) ; } byte [ ] buf = new byte [ 100 ] ; for ( int i = 0 ; i < ( buf . length ) ; i ++ ) { buf [ i ] = 0 ; } try { "<AssertPlaceHolder>" ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( "unexpected<sp>IOException" , e ) ; } return null ; } } ; java . util . concurrent . Future < java . lang . Void > future = exeServ . submit ( callable ) ; org . apache . hadoop . net . unix . DomainSocket conn = org . apache . hadoop . net . unix . DomainSocket . connect ( serv . getPath ( ) ) ; java . lang . Thread . sleep ( 50 ) ; conn . close ( ) ; serv . close ( ) ; future . get ( 2 , TimeUnit . MINUTES ) ; } getInputStream ( ) { return inputStream ; } | org . junit . Assert . assertEquals ( ( - 1 ) , conn . getInputStream ( ) . read ( ) ) |
getHumanTaskInstances ( ) { final org . bonitasoft . engine . bpm . process . DesignProcessDefinition designProcessDef1 = org . bonitasoft . engine . test . BuildTestUtil . buildProcessDefinitionWithHumanAndAutomaticSteps ( java . util . Arrays . asList ( "initTask1" ) , java . util . Arrays . asList ( true ) ) ; final org . bonitasoft . engine . bpm . process . ProcessDefinition processDef1 = deployAndEnableProcessWithActor ( designProcessDef1 , org . bonitasoft . engine . activity . ACTOR_NAME , user ) ; final org . bonitasoft . engine . bpm . process . ProcessInstance processInstance1 = getProcessAPI ( ) . startProcess ( processDef1 . getId ( ) ) ; waitForUserTask ( processInstance1 , "initTask1" ) ; final org . bonitasoft . engine . bpm . process . ProcessInstance processInstance2 = getProcessAPI ( ) . startProcess ( processDef1 . getId ( ) ) ; waitForUserTask ( processInstance2 , "initTask1" ) ; final org . bonitasoft . engine . bpm . process . impl . ProcessDefinitionBuilder definitionBuilder = new org . bonitasoft . engine . bpm . process . impl . ProcessDefinitionBuilder ( ) . createNewInstance ( ( ( PROCESS_NAME ) + 2 ) , org . bonitasoft . engine . activity . PROCESS_VERSION ) ; definitionBuilder . addStartEvent ( "start" ) ; definitionBuilder . addActor ( org . bonitasoft . engine . activity . ACTOR_NAME ) ; definitionBuilder . addUserTask ( "initTask2" , org . bonitasoft . engine . activity . ACTOR_NAME ) ; definitionBuilder . addEndEvent ( "end" ) ; definitionBuilder . addTransition ( "start" , "initTask2" ) ; definitionBuilder . addTransition ( "initTask2" , "end" ) ; final org . bonitasoft . engine . bpm . process . DesignProcessDefinition designProcessDef2 = definitionBuilder . done ( ) ; final org . bonitasoft . engine . bpm . process . ProcessDefinition processDef2 = deployAndEnableProcessWithActor ( designProcessDef2 , org . bonitasoft . engine . activity . ACTOR_NAME , user ) ; final org . bonitasoft . engine . bpm . process . ProcessInstance processInstance3 = getProcessAPI ( ) . startProcess ( processDef2 . getId ( ) ) ; waitForUserTask ( processInstance3 , "initTask2" ) ; final org . bonitasoft . engine . bpm . process . ProcessInstance processInstance4 = getProcessAPI ( ) . startProcess ( processDef2 . getId ( ) ) ; waitForUserTask ( processInstance4 , "initTask2" ) ; final org . bonitasoft . engine . bpm . process . ProcessInstance processInstance5 = getProcessAPI ( ) . startProcess ( processDef2 . getId ( ) ) ; waitForUserTask ( processInstance5 , "initTask2" ) ; getProcessAPI ( ) . searchActivities ( new org . bonitasoft . engine . search . SearchOptionsBuilder ( 0 , 10 ) . filter ( ActivityInstanceSearchDescriptor . PROCESS_INSTANCE_ID , processInstance3 . getId ( ) ) . filter ( ActivityInstanceSearchDescriptor . ACTIVITY_TYPE , FlowNodeType . HUMAN_TASK ) . done ( ) ) ; getProcessAPI ( ) . searchActivities ( new org . bonitasoft . engine . search . SearchOptionsBuilder ( 0 , 10 ) . filter ( ActivityInstanceSearchDescriptor . PROCESS_INSTANCE_ID , processInstance3 . getId ( ) ) . filter ( ProcessSupervisorSearchDescriptor . USER_ID , user . getId ( ) ) . done ( ) ) ; getProcessAPI ( ) . searchActivities ( new org . bonitasoft . engine . search . SearchOptionsBuilder ( 0 , 10 ) . filter ( ActivityInstanceSearchDescriptor . ACTIVITY_TYPE , FlowNodeType . HUMAN_TASK ) . filter ( ProcessSupervisorSearchDescriptor . USER_ID , user . getId ( ) ) . done ( ) ) ; final java . util . List < org . bonitasoft . engine . bpm . flownode . HumanTaskInstance > taskInstances = getProcessAPI ( ) . getHumanTaskInstances ( processInstance3 . getId ( ) , "initTask2" , 0 , 10 ) ; "<AssertPlaceHolder>" ; disableAndDeleteProcess ( processDef1 ) ; disableAndDeleteProcess ( processDef2 ) ; } getId ( ) { return id ; } | org . junit . Assert . assertEquals ( 1 , taskInstances . size ( ) ) |
isImageRendered_KeySet ( ) { user . getVOUserDetails ( ) . setKey ( 1234 ) ; "<AssertPlaceHolder>" ; } isImageRendered ( ) { return ! ( isCheckBoxRendered ( ) ) ; } | org . junit . Assert . assertTrue ( user . isImageRendered ( ) ) |
shouldInstrumentBranch ( ) { java . lang . String source = "var<sp>x<sp>=<sp>x<sp>||<sp>7;" ; sourceProcessor = new jscover . instrument . SourceProcessor ( config , "test.js" , source ) ; java . lang . String instrumentedSource = sourceProcessor . instrumentSource ( source ) ; java . lang . String expectedSource = "_$jscoverage[\'test.js\'].branchData[\'1\'][1].init(8,<sp>6);\n" + ( ( ( ( ( "function<sp>visit1_1_1(result)<sp>{\n" + "<sp>_$jscoverage[\'test.js\'].branchData[\'1\'][1].ranCondition(result);\n" ) + "<sp>return<sp>result;\n" ) + "}\n" ) + "_$jscoverage[\'test.js\'].lineData[1]++;\n" ) + "var<sp>x<sp>=<sp>visit1_1_1(x<sp>||<sp>7);\n" ) ; "<AssertPlaceHolder>" ; } instrumentSource ( java . lang . String ) { return instrumentSource ( uri , source ) ; } | org . junit . Assert . assertEquals ( expectedSource , instrumentedSource ) |
testOauth2ClientClientIdDeleteHandler ( ) { final com . networknt . client . Http2Client client = com . networknt . client . Http2Client . getInstance ( ) ; final java . util . concurrent . CountDownLatch latch = new java . util . concurrent . CountDownLatch ( 1 ) ; final io . undertow . client . ClientConnection connection ; try { connection = client . connect ( new java . net . URI ( "https://localhost:6884" ) , Http2Client . WORKER , Http2Client . SSL , Http2Client . BUFFER_POOL , org . xnio . OptionMap . create ( UndertowOptions . ENABLE_HTTP2 , true ) ) . get ( ) ; } catch ( java . lang . Exception e ) { throw new com . networknt . exception . ClientException ( e ) ; } final java . util . concurrent . atomic . AtomicReference < io . undertow . client . ClientResponse > reference = new java . util . concurrent . atomic . AtomicReference ( ) ; try { io . undertow . client . ClientRequest request = new io . undertow . client . ClientRequest ( ) . setMethod ( Methods . DELETE ) . setPath ( "/oauth2/client/59f347a0-c92d-11e6-9d9d-cec0c932ce03" ) ; connection . sendRequest ( request , client . createClientCallback ( reference , latch ) ) ; latch . await ( ) ; } catch ( java . lang . Exception e ) { com . networknt . oauth . client . handler . Oauth2ClientClientIdDeleteHandlerTest . logger . error ( "Exception:<sp>" , e ) ; throw new com . networknt . exception . ClientException ( e ) ; } finally { org . xnio . IoUtils . safeClose ( connection ) ; } int statusCode = reference . get ( ) . getResponseCode ( ) ; java . lang . String body = reference . get ( ) . getAttachment ( Http2Client . RESPONSE_BODY ) ; "<AssertPlaceHolder>" ; } getResponseCode ( ) { return responseCode ; } | org . junit . Assert . assertEquals ( 200 , statusCode ) |
testGetCriterionTypes ( ) { int previous = criterionTypeDAO . list ( org . libreplan . business . resources . entities . CriterionType . class ) . size ( ) ; org . libreplan . business . resources . entities . CriterionType criterion1 = org . libreplan . business . test . resources . daos . CriterionTypeDAOTest . createValidCriterionType ( ) ; org . libreplan . business . resources . entities . CriterionType criterion2 = org . libreplan . business . test . resources . daos . CriterionTypeDAOTest . createValidCriterionType ( ) ; criterionTypeDAO . save ( criterion1 ) ; criterionTypeDAO . save ( criterion2 ) ; java . util . List < org . libreplan . business . resources . entities . CriterionType > list = criterionTypeDAO . getCriterionTypes ( ) ; "<AssertPlaceHolder>" ; } getCriterionTypes ( ) { return new org . libreplan . ws . resources . criterion . api . CriterionTypeListDTO ( findAll ( ) ) ; } | org . junit . Assert . assertEquals ( ( previous + 2 ) , list . size ( ) ) |
maakOfCriteria ( ) { nl . bzk . brp . domain . algemeen . ZoekCriterium zoekCriterium = new nl . bzk . brp . domain . algemeen . ZoekCriterium ( getAttribuutElement ( Element . PERSOON_ADRES_HUISNUMMER ) , nl . bzk . algemeenbrp . dal . domein . brp . enums . Zoekoptie . EXACT , 3 ) ; nl . bzk . brp . domain . algemeen . ZoekCriterium zoekCriteriumOf1 = new nl . bzk . brp . domain . algemeen . ZoekCriterium ( getAttribuutElement ( Element . PERSOON_ADRES_POSTCODE ) , nl . bzk . algemeenbrp . dal . domein . brp . enums . Zoekoptie . EXACT , "postcode2" , zoekCriterium ) ; nl . bzk . brp . domain . algemeen . ZoekCriterium zoekCriteriumOf2 = new nl . bzk . brp . domain . algemeen . ZoekCriterium ( getAttribuutElement ( Element . PERSOON_ADRES_POSTCODE ) , nl . bzk . algemeenbrp . dal . domein . brp . enums . Zoekoptie . EXACT , "postcode3" , zoekCriteriumOf1 ) ; nl . bzk . brp . domain . algemeen . ZoekCriterium zoekCriteriumOf3 = new nl . bzk . brp . domain . algemeen . ZoekCriterium ( getAttribuutElement ( Element . PERSOON_ADRES_POSTCODE ) , nl . bzk . algemeenbrp . dal . domein . brp . enums . Zoekoptie . EXACT , "postcode4" , zoekCriteriumOf2 ) ; final nl . bzk . brp . delivery . dataaccess . bevraging . MetaInformatieZoekCriterium metaInformatieZoekCriterium = nl . bzk . brp . delivery . dataaccess . bevraging . MetaInformatieZoekCriterium . maak ( zoekCriteriumOf3 , true ) ; "<AssertPlaceHolder>" ; } getZoekCriteriaOrClauses ( ) { return zoekCriteriaOrClauses ; } | org . junit . Assert . assertEquals ( 3 , metaInformatieZoekCriterium . getZoekCriteriaOrClauses ( ) . size ( ) ) |
testNotBlankMsgBlankStringShouldThrow ( ) { final java . lang . String string = "<sp>\n<sp>\t<sp>\r<sp>\n<sp>" ; try { org . apache . commons . lang3 . Validate . notBlank ( string , "Message" ) ; org . junit . Assert . fail ( "Expecting<sp>IllegalArgumentException" ) ; } catch ( final java . lang . IllegalArgumentException e ) { "<AssertPlaceHolder>" ; } } getMessage ( ) { return getFormattedExceptionMessage ( super . getMessage ( ) ) ; } | org . junit . Assert . assertEquals ( "Message" , e . getMessage ( ) ) |
testSendInsightMessageDoesNotAppearInS3 ( ) { net . sf . json . JSONObject imgPayload = com . streamreduce . test . service . TestUtils . createValidSampleIMGPayload ( ) ; com . streamreduce . core . model . Connection testIMGConnection = com . streamreduce . test . service . TestUtils . createIMGConnectionWithSpecificOutboundDatatypes ( OutboundDataType . INSIGHT ) ; com . streamreduce . core . model . messages . SobaMessage sobaMessage = new com . streamreduce . core . model . messages . SobaMessage . Builder ( ) . connection ( testIMGConnection ) . dateGenerated ( java . lang . System . currentTimeMillis ( ) ) . hashtags ( com . google . common . collect . Sets . newHashSet ( "#foo" ) ) . sender ( testIMGConnection ) . transformedMessage ( imgPayload . getString ( "message" ) ) . type ( MessageType . GATEWAY ) . visibility ( SobaObject . Visibility . ACCOUNT ) . build ( ) ; sobaMessage . setId ( new org . bson . types . ObjectId ( ) ) ; outboundStorageService . sendSobaMessage ( sobaMessage , testIMGConnection ) ; com . streamreduce . core . model . ConnectionCredentials creds = new java . util . ArrayList ( testIMGConnection . getOutboundConfigurations ( ) ) . get ( 0 ) . getCredentials ( ) ; s3TestUtils = new com . streamreduce . test . service . S3TestUtils ( creds ) ; java . lang . String expectedBucketName = "com.streamreduce." + ( testIMGConnection . getAccount ( ) . getId ( ) ) ; java . lang . String prefix = ( "insight/" + ( sobaMessage . getConnectionId ( ) ) ) + "/" ; java . util . List < org . jclouds . blobstore . domain . Blob > payloads = s3TestUtils . getBlobsFromS3 ( expectedBucketName , prefix ) ; "<AssertPlaceHolder>" ; } getBlobsFromS3 ( java . lang . String , java . lang . String ) { if ( ! ( s3BlobStore . containerExists ( expectedBucketName ) ) ) { return java . util . Collections . emptyList ( ) ; } org . jclouds . blobstore . domain . PageSet < ? extends org . jclouds . blobstore . domain . StorageMetadata > pageSet = s3BlobStore . list ( expectedBucketName , ListContainerOptions . Builder . afterMarker ( prefix ) ) ; java . util . List < org . jclouds . blobstore . domain . Blob > blobs = new java . util . ArrayList ( ) ; for ( org . jclouds . blobstore . domain . StorageMetadata metadata : pageSet ) { blobs . add ( s3BlobStore . getBlob ( expectedBucketName , metadata . getName ( ) ) ) ; } return blobs ; } | org . junit . Assert . assertEquals ( 0 , payloads . size ( ) ) |
testShouldFireSyncEvent ( ) { java . util . concurrent . atomic . AtomicInteger counter = com . liferay . document . library . app . service . test . DLAppServiceTestUtil . registerDLSyncEventProcessorMessageListener ( DLSyncConstants . EVENT_UPDATE ) ; com . liferay . portal . kernel . repository . model . FileEntry fileEntry = com . liferay . document . library . app . service . test . DLAppServiceTestUtil . addFileEntry ( group . getGroupId ( ) , parentFolder . getFolderId ( ) ) ; com . liferay . portal . kernel . service . ServiceContext serviceContext = com . liferay . portal . kernel . test . util . ServiceContextTestUtil . getServiceContext ( group . getGroupId ( ) ) ; com . liferay . document . library . kernel . service . DLAppServiceUtil . checkOutFileEntry ( fileEntry . getFileEntryId ( ) , serviceContext ) ; "<AssertPlaceHolder>" ; } get ( ) { return _byteBuffer . get ( ) ; } | org . junit . Assert . assertEquals ( 1 , counter . get ( ) ) |
testGetParametersWithDisabledSecurity ( ) { unit . setActive ( false ) ; unit . setSecurity ( false ) ; java . lang . Long adminUnitId = 1L ; org . lnu . is . domain . admin . unit . AdminUnit adminUnit = new org . lnu . is . domain . admin . unit . AdminUnit ( ) ; adminUnit . setId ( adminUnitId ) ; java . lang . Long assetId = 2L ; org . lnu . is . domain . asset . Asset asset = new org . lnu . is . domain . asset . Asset ( ) ; asset . setId ( assetId ) ; java . lang . Long addressTypeId = 3L ; org . lnu . is . domain . address . type . AddressType addressType = new org . lnu . is . domain . address . type . AddressType ( ) ; addressType . setId ( addressTypeId ) ; java . lang . Long streetTypeId = 4L ; org . lnu . is . domain . street . type . StreetType streetType = new org . lnu . is . domain . street . type . StreetType ( ) ; streetType . setId ( streetTypeId ) ; java . lang . String zipCode = "zip<sp>code" ; java . lang . String street = "street" ; java . lang . String house = "house" ; java . lang . String apartment = "apartment" ; org . lnu . is . domain . asset . address . AssetAddress entity = new org . lnu . is . domain . asset . address . AssetAddress ( ) ; entity . setAdminUnit ( adminUnit ) ; entity . setAsset ( asset ) ; entity . setAddressType ( addressType ) ; entity . setStreetType ( streetType ) ; entity . setZipCode ( zipCode ) ; entity . setStreet ( street ) ; entity . setHouse ( house ) ; entity . setApartment ( apartment ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "adminUnit" , adminUnit ) ; expected . put ( "asset" , asset ) ; expected . put ( "addressType" , addressType ) ; expected . put ( "streetType" , streetType ) ; expected . put ( "zipCode" , zipCode ) ; expected . put ( "street" , street ) ; expected . put ( "house" , house ) ; expected . put ( "apartment" , apartment ) ; when ( adminUnitDao . getEntityById ( anyLong ( ) ) ) . thenReturn ( adminUnit ) ; when ( assetDao . getEntityById ( anyLong ( ) ) ) . thenReturn ( asset ) ; when ( addressTypeDao . getEntityById ( anyLong ( ) ) ) . thenReturn ( addressType ) ; when ( streetTypeDao . getEntityById ( anyLong ( ) ) ) . thenReturn ( streetType ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; verify ( adminUnitDao ) . getEntityById ( adminUnitId ) ; verify ( assetDao ) . getEntityById ( assetId ) ; verify ( addressTypeDao ) . getEntityById ( addressTypeId ) ; verify ( streetTypeDao ) . getEntityById ( streetTypeId ) ; "<AssertPlaceHolder>" ; } getEntityById ( KEY ) { org . lnu . is . dao . dao . DefaultDao . LOG . info ( "Getting<sp>{}.entity<sp>wit<sp>id" , getEntityClass ( ) . getSimpleName ( ) , id ) ; return persistenceManager . findById ( getEntityClass ( ) , id ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testMergeFilteredMapsWithNoMapsAtAll ( ) { java . util . Map < java . lang . String , java . lang . String > filteredMap = systemUnderTest . mergeFilteredMaps ( null , null ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNull ( filteredMap ) |
testConfigureDefaultClassFound ( ) { java . lang . System . getProperties ( ) . put ( "user.lookup.class.name" , "com.intuit.wasabi.userdirectory.impl.DefaultUserDirectory" ) ; com . google . inject . Injector injector = com . google . inject . Guice . createInjector ( new com . intuit . wasabi . userdirectory . UserDirectoryModule ( ) ) ; com . intuit . wasabi . userdirectory . UserDirectory userDirectory = injector . getInstance ( com . intuit . wasabi . userdirectory . UserDirectory . class ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( userDirectory ) |
testPostfixFunction6 ( ) { java . lang . String expr ; double expected ; double x = 1.565 ; double y = 2.1323 ; expr = "ceil(x)<sp>+<sp>1<sp>/<sp>y<sp>*<sp>abs(1.4)" ; expected = ( java . lang . Math . Math . ceil ( x ) ) + ( ( 1 / y ) * ( java . lang . Math . Math . abs ( 1.4 ) ) ) ; net . objecthunter . exp4j . Expression e = new net . objecthunter . exp4j . ExpressionBuilder ( expr ) . variables ( "x" , "y" ) . build ( ) ; "<AssertPlaceHolder>" ; } setVariable ( java . lang . String , double ) { this . checkVariableName ( name ) ; this . variables . put ( name , java . lang . Double . valueOf ( value ) ) ; return this ; } | org . junit . Assert . assertTrue ( ( expected == ( e . setVariable ( "x" , x ) . setVariable ( "y" , y ) . evaluate ( ) ) ) ) |
testLong ( ) { final long TEST_CASE = 1642146535132L ; java . nio . ByteBuffer buffer = java . nio . ByteBuffer . allocate ( 8 ) ; buffer = buffer . order ( ByteOrder . BIG_ENDIAN ) ; buffer . putLong ( TEST_CASE ) ; long readLong = com . nhnent . haste . common . ByteRead . getLong ( buffer . array ( ) , 0 ) ; "<AssertPlaceHolder>" ; } getLong ( byte [ ] , int ) { com . nhnent . haste . common . Check . EnsureIndex ( src , startIndex , 8 ) ; long value1 = ( ( com . nhnent . haste . common . ByteRead . getInt ( src , startIndex ) ) & ( com . nhnent . haste . common . ByteRead . MASK_INT ) ) << 32 ; long value2 = ( com . nhnent . haste . common . ByteRead . getInt ( src , ( startIndex + 4 ) ) ) & ( com . nhnent . haste . common . ByteRead . MASK_INT ) ; return value1 | value2 ; } | org . junit . Assert . assertEquals ( TEST_CASE , readLong ) |
shouldFailWebSocketConnectionWhenServerSendCloseFrameWithPayloadTooLong ( ) { final org . apache . mina . core . service . IoHandler handler = context . mock ( org . apache . mina . core . service . IoHandler . class ) ; context . checking ( new org . kaazing . gateway . transport . test . Expectations ( ) { { oneOf ( handler ) . sessionCreated ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) ) ; oneOf ( handler ) . sessionOpened ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) ) ; allowing ( handler ) . exceptionCaught ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) , with ( any ( org . kaazing . gateway . transport . wsn . specification . ws . connector . Exception . class ) ) ) ; allowing ( handler ) . sessionClosed ( with ( any ( org . kaazing . mina . core . session . IoSessionEx . class ) ) ) ; } } ) ; org . apache . mina . core . future . ConnectFuture connectFuture = connector . connect ( "ws://localhost:8080/echo" , null , handler ) ; connectFuture . awaitUninterruptibly ( ) ; "<AssertPlaceHolder>" ; k3po . finish ( ) ; } isConnected ( ) { return channel . isConnected ( ) ; } | org . junit . Assert . assertTrue ( connectFuture . isConnected ( ) ) |
testClose ( ) { java . lang . String testFileName = "testClose.csv" ; java . lang . String targetIrodsCollection = org . irods . jargon . core . pub . io . IRODSFileOutputStreamTest . testingPropertiesHelper . buildIRODSCollectionAbsolutePathFromTestProperties ( org . irods . jargon . core . pub . io . IRODSFileOutputStreamTest . testingProperties , org . irods . jargon . core . pub . io . IRODSFileOutputStreamTest . IRODS_TEST_SUBDIR_PATH ) ; org . irods . jargon . core . connection . IRODSAccount irodsAccount = org . irods . jargon . core . pub . io . IRODSFileOutputStreamTest . testingPropertiesHelper . buildIRODSAccountFromTestProperties ( org . irods . jargon . core . pub . io . IRODSFileOutputStreamTest . testingProperties ) ; org . irods . jargon . core . pub . IRODSAccessObjectFactory accessObjectFactory = org . irods . jargon . core . pub . io . IRODSFileOutputStreamTest . irodsFileSystem . getIRODSAccessObjectFactory ( ) ; org . irods . jargon . core . pub . io . IRODSFileFactory irodsFileFactory = accessObjectFactory . getIRODSFileFactory ( irodsAccount ) ; org . irods . jargon . core . pub . io . IRODSFile irodsFile = irodsFileFactory . instanceIRODSFile ( ( ( targetIrodsCollection + '/' ) + testFileName ) ) ; irodsFile . createNewFile ( ) ; org . irods . jargon . core . pub . io . IRODSFileOutputStream irodsFileOutputStream = irodsFileFactory . instanceIRODSFileOutputStream ( irodsFile ) ; java . lang . String myBytes = "ajjjjjjjjjfjjifi98jdkjfaklsdfjaidnadfjaisdfaskdjfaijfjfjad;fasjgjgkjjasfgkasgkjas;dfjas;df9920jdsaklfaslkdfja;sdjfasffjjjjjjjjjjjjjfeiiiiiiiiiiiiiii54454545" ; byte [ ] myBytesArray = myBytes . getBytes ( ) ; irodsFileOutputStream . write ( myBytesArray , 10 , 10 ) ; irodsFileOutputStream . close ( ) ; irodsFile . close ( ) ; org . irods . jargon . core . pub . io . IRODSFileOutputStreamTest . irodsFileSystem . closeAndEatExceptions ( ) ; "<AssertPlaceHolder>" ; } getFileDescriptor ( ) { return fileDescriptor ; } | org . junit . Assert . assertTrue ( ( ( irodsFile . getFileDescriptor ( ) ) < 0 ) ) |
firstTest ( ) { com . microsoft . azure . management . compute . v2017_09_01 . ComputeTest . rgName = com . microsoft . azure . arm . utils . SdkContext . randomResourceName ( "rg" , 20 ) ; com . microsoft . azure . management . resources . ResourceGroup group = com . microsoft . azure . management . compute . v2017_09_01 . ComputeTest . resourceManager . resourceGroups ( ) . define ( com . microsoft . azure . management . compute . v2017_09_01 . ComputeTest . rgName ) . withRegion ( Region . US_WEST . toString ( ) ) . create ( ) ; "<AssertPlaceHolder>" ; } create ( ) { return this . create ( null , null , null , null ) ; } | org . junit . Assert . assertNotNull ( group ) |
shouldReturnExpressionParser ( ) { org . springframework . expression . ExpressionParser expressionParser = mock ( org . springframework . expression . ExpressionParser . class ) ; when ( featureExpressionContext . getExpressionParser ( ) ) . thenReturn ( expressionParser ) ; org . springframework . expression . ExpressionParser parser = featureContext . getExpressionParser ( ) ; "<AssertPlaceHolder>" ; verify ( featureExpressionContext ) . getExpressionParser ( ) ; } getExpressionParser ( ) { return new org . springframework . expression . spel . standard . SpelExpressionParser ( ) ; } | org . junit . Assert . assertEquals ( expressionParser , parser ) |
testLargeSequenceInProgress ( ) { long count = 10 ; long loops = 1000 ; long total = count * loops ; java . util . concurrent . atomic . AtomicLong result = new java . util . concurrent . atomic . AtomicLong ( 0 ) ; org . opennms . core . tasks . SequenceTask task = createSequence ( ) ; task . add ( scheduler ( task , result , 1 , count , ( loops - 1 ) ) ) ; task . schedule ( ) ; task . waitFor ( ) ; "<AssertPlaceHolder>" ; } get ( ) { return m_engineConfiguration ; } | org . junit . Assert . assertEquals ( ( ( total * ( total + 1 ) ) / 2 ) , result . get ( ) ) |
test18 ( ) { byte [ ] expected = new byte [ ] { ( ( byte ) ( 0 ) ) } ; java . lang . String str = new java . lang . String ( "" ) ; "<AssertPlaceHolder>" ; } build_null_str ( java . lang . String ) { byte [ ] strByte = str . getBytes ( com . openddal . server . mysql . proto . Proto . CHARSET ) ; int size = ( strByte . length ) + 1 ; byte [ ] packet = new byte [ size ] ; if ( ( strByte . length ) < ( packet . length ) ) size = strByte . length ; java . lang . System . arraycopy ( strByte , 0 , packet , 0 , size ) ; return packet ; } | org . junit . Assert . assertArrayEquals ( expected , com . openddal . server . mysql . proto . Proto . build_null_str ( str ) ) |
testHarsdorf ( ) { java . util . List < com . graphhopper . routing . util . TestAlgoCollector . OneRun > list = new java . util . ArrayList ( ) ; list . add ( new com . graphhopper . routing . util . TestAlgoCollector . OneRun ( 50.004333 , 11.600254 , 50.044449 , 11.543434 , 6952 , 190 ) ) ; runAlgo ( testCollector , ( ( com . graphhopper . GraphHopperIT . DIR ) + "/north-bayreuth.osm.gz" ) , "target/north-bayreuth-gh" , list , "bike" , true , "bike" , "fastest" , false ) ; "<AssertPlaceHolder>" ; } toString ( ) { return "OSM<sp>File<sp>header:" + ( super . toString ( ) ) ; } | org . junit . Assert . assertEquals ( testCollector . toString ( ) , 0 , testCollector . errors . size ( ) ) |
withFourSteps ( ) { "<AssertPlaceHolder>" ; } countWays ( int ) { if ( steps == 0 ) return 1 ; else if ( steps == 1 ) return 1 ; else if ( steps == 2 ) return 2 ; else if ( steps == 3 ) return 4 ; int a = 1 ; int b = 2 ; int c = 4 ; int ways = 0 ; for ( int i = 4 ; i <= steps ; i ++ ) { ways = ( a + b ) + c ; a = b ; b = c ; c = ways ; } return ways ; } | org . junit . Assert . assertEquals ( 7 , s . countWays ( 4 ) ) |
listAccessLevelsForwardsCalls ( ) { org . phenotips . data . permissions . EntityPermissionsManager internal = this . mocker . getInstance ( org . phenotips . data . permissions . EntityPermissionsManager . class ) ; java . util . List < org . phenotips . data . permissions . AccessLevel > levels = new java . util . ArrayList ( ) ; when ( internal . listAccessLevels ( ) ) . thenReturn ( levels ) ; java . util . Collection < org . phenotips . data . permissions . AccessLevel > returnedLevels = this . mocker . getComponentUnderTest ( ) . listAccessLevels ( ) ; "<AssertPlaceHolder>" ; } listAccessLevels ( ) { java . util . List < org . phenotips . data . permissions . AccessLevel > levels = new java . util . ArrayList ( ) ; levels . add ( org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . EDIT_ACCESS ) ; levels . add ( org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . NO_ACCESS ) ; levels . add ( org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . OWNER_ACCESS ) ; levels . add ( org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . VIEW_ACCESS ) ; levels . add ( org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . MANAGE_ACCESS ) ; when ( this . componentManager . < org . phenotips . data . permissions . AccessLevel > getInstanceList ( org . phenotips . data . permissions . AccessLevel . class ) ) . thenReturn ( levels ) ; java . util . Collection < org . phenotips . data . permissions . AccessLevel > returnedLevels = this . component . listAccessLevels ( ) ; org . junit . Assert . assertEquals ( 3 , returnedLevels . size ( ) ) ; java . util . Iterator < org . phenotips . data . permissions . AccessLevel > it = returnedLevels . iterator ( ) ; org . junit . Assert . assertSame ( org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . VIEW_ACCESS , it . next ( ) ) ; org . junit . Assert . assertSame ( org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . EDIT_ACCESS , it . next ( ) ) ; org . junit . Assert . assertSame ( org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . MANAGE_ACCESS , it . next ( ) ) ; org . junit . Assert . assertFalse ( returnedLevels . contains ( org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . NO_ACCESS ) ) ; org . junit . Assert . assertFalse ( returnedLevels . contains ( org . phenotips . data . permissions . internal . DefaultEntityAccessManagerTest . OWNER_ACCESS ) ) ; } | org . junit . Assert . assertSame ( levels , returnedLevels ) |
testSetNode ( ) { com . blinkfox . zealot . test . bean . BuildSourceTest . source . setNode ( null ) ; "<AssertPlaceHolder>" ; } getNode ( ) { return node ; } | org . junit . Assert . assertEquals ( null , com . blinkfox . zealot . test . bean . BuildSourceTest . source . getNode ( ) ) |
testBuildPkgNameRootServicePathNoEncoding ( ) { System . out . println ( ( ( ( ( getTestTraceHead ( "[NGSICKANSink.buildPkgName]" ) ) + "--------<sp>When<sp>no<sp>encoding<sp>and<sp>when<sp>using<sp>a<sp>notified/defaulted<sp>root<sp>service<sp>path,<sp>the<sp>pkg<sp>name<sp>is<sp>" ) + "--------<sp>When<sp>no<sp>encoding<sp>and<sp>when<sp>using<sp>a<sp>notified/defaulted<sp>root<sp>service<sp>path,<sp>the<sp>pkg<sp>name<sp>is<sp>" 2 ) + "notified/defaulted<sp>service<sp>path" ) ) ; java . lang . String apiKey = null ; java . lang . String attrPersistence = null ; java . lang . String backendMaxConns = null ; java . lang . String backendMaxConnsPerRoute = null ; java . lang . String batchSize = null ; java . lang . String batchTime = null ; java . lang . String batchTTL = null ; java . lang . String dataModel = null ; java . lang . String enableEncoding = null ; java . lang . String enableGrouping = null ; java . lang . String enableLowercase = null ; java . lang . String host = null ; java . lang . String port = null ; java . lang . String ssl = null ; java . lang . String viewer = null ; com . telefonica . iot . cygnus . sinks . NGSICKANSink sink = new com . telefonica . iot . cygnus . sinks . NGSICKANSink ( ) ; sink . configure ( createContext ( apiKey , attrPersistence , backendMaxConns , backendMaxConnsPerRoute , batchSize , batchTime , batchTTL , dataModel , enableEncoding , enableGrouping , enableLowercase , host , port , ssl , viewer ) ) ; java . lang . String service = "someService" ; java . lang . String servicePath = "--------<sp>When<sp>no<sp>encoding<sp>and<sp>when<sp>using<sp>a<sp>notified/defaulted<sp>root<sp>service<sp>path,<sp>the<sp>pkg<sp>name<sp>is<sp>" 0 ; try { java . lang . String builtPkgName = sink . buildPkgName ( service , servicePath ) ; java . lang . String expectedPkgName = "someservice" ; try { "<AssertPlaceHolder>" ; System . out . println ( ( ( ( ( ( getTestTraceHead ( "[NGSICKANSink.buildPkgName]" ) ) + "-<sp>OK<sp>-<sp>'" ) + expectedPkgName ) + "'<sp>is<sp>equals<sp>to<sp>the<sp>encoding<sp>of<sp>" ) + "--------<sp>When<sp>no<sp>encoding<sp>and<sp>when<sp>using<sp>a<sp>notified/defaulted<sp>root<sp>service<sp>path,<sp>the<sp>pkg<sp>name<sp>is<sp>" 1 ) ) ; } catch ( java . lang . AssertionError e ) { System . out . println ( ( ( ( ( ( getTestTraceHead ( "[NGSICKANSink.buildPkgName]" ) ) + "-<sp>FAIL<sp>-<sp>'" ) + expectedPkgName ) + "'<sp>is<sp>not<sp>equals<sp>to<sp>the<sp>encoding<sp>of<sp>" ) + "--------<sp>When<sp>no<sp>encoding<sp>and<sp>when<sp>using<sp>a<sp>notified/defaulted<sp>root<sp>service<sp>path,<sp>the<sp>pkg<sp>name<sp>is<sp>" 1 ) ) ; throw e ; } } catch ( java . lang . Exception e ) { System . out . println ( ( ( getTestTraceHead ( "[NGSICKANSink.buildPkgName]" ) ) + "-<sp>FAIL<sp>-<sp>There<sp>was<sp>some<sp>problem<sp>when<sp>building<sp>the<sp>DB<sp>name" ) ) ; throw e ; } createContext ( java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String ) { org . apache . flume . Context context = new org . apache . flume . Context ( ) ; context . put ( "backend.max_conns" 2 , apiKey ) ; context . put ( "backend.max_conns" 1 , attrPersistence ) ; context . put ( "backend.max_conns" , backendMaxConns ) ; context . put ( "backend.max_conns_per_route" , backendMaxConnsPerRoute ) ; context . put ( "batch_size" , batchSize ) ; context . put ( "backend.max_conns" 4 , batchTime ) ; context . put ( "batch_ttl" , batchTTL ) ; context . put ( "ckan_host" , host ) ; context . put ( "ckan_port" , port ) ; context . put ( "ckan_viewer" , viewer ) ; context . put ( "backend.max_conns" 3 , dataModel ) ; context . put ( "enable_encoding" , enableEncoding ) ; context . put ( "backend.max_conns" 0 , enableGrouping ) ; context . put ( "enable_lowercase" , enableLowercase ) ; context . put ( "ssl" , ssl ) ; return context ; } | org . junit . Assert . assertEquals ( expectedPkgName , builtPkgName ) |
checksUserPropertiesFileReadabilityCorrectly ( ) { com . github . marabou . helper . PathHelper pathHelperMock = mock ( com . github . marabou . helper . PathHelper . class ) ; when ( pathHelperMock . getUserPropertiesFilePath ( ) ) . thenReturn ( "this-file-does-not-exist" ) ; java . io . File f = mock ( java . io . File . class ) ; when ( f . canRead ( ) ) . thenReturn ( true ) ; com . github . marabou . properties . PropertiesLoader propertiesLoaderMock = mock ( com . github . marabou . properties . PropertiesLoader . class ) ; com . github . marabou . properties . PropertiesHelper propertiesHelper = spy ( new com . github . marabou . properties . PropertiesHelper ( pathHelperMock , propertiesLoaderMock ) ) ; java . io . File nonReadableFile = mock ( java . io . File . class ) ; when ( nonReadableFile . canRead ( ) ) . thenReturn ( false ) ; doReturn ( nonReadableFile ) . when ( propertiesHelper ) . getUserPropertiesFile ( ) ; "<AssertPlaceHolder>" ; } userPropertiesNotReadable ( ) { com . github . marabou . properties . File userPropertiesFile = getUserPropertiesFile ( ) ; return ! ( userPropertiesFile . canRead ( ) ) ; } | org . junit . Assert . assertTrue ( propertiesHelper . userPropertiesNotReadable ( ) ) |
verwerkenMoetAantalVerzondenAanpassen ( ) { final nl . bzk . migratiebrp . bericht . model . sync . impl . AfnemersindicatiesBericht bericht = new nl . bzk . migratiebrp . bericht . model . sync . impl . AfnemersindicatiesBericht ( ) ; bericht . setAfnemersindicaties ( new nl . bzk . migratiebrp . conversie . model . lo3 . autorisatie . Lo3Afnemersindicatie ( "1" , java . util . Collections . emptyList ( ) ) ) ; subject . voegBerichtToe ( bericht ) ; subject . voegBerichtToe ( bericht ) ; subject . verwerkBerichten ( ) ; "<AssertPlaceHolder>" ; } aantalVerzonden ( ) { return aantalVerzonden . get ( ) ; } | org . junit . Assert . assertEquals ( 2 , subject . aantalVerzonden ( ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.