input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
testReadNextValuesUsesNaNWhenNoMoreBytes ( ) { au . gov . ga . worldwind . common . util . io . FloatReader classUnderTest = FloatReader . Builder . newFloatReaderForStream ( is ) . withGroupValueGap ( 1 ) . withGroupSize ( 101 ) . build ( ) ; float [ ] values = new float [ 101 ] ; for ( int i = 0 ; i < ( values . length ) ; i ++ ) { values [ i ] = - 9999 ; } classUnderTest . readNextValues ( values ) ; "<AssertPlaceHolder>" ; } isNaN ( float [ ] ) { for ( float f : values ) { if ( java . lang . Float . isNaN ( f ) ) { return true ; } } return false ; }
|
org . junit . Assert . assertTrue ( java . lang . Float . isNaN ( values [ 100 ] ) )
|
testSingleWordQueryInTextFieldUsingKeywordChinese ( ) { java . util . ArrayList < java . lang . String > names = new java . util . ArrayList < java . lang . String > ( java . util . Arrays . asList ( "" ) ) ; edu . uci . ics . texera . dataflow . dictionarymatcher . Dictionary dictionary = new edu . uci . ics . texera . dataflow . dictionarymatcher . Dictionary ( names ) ; java . util . List < edu . uci . ics . texera . api . span . Span > list = new java . util . ArrayList < edu . uci . ics . texera . api . span . Span > ( ) ; edu . uci . ics . texera . api . span . Span span = new edu . uci . ics . texera . api . span . Span ( "description" , 0 , 4 , "" , "" , 0 ) ; list . add ( span ) ; edu . uci . ics . texera . api . schema . Attribute [ ] schemaAttributes = new edu . uci . ics . texera . api . schema . Attribute [ ( TestConstantsChinese . ATTRIBUTES_PEOPLE . length ) + 1 ] ; for ( int count = 0 ; count < ( ( schemaAttributes . length ) - 1 ) ; count ++ ) { schemaAttributes [ count ] = edu . uci . ics . texera . api . constants . test . TestConstantsChinese . ATTRIBUTES_PEOPLE [ count ] ; } schemaAttributes [ ( ( schemaAttributes . length ) - 1 ) ] = edu . uci . ics . texera . dataflow . dictionarymatcher . DictionaryMatcherTest . RESULTS_ATTRIBUTE ; edu . uci . ics . texera . api . field . IField [ ] fields1 = new edu . uci . ics . texera . api . field . IField [ ] { new edu . uci . ics . texera . api . field . StringField ( "" ) , new edu . uci . ics . texera . api . field . StringField ( "" ) , new edu . uci . ics . texera . api . field . IntegerField ( 46 ) , new edu . uci . ics . texera . api . field . DoubleField ( 5.5 ) , new edu . uci . ics . texera . api . field . DateField ( new java . text . SimpleDateFormat ( "MM-dd-yyyy" ) . parse ( "01-14-1970" ) ) , new edu . uci . ics . texera . api . field . TextField ( "" ) , new edu . uci . ics . texera . api . field . ListField < edu . uci . ics . texera . api . span . Span > ( list ) } ; edu . uci . ics . texera . api . field . IField [ ] fields2 = new edu . uci . ics . texera . api . field . IField [ ] { new edu . uci . ics . texera . api . field . StringField ( "" 0 ) , new edu . uci . ics . texera . api . field . StringField ( "" ) , new edu . uci . ics . texera . api . field . IntegerField ( 42 ) , new edu . uci . ics . texera . api . field . DoubleField ( 5.99 ) , new edu . uci . ics . texera . api . field . DateField ( new java . text . SimpleDateFormat ( "MM-dd-yyyy" ) . parse ( "01-13-1974" ) ) , new edu . uci . ics . texera . api . field . TextField ( "" ) , new edu . uci . ics . texera . api . field . ListField < edu . uci . ics . texera . api . span . Span > ( list ) } ; edu . uci . ics . texera . api . tuple . Tuple tuple1 = new edu . uci . ics . texera . api . tuple . Tuple ( new edu . uci . ics . texera . api . schema . Schema ( schemaAttributes ) , fields1 ) ; edu . uci . ics . texera . api . tuple . Tuple tuple2 = new edu . uci . ics . texera . api . tuple . Tuple ( new edu . uci . ics . texera . api . schema . Schema ( schemaAttributes ) , fields2 ) ; java . util . List < edu . uci . ics . texera . api . tuple . Tuple > expectedResults = new java . util . ArrayList < edu . uci . ics . texera . api . tuple . Tuple > ( ) ; expectedResults . add ( tuple1 ) ; expectedResults . add ( tuple2 ) ; java . util . List < java . lang . String > attributeNames = java . util . Arrays . asList ( TestConstantsChinese . FIRST_NAME , TestConstantsChinese . LAST_NAME , TestConstantsChinese . DESCRIPTION ) ; java . util . List < edu . uci . ics . texera . api . tuple . Tuple > returnedResults = edu . uci . ics . texera . dataflow . dictionarymatcher . DictionaryMatcherTestHelper . getQueryResults ( edu . uci . ics . texera . dataflow . dictionarymatcher . DictionaryMatcherTest . CHINESE_TABLE , dictionary , attributeNames , KeywordMatchingType . CONJUNCTION_INDEXBASED ) ; boolean contains = edu . uci . ics . texera . api . utils . TestUtils . equals ( expectedResults , returnedResults ) ; "<AssertPlaceHolder>" ; } equals ( java . util . List , java . util . List ) { expectedResults = Tuple . Builder . removeIfExists ( expectedResults , SchemaConstants . _ID , SchemaConstants . PAYLOAD ) ; exactResults = Tuple . Builder
|
org . junit . Assert . assertTrue ( contains )
|
negativeSkewXTest ( ) { com . itextpdf . kernel . geom . AffineTransform expected = new com . itextpdf . kernel . geom . AffineTransform ( 1.0 , 0.0 , java . lang . Math . tan ( java . lang . Math . toRadians ( ( ( float ) ( com . itextpdf . styledxmlparser . css . util . CssUtils . parseFloat ( "-26" ) ) ) ) ) , 1.0 , 0.0 , 0.0 ) ; com . itextpdf . kernel . geom . AffineTransform actual = com . itextpdf . svg . utils . TransformUtils . parseTransform ( "skewX(-26)" ) ; "<AssertPlaceHolder>" ; } parseTransform ( java . lang . String ) { if ( transform == null ) { throw new com . itextpdf . svg . exceptions . SvgProcessingException ( com . itextpdf . svg . exceptions . SvgLogMessageConstant . TRANSFORM_NULL ) ; } if ( transform . isEmpty ( ) ) { throw new com . itextpdf . svg . exceptions . SvgProcessingException ( com . itextpdf . svg . exceptions . SvgLogMessageConstant . TRANSFORM_EMPTY ) ; } com . itextpdf . kernel . geom . AffineTransform matrix = new com . itextpdf . kernel . geom . AffineTransform ( ) ; java . util . List < java . lang . String > listWithTransformations = com . itextpdf . svg . utils . TransformUtils . splitString ( transform ) ; for ( java . lang . String transformation : listWithTransformations ) { com . itextpdf . kernel . geom . AffineTransform newMatrix = com . itextpdf . svg . utils . TransformUtils . transformationStringToMatrix ( transformation ) ; if ( newMatrix != null ) { matrix . concatenate ( newMatrix ) ; } } return matrix ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testCancellation ( ) { int MIN_NUM_TO_RETURN = 5 ; org . genemania . dto . EnrichmentEngineRequestDto request = new org . genemania . dto . EnrichmentEngineRequestDto ( ) ; request . setOrganismId ( org . genemania . engine . actions . ComputeEnrichmentTest . org1Id ) ; request . setOntologyId ( 1 ) ; request . setqValueThreshold ( 0.05 ) ; request . setMinCategories ( MIN_NUM_TO_RETURN ) ; org . genemania . util . ProgressReporter progress = new org . genemania . engine . SimpleProgressReporter ( ) ; progress . cancel ( ) ; request . setProgressReporter ( progress ) ; org . genemania . engine . core . data . NodeIds nodeIds = org . genemania . engine . actions . ComputeEnrichmentTest . cacheBuilder . getCache ( ) . getNodeIds ( request . getOrganismId ( ) ) ; java . util . Collection < java . lang . Long > nodes = new java . util . ArrayList < java . lang . Long > ( ) ; for ( int i = 0 ; i < ( ( nodeIds . getNodeIds ( ) . length ) / 2 ) ; i ++ ) { nodes . add ( nodeIds . getIdForIndex ( i ) ) ; } request . setNodes ( nodes ) ; org . genemania . engine . actions . ComputeEnrichment ce = new org . genemania . engine . actions . ComputeEnrichment ( org . genemania . engine . actions . ComputeEnrichmentTest . cacheBuilder . getCache ( ) , request ) ; org . genemania . dto . EnrichmentEngineResponseDto response = ce . process ( ) ; "<AssertPlaceHolder>" ; } process ( ) { java . io . File source = new java . io . File ( fSourcePath ) ; java . io . File target = new java . io . File ( fTargetPath ) ; java . util . regex . Pattern pattern = java . util . regex . Pattern . compile ( "\\d+" ) ; if ( ( ! ( source . isDirectory ( ) ) ) || ( ! ( target . isDirectory ( ) ) ) ) { throw new java . lang . IllegalArgumentException ( "Both<sp>the<sp>source<sp>and<sp>target<sp>index<sp>directories<sp>must<sp>exist" ) ; } for ( java . io . File file : target . listFiles ( ) ) { if ( ! ( file . isDirectory ( ) ) ) { continue ; } java . lang . String organismId = file . getName ( ) ; java . util . regex . Matcher matcher = pattern . matcher ( organismId ) ; if ( ! ( matcher . matches ( ) ) ) { continue ; } java . io . File sourceFile = new java . io . File ( ( ( ( source . getPath ( ) ) + ( java . io . File . separator ) ) + organismId ) ) ; org . apache . lucene . store . FSDirectory targetDirectory = org . apache . lucene . store . FSDirectory . open ( file ) ; org . apache . lucene . search . Searcher targetSearcher = new org . apache . lucene . search . IndexSearcher ( targetDirectory ) ; org . apache . lucene . search . Searcher sourceSearcher = new org . apache . lucene . search . IndexSearcher ( org . apache . lucene . store . FSDirectory . open ( sourceFile ) ) ; org . apache . lucene . analysis . Analyzer analyzer = org . genemania . mediator . lucene . LuceneMediator . createDefaultAnalyzer ( ) ; org . genemania . mediator . NetworkMediator targetMediator = new org . genemania . mediator . lucene . LuceneNetworkMediator ( targetSearcher , analyzer ) ; org . genemania . mediator . NetworkMediator sourceMediator = new org . genemania . mediator . lucene . LuceneNetworkMediator ( sourceSearcher , analyzer ) ; java . util . Map < org . genemania . domain . InteractionNetwork , org . genemania . domain . InteractionNetworkGroup > networksToUpdate = new java . util . HashMap < org . genemania . domain . InteractionNetwork , org . genemania . domain . InteractionNetworkGroup > ( ) ; for ( org . genemania . domain . InteractionNetwork targetNetwork : targetMediator . getAllNetworks ( ) ) { org . genemania . domain . InteractionNetwork sourceNetwork = sourceMediator . getNetwork ( targetNetwork . getId ( ) ) ; if ( hasChanges ( sourceNetwork , targetNetwork ) ) { org . genemania . domain . InteractionNetworkGroup group = sourceMediator . getNetworkGroupForNetwork ( sourceNetwork . getId ( ) ) ; networksToUpdate . put ( sourceNetwork , group ) ; System . out . printf ( "Updated<sp>%s\t%s\t%s.\n" , group . getName ( ) , sourceNetwork . getId ( ) , sourceNetwork . getName ( ) ) ; } } if ( ( networksToUpdate . size ( ) ) == 0 ) { return ; } org . apache . lucene . index . IndexWriter indexWriter = new org . apache . lucene . index . IndexWriter ( targetDirectory , analyzer , false , org . apache . lucene . index . IndexWriter . MaxFieldLength . UNLIMITED ) ; org . genemania . plugin . data . IModelWriter modelWriter = new org . genemania . plugin . data . lucene . LuceneModelWriter ( indexWriter ) ; try { for ( java . util . Map . Entry < org . genemania . domain . InteractionNetwork , org . genemania . domain . InteractionNetworkGroup > entry : networksToUpdate . entrySet ( ) ) { org . genemania . domain . InteractionNetwork network = entry . getKey ( ) ; org . genemania . domain . InteractionNetworkGroup group = entry . getValue ( ) ; modelWriter . deleteNetwork ( network ) ; modelWriter . addNetwork ( network , group ) ; } } finally { modelWriter . close ( ) ; } } }
|
org . junit . Assert . assertNull ( response )
|
testMapperValidValues ( ) { org . apache . hadoop . mapreduce . Mapper . Context context = mock ( Mapper . Context . class ) ; org . apache . hadoop . mapreduce . Counters counters = new org . apache . hadoop . mapreduce . Counters ( ) ; org . apache . hadoop . mapreduce . Counter counter = counters . findCounter ( DedupRecordCounter . TOTAL_RECORDS_READ ) ; when ( context . getCounter ( DedupRecordCounter . TOTAL_RECORDS_READ ) ) . thenReturn ( counter ) ; co . nubetech . hiho . dedup . DedupKeyMapper < org . apache . hadoop . io . Text , java . lang . String > mapper = new co . nubetech . hiho . dedup . DedupKeyMapper < org . apache . hadoop . io . Text , java . lang . String > ( ) ; org . apache . hadoop . io . Text key = new org . apache . hadoop . io . Text ( "abc123" ) ; java . lang . String val = "valueOfKey" ; mapper . map ( key , val , context ) ; co . nubetech . hiho . dedup . HihoTuple < org . apache . hadoop . io . Text > hihoTuple = new co . nubetech . hiho . dedup . HihoTuple < org . apache . hadoop . io . Text > ( ) ; hihoTuple . setKey ( key ) ; verify ( context ) . write ( hihoTuple , val ) ; "<AssertPlaceHolder>" ; } write ( K , V ) { writeObject ( value ) ; out . write ( co . nubetech . hiho . mapreduce . lib . output . NoKeyOnlyValueOutputFormat . NoKeyRecordWriter . newline ) ; }
|
org . junit . Assert . assertEquals ( 1 , context . getCounter ( DedupRecordCounter . TOTAL_RECORDS_READ ) . getValue ( ) )
|
updatingToNullNameIgnoresName ( ) { org . candlepin . dto . api . v1 . ConsumerDTO consumer = getFakeConsumerDTO ( ) ; consumer . setName ( "old<sp>name" ) ; org . candlepin . dto . api . v1 . ConsumerDTO updated = new org . candlepin . dto . api . v1 . ConsumerDTO ( ) ; updated . setName ( null ) ; resource . updateConsumer ( consumer . getUuid ( ) , updated , principal ) ; "<AssertPlaceHolder>" ; } getName ( ) { if ( ( pool ) != null ) { return pool . getProductName ( ) ; } return null ; }
|
org . junit . Assert . assertEquals ( "old<sp>name" , consumer . getName ( ) )
|
testEqualityOfIdenticalSubjects ( ) { org . apache . cayenne . event . EventSubject s1 = org . apache . cayenne . event . EventSubject . getSubject ( org . apache . cayenne . event . EventSubjectTest . class , "MySubject" ) ; org . apache . cayenne . event . EventSubject s2 = org . apache . cayenne . event . EventSubject . getSubject ( org . apache . cayenne . event . EventSubjectTest . class , "MySubject" ) ; "<AssertPlaceHolder>" ; } getSubject ( java . lang . Class , java . lang . String ) { if ( subjectOwner == null ) { throw new java . lang . IllegalArgumentException ( "Owner<sp>class<sp>must<sp>not<sp>be<sp>null." ) ; } if ( ( subjectName == null ) || ( ( subjectName . length ( ) ) == 0 ) ) { throw new java . lang . IllegalArgumentException ( "Subject<sp>name<sp>must<sp>not<sp>be<sp>null<sp>or<sp>empty." ) ; } java . lang . String fullSubjectName = ( ( subjectOwner . getName ( ) ) + "/" ) + subjectName ; org . apache . cayenne . event . EventSubject newSubject = org . apache . cayenne . event . EventSubject . _registeredSubjects . get ( fullSubjectName ) ; if ( newSubject == null ) { newSubject = new org . apache . cayenne . event . EventSubject ( fullSubjectName ) ; org . apache . cayenne . event . EventSubject . _registeredSubjects . put ( newSubject . getSubjectName ( ) , newSubject ) ; } return newSubject ; }
|
org . junit . Assert . assertEquals ( s1 , s2 )
|
testMask6 ( ) { java . net . InetAddress inet = java . net . Inet6Address . getByName ( "2607:f0d0:1002:0051:0000:0000:0000:0004" ) ; net . tomp2p . peers . IP . IPv6 v6 = net . tomp2p . peers . IP . fromInet6Address ( ( ( java . net . Inet6Address ) ( inet ) ) ) ; java . net . InetAddress inet2 = v6 . toInet6Address ( ) ; "<AssertPlaceHolder>" ; } toInet6Address ( ) { final byte [ ] ip = new byte [ 16 ] ; ip [ 0 ] = ( ( byte ) ( ( highBits ) > > > 56 ) ) ; ip [ 1 ] = ( ( byte ) ( ( highBits ) > > > 48 ) ) ; ip [ 2 ] = ( ( byte ) ( ( highBits ) > > > 40 ) ) ; ip [ 3 ] = ( ( byte ) ( ( highBits ) > > > 32 ) ) ; ip [ 4 ] = ( ( byte ) ( ( highBits ) > > > 24 ) ) ; ip [ 5 ] = ( ( byte ) ( ( highBits ) > > > 16 ) ) ; ip [ 6 ] = ( ( byte ) ( ( highBits ) > > > 8 ) ) ; ip [ 7 ] = ( ( byte ) ( highBits ) ) ; ip [ 8 ] = ( ( byte ) ( ( lowBits ) > > > 56 ) ) ; ip [ 9 ] = ( ( byte ) ( ( lowBits ) > > > 48 ) ) ; ip [ 10 ] = ( ( byte ) ( ( lowBits ) > > > 40 ) ) ; ip [ 11 ] = ( ( byte ) ( ( lowBits ) > > > 32 ) ) ; ip [ 12 ] = ( ( byte ) ( ( lowBits ) > > > 24 ) ) ; ip [ 13 ] = ( ( byte ) ( ( lowBits ) > > > 16 ) ) ; ip [ 14 ] = ( ( byte ) ( ( lowBits ) > > > 8 ) ) ; ip [ 15 ] = ( ( byte ) ( lowBits ) ) ; try { return ( ( java . net . Inet6Address ) ( java . net . Inet6Address . getByAddress ( ip ) ) ) ; } catch ( java . net . UnknownHostException e ) { e . printStackTrace ( ) ; return null ; } }
|
org . junit . Assert . assertEquals ( inet , inet2 )
|
testSetPayloadTransformerPlainText ( ) { setPayloadTransformer . setValue ( org . mule . runtime . core . internal . transformer . simple . SetPayloadTransformerTestCase . PLAIN_TEXT ) ; setPayloadTransformer . initialise ( ) ; when ( mockExpressionManager . isExpression ( org . mule . runtime . core . internal . transformer . simple . SetPayloadTransformerTestCase . PLAIN_TEXT ) ) . thenReturn ( false ) ; java . lang . Object response = setPayloadTransformer . transformMessage ( mockMuleEvent , org . mule . runtime . core . internal . transformer . simple . UTF_8 ) ; "<AssertPlaceHolder>" ; } transformMessage ( org . mule . runtime . core . api . event . CoreEvent , java . nio . charset . Charset ) { return org . mule . runtime . core . internal . transformer . simple . AbstractMessageTransformerTestCase . BYTES ; }
|
org . junit . Assert . assertThat ( response , org . hamcrest . CoreMatchers . is ( org . mule . runtime . core . internal . transformer . simple . SetPayloadTransformerTestCase . PLAIN_TEXT ) )
|
shouldReturnFalseWhenRemoteDoesNotExist2 ( ) { org . eclipse . egit . core . synchronize . GitResourceVariantComparator grvc = new org . eclipse . egit . core . synchronize . GitResourceVariantComparator ( null ) ; org . eclipse . core . resources . IResource local = mock ( org . eclipse . core . resources . IResource . class ) ; when ( local . exists ( ) ) . thenReturn ( false ) ; org . eclipse . team . core . variants . IResourceVariant remote = new org . eclipse . egit . core . synchronize . GitRemoteFolder ( repo , null , null , null , "./" ) ; "<AssertPlaceHolder>" ; } compare ( org . eclipse . jgit . lib . Repository , org . eclipse . jgit . lib . Repository ) { java . lang . String name1 = o1 . getWorkTree ( ) . getName ( ) ; java . lang . String name2 = o2 . getWorkTree ( ) . getName ( ) ; return name1 . compareToIgnoreCase ( name2 ) ; }
|
org . junit . Assert . assertFalse ( grvc . compare ( local , remote ) )
|
defaultForNonExistingWorks ( ) { "<AssertPlaceHolder>" ; } get ( java . lang . String , java . lang . Class ) { java . io . Serializable s = get ( key ) ; if ( s != null ) { try { return clazz . cast ( s ) ; } catch ( java . lang . ClassCastException ignore ) { } } return null ; }
|
org . junit . Assert . assertThat ( subject . get ( key , value ) , org . hamcrest . CoreMatchers . is ( value ) )
|
testHostNameProvided ( ) { java . lang . String hostname = "testhost" ; java . lang . String syslogMessage = ( "<11>Mar<sp>22<sp>14:24:49<sp>" + hostname ) + "<sp>last<sp>message<sp>repeated<sp>30<sp>times" ; org . opennms . netmgt . xml . event . Event event = org . opennms . netmgt . syslogd . ConvertToEventTest . parseSyslog ( "testHostNameProvided" , org . opennms . netmgt . syslogd . ConvertToEventTest . radixConfig , syslogMessage ) ; java . lang . String eventHostname = event . getParm ( "hostname" ) . getValue ( ) . getContent ( ) ; "<AssertPlaceHolder>" ; } getContent ( ) { return m_data . duplicate ( ) ; }
|
org . junit . Assert . assertEquals ( hostname , eventHostname )
|
roundTripOfMomentIntervalCollection ( ) { net . time4j . range . MomentInterval i1 = net . time4j . range . MomentInterval . between ( net . time4j . PlainTimestamp . of ( 2014 , 2 , 27 , 0 , 0 ) . atUTC ( ) , net . time4j . PlainTimestamp . of ( 2014 , 5 , 14 , 0 , 0 ) . atUTC ( ) ) ; net . time4j . range . MomentInterval i2 = net . time4j . range . MomentInterval . between ( net . time4j . PlainTimestamp . of ( 2013 , 2 , 27 , 0 , 0 ) . atUTC ( ) , net . time4j . PlainTimestamp . of ( 2014 , 4 , 30 , 0 , 0 ) . atUTC ( ) ) ; net . time4j . range . IntervalCollection < net . time4j . Moment > windows = net . time4j . range . IntervalCollection . onMomentAxis ( ) ; windows = windows . plus ( i1 ) . plus ( i2 ) ; java . lang . Object ser = net . time4j . range . SerializationTest . roundtrip ( windows ) ; "<AssertPlaceHolder>" ; } roundtrip ( java . lang . Object ) { java . io . ByteArrayOutputStream baos = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutputStream oos = new java . io . ObjectOutputStream ( baos ) ; oos . writeObject ( obj ) ; byte [ ] data = baos . toByteArray ( ) ; oos . close ( ) ; java . io . ByteArrayInputStream bais = new java . io . ByteArrayInputStream ( data ) ; java . io . ObjectInputStream ois = new java . io . ObjectInputStream ( bais ) ; java . lang . Object ser = ois . readObject ( ) ; ois . close ( ) ; return ser ; }
|
org . junit . Assert . assertThat ( windows , org . hamcrest . CoreMatchers . is ( ser ) )
|
createTableSelectAllWithSignlePartitionMySqlTest ( ) { org . verdictdb . core . sqlobject . BaseTable base = new org . verdictdb . core . sqlobject . BaseTable ( "test" , "people" , "t" ) ; org . verdictdb . core . sqlobject . SelectQuery relation = org . verdictdb . core . sqlobject . SelectQuery . create ( java . util . Arrays . < org . verdictdb . core . sqlobject . SelectItem > asList ( new org . verdictdb . core . sqlobject . AsteriskColumn ( ) ) , base ) ; org . verdictdb . core . sqlobject . CreateTableAsSelectQuery create = new org . verdictdb . core . sqlobject . CreateTableAsSelectQuery ( "test" , "newtable" , relation ) ; create . addPartitionColumn ( "id" ) ; create . addPartitionCount ( 2 ) ; java . lang . String expected = "create<sp>table<sp>`test`.`newtable`<sp>partition<sp>by<sp>list<sp>columns<sp>(`id`)<sp>(" + ( ( "partition<sp>p0<sp>values<sp>in<sp>(0),<sp>" + "partition<sp>p1<sp>values<sp>in<sp>(1))<sp>" ) + "select<sp>*<sp>from<sp>`test`.`people`<sp>as<sp>t" ) ; org . verdictdb . sqlwriter . CreateTableToSql queryToSql = new org . verdictdb . sqlwriter . CreateTableToSql ( new org . verdictdb . sqlsyntax . MysqlSyntax ( ) ) ; java . lang . String actual = queryToSql . toSql ( create ) ; "<AssertPlaceHolder>" ; org . verdictdb . connection . DbmsConnection dbmsConn = new org . verdictdb . connection . JdbcConnection ( org . verdictdb . sqlwriter . CreateTableToSqlMysqlTest . mysqlConn , new org . verdictdb . sqlsyntax . MysqlSyntax ( ) ) ; dbmsConn . execute ( "drop<sp>table<sp>if<sp>exists<sp>test.newtable" ) ; dbmsConn . execute ( actual ) ; } toSql ( org . verdictdb . core . sqlobject . InsertValuesQuery ) { java . lang . StringBuilder sql = new java . lang . StringBuilder ( ) ; java . lang . String schemaName = query . getSchemaName ( ) ; java . lang . String tableName = query . getTableName ( ) ; java . util . List < java . lang . Object > values = query . getValues ( ) ; sql . append ( "insert<sp>into<sp>" ) ; sql . append ( quoteName ( schemaName ) ) ; sql . append ( "." ) ; sql . append ( quoteName ( tableName ) ) ; sql . append ( "<sp>values<sp>(" ) ; boolean isFirst = true ; for ( java . lang . Object v : values ) { if ( isFirst == false ) { sql . append ( ",<sp>" ) ; } if ( v instanceof org . verdictdb . commons . VerdictTimestamp ) { if ( ( syntax ) instanceof org . verdictdb . sqlsyntax . PrestoSyntax ) { sql . append ( ( ( "timestamp<sp>'" + ( v . toString ( ) ) ) + "'" ) ) ; } else { sql . append ( ( ( "'" + ( v . toString ( ) ) ) + "'" ) ) ; } } else if ( v instanceof java . lang . String ) { sql . append ( ( ( "'" + v ) + "'" ) ) ; } else { sql . append ( v . toString ( ) ) ; } isFirst = false ; } sql . append ( ")" ) ; return sql . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testBuildWithDisabledSecurityConstraint ( ) { unit . setSecurity ( false ) ; org . lnu . is . domain . benefit . Benefit context = new org . lnu . is . domain . benefit . Benefit ( ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>Benefit<sp>e<sp>WHERE<sp>e.status=:status<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . benefit . Benefit > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expected , actualQuery )
|
add_string_enablesChaining ( ) { "<AssertPlaceHolder>" ; } add ( java . lang . String ) { hashTable . add ( element , size ( ) ) ; return super . add ( element ) ; }
|
org . junit . Assert . assertSame ( array , array . add ( "foo" ) )
|
testUpdate ( ) { com . ewcms . common . dao . model . Model model = new com . ewcms . common . dao . model . Model ( 1 , "test" ) ; dao . persist ( model ) ; model . setTitle ( "test3" ) ; dao . merge ( model ) ; model = dao . get ( 1 ) ; "<AssertPlaceHolder>" ; } getTitle ( ) { return title ; }
|
org . junit . Assert . assertEquals ( model . getTitle ( ) , "test3" )
|
xssf ( ) { com . asakusafw . testdriver . excel . ExcelRuleExtractor extractor = new com . asakusafw . testdriver . excel . DefaultExcelRuleExtractor ( ) ; org . apache . poi . ss . usermodel . Sheet sheet = sheet ( "simple.xlsx" ) ; "<AssertPlaceHolder>" ; } supports ( org . apache . poi . ss . usermodel . Sheet ) { if ( sheet == null ) { throw new java . lang . IllegalArgumentException ( "sheet<sp>must<sp>not<sp>be<sp>null" ) ; } com . asakusafw . testdriver . excel . RuleSheetFormat item = RuleSheetFormat . FORMAT ; java . lang . String title = com . asakusafw . testdriver . excel . DefaultExcelRuleExtractor . getStringCell ( sheet , item . getRowIndex ( ) , item . getColumnIndex ( ) ) ; if ( ( title . equals ( item . getTitle ( ) ) ) == false ) { return false ; } java . lang . String format = com . asakusafw . testdriver . excel . DefaultExcelRuleExtractor . getStringCell ( sheet , item . getRowIndex ( ) , ( ( item . getColumnIndex ( ) ) + 1 ) ) ; return com . asakusafw . testdriver . excel . DefaultExcelRuleExtractor . SUPPORTED_FORMATS . contains ( format ) ; }
|
org . junit . Assert . assertThat ( extractor . supports ( sheet ) , is ( true ) )
|
testSaveWorkflowDefinition ( ) { com . liferay . portal . kernel . workflow . WorkflowDefinition workflowDefinition = saveWorkflowDefinition ( ) ; "<AssertPlaceHolder>" ; } saveWorkflowDefinition ( ) { java . io . InputStream inputStream = getResource ( "single-approver-definition.xml" ) ; byte [ ] content = com . liferay . portal . kernel . util . FileUtil . getBytes ( inputStream ) ; return saveWorkflowDefinition ( com . liferay . portal . kernel . util . StringUtil . randomId ( ) , content ) ; }
|
org . junit . Assert . assertNotNull ( workflowDefinition )
|
shouldReturnBothForMd5AndAdler32 ( ) { java . util . Set < org . dcache . util . Checksum > result = org . dcache . util . Checksums . decodeRfc3230 ( "adler32=03da0195,md5=HUXZLQLMuI/KZ5KDcJPcOA==" ) ; java . util . Set < org . dcache . util . Checksum > expected = com . google . common . collect . Sets . newHashSet ( newAdler32Checksum ( "03da0195" ) , newMd5Checksum ( "1d45d92d02ccb88fca6792837093dc38" ) ) ; "<AssertPlaceHolder>" ; } newMd5Checksum ( java . lang . String ) { return new org . dcache . util . Checksum ( org . dcache . util . ChecksumType . ChecksumType . MD5_TYPE , value ) ; }
|
org . junit . Assert . assertThat ( result , equalTo ( expected ) )
|
testLog4J ( ) { org . glassfish . hk2 . utilities . binding . AbstractBinder binder = new org . glassfish . hk2 . utilities . binding . AbstractBinder ( ) { @ org . loginject . tests . Override protected void configure ( ) { install ( org . loginject . LogInject . loginject ( org . apache . logging . log4j . Logger . class , LogManager :: getLogger , org . loginject . LogParameter . currentClass ( ) ) . as ( org . glassfish . hk2 . utilities . Binder . class ) ) ; addActiveDescriptor ( org . loginject . tests . LogInjectLog4JTest . TestClass . class ) ; } } ; org . glassfish . hk2 . api . ServiceLocator serviceLocator = org . glassfish . hk2 . utilities . ServiceLocatorUtilities . bind ( testName . getMethodName ( ) , binder ) ; org . loginject . tests . LogInjectLog4JTest . TestClass service = serviceLocator . getService ( org . loginject . tests . LogInjectLog4JTest . TestClass . class ) ; "<AssertPlaceHolder>" ; } as ( java . lang . Class ) { java . util . ServiceLoader < org . loginject . LogInjectionService < ? , _Logger_ > > serviceLoader = java . util . ServiceLoader . load ( classLogInjectionService ) ; java . util . stream . Stream < org . loginject . LogInjectionService < ? , _Logger_ > > allImplementations = stream ( serviceLoader . spliterator ( ) , false ) ; java . util . function . Predicate < org . loginject . LogInjectionService < ? , _Logger_ > > matchBinding = ( service ) -> service . supports ( this , binding ) ; java . util . Optional < org . loginject . LogInjectionService < ? , _Logger_ > > implementation = allImplementations . filter ( matchBinding ) . findFirst ( ) ; @ org . loginject . SuppressWarnings ( "unchecked" ) _Binding_ bindings = ( ( _Binding_ ) ( implementation . orElseThrow ( noBindingFor ( binding ) ) . getBindings ( this ) ) ) ; return bindings ; }
|
org . junit . Assert . assertEquals ( org . loginject . tests . LogInjectLog4JTest . TestClass . class . getName ( ) , service . logger . getName ( ) )
|
testGetWrapperProperties ( ) { root . newFile ( "build.gradle" ) ; root . newFile ( "settings.gradle" ) ; root . newFile ( "gradlew" ) ; root . newFile ( "gradlew.bat" ) ; java . io . File wrapperProps = new java . io . File ( root . newFolder ( "gradle" , "wrapper" ) , "gradle-wrapper.properties" ) ; wrapperProps . createNewFile ( ) ; org . netbeans . modules . gradle . spi . GradleFiles gf = new org . netbeans . modules . gradle . spi . GradleFiles ( root . getRoot ( ) ) ; "<AssertPlaceHolder>" ; } getWrapperProperties ( ) { return wrapperProperties ; }
|
org . junit . Assert . assertEquals ( wrapperProps , gf . getWrapperProperties ( ) )
|
testReverse3 ( ) { org . nd4j . linalg . api . ndarray . INDArray array = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 , 0 } ) ; org . nd4j . linalg . api . ndarray . INDArray exp = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } ) ; org . nd4j . linalg . api . ndarray . INDArray rev = org . nd4j . linalg . factory . Nd4j . getExecutioner ( ) . exec ( new org . nd4j . linalg . OldReverse ( array , org . nd4j . linalg . factory . Nd4j . createUninitialized ( array . length ( ) ) ) ) . z ( ) ; "<AssertPlaceHolder>" ; } z ( ) { return x ( ) . transpose ( ) ; }
|
org . junit . Assert . assertEquals ( exp , rev )
|
testToMachineDetails_4 ( ) { org . cloudifysource . esc . driver . provisioning . MachineDetailsDocumentConverter fixture = new org . cloudifysource . esc . driver . provisioning . MachineDetailsDocumentConverter ( ) ; com . gigaspaces . document . SpaceDocument document = new com . gigaspaces . document . SpaceDocument ( ) ; org . cloudifysource . esc . driver . provisioning . MachineDetails result = fixture . toMachineDetails ( document ) ; "<AssertPlaceHolder>" ; } toMachineDetails ( com . gigaspaces . document . SpaceDocument ) { if ( document == null ) { return null ; } final java . lang . Object pmdObject = com . gigaspaces . document . DocumentObjectConverter . instance ( ) . toObject ( document ) ; if ( pmdObject == null ) { return null ; } if ( ! ( pmdObject instanceof org . cloudifysource . esc . driver . provisioning . PersistentMachineDetails ) ) { throw new java . lang . IllegalStateException ( ( "Unsupported<sp>object<sp>received<sp>in<sp>failed<sp>agent<sp>context.<sp>Was<sp>expecting<sp>MachineDetails<sp>but<sp>got:<sp>" + ( pmdObject . getClass ( ) . getName ( ) ) ) ) ; } final org . cloudifysource . esc . driver . provisioning . PersistentMachineDetails pmd = ( ( org . cloudifysource . esc . driver . provisioning . PersistentMachineDetails ) ( pmdObject ) ) ; final org . cloudifysource . esc . driver . provisioning . MachineDetails md = pmd . toMachineDetails ( ) ; return md ; }
|
org . junit . Assert . assertNotNull ( result )
|
testJweJwkAesWrap ( ) { java . lang . String address = ( "https://localhost:" + ( org . apache . cxf . systest . jaxrs . security . jose . jwejws . JAXRSJweJwsTest . PORT ) ) + "/jwejwkaeswrap" ; org . apache . cxf . jaxrs . client . JAXRSClientFactoryBean bean = new org . apache . cxf . jaxrs . client . JAXRSClientFactoryBean ( ) ; org . apache . cxf . bus . spring . SpringBusFactory bf = new org . apache . cxf . bus . spring . SpringBusFactory ( ) ; java . net . URL busFile = org . apache . cxf . systest . jaxrs . security . jose . jwejws . JAXRSJweJwsTest . class . getResource ( "client.xml" ) ; org . apache . cxf . Bus springBus = bf . createBus ( busFile . toString ( ) ) ; bean . setBus ( springBus ) ; bean . setServiceClass ( org . apache . cxf . systest . jaxrs . security . jose . BookStore . class ) ; bean . setAddress ( address ) ; java . util . List < java . lang . Object > providers = new java . util . LinkedList ( ) ; org . apache . cxf . rs . security . jose . jaxrs . JweWriterInterceptor jweWriter = new org . apache . cxf . rs . security . jose . jaxrs . JweWriterInterceptor ( ) ; jweWriter . setUseJweOutputStream ( true ) ; providers . add ( jweWriter ) ; providers . add ( new org . apache . cxf . rs . security . jose . jaxrs . JweClientResponseFilter ( ) ) ; bean . setProviders ( providers ) ; bean . getProperties ( true ) . put ( "rs.security.encryption.properties" , "org/apache/cxf/systest/jaxrs/security/secret.jwk.properties" ) ; bean . getProperties ( true ) . put ( "jose.debug" , true ) ; org . apache . cxf . systest . jaxrs . security . jose . BookStore bs = bean . create ( org . apache . cxf . systest . jaxrs . security . jose . BookStore . class ) ; java . lang . String text = bs . echoText ( "book" ) ; "<AssertPlaceHolder>" ; } echoText ( java . lang . String ) { return text ; }
|
org . junit . Assert . assertEquals ( "book" , text )
|
shouldResolveToNullIfNoActiveContexts ( ) { org . jboss . arquillian . core . impl . ManagerImpl manager = ( ( org . jboss . arquillian . core . impl . ManagerImpl ) ( org . jboss . arquillian . core . spi . ManagerBuilder . from ( ) . create ( ) ) ) ; "<AssertPlaceHolder>" ; } resolve ( java . lang . reflect . Method ) { return new java . lang . Object [ method . getParameterTypes ( ) . length ] ; }
|
org . junit . Assert . assertNull ( manager . resolve ( java . lang . Object . class ) )
|
test_shouldNotUpdateEnvironmentVariableEmptyNewKey ( ) { connect ( ) ; createApplication ( ) ; try { createEnvironmentVariable ( "key" , "value" ) ; org . springframework . shell . core . CommandResult result = updateEnvironmentVariable ( "key" , "" , "value" ) ; "<AssertPlaceHolder>" ; } finally { removeApplication ( ) ; } } isFailedCommand ( ) { return new fr . treeptik . cloudunit . cli . integration . ShellMatchers . CommandStatusMatcher ( false ) ; }
|
org . junit . Assert . assertThat ( result , isFailedCommand ( ) )
|
testResolvePackageDefaultResources ( ) { final javax . enterprise . inject . spi . Bean moduleServiceBean = ( ( javax . enterprise . inject . spi . Bean ) ( beanManager . getBeans ( org . kie . workbench . common . services . shared . project . KieModuleService . class ) . iterator ( ) . next ( ) ) ) ; final javax . enterprise . context . spi . CreationalContext cc = beanManager . createCreationalContext ( moduleServiceBean ) ; final org . kie . workbench . common . services . shared . project . KieModuleService moduleService = ( ( org . kie . workbench . common . services . shared . project . KieModuleService ) ( beanManager . getReference ( moduleServiceBean , org . kie . workbench . common . services . shared . project . KieModuleService . class , cc ) ) ) ; final java . net . URL rootUrl = this . getClass ( ) . getResource ( "/ModuleBackendTestModuleStructureInvalidNoKModule/src/main/resources" ) ; final org . uberfire . java . nio . file . Path nioRootPath = fs . getPath ( rootUrl . toURI ( ) ) ; final org . uberfire . backend . vfs . Path rootPath = paths . convert ( nioRootPath ) ; final java . net . URL testUrl = this . getClass ( ) . getResource ( "/ModuleBackendTestModuleStructureInvalidNoKModule/src/main/resources" ) ; final org . uberfire . java . nio . file . Path nioTestPath = fs . getPath ( testUrl . toURI ( ) ) ; final org . uberfire . backend . vfs . Path testPath = paths . convert ( nioTestPath ) ; final org . guvnor . common . services . project . model . Package result = moduleService . resolvePackage ( testPath ) ; "<AssertPlaceHolder>" ; } resolvePackage ( org . uberfire . backend . vfs . Path ) { try { if ( resource == null ) { return null ; } final org . guvnor . common . services . project . model . Module module = resolveModule ( resource , false ) ; if ( module == null ) { return null ; } if ( ( isPom ( resource ) ) || ( kModuleService . isKModule ( resource ) ) ) { return null ; } return makePackage ( module , resource ) ; } catch ( java . lang . Exception e ) { throw org . guvnor . common . services . backend . exceptions . ExceptionUtilities . handleException ( e ) ; } }
|
org . junit . Assert . assertNull ( result )
|
testAddSingle ( ) { instance = org . dayatang . domain . NamedParameters . create ( ) . add ( "id" , 12 ) . add ( "name" , "abc" ) ; "<AssertPlaceHolder>" ; } getParams ( ) { return java . util . Arrays . copyOf ( params , params . length ) ; }
|
org . junit . Assert . assertEquals ( params , instance . getParams ( ) )
|
testGetJavaClassByID ( ) { java . lang . String fqn = "java.io.PrintStream" ; org . netbeans . lib . profiler . heap . JavaClass printStream = heap . getJavaClassByName ( fqn ) ; long javaclassId = printStream . getJavaClassId ( ) ; org . netbeans . lib . profiler . heap . JavaClass result = heap . getJavaClassByID ( javaclassId ) ; "<AssertPlaceHolder>" ; } getJavaClassId ( ) { if ( ( classType ) != null ) { return classType . hashCode ( ) ; } else { return className . hashCode ( ) ; } }
|
org . junit . Assert . assertEquals ( javaclassId , result . getJavaClassId ( ) )
|
resetOrganizationSettings_orgIdParam_Delegation ( ) { container . login ( 1 , org . oscm . internal . usermanagement . ROLE_PLATFORM_OPERATOR ) ; ums . resetOrganizationSettings ( "orgId" ) ; org . mockito . ArgumentCaptor < java . lang . String > orgId = org . mockito . ArgumentCaptor . forClass ( java . lang . String . class ) ; verify ( ldapServ , times ( 1 ) ) . resetOrganizationSettings ( orgId . capture ( ) ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
|
org . junit . Assert . assertEquals ( "orgId" , orgId . getValue ( ) )
|
testDatabaseMetadataUDTs ( ) { java . sql . Connection conn = java . sql . DriverManager . getConnection ( ( "jdbc:relique:csv:" + ( org . relique . jdbc . csv . TestCsvDriver . filePath ) ) ) ; java . sql . DatabaseMetaData metadata = conn . getMetaData ( ) ; java . sql . ResultSet results = metadata . getUDTs ( null , null , "test" , null ) ; "<AssertPlaceHolder>" ; } next ( ) { if ( this . isPlainReader ( ) ) { boolean result = rawReader . next ( ) ; lineNumber = rawReader . getLineNumber ( ) ; fieldValues = rawReader . getFieldValues ( ) ; return result ; } else { if ( ( ( joiningValues ) == null ) || ( ( ( joiningValueNo ) + ( getTransposedFieldsToSkip ( ) ) ) == ( valuesToJoin ) ) ) { java . lang . String line ; try { line = rawReader . getNextDataLine ( ) ; if ( line != null ) lineNumber = rawReader . getLineNumber ( ) ; } catch ( java . io . IOException e ) { throw new java . sql . SQLException ( e . toString ( ) ) ; } if ( line == null ) return false ; joiningValues = rawReader . parseLine ( line , false ) ; joiningValueNo = 0 ; } for ( int i = 0 ; i < ( transposedLines ) ; i ++ ) { fieldValues [ i ] = firstTable . get ( i ) [ ( ( joiningValueNo ) + ( getTransposedFieldsToSkip ( ) ) ) ] ; } for ( int i = transposedLines ; i < ( ( columnNames . length ) - 1 ) ; i ++ ) { fieldValues [ i ] = joiningValues [ ( i - ( transposedLines ) ) ] ; } fieldValues [ ( ( columnNames . length ) - 1 ) ] = joiningValues [ ( ( ( ( columnNames . length ) - ( transposedLines ) ) - 1 ) + ( joiningValueNo ) ) ] ; ( joiningValueNo ) ++ ; if ( ( columnTypes ) == null ) getColumnTypes ( ) ; return true ; } }
|
org . junit . Assert . assertFalse ( results . next ( ) )
|
multiLineString ( ) { com . querydsl . sql . spatial . MultiLineString multiLineString = ( ( org . geolatte . geom . MultiLineString ) ( org . geolatte . geom . codec . Wkt . fromWkt ( ( "MULTILINESTRING<sp>(" + ( "(30<sp>10,<sp>40<sp>40,<sp>20<sp>40,<sp>10<sp>20,<sp>30<sp>10),<sp>" + "(20<sp>30,<sp>35<sp>35,<sp>30<sp>20,<sp>20<sp>30))" ) ) ) ) ) ; oracle . spatial . geometry . JGeometry geo = com . querydsl . sql . spatial . JGeometryConverter . convert ( multiLineString ) ; double [ ] line1 = new double [ ] { 30 , 10 , 40 , 40 , 20 , 40 , 10 , 20 , 30 , 10 } ; double [ ] line2 = new double [ ] { 20 , 30 , 35 , 35 , 30 , 20 , 20 , 30 } ; oracle . spatial . geometry . JGeometry geo2 = oracle . spatial . geometry . JGeometry . createLinearMultiLineString ( new java . lang . Object [ ] { line1 , line2 } , multiLineString . getCoordinateDimension ( ) , multiLineString . getSRID ( ) ) ; "<AssertPlaceHolder>" ; } convert ( com . querydsl . sql . spatial . Geometry ) { switch ( geometry . getGeometryType ( ) ) { case POINT : return com . querydsl . sql . spatial . JGeometryConverter . convert ( ( ( org . geolatte . geom . Point ) ( geometry ) ) ) ; case GEOMETRY_COLLECTION : return com . querydsl . sql . spatial . JGeometryConverter . convert ( ( ( com . querydsl . sql . spatial . GeometryCollection ) ( geometry ) ) ) ; case LINE_STRING : return com . querydsl . sql . spatial . JGeometryConverter . convert ( ( ( com . querydsl . sql . spatial . LineString ) ( geometry ) ) ) ; case LINEAR_RING : return com . querydsl . sql . spatial . JGeometryConverter . convert ( ( ( com . querydsl . sql . spatial . LinearRing ) ( geometry ) ) ) ; case POLYGON : return com . querydsl . sql . spatial . JGeometryConverter . convert ( ( ( com . querydsl . sql . spatial . Polygon ) ( geometry ) ) ) ; case POLYHEDRAL_SURFACE : return com . querydsl . sql . spatial . JGeometryConverter . convert ( ( ( com . querydsl . sql . spatial . PolyHedralSurface ) ( geometry ) ) ) ; case MULTI_POINT : return com . querydsl . sql . spatial . JGeometryConverter . convert ( ( ( com . querydsl . sql . spatial . MultiPoint ) ( geometry ) ) ) ; case MULTI_POLYGON : return com . querydsl . sql . spatial . JGeometryConverter . convert ( ( ( com . querydsl . sql . spatial . MultiPolygon ) ( geometry ) ) ) ; case MULTI_LINE_STRING : return com . querydsl . sql . spatial . JGeometryConverter . convert ( ( ( com . querydsl . sql . spatial . MultiLineString ) ( geometry ) ) ) ; default : throw new java . lang . IllegalArgumentException ( geometry . toString ( ) ) ; } }
|
org . junit . Assert . assertEquals ( geo2 , geo )
|
testReadObjectClassWithNullContextName ( ) { java . lang . Class < ? > clazz = getClass ( ) ; java . lang . String className = clazz . getName ( ) ; java . lang . String contextName = com . liferay . petra . string . StringPool . NULL ; java . nio . ByteBuffer byteBuffer = java . nio . ByteBuffer . allocate ( ( ( ( className . length ( ) ) + ( contextName . length ( ) ) ) + 11 ) ) ; byteBuffer . put ( SerializationConstants . TC_CLASS ) ; byteBuffer . put ( ( ( byte ) ( 1 ) ) ) ; byteBuffer . putInt ( contextName . length ( ) ) ; byteBuffer . put ( contextName . getBytes ( StringPool . UTF8 ) ) ; byteBuffer . put ( ( ( byte ) ( 1 ) ) ) ; byteBuffer . putInt ( className . length ( ) ) ; byteBuffer . put ( className . getBytes ( StringPool . UTF8 ) ) ; byteBuffer . flip ( ) ; com . liferay . portal . kernel . io . Deserializer deserializer = new com . liferay . portal . kernel . io . Deserializer ( byteBuffer ) ; java . lang . Class < ? > readClass = deserializer . readObject ( ) ; "<AssertPlaceHolder>" ; } readObject ( ) { byte tcByte = _buffer [ ( ( _index ) ++ ) ] ; if ( tcByte == ( SerializationConstants . TC_BOOLEAN ) ) { return ( ( T ) ( java . lang . Boolean . valueOf ( readBoolean ( ) ) ) ) ; } else if ( tcByte == ( SerializationConstants . TC_BYTE ) ) { return ( ( T ) ( java . lang . Byte . valueOf ( readByte ( ) ) ) ) ; } else if ( tcByte == ( SerializationConstants . TC_CHARACTER ) ) { return ( ( T ) ( java . lang . Character . valueOf ( readChar ( ) ) ) ) ; } else if ( tcByte == ( SerializationConstants . TC_CLASS ) ) { java . lang . String contextName = readString ( ) ; java . lang . String className = readString ( ) ; java . lang . ClassLoader classLoader = com . liferay . petra . lang . ClassLoaderPool . getClassLoader ( contextName ) ; return ( ( T ) ( com . liferay . petra . lang . ClassResolverUtil . resolve ( className , classLoader ) ) ) ; } else if ( tcByte == ( SerializationConstants . TC_DOUBLE ) ) { return ( ( T ) ( java . lang . Double . valueOf ( readDouble ( ) ) ) ) ; } else if ( tcByte == ( SerializationConstants . TC_FLOAT ) ) { return ( ( T ) ( java . lang . Float . valueOf ( readFloat ( ) ) ) ) ; } else if ( tcByte == ( SerializationConstants . TC_INTEGER ) ) { return ( ( T ) ( java . lang . Integer . valueOf ( readInt ( ) ) ) ) ; } else if ( tcByte == ( SerializationConstants . TC_LONG ) ) { return ( ( T ) ( java . lang . Long . valueOf ( readLong ( ) ) ) ) ; } else if ( tcByte == ( SerializationConstants . TC_NULL ) ) { return null ; } else if ( tcByte == ( SerializationConstants . TC_SHORT ) ) { return ( ( T ) ( java . lang . Short . valueOf ( readShort ( ) ) ) ) ; } else if ( tcByte == ( SerializationConstants . TC_STRING ) ) { return ( ( T ) ( readString ( ) ) ) ; } else if ( tcByte == ( SerializationConstants . TC_OBJECT ) ) { try { java . io . ObjectInputStream objectInputStream = new com . liferay . petra . io . ProtectedAnnotatedObjectInputStream ( new com . liferay . petra . io . Deserializer . BufferInputStream ( ) ) ; return ( ( T ) ( objectInputStream . readObject ( ) ) ) ; } catch ( java . io . IOException ioe ) { throw new java . lang . RuntimeException ( ioe ) ; } } throw new java . lang . IllegalStateException ( ( "Unkown<sp>TC<sp>code<sp>" + tcByte ) ) ; }
|
org . junit . Assert . assertSame ( clazz , readClass )
|
shouldTranslateViewIndexesToOriginal ( ) { long [ ] shape = new long [ ] { 4 , 2 , 3 } ; double [ ] values = new double [ ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } ; int [ ] [ ] indices = new int [ ] [ ] { new int [ ] { 0 , 0 , 2 } , new int [ ] { 0 , 1 , 1 } , new int [ ] { 1 , 0 , 0 } , new int [ ] { 1 , 0 , 1 } , new int [ ] { 1 , 1 , 2 } , new int [ ] { 2 , 0 , 1 } , new int [ ] { 2 , 1 , 2 } , new int [ ] { 3 , 0 , 2 } , new int [ ] { 3 , 1 , 0 } } ; org . nd4j . linalg . api . ndarray . INDArray original = org . nd4j . linalg . factory . Nd4j . createSparseCOO ( values , indices , shape ) ; org . nd4j . linalg . api . ndarray . BaseSparseNDArrayCOO view = ( ( org . nd4j . linalg . api . ndarray . BaseSparseNDArrayCOO ) ( original . get ( org . nd4j . linalg . indexing . NDArrayIndex . all ( ) , org . nd4j . linalg . indexing . NDArrayIndex . point ( 1 ) ) ) ) ; int [ ] originalIdx = view . translateToPhysical ( new int [ ] { 0 , 0 } ) ; int [ ] exceptedIdx = new int [ ] { 0 , 1 , 0 } ; "<AssertPlaceHolder>" ; } point ( long ) { return new org . nd4j . linalg . indexing . PointIndex ( point ) ; }
|
org . junit . Assert . assertArrayEquals ( exceptedIdx , originalIdx )
|
testPackageImport ( ) { org . apache . karaf . packages . core . internal . filter . AndExpression expr = ( ( org . apache . karaf . packages . core . internal . filter . AndExpression ) ( new org . apache . karaf . packages . core . internal . filter . FilterParser ( ) . parse ( "(&(osgi.wiring.package=org.mypackage)(version>=1.9.0)(!(version>=2.0.0)))" ) ) ) ; "<AssertPlaceHolder>" ; checkItem ( expr . expressions [ 0 ] , "osgi.wiring.package" , FilterType . equal , "org.mypackage" ) ; checkItem ( expr . expressions [ 1 ] , "version" , FilterType . gt , "1.9.0" ) ; org . apache . karaf . packages . core . internal . filter . NotExpression notVersion = ( ( org . apache . karaf . packages . core . internal . filter . NotExpression ) ( expr . expressions [ 2 ] ) ) ; checkItem ( notVersion . expression , "version" , FilterType . gt , "2.0.0" ) ; } parse ( java . net . URL ) { try ( java . io . InputStream is = url . openStream ( ) ) { return org . apache . karaf . util . XmlUtils . parse ( is ) ; } }
|
org . junit . Assert . assertEquals ( 3 , expr . expressions . length )
|
itUnregistersServices ( ) { com . mixer . api . services . AbstractService serviceStub = org . mockito . Mockito . mock ( com . mixer . api . services . AbstractService . class ) ; com . mixer . api . services . ServiceManager < com . mixer . api . services . AbstractService > sm = new com . mixer . api . services . ServiceManager ( ) ; sm . register ( serviceStub ) ; sm . unregister ( serviceStub ) ; "<AssertPlaceHolder>" ; } get ( java . lang . Class ) { for ( T service : this . services ) { if ( ( service . getClass ( ) ) == type ) { return ( ( V ) ( service ) ) ; } } return null ; }
|
org . junit . Assert . assertNull ( sm . get ( serviceStub . getClass ( ) ) )
|
loadRetursnNullWhenPatientDoesNotHaveFileObjects ( ) { when ( this . doc . getXObjects ( AdditionalDocumentsController . CLASS_REFERENCE ) ) . thenReturn ( null ) ; org . phenotips . data . PatientData < org . phenotips . data . internal . controller . Attachment > result = this . mocker . getComponentUnderTest ( ) . load ( this . patient ) ; "<AssertPlaceHolder>" ; } load ( java . net . URL ) { parseOmimData ( url ) ; loadGenes ( ) ; loadGeneReviews ( ) ; loadVersion ( ) ; return this . data . values ( ) ; }
|
org . junit . Assert . assertNull ( result )
|
testRemoveMap ( ) { fs . delete ( p , true ) ; conf . setInt ( TTConfig . TT_INDEX_CACHE , 10 ) ; final int partsPerMap = 100000 ; final int bytesPerFile = partsPerMap * 24 ; final org . apache . hadoop . mapred . IndexCache cache = new org . apache . hadoop . mapred . IndexCache ( conf ) ; final org . apache . hadoop . fs . Path big = new org . apache . hadoop . fs . Path ( p , "bigIndex" ) ; final java . lang . String user = org . apache . hadoop . security . UserGroupInformation . getCurrentUser ( ) . getShortUserName ( ) ; org . apache . hadoop . mapred . TestIndexCache . writeFile ( fs , big , bytesPerFile , partsPerMap ) ; for ( int i = 0 ; i < 20 ; ++ i ) { java . lang . Thread getInfoThread = new java . lang . Thread ( ) { @ org . apache . hadoop . mapred . Override public void run ( ) { try { cache . getIndexInformation ( "bigIndex" , partsPerMap , big , user ) ; } catch ( java . lang . Exception e ) { } } } ; java . lang . Thread removeMapThread = new java . lang . Thread ( ) { @ org . apache . hadoop . mapred . Override public void run ( ) { cache . removeMap ( "bigIndex" ) ; } } ; if ( ( i % 2 ) == 0 ) { getInfoThread . start ( ) ; removeMapThread . start ( ) ; } else { removeMapThread . start ( ) ; getInfoThread . start ( ) ; } getInfoThread . join ( ) ; removeMapThread . join ( ) ; "<AssertPlaceHolder>" ; } } checkTotalMemoryUsed ( ) { int totalSize = 0 ; for ( org . apache . hadoop . mapred . IndexCache . IndexInformation info : cache . values ( ) ) { totalSize += info . getSize ( ) ; } return totalSize == ( totalMemoryUsed . get ( ) ) ; }
|
org . junit . Assert . assertEquals ( true , cache . checkTotalMemoryUsed ( ) )
|
testFetchByPrimaryKeyMissing ( ) { long pk = com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) ; com . liferay . message . boards . model . MBBan missingMBBan = _persistence . fetchByPrimaryKey ( pk ) ; "<AssertPlaceHolder>" ; } fetchByPrimaryKey ( long ) { return com . liferay . adaptive . media . image . service . persistence . AMImageEntryUtil . getPersistence ( ) . fetchByPrimaryKey ( amImageEntryId ) ; }
|
org . junit . Assert . assertNull ( missingMBBan )
|
nodeTypeInheritance ( ) { org . apache . jackrabbit . oak . spi . state . NodeBuilder defn = newLucenePropertyIndexDefinition ( builder , "test" , of ( "foo" ) , "async" ) ; defn . setProperty ( createProperty ( IndexConstants . DECLARING_NODE_TYPES , of ( "nt:hierarchyNode" ) , org . apache . jackrabbit . oak . plugins . index . lucene . STRINGS ) ) ; org . apache . jackrabbit . oak . plugins . index . lucene . LuceneIndexNode node = createIndexNode ( new org . apache . jackrabbit . oak . plugins . index . lucene . LuceneIndexDefinition ( root , defn . getNodeState ( ) , "/foo" ) ) ; org . apache . jackrabbit . oak . query . index . FilterImpl filter = createFilter ( "nt:folder" ) ; filter . restrictProperty ( "foo" , Operator . EQUAL , org . apache . jackrabbit . oak . plugins . memory . PropertyValues . newString ( "bar" ) ) ; org . apache . jackrabbit . oak . plugins . index . search . spi . query . FulltextIndexPlanner planner = new org . apache . jackrabbit . oak . plugins . index . search . spi . query . FulltextIndexPlanner ( node , "/foo" , filter , java . util . Collections . < org . apache . jackrabbit . oak . spi . query . QueryIndex . OrderEntry > emptyList ( ) ) ; "<AssertPlaceHolder>" ; } getPlan ( ) { if ( ( definition ) == null ) { org . apache . jackrabbit . oak . plugins . index . search . spi . query . FulltextIndexPlanner . log . debug ( "Index<sp>{}<sp>not<sp>loaded" , indexPath ) ; return null ; } org . apache . jackrabbit . oak . plugins . index . search . spi . query . IndexPlan . Builder builder = getPlanBuilder ( ) ; if ( definition . isTestMode ( ) ) { if ( builder == null ) { if ( notSupportedFeature ( ) ) { return null ; } java . lang . String msg = java . lang . String . format ( ( "No<sp>plan<sp>found<sp>for<sp>filter<sp>[%s]<sp>" + "while<sp>using<sp>definition<sp>[%s]<sp>and<sp>testMode<sp>is<sp>found<sp>to<sp>be<sp>enabled" ) , filter , definition ) ; throw new java . lang . IllegalStateException ( msg ) ; } else { builder . setEstimatedEntryCount ( 1 ) . setCostPerExecution ( 0.001 ) . setCostPerEntry ( 0.001 ) ; } } return builder != null ? builder . build ( ) : null ; }
|
org . junit . Assert . assertNotNull ( planner . getPlan ( ) )
|
aconvert_null_primitive_noerror ( ) { converter . setThrowError ( false ) ; "<AssertPlaceHolder>" ; } convert ( com . psddev . dari . util . TypeReference , java . lang . Object ) { return ( ( T ) ( convert ( returnTypeReference . getType ( ) , object ) ) ) ; }
|
org . junit . Assert . assertEquals ( new java . lang . Integer ( 0 ) , converter . convert ( int . class , ( ( java . lang . Object ) ( null ) ) ) )
|
testWriteShort ( ) { org . omg . CORBA . portable . OutputStream oStream = org . apache . cxf . binding . corba . runtime . CorbaObjectWriterTest . orb . create_output_stream ( ) ; org . apache . cxf . binding . corba . runtime . CorbaObjectWriter writer = new org . apache . cxf . binding . corba . runtime . CorbaObjectWriter ( oStream ) ; java . lang . Short shortValue = java . lang . Short . valueOf ( ( ( short ) ( - 123 ) ) ) ; writer . writeShort ( shortValue ) ; org . omg . CORBA . portable . InputStream iStream = oStream . create_input_stream ( ) ; short s = iStream . read_short ( ) ; "<AssertPlaceHolder>" ; } writeShort ( java . lang . Short ) { if ( s == null ) { stream . write_short ( ( ( short ) ( 0 ) ) ) ; } else { stream . write_short ( s . shortValue ( ) ) ; } }
|
org . junit . Assert . assertTrue ( ( s == ( shortValue . shortValue ( ) ) ) )
|
doesNotBackoffBelowOneConnection ( ) { connPerRoute . setMaxPerRoute ( route , 1 ) ; impl . backOff ( route ) ; "<AssertPlaceHolder>" ; } getMaxPerRoute ( org . apache . hc . client5 . http . HttpRoute ) { return pool . getMaxPerRoute ( route ) ; }
|
org . junit . Assert . assertEquals ( 1 , connPerRoute . getMaxPerRoute ( route ) )
|
testEmptyList ( ) { org . zeromq . ZFrame frame = new org . zeromq . ZFrame ( new byte [ 1 ] ) ; org . zeromq . proto . ZNeedle needle = new org . zeromq . proto . ZNeedle ( frame ) ; needle . putList ( java . util . Collections . emptyList ( ) ) ; needle = new org . zeromq . proto . ZNeedle ( frame ) ; "<AssertPlaceHolder>" ; } getList ( ) { int size = getNumber1 ( ) ; java . util . List < java . lang . String > list = new java . util . ArrayList ( size ) ; for ( int idx = 0 ; idx < size ; ++ idx ) { list . add ( getString ( ) ) ; } return list ; }
|
org . junit . Assert . assertThat ( needle . getList ( ) , org . hamcrest . CoreMatchers . is ( java . util . Collections . emptyList ( ) ) )
|
testNullTranslation ( ) { org . apache . storm . kafka . spout . SimpleRecordTranslator < java . lang . String , java . lang . String > trans = new org . apache . storm . kafka . spout . SimpleRecordTranslator ( ( r ) -> null , new org . apache . storm . tuple . Fields ( "key" ) ) ; "<AssertPlaceHolder>" ; } apply ( java . lang . String ) { throw new java . lang . UnsupportedOperationException ( ) ; }
|
org . junit . Assert . assertEquals ( null , trans . apply ( null ) )
|
testPaddingValidatinfIVInCiphertextConstantKeyAESCBC ( ) { org . meri . matasano . utils . oracle . IVInCiphertextConstantKeyAESCBC cipher = new org . meri . matasano . utils . oracle . IVInCiphertextConstantKeyAESCBC ( new org . meri . matasano . utils . encryption . PadValidatingAESCBC ( ) ) ; java . lang . String source = "plaintext" ; byte [ ] input = org . apache . shiro . codec . CodecSupport . toBytes ( source ) ; byte [ ] output = cipher . encrypt ( input ) ; byte [ ] decryptedOutput = cipher . decrypt ( output ) ; "<AssertPlaceHolder>" ; } decrypt ( byte [ ] ) { return cipherB . decrypt ( ciphertext ) ; }
|
org . junit . Assert . assertEquals ( source , org . apache . shiro . codec . CodecSupport . toString ( decryptedOutput ) )
|
testChar ( ) { java . lang . Class < com . j256 . ormlite . field . types . CharTypeTest . LocalChar > clazz = com . j256 . ormlite . field . types . CharTypeTest . LocalChar . class ; com . j256 . ormlite . dao . Dao < com . j256 . ormlite . field . types . CharTypeTest . LocalChar , java . lang . Object > dao = createDao ( clazz , true ) ; char val = 'w' ; java . lang . String valStr = java . lang . Character . toString ( val ) ; com . j256 . ormlite . field . types . CharTypeTest . LocalChar foo = new com . j256 . ormlite . field . types . CharTypeTest . LocalChar ( ) ; foo . charField = val ; "<AssertPlaceHolder>" ; testType ( dao , foo , clazz , val , val , val , valStr , DataType . CHAR , com . j256 . ormlite . field . types . CharTypeTest . CHAR_COLUMN , false , true , true , true , false , false , true , false ) ; } create ( T ) { checkForInitialized ( ) ; if ( data == null ) { return 0 ; } if ( data instanceof com . j256 . ormlite . misc . BaseDaoEnabled ) { @ com . j256 . ormlite . dao . SuppressWarnings ( "unchecked" ) com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > daoEnabled = ( ( com . j256 . ormlite . misc . BaseDaoEnabled < T , ID > ) ( data ) ) ; daoEnabled . setDao ( this ) ; } com . j256 . ormlite . support . DatabaseConnection connection = connectionSource . getReadWriteConnection ( tableInfo . getTableName ( ) ) ; try { return statementExecutor . create ( connection , data , objectCache ) ; } finally { connectionSource . releaseConnection ( connection ) ; } }
|
org . junit . Assert . assertEquals ( 1 , dao . create ( foo ) )
|
testUnBindPrivilegeConfiguration ( ) { org . apache . jackrabbit . oak . spi . security . privilege . PrivilegeConfiguration pc = org . mockito . Mockito . mock ( org . apache . jackrabbit . oak . spi . security . privilege . PrivilegeConfiguration . class ) ; securityProvider . bindPrivilegeConfiguration ( pc ) ; securityProvider . unbindPrivilegeConfiguration ( pc ) ; "<AssertPlaceHolder>" ; for ( org . apache . jackrabbit . oak . spi . security . SecurityConfiguration sc : securityProvider . getConfigurations ( ) ) { if ( sc instanceof org . apache . jackrabbit . oak . spi . security . privilege . PrivilegeConfiguration ) { org . junit . Assert . fail ( ) ; } } } getConfiguration ( java . lang . Class ) { if ( ( org . apache . jackrabbit . oak . spi . security . authentication . AuthenticationConfiguration . class ) == configClass ) { return ( ( T ) ( new org . apache . jackrabbit . oak . spi . security . authentication . OpenAuthenticationConfiguration ( ) ) ) ; } else if ( ( org . apache . jackrabbit . oak . spi . security . authorization . AuthorizationConfiguration . class ) == configClass ) { return ( ( T ) ( new org . apache . jackrabbit . oak . spi . security . authorization . OpenAuthorizationConfiguration ( ) ) ) ; } else { throw new java . lang . IllegalArgumentException ( ( "Unsupported<sp>security<sp>configuration<sp>class<sp>" + configClass ) ) ; } }
|
org . junit . Assert . assertNull ( securityProvider . getConfiguration ( org . apache . jackrabbit . oak . spi . security . privilege . PrivilegeConfiguration . class ) )
|
testColumnsOfDateTime ( ) { methodWatcher . executeUpdate ( "10<sp>|2017-12-05<sp>|2017<sp>|17:11:24<sp>|2017-12-05<sp>17:11:24.0<sp>|2017-12-04<sp>17:11:24.0<sp>|" 1 ) ; methodWatcher . executeUpdate ( "10<sp>|2017-12-05<sp>|2017<sp>|17:11:24<sp>|2017-12-05<sp>17:11:24.0<sp>|2017-12-04<sp>17:11:24.0<sp>|" 5 ) ; methodWatcher . executeUpdate ( "10<sp>|2017-12-05<sp>|2017<sp>|17:11:24<sp>|2017-12-05<sp>17:11:24.0<sp>|2017-12-04<sp>17:11:24.0<sp>|" 8 ) ; methodWatcher . executeUpdate ( "create<sp>index<sp>idx1_t3<sp>on<sp>t3<sp>(b3,<sp>d3)" ) ; methodWatcher . executeUpdate ( "insert<sp>into<sp>t3<sp>values<sp>(10,<sp>10,<sp>10,<sp>'2017-12-05',<sp>'17:11:24',<sp>'2017-12-05<sp>17:11:24')" ) ; sql = format ( "10<sp>|2017-12-05<sp>|2017<sp>|17:11:24<sp>|2017-12-05<sp>17:11:24.0<sp>|2017-12-04<sp>17:11:24.0<sp>|" 9 , useSparkString ) ; expected = "10<sp>|2017-12-05<sp>|2017<sp>|17:11:24<sp>|2017-12-05<sp>17:11:24.0<sp>|2017-12-04<sp>17:11:24.0<sp>|" 7 + ( ( ( ( ( "------------------------------------------------------------------------------\n" + "<sp>1<sp>|2017-01-01<sp>|2017<sp>|00:00:00<sp>|2017-01-01<sp>00:00:00.0<sp>|2016-12-31<sp>00:00:00.0<sp>|\n" ) + "10<sp>|2017-12-05<sp>|2017<sp>|17:11:24<sp>|2017-12-05<sp>17:11:24.0<sp>|2017-12-04<sp>17:11:24.0<sp>|\n" ) + "<sp>2<sp>|2017-01-01<sp>|2017<sp>|00:00:00<sp>|2017-01-01<sp>00:00:00.0<sp>|2016-12-31<sp>00:00:00.0<sp>|\n" ) + "<sp>1<sp>|2017-01-01<sp>|2017<sp>|00:00:00<sp>|2017-01-01<sp>00:00:00.0<sp>|2016-12-31<sp>00:00:00.0<sp>|\n" 1 ) + "<sp>1<sp>|2017-01-01<sp>|2017<sp>|00:00:00<sp>|2017-01-01<sp>00:00:00.0<sp>|2016-12-31<sp>00:00:00.0<sp>|\n" 2 ) ; rs = methodWatcher . executeQuery ( sql ) ; "<AssertPlaceHolder>" ; rs . close ( ) ; } toString ( com . splicemachine . homeless . ResultSet ) { return com . splicemachine . homeless . TestUtils . FormattedResult . ResultFactory . convert ( "" , rs ) . toString ( ) . trim ( ) ; }
|
org . junit . Assert . assertEquals ( expected , TestUtils . FormattedResult . ResultFactory . toString ( rs ) )
|
testDiff ( ) { org . openscience . cdk . tools . diff . tree . IDifference result = org . openscience . cdk . tools . diff . tree . DoubleDifference . construct ( "Foo" , 1.0 , 3.0 ) ; "<AssertPlaceHolder>" ; } construct ( java . lang . String , java . lang . Double , java . lang . Double ) { if ( ( first == null ) && ( second == null ) ) { return null ; } if ( ( first == null ) || ( second == null ) ) { return new org . openscience . cdk . tools . diff . tree . DoubleDifference ( name , first , second ) ; } if ( ( java . lang . Math . abs ( ( first - second ) ) ) < ( org . openscience . cdk . tools . diff . tree . DoubleDifference . ERROR ) ) { return null ; } return new org . openscience . cdk . tools . diff . tree . DoubleDifference ( name , first , second ) ; }
|
org . junit . Assert . assertNotNull ( result )
|
testCommentStyleInput ( ) { float [ ] [ ] data = new float [ 500 ] [ 500 ] ; nom . tam . fits . Fits f = null ; try { f = new nom . tam . fits . Fits ( ) ; nom . tam . fits . BasicHDU < ? > hdu = nom . tam . fits . FitsFactory . hduFactory ( data ) ; hdu . getHeader ( ) . insertCommentStyle ( "<sp>" , "---------------FITS<sp>Data<sp>Generator---------------" ) ; hdu . getHeader ( ) . insertCommentStyle ( "<sp>" , "This<sp>product<sp>is<sp>generated<sp>by<sp>me." ) ; hdu . getHeader ( ) . addValue ( "NAXIS3" , 1000 , "Actual<sp>number<sp>of<sp>energy<sp>channels" ) ; f . addHDU ( hdu ) ; nom . tam . util . BufferedFile bf = null ; try { bf = new nom . tam . util . BufferedFile ( "target/testCommentStyleInput.fits" , "rw" ) ; f . write ( bf ) ; } finally { nom . tam . util . SafeClose . close ( bf ) ; } } finally { nom . tam . util . SafeClose . close ( f ) ; } try { f = new nom . tam . fits . Fits ( "target/testCommentStyleInput.fits" ) ; nom . tam . fits . Header header = f . readHDU ( ) . getHeader ( ) ; int foundComments = 0 ; nom . tam . util . Cursor < java . lang . String , nom . tam . fits . HeaderCard > iter = header . iterator ( ) ; while ( iter . hasNext ( ) ) { nom . tam . fits . HeaderCard headerCard = iter . next ( ) ; java . lang . String comment = headerCard . getComment ( ) ; if ( comment != null ) { if ( comment . contains ( "This<sp>product<sp>is<sp>generated<sp>by<sp>me." ) ) { foundComments ++ ; } if ( comment . contains ( "---------------FITS<sp>Data<sp>Generator---------------" ) ) { foundComments ++ ; } } } "<AssertPlaceHolder>" ; } finally { nom . tam . util . SafeClose . close ( f ) ; } } contains ( java . lang . Object ) { for ( VALUE entry : this . ordered ) { if ( o . equals ( entry ) ) { return true ; } } return false ; }
|
org . junit . Assert . assertEquals ( 2 , foundComments )
|
swallowException ( ) { final java . lang . String result = org . kie . workbench . common . stunner . core . graph . util . Exceptions . swallow ( ( ) -> methodThatThrowsException ( ) , org . kie . workbench . common . stunner . core . graph . util . ExceptionsTest . DEFAULT_RESULT ) ; "<AssertPlaceHolder>" ; } methodThatThrowsException ( ) { throw new java . lang . Exception ( ) ; }
|
org . junit . Assert . assertEquals ( result , org . kie . workbench . common . stunner . core . graph . util . ExceptionsTest . DEFAULT_RESULT )
|
testMultiNormalizerMinMaxScalerNotFitLabels ( ) { org . nd4j . linalg . dataset . MultiNormalizerMinMaxScaler original = new org . nd4j . linalg . dataset . MultiNormalizerMinMaxScaler ( 0.1 , 0.9 ) ; original . setFeatureStats ( java . util . Arrays . asList ( new org . nd4j . linalg . dataset . api . preprocessor . stats . MinMaxStats ( org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 0.5 , 1.5 } ) , org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 2.5 , 3.5 } ) ) , new org . nd4j . linalg . dataset . api . preprocessor . stats . MinMaxStats ( org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 4.5 , 5.5 , 6.5 } ) , org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 7.5 , 8.5 , 9.5 } ) ) ) ) ; SUT . write ( original , tmpFile ) ; org . nd4j . linalg . dataset . MultiNormalizerMinMaxScaler restored = SUT . restore ( tmpFile ) ; "<AssertPlaceHolder>" ; } restore ( org . nd4j . linalg . dataset . api . preprocessor . serializer . InputStream ) { org . nd4j . linalg . dataset . api . preprocessor . serializer . DataInputStream dis = new org . nd4j . linalg . dataset . api . preprocessor . serializer . DataInputStream ( stream ) ; boolean fitLabels = dis . readBoolean ( ) ; double targetMin = dis . readDouble ( ) ; double targetMax = dis . readDouble ( ) ; org . nd4j . linalg . dataset . api . preprocessor . NormalizerMinMaxScaler result = new org . nd4j . linalg . dataset . api . preprocessor . NormalizerMinMaxScaler ( targetMin , targetMax ) ; result . fitLabel ( fitLabels ) ; result . setFeatureStats ( org . nd4j . linalg . factory . Nd4j . read ( dis ) , org . nd4j . linalg . factory . Nd4j . read ( dis ) ) ; if ( fitLabels ) { result . setLabelStats ( org . nd4j . linalg . factory . Nd4j . read ( dis ) , org . nd4j . linalg . factory . Nd4j . read ( dis ) ) ; } return result ; }
|
org . junit . Assert . assertEquals ( original , restored )
|
test ( ) { cn . bc . spider . callable . DomCallable c = new cn . bc . spider . callable . DomCallable ( ) ; c . setMethod ( "get" ) ; c . setGroup ( "baidu" ) ; c . setUrl ( "http://www.baidu.com" ) ; c . setSuccessExpression ( "select(\"#kw\").size()<sp>><sp>0" ) ; cn . bc . spider . Result < org . jsoup . nodes . Document > result = cn . bc . spider . http . TaskExecutor . get ( c ) ; "<AssertPlaceHolder>" ; if ( cn . bc . spider . callable . DomCallableTest . logger . isDebugEnabled ( ) ) cn . bc . spider . callable . DomCallableTest . logger . debug ( result . getData ( ) ) ; } isSuccess ( ) { return success ; }
|
org . junit . Assert . assertTrue ( result . isSuccess ( ) )
|
testRemovePoolWithPresentPool ( ) { org . candlepin . dto . api . v1 . ActivationKeyDTO dto = new org . candlepin . dto . api . v1 . ActivationKeyDTO ( ) ; java . util . Set < org . candlepin . dto . api . v1 . ActivationKeyDTO . ActivationKeyPoolDTO > pools = new java . util . HashSet ( ) ; pools . add ( new org . candlepin . dto . api . v1 . ActivationKeyDTO . ActivationKeyPoolDTO ( "test-id-pool-4" , null ) ) ; dto . setPools ( pools ) ; "<AssertPlaceHolder>" ; } removePool ( java . lang . String ) { if ( poolId == null ) { throw new java . lang . IllegalArgumentException ( "poolId<sp>is<sp>null" ) ; } if ( ( this . pools ) == null ) { return false ; } for ( org . candlepin . dto . api . v1 . ActivationKeyDTO . ActivationKeyPoolDTO candidate : this . getPools ( ) ) { if ( poolId . equals ( candidate . getPoolId ( ) ) ) { this . pools . remove ( candidate ) ; return true ; } } return false ; }
|
org . junit . Assert . assertTrue ( dto . removePool ( "test-id-pool-4" ) )
|
testCalculateAuthorityKeyIdentifier ( ) { java . security . KeyPairGenerator gen = java . security . KeyPairGenerator . getInstance ( "RSA" ) ; java . security . interfaces . RSAPublicKey key = ( ( java . security . interfaces . RSAPublicKey ) ( gen . generateKeyPair ( ) . getPublic ( ) ) ) ; org . bouncycastle . asn1 . x509 . AuthorityKeyIdentifier expectedAki = new org . bouncycastle . cert . jcajce . JcaX509ExtensionUtils ( ) . createAuthorityKeyIdentifier ( key ) ; org . mozilla . jss . netscape . security . x509 . AuthorityKeyIdentifierExtension actualAki = org . candlepin . pki . impl . JSSPKIUtility . buildAuthorityKeyIdentifier ( key ) ; byte [ ] expectedKeyIdentifier = expectedAki . getKeyIdentifier ( ) ; byte [ ] actualKeyIdentifier = ( ( org . mozilla . jss . netscape . security . x509 . KeyIdentifier ) ( actualAki . get ( AuthorityKeyIdentifierExtension . KEY_ID ) ) ) . getIdentifier ( ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return curator . findFile ( id ) ; }
|
org . junit . Assert . assertArrayEquals ( expectedKeyIdentifier , actualKeyIdentifier )
|
test1 ( ) { org . esa . s2tbx . dataio . s2 . l1c . IL1cProductMetadata productMetadata = getUserProduct ( ) ; "<AssertPlaceHolder>" ; } getUserProduct ( ) { org . esa . s2tbx . dataio . s2 . l1b . IL1bProductMetadata productMetadata = org . esa . s2tbx . dataio . s2 . l1b . L1bMetadataFactory . createL1bProductMetadata ( new org . esa . s2tbx . dataio . VirtualPath ( buildPathResource ( "S2A_OPER_MTD_SAFL1B_PDMC_20140926T120000_R069_V20130707T171925_20130707T172037.xml" ) , null ) ) ; return productMetadata ; }
|
org . junit . Assert . assertNotNull ( productMetadata )
|
immediateApplyThrows ( ) { doThrow ( eu . toolchain . concurrent . AbstractImmediateTest . cause ) . when ( fn ) . apply ( from ) ; "<AssertPlaceHolder>" ; } thenApplyCompleted ( java . util . function . Function , T ) { final U result ; try { result = fn . apply ( value ) ; } catch ( final java . lang . Exception e ) { return new eu . toolchain . concurrent . ImmediateFailed ( caller , e ) ; } return new eu . toolchain . concurrent . ImmediateCompleted ( caller , result ) ; }
|
org . junit . Assert . assertThat ( base . thenApplyCompleted ( fn , from ) , org . hamcrest . core . Is . is ( new eu . toolchain . concurrent . ImmediateFailed ( caller , eu . toolchain . concurrent . AbstractImmediateTest . cause ) ) )
|
customType ( ) { java . io . File out = folder . newFile ( ) ; int testCount = 1000 ; java . util . List < org . apache . jackrabbit . oak . commons . sort . ExternalSortTest . TestLine > testLines = new java . util . ArrayList ( 1000 ) ; for ( int i = 0 ; i < testCount ; i ++ ) { testLines . add ( new org . apache . jackrabbit . oak . commons . sort . ExternalSortTest . TestLine ( ( ( ( i + ":" ) + "foo-" ) + i ) ) ) ; } java . util . Collections . shuffle ( testLines ) ; java . util . Comparator < org . apache . jackrabbit . oak . commons . sort . ExternalSortTest . TestLine > cmp = java . util . Comparator . naturalOrder ( ) ; java . nio . charset . Charset charset = com . google . common . base . Charsets . UTF_8 ; java . util . function . Function < java . lang . String , org . apache . jackrabbit . oak . commons . sort . ExternalSortTest . TestLine > stringToType = ( line ) -> line != null ? new org . apache . jackrabbit . oak . commons . sort . TestLine ( line ) : null ; java . util . function . Function < org . apache . jackrabbit . oak . commons . sort . ExternalSortTest . TestLine , java . lang . String > typeToString = ( tl ) -> tl != null ? tl . line : null ; java . lang . String testData = com . google . common . base . Joiner . on ( '\n' ) . join ( transform ( testLines , ( tl ) -> tl . line ) ) ; java . io . File testFile = folder . newFile ( ) ; com . google . common . io . Files . write ( testData , testFile , charset ) ; java . util . List < java . io . File > listOfFiles = org . apache . jackrabbit . oak . commons . sort . ExternalSort . sortInBatch ( testFile , cmp , ExternalSort . DEFAULTMAXTEMPFILES , 100 , charset , folder . newFolder ( ) , false , 0 , false , typeToString , stringToType ) ; org . apache . jackrabbit . oak . commons . sort . ExternalSort . mergeSortedFiles ( listOfFiles , out , cmp , charset , false , true , false , typeToString , stringToType ) ; java . util . Collections . sort ( testLines ) ; java . util . List < org . apache . jackrabbit . oak . commons . sort . ExternalSortTest . TestLine > linesFromSortedFile = new java . util . ArrayList ( ) ; com . google . common . io . Files . readLines ( out , charset ) . forEach ( ( line ) -> linesFromSortedFile . add ( new org . apache . jackrabbit . oak . commons . sort . TestLine ( line ) ) ) ; "<AssertPlaceHolder>" ; } add ( org . apache . jackrabbit . oak . spi . observation . ChangeSet ) { if ( cs == null ) { parentPathOverflow = true ; parentNodeNameOverflow = true ; parentNodeTypeOverflow = true ; propertyNameOverflow = true ; allNodeTypeOverflow = true ; return this ; } if ( ( cs . getParentPaths ( ) ) == null ) { parentPathOverflow = true ; } else { addPathFromChangeSet ( cs ) ; } if ( ( cs . getParentNodeNames ( ) ) == null ) { parentNodeNameOverflow = true ; } else { for ( java . lang . String parentNodeName : cs . getParentNodeNames ( ) ) { addParentNodeName ( parentNodeName ) ; } } if ( ( cs . getParentNodeTypes ( ) ) == null ) { parentNodeTypeOverflow = true ; } else { for ( java . lang . String parentNodeType : cs . getParentNodeTypes ( ) ) { addParentNodeType ( parentNodeType ) ; } } if ( ( cs . getPropertyNames ( ) ) == null ) { propertyNameOverflow = true ; } else { for ( java . lang . String propertyName : cs . getPropertyNames ( ) ) { addPropertyName ( propertyName ) ; } } if ( ( cs . getAllNodeTypes ( ) ) == null ) { allNodeTypeOverflow = true ; } else { for ( java . lang . String nodeType : cs . getAllNodeTypes ( ) ) { addNodeType ( nodeType ) ; } } return this ; }
|
org . junit . Assert . assertEquals ( testLines , linesFromSortedFile )
|
testNoObject ( ) { java . lang . String name = gateway . putNewObject ( entryPoint . getNewExample ( ) ) ; try { gateway . invoke ( "method1" , ( name + "bob" ) , null ) ; org . junit . Assert . fail ( ) ; } catch ( py4j . Py4JException pe ) { "<AssertPlaceHolder>" ; } } invoke ( java . lang . Object , java . lang . reflect . Method , java . lang . Object [ ] ) { logger . fine ( ( ( ( "Method<sp>" + ( method . getName ( ) ) ) + "<sp>called<sp>on<sp>Python<sp>object<sp>" ) + ( id ) ) ) ; java . lang . StringBuilder sBuilder = new java . lang . StringBuilder ( ) ; sBuilder . append ( py4j . reflection . PythonProxyHandler . CALL_PROXY_COMMAND_NAME ) ; sBuilder . append ( id ) ; sBuilder . append ( "\n" ) ; sBuilder . append ( method . getName ( ) ) ; sBuilder . append ( "\n" ) ; if ( args != null ) { for ( java . lang . Object arg : args ) { sBuilder . append ( gateway . getReturnObject ( arg ) . getCommandPart ( ) ) ; sBuilder . append ( "\n" ) ; } } sBuilder . append ( "e\n" ) ; java . lang . String returnCommand = gateway . getCallbackClient ( ) . sendCommand ( sBuilder . toString ( ) ) ; java . lang . Object output = py4j . Protocol . getReturnValue ( returnCommand , gateway ) ; java . lang . Object convertedOutput = convertOutput ( method , output ) ; return convertedOutput ; }
|
org . junit . Assert . assertTrue ( true )
|
shouldDetermineIfWorkingDay ( ) { java . util . Calendar holiday = toCalendar ( "01-Nov-2010" ) ; org . joda . time . DateTime holidayAsDateTime = new org . joda . time . DateTime ( holiday . getTime ( ) . getTime ( ) ) ; java . lang . String holidayAsString = holidayAsDateTime . toLocalDate ( ) . toString ( ) ; when ( fiscalCalendarRules . isWorkingDay ( holiday ) ) . thenReturn ( true ) ; when ( holidayDao . isHoliday ( officeId , holidayAsString ) ) . thenReturn ( false ) ; "<AssertPlaceHolder>" ; verify ( fiscalCalendarRules , times ( 1 ) ) . isWorkingDay ( holiday ) ; verify ( holidayDao ) . isHoliday ( officeId , holidayAsString ) ; } isWorkingDay ( java . util . Calendar , java . lang . Short ) { return holidayService . isWorkingDay ( day , officeId ) ; }
|
org . junit . Assert . assertThat ( holidayService . isWorkingDay ( holiday , officeId ) , org . hamcrest . Matchers . is ( true ) )
|
testGetTitle ( ) { uk . ac . ebi . ep . ebeye . protein . model . EntryTest . LOGGER . info ( "getTitle" ) ; java . lang . String expResult = "cGMP-specific<sp>3',5'-cyclic<sp>phosphodiesterase" ; java . lang . String result = instance . getTitle ( ) ; "<AssertPlaceHolder>" ; } getTitle ( ) { return title ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
ShouldGetArrayByIndexAndCountForNull ( ) { org . atomhopper . jdbc . query . PostgreSQLTextArray array = new org . atomhopper . jdbc . query . PostgreSQLTextArray ( null ) ; "<AssertPlaceHolder>" ; } getArray ( long , int ) { return ( stringArray ) == null ? null : java . util . Arrays . copyOfRange ( stringArray , ( ( int ) ( index ) ) , ( ( ( int ) ( index ) ) + count ) ) ; }
|
org . junit . Assert . assertNull ( array . getArray ( 0 , 1 ) )
|
test3b ( ) { final java . util . List < org . eclipse . packagedrone . repo . channel . ArtifactInformation > r = org . eclipse . packagedrone . repo . adapter . p2 . internal . servlet . MavenLocator . findByMavenCoordinates ( org . eclipse . packagedrone . repo . adapter . p2 . internal . servlet . MavenLocatorTest . arts , "g1" , "a1" , "v3-SNAPSHOT" , null , null , null ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return ( ( ( this . operatingSystems . isEmpty ( ) ) && ( this . windowSystems . isEmpty ( ) ) ) && ( this . architectures . isEmpty ( ) ) ) && ( this . languages . isEmpty ( ) ) ; }
|
org . junit . Assert . assertTrue ( r . isEmpty ( ) )
|
testGetSetId ( ) { java . lang . String expectedId = "expectedId" ; com . microsoft . windowsazure . services . media . models . ContentKeyInfo contentKeyInfo = new com . microsoft . windowsazure . services . media . models . ContentKeyInfo ( null , new com . microsoft . windowsazure . services . media . implementation . content . ContentKeyRestType ( ) . setId ( expectedId ) ) ; java . lang . String actualId = contentKeyInfo . getId ( ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
|
org . junit . Assert . assertEquals ( expectedId , actualId )
|
testDescribeErrorLogs ( ) { try { com . fit2cloud . aliyun . rds . model . request . DescribeErrorLogsRequest request = new com . fit2cloud . aliyun . rds . model . request . DescribeErrorLogsRequest ( ) ; request . setDBInstanceId ( dBInstanceId ) ; java . util . Date date = new java . util . Date ( ) ; java . lang . String endTime = new java . text . SimpleDateFormat ( "YYYY-MM-dd'T'HH:mm'Z'" ) . format ( date ) ; date = new java . util . Date ( ( ( date . getTime ( ) ) - 36000000 ) ) ; java . lang . String startTime = new java . text . SimpleDateFormat ( "YYYY-MM-dd'T'HH:mm'Z'" ) . format ( date ) ; request . setStartTime ( startTime ) ; request . setEndTime ( endTime ) ; com . fit2cloud . aliyun . Response response = client . describeErrorLogs ( request ) ; System . out . println ( ( "testDescribeErrorLogs<sp>::<sp>" + ( new com . google . gson . Gson ( ) . toJson ( response ) ) ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( e . getMessage ( ) ) ; } } describeErrorLogs ( com . fit2cloud . aliyun . rds . model . request . DescribeErrorLogsRequest ) { return listPageableData ( describeErrorLogsRequest , "DescribeErrorLogs" , com . fit2cloud . aliyun . rds . model . response . DescribeErrorLogsResponse . class ) ; }
|
org . junit . Assert . assertTrue ( true )
|
testParseXmlInZip ( ) { final java . io . File newZipFile = createTempFile ( ) ; final java . lang . String xmlFilePath = ( "zip:file:" + ( newZipFile . getAbsolutePath ( ) ) ) + "!/read-xml-tests/file1.xml" ; final org . apache . commons . vfs2 . FileSystemManager manager = org . apache . commons . vfs2 . VFS . getManager ( ) ; try ( final org . apache . commons . vfs2 . FileObject zipFileObject = manager . resolveFile ( xmlFilePath ) ) { try ( final java . io . InputStream inputStream = zipFileObject . getContent ( ) . getInputStream ( ) ) { final org . w3c . dom . Document document = newDocumentBuilder ( zipFileObject , zipFileObject , null ) . parse ( inputStream ) ; "<AssertPlaceHolder>" ; } } } parse ( java . lang . String ) { return new com . github . vfss3 . S3FileNameParserTest . S3FileNameAssert ( new com . github . vfss3 . S3FileNameParser ( ) . parseUri ( null , null , url ) ) ; }
|
org . junit . Assert . assertNotNull ( document )
|
uploadMultipleRules ( ) { org . candlepin . model . Rules rules = new org . candlepin . model . Rules ( "//<sp>Version:<sp>5.1000\n//<sp>rules1<sp>" ) ; rulesCurator . update ( rules ) ; org . candlepin . model . Rules rules2 = new org . candlepin . model . Rules ( "//<sp>Version:<sp>5.1001\n//<sp>rules2<sp>" ) ; rulesCurator . update ( rules2 ) ; org . candlepin . model . Rules updateRules = rulesCurator . getRules ( ) ; "<AssertPlaceHolder>" ; } getRules ( ) { return rules ; }
|
org . junit . Assert . assertEquals ( rules2 . getRules ( ) , updateRules . getRules ( ) )
|
testFormatDate ( ) { javax . jcr . Value dateV = valueFactory . createValue ( java . util . Calendar . getInstance ( ) ) ; java . lang . String dateString = dateV . getString ( ) ; "<AssertPlaceHolder>" ; } format ( javax . jcr . Value ) { switch ( value . getType ( ) ) { case javax . jcr . PropertyType . STRING : case javax . jcr . PropertyType . BOOLEAN : return ( '\'' + ( org . apache . jackrabbit . oak . security . user . query . QueryUtil . escapeForQuery ( value . getString ( ) ) ) ) + '\'' ; case javax . jcr . PropertyType . LONG : case javax . jcr . PropertyType . DOUBLE : return value . getString ( ) ; case javax . jcr . PropertyType . DATE : return ( "xs:dateTime('" + ( value . getString ( ) ) ) + "')" ; default : throw new javax . jcr . RepositoryException ( ( ( "Property<sp>of<sp>type<sp>" + ( javax . jcr . PropertyType . nameFromValue ( value . getType ( ) ) ) ) + "<sp>not<sp>supported" ) ) ; } }
|
org . junit . Assert . assertEquals ( ( ( "xs:dateTime('" + dateString ) + "')" ) , org . apache . jackrabbit . oak . security . user . query . QueryUtil . format ( dateV ) )
|
testToDBObject ( ) { final org . apache . rya . mongodb . document . visibility . DocumentVisibility dv = new org . apache . rya . mongodb . document . visibility . DocumentVisibility ( "A" ) ; final com . mongodb . BasicDBObject dbObject = org . apache . rya . mongodb . document . visibility . DocumentVisibilityAdapter . toDBObject ( dv ) ; final com . mongodb . BasicDBObject expected = ( ( com . mongodb . BasicDBObject ) ( com . mongodb . util . JSON . parse ( ( "{" + ( "documentVisibility<sp>:<sp>[[\"A\"]]" + "}" ) ) ) ) ) ; "<AssertPlaceHolder>" ; } parse ( java . lang . String ) { checkNotNull ( requestText ) ; int startOfSparql = 0 ; final java . util . Set < org . apache . rya . indexing . pcj . storage . accumulo . VariableOrder > varOrders = new java . util . HashSet ( ) ; final java . util . regex . Matcher matcher = org . apache . rya . indexing . pcj . fluo . client . util . ParsedQueryRequest . varOrdersPattern . matcher ( requestText ) ; while ( matcher . find ( ) ) { final java . lang . String varOrder = matcher . group ( 1 ) ; varOrders . add ( new org . apache . rya . indexing . pcj . storage . accumulo . VariableOrder ( varOrder . split ( ",\\s*" ) ) ) ; startOfSparql = matcher . end ( ) ; } final java . lang . String sparql = requestText . substring ( startOfSparql ) . trim ( ) ; return new org . apache . rya . indexing . pcj . fluo . client . util . ParsedQueryRequest ( sparql , varOrders ) ; }
|
org . junit . Assert . assertEquals ( expected , dbObject )
|
testEmptyOriginalMessageId_assertFalse ( ) { new org . nhindirect . common . tx . impl . RESTTxServiceClient_suppressNotificationTest . TestPlan < org . nhindirect . common . tx . model . Tx > ( ) { @ org . nhindirect . common . tx . impl . Override protected boolean suppressNotification ( org . nhindirect . common . tx . model . Tx tx ) throws org . nhindirect . common . tx . impl . Exception { return client . suppressNotification ( tx ) ; } @ org . nhindirect . common . tx . impl . Override protected org . nhindirect . common . tx . model . Tx getNotficationSubmit ( ) throws org . nhindirect . common . tx . impl . Exception { javax . mail . internet . MimeMessage msg = org . nhindirect . common . util . TestUtils . readMimeMessageFromFile ( "MDNMessage.txt" ) ; java . util . Map < java . lang . String , org . nhindirect . common . tx . model . TxDetail > details = new org . nhindirect . common . tx . impl . DefaultTxDetailParser ( ) . getMessageDetails ( msg ) ; details . put ( TxDetailType . PARENT_MSG_ID . getType ( ) , new org . nhindirect . common . tx . model . TxDetail ( org . nhindirect . common . tx . model . TxDetailType . PARENT_MSG_ID , "" ) ) ; org . nhindirect . common . tx . model . Tx tx = new org . nhindirect . common . tx . model . Tx ( org . nhindirect . common . tx . TxUtil . getMessageType ( msg ) , details ) ; return tx ; } protected void doAssertions ( boolean b ) throws org . nhindirect . common . tx . impl . Exception { "<AssertPlaceHolder>" ; } } . perform ( ) ; }
|
org . junit . Assert . assertFalse ( b )
|
testCannotFindWidget ( ) { org . eclipse . swt . widgets . Widget result = itemHeightService . findWidget ( "bar" ) ; "<AssertPlaceHolder>" ; } findWidget ( java . lang . String ) { org . eclipse . swt . widgets . Display display = org . eclipse . swt . widgets . Display . getCurrent ( ) ; org . eclipse . swt . widgets . Shell [ ] shells = display . getShells ( ) ; for ( org . eclipse . swt . widgets . Shell shell : shells ) { org . eclipse . swt . widgets . Widget widget = findWidget ( widgetID , shell ) ; if ( widget != null ) { return widget ; } } return null ; }
|
org . junit . Assert . assertNull ( result )
|
testStrictHostChecking ( ) { java . io . File knownHostsFile = testFolder . newFile ( "hosts" ) ; com . google . common . io . Files . write ( getHostsFileEntry ( ) , knownHostsFile ) ; com . streamsets . pipeline . lib . remote . TestSFTPRemoteConnector . SFTPRemoteConnectorForTest connector = new com . streamsets . pipeline . lib . remote . TestSFTPRemoteConnector . SFTPRemoteConnectorForTest ( getBean ( ( ( "sftp://localhost:" + ( port ) ) + "/" ) , true , false , com . streamsets . pipeline . lib . remote . TESTUSER , com . streamsets . pipeline . lib . remote . TESTPASS , null , null , knownHostsFile . toString ( ) , false , null ) ) ; java . util . List < com . streamsets . pipeline . api . Stage . ConfigIssue > issues = initWithNoIssues ( connector ) ; "<AssertPlaceHolder>" ; verifyConnection ( connector ) ; connector . close ( ) ; } size ( ) { return delegate . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , issues . size ( ) )
|
testOr1 ( ) { com . liferay . dynamic . data . mapping . expression . internal . DDMExpressionImpl < java . lang . Boolean > ddmExpression = createDDMExpression ( "2<sp>>=<sp>1<sp>||<sp>1<sp><<sp>0" ) ; "<AssertPlaceHolder>" ; } evaluate ( ) { java . util . stream . Stream < java . lang . reflect . Method > methodStream = _parentTestMethods . stream ( ) ; org . junit . Assume . assumeTrue ( methodStream . noneMatch ( ( m ) -> java . util . Objects . equals ( m . getName ( ) , description . getMethodName ( ) ) ) ) ; statement . evaluate ( ) ; }
|
org . junit . Assert . assertTrue ( ddmExpression . evaluate ( ) )
|
test_JLS_13_4_3 ( ) { japicmp . model . JApiClass publicToPrivateInnerClass = getJApiClass ( japicmp . test . CompatibilityChangesTest . jApiClasses , "japicmp.test.ClassModifier$PublicToPrivateInnerClass" ) ; "<AssertPlaceHolder>" ; } isBinaryCompatible ( ) { return true ; }
|
org . junit . Assert . assertThat ( publicToPrivateInnerClass . isBinaryCompatible ( ) , org . hamcrest . CoreMatchers . is ( false ) )
|
testFromEbXMLEmpty ( ) { org . openehealth . ipf . commons . ihe . xds . core . transform . requests . EbXMLSubmitObjectsRequest ebXML = transformer . toEbXML ( new org . openehealth . ipf . commons . ihe . xds . core . requests . RegisterDocumentSet ( ) ) ; org . openehealth . ipf . commons . ihe . xds . core . requests . RegisterDocumentSet result = transformer . fromEbXML ( ebXML ) ; "<AssertPlaceHolder>" ; } fromEbXML ( org . openehealth . ipf . commons . ihe . xds . core . ebxml . EbXMLRetrieveDocumentSetRequest ) { if ( ebXML == null ) { return null ; } org . openehealth . ipf . commons . ihe . xds . core . requests . RetrieveDocumentSet request = new org . openehealth . ipf . commons . ihe . xds . core . requests . RetrieveDocumentSet ( ) ; request . getDocuments ( ) . addAll ( ebXML . getDocuments ( ) ) ; return request ; }
|
org . junit . Assert . assertEquals ( new org . openehealth . ipf . commons . ihe . xds . core . requests . RegisterDocumentSet ( ) , result )
|
testCustomBehaviour ( ) { final java . util . List < java . lang . String > labels = new java . util . ArrayList < java . lang . String > ( ) ; java . awt . Graphics2D graphics = org . mockito . Mockito . mock ( java . awt . Graphics2D . class ) ; org . geotools . renderer . label . LabelCacheImpl myCache = new org . geotools . renderer . label . LabelCacheImpl ( ) { @ org . geotools . renderer . label . Override int paintLabel ( java . awt . Graphics2D graphics , java . awt . Rectangle displayArea , org . geotools . renderer . label . LabelIndex glyphs , int paintedLineLabels , org . geotools . renderer . label . LabelPainter painter , org . geotools . renderer . label . LabelCacheItem labelItem ) { labels . add ( labelItem . getLabel ( ) ) ; return super . paintLabel ( graphics , displayArea , glyphs , paintedLineLabels , painter , labelItem ) ; } } ; org . geotools . styling . TextSymbolizer ts = sb . createTextSymbolizer ( Color . BLACK , ( ( org . geotools . styling . Font ) ( null ) ) , "name" ) ; org . opengis . feature . simple . SimpleFeature f1 = createFeature ( "label1" , org . geotools . renderer . label . LabelCacheImplTest . L1 ) ; myCache . enableLayer ( org . geotools . renderer . label . LabelCacheImplTest . LAYER_ID ) ; myCache . put ( org . geotools . renderer . label . LabelCacheImplTest . LAYER_ID , ts , f1 , new org . geotools . geometry . jts . LiteShape2 ( ( ( org . locationtech . jts . geom . Geometry ) ( f1 . getDefaultGeometry ( ) ) ) , null , null , false ) , ALL_SCALES ) ; myCache . endLayer ( org . geotools . renderer . label . LabelCacheImplTest . LAYER_ID , graphics , new java . awt . Rectangle ( 0 , 0 , 256 , 256 ) ) ; myCache . end ( graphics , new java . awt . Rectangle ( 0 , 0 , 256 , 256 ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return categories . length ; }
|
org . junit . Assert . assertEquals ( 1 , labels . size ( ) )
|
testGetConsoleConfig ( ) { org . pentaho . platform . config . IConsoleConfig consoleConfig = appConfigProperties . getConsoleConfig ( ) ; "<AssertPlaceHolder>" ; } getConsoleConfig ( ) { if ( ( consoleConfig ) == null ) { try { consoleConfig = new org . pentaho . platform . config . ConsoleConfigXml ( new java . io . File ( java . lang . ClassLoader . getSystemResource ( org . pentaho . platform . config . AppConfigProperties . CONFIG_FILE_NAME ) . toURI ( ) ) ) ; } catch ( java . lang . Exception ex ) { org . pentaho . platform . config . AppConfigProperties . logger . warn ( org . pentaho . platform . config . i18n . Messages . getErrorString ( "AppConfigProperties.ERROR_0004_UNABLE_TO_READ_FILE" , org . pentaho . platform . config . AppConfigProperties . CONFIG_FILE_NAME ) ) ; consoleConfig = new org . pentaho . platform . config . ConsoleConfigXml ( ) ; } } return consoleConfig ; }
|
org . junit . Assert . assertNotNull ( consoleConfig )
|
test1a ( ) { com . milaboratory . core . alignment . kaligner1 . KAlignerParameters parameters = com . milaboratory . core . alignment . kaligner1 . KAlignerParameters . getByName ( "default" ) ; com . milaboratory . core . alignment . kaligner1 . KAlignerParameters override = com . milaboratory . mixcr . cli . JsonOverrider . override ( parameters , com . milaboratory . core . alignment . kaligner1 . KAlignerParameters . class , "floatingLeftBound=true" , "scoring.subsMatrix='simple(match=4,mismatch=-9)'" ) ; com . milaboratory . core . alignment . kaligner1 . KAlignerParameters expected = parameters . clone ( ) . setFloatingLeftBound ( true ) . setScoring ( new com . milaboratory . core . alignment . LinearGapAlignmentScoring ( com . milaboratory . core . sequence . NucleotideSequence . ALPHABET , 4 , ( - 9 ) , parameters . getScoring ( ) . getGapPenalty ( ) ) ) ; "<AssertPlaceHolder>" ; } getScoring ( ) { return parameters . getScoring ( ) ; }
|
org . junit . Assert . assertEquals ( expected , override )
|
testWithdrawIn20SecondAfterCreditCard ( ) { System . out . println ( "**<sp>Placing<sp>a<sp>Withdraw<sp>after<sp>a<sp>Credit<sp>Card<sp>transaction<sp>in<sp>more<sp>than<sp>10<sp>seconds<sp>**" ) ; org . jboss . quickstarts . brms . cep . model . Transaction t1 = new org . jboss . quickstarts . brms . cep . model . Transaction ( new java . math . BigInteger ( "10" ) , org . jboss . quickstarts . brms . cep . model . TransactionType . CREDIT_CARD ) ; org . jboss . quickstarts . brms . cep . model . Transaction t2 = new org . jboss . quickstarts . brms . cep . model . Transaction ( new java . math . BigInteger ( "10" ) , org . jboss . quickstarts . brms . cep . model . TransactionType . WITHDRAW ) ; org . kie . api . runtime . rule . EntryPoint entryPoint = kieSession . getEntryPoint ( "Credit<sp>Card" ) ; entryPoint . insert ( t1 ) ; org . drools . core . time . SessionPseudoClock clock = kieSession . getSessionClock ( ) ; clock . advanceTime ( 20 , TimeUnit . SECONDS ) ; kieSession . insert ( t2 ) ; kieSession . fireAllRules ( ) ; "<AssertPlaceHolder>" ; System . out . println ( ( "*<sp>Transaction<sp>denied:<sp>" + ( t2 . isDenied ( ) ) ) ) ; } isDenied ( ) { return denied ; }
|
org . junit . Assert . assertFalse ( t2 . isDenied ( ) )
|
testUnicodeEmptyString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; java . lang . String inFile = "japanese_text.pdf" ; com . itextpdf . text . pdf . PdfReader p = com . itextpdf . testutils . TestResourceUtils . getResourceAsPdfReader ( this , inFile ) ; com . itextpdf . text . pdf . parser . TextExtractionStrategy strat = new com . itextpdf . text . pdf . parser . SimpleTextExtractionStrategy ( ) ; sb . append ( com . itextpdf . text . pdf . parser . PdfTextExtractor . getTextFromPage ( p , com . itextpdf . text . pdf . parser . TextRenderInfoTest . FIRST_PAGE , strat ) ) ; java . lang . String result = sb . substring ( 0 , sb . indexOf ( "\n" ) ) ; java . lang . String origText = "直近のS&P500" + ( ( "配当貴族指数のパフ" + "ォーマンスはS&P" ) + "500指数を上回る" ) ; "<AssertPlaceHolder>" ; } getTextFromPage ( com . itextpdf . text . pdf . PdfReader , int , com . itextpdf . text . pdf . parser . TextExtractionStrategy ) { return com . itextpdf . text . pdf . parser . PdfTextExtractor . getTextFromPage ( reader , pageNumber , strategy , new java . util . HashMap < java . lang . String , com . itextpdf . text . pdf . parser . ContentOperator > ( ) ) ; }
|
org . junit . Assert . assertEquals ( result , origText )
|
whenAddAutoInTreeWeShouldGetArraySizeByCountItemInTree ( ) { ru . szhernovoy . tree . SimpleTree < java . lang . Integer > simple = new ru . szhernovoy . tree . SimpleTree ( ) ; for ( int index = 0 ; index < 35000 ; index ++ ) { simple . addChild ( new ru . szhernovoy . tree . Leaf < java . lang . Integer > ( ) , index ) ; } int control = 35000 ; int result = simple . getChildren ( ) . size ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return array . length ; }
|
org . junit . Assert . assertThat ( result , org . hamcrest . core . Is . is ( control ) )
|
testListTables ( ) { com . google . common . collect . ImmutableList < java . lang . String > tableIdList = com . google . common . collect . ImmutableList . of ( com . google . cloud . bigtable . grpc . TestBigtableTableAdminClientWrapper . TEST_TABLE_ID_1 , com . google . cloud . bigtable . grpc . TestBigtableTableAdminClientWrapper . TEST_TABLE_ID_2 , com . google . cloud . bigtable . grpc . TestBigtableTableAdminClientWrapper . TEST_TABLE_ID_3 ) ; com . google . bigtable . admin . v2 . ListTablesRequest request = com . google . bigtable . admin . v2 . ListTablesRequest . newBuilder ( ) . setParent ( com . google . cloud . bigtable . grpc . TestBigtableTableAdminClientWrapper . INSTANCE_NAME . toString ( ) ) . build ( ) ; com . google . bigtable . admin . v2 . ListTablesResponse . Builder builder = com . google . bigtable . admin . v2 . ListTablesResponse . newBuilder ( ) ; builder . addTablesBuilder ( ) . setName ( com . google . cloud . bigtable . grpc . TestBigtableTableAdminClientWrapper . INSTANCE_NAME . toTableNameStr ( com . google . cloud . bigtable . grpc . TestBigtableTableAdminClientWrapper . TEST_TABLE_ID_1 ) ) . build ( ) ; builder . addTablesBuilder ( ) . setName ( com . google . cloud . bigtable . grpc . TestBigtableTableAdminClientWrapper . INSTANCE_NAME . toTableNameStr ( com . google . cloud . bigtable . grpc . TestBigtableTableAdminClientWrapper . TEST_TABLE_ID_2 ) ) . build ( ) ; builder . addTablesBuilder ( ) . setName ( com . google . cloud . bigtable . grpc . TestBigtableTableAdminClientWrapper . INSTANCE_NAME . toTableNameStr ( com . google . cloud . bigtable . grpc . TestBigtableTableAdminClientWrapper . TEST_TABLE_ID_3 ) ) . build ( ) ; when ( mockAdminClient . listTables ( request ) ) . thenReturn ( builder . build ( ) ) ; java . util . List < java . lang . String > actualResponse = clientWrapper . listTables ( ) ; "<AssertPlaceHolder>" ; verify ( mockAdminClient ) . listTables ( request ) ; } listTables ( ) { return getTableDescriptors ( listTableNames ( ) ) ; }
|
org . junit . Assert . assertEquals ( tableIdList , actualResponse )
|
writeStringToFileWithEncoding_WithAppendOptionTrue_ShouldNotDeletePreviousFileLines ( ) { java . io . File file = org . apache . maven . shared . utils . testhelpers . FileTestHelper . newFile ( tempFolder , "lines.txt" ) ; org . apache . maven . shared . utils . io . FileUtils . fileWrite ( file , null , "This<sp>line<sp>was<sp>there<sp>before<sp>you..." ) ; org . apache . maven . shared . utils . io . FileUtils . fileAppend ( file . getAbsolutePath ( ) , "this<sp>is<sp>brand<sp>new<sp>data" ) ; java . lang . String expected = "This<sp>line<sp>was<sp>there<sp>before<sp>you..." + "this<sp>is<sp>brand<sp>new<sp>data" ; java . lang . String actual = org . apache . maven . shared . utils . io . FileUtils . fileRead ( file ) ; "<AssertPlaceHolder>" ; } fileRead ( java . lang . String ) { return org . apache . maven . shared . utils . io . FileUtils . fileRead ( file , null ) ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( expected ) )
|
assertGetAggregationDistinctColumnIndexByColumnLabel ( ) { int actual = distinctQueryMetaData . getAggregationDistinctColumnIndex ( "a" ) ; "<AssertPlaceHolder>" ; } getAggregationDistinctColumnIndex ( java . lang . String ) { for ( java . util . Map . Entry < java . lang . Integer , java . lang . String > entry : aggregationDistinctColumnIndexAndLabels . entrySet ( ) ) { if ( entry . getValue ( ) . equals ( distinctColumnLabel ) ) { return entry . getKey ( ) ; } } throw new org . apache . shardingsphere . core . exception . ShardingException ( "Can<sp>not<sp>get<sp>aggregation<sp>distinct<sp>column<sp>index." ) ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( 2 ) )
|
detectIfNone ( ) { boolean detect = this . classUnderTest ( ) . detectIfNone ( ( value ) -> true , false ) ; "<AssertPlaceHolder>" ; } detectIfNone ( org . eclipse . collections . api . block . predicate . Predicate , org . eclipse . collections . api . block . function . Function0 ) { return this . getMutableCollection ( ) . detectIfNone ( predicate , function ) ; }
|
org . junit . Assert . assertFalse ( detect )
|
testDBMacroSupport ( ) { java . lang . String importQuery = "SELECT<sp>*<sp>FROM<sp>\"my_table\"<sp>WHERE<sp>DATE_COL<sp><=<sp>\'${logicalStartTime(yyyy-MM-dd,1d)}\'<sp>" + "AND<sp>$CONDITIONS" ; java . lang . String boundingQuery = "SELECT<sp>MIN(ID),MAX(ID)<sp>from<sp>\"my_table\"" ; java . lang . String splitBy = "ID" ; io . cdap . cdap . etl . proto . v2 . ETLPlugin sourceConfig = new io . cdap . cdap . etl . proto . v2 . ETLPlugin ( "<sp>WHERE<sp>DATE_COL<sp><=<sp>\'${logicalStartTime(yyyy-MM-dd,1d)}\'<sp>" 1 , io . cdap . cdap . etl . api . batch . BatchSource . PLUGIN_TYPE , com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . String > builder ( ) . put ( ConnectionConfig . CONNECTION_STRING , getConnectionURL ( ) ) . put ( DBSource . DBSourceConfig . IMPORT_QUERY , importQuery ) . put ( DBSource . DBSourceConfig . BOUNDING_QUERY , boundingQuery ) . put ( DBSource . DBSourceConfig . SPLIT_BY , splitBy ) . put ( ConnectionConfig . JDBC_PLUGIN_NAME , "hypersql" ) . put ( Constants . Reference . REFERENCE_NAME , "<sp>WHERE<sp>DATE_COL<sp><=<sp>\'${logicalStartTime(yyyy-MM-dd,1d)}\'<sp>" 0 ) . build ( ) , null ) ; io . cdap . cdap . etl . proto . v2 . ETLPlugin sinkConfig = io . cdap . cdap . etl . mock . batch . MockSink . getPlugin ( "macroOutputTable" ) ; io . cdap . cdap . test . ApplicationManager appManager = deployETL ( sourceConfig , sinkConfig , "testDBMacro" ) ; runETLOnce ( appManager , com . google . common . collect . ImmutableMap . of ( "logical.start.time" , java . lang . String . valueOf ( io . cdap . plugin . db . batch . sink . CURRENT_TS ) ) ) ; io . cdap . cdap . test . DataSetManager < io . cdap . cdap . api . dataset . table . Table > outputManager = getDataset ( "macroOutputTable" ) ; "<AssertPlaceHolder>" ; } readOutput ( org . apache . twill . filesystem . Location ) { org . apache . avro . Schema avroSchema = new org . apache . avro . Schema . Parser ( ) . parse ( io . cdap . plugin . batch . ETLSnapshotTestRun . SCHEMA . toString ( ) ) ; java . util . Map < java . lang . String , java . lang . Integer > contents = new java . util . HashMap ( ) ; for ( org . apache . twill . filesystem . Location file : outputLocation . list ( ) ) { java . lang . String fileName = file . getName ( ) ; if ( fileName . endsWith ( ".avro" ) ) { org . apache . avro . io . DatumReader < org . apache . avro . generic . GenericRecord > datumReader = new org . apache . avro . generic . GenericDatumReader ( avroSchema ) ; org . apache . avro . file . DataFileStream < org . apache . avro . generic . GenericRecord > fileStream = new org . apache . avro . file . DataFileStream ( file . getInputStream ( ) , datumReader ) ; for ( org . apache . avro . generic . GenericRecord record : fileStream ) { contents . put ( record . get ( "id" ) . toString ( ) , ( ( java . lang . Integer ) ( record . get ( "price" ) ) ) ) ; } fileStream . close ( ) ; } else if ( fileName . endsWith ( ".parquet" ) ) { org . apache . hadoop . fs . Path parquetFile = new org . apache . hadoop . fs . Path ( file . toString ( ) ) ; org . apache . parquet . avro . AvroParquetReader . Builder < org . apache . avro . generic . GenericRecord > genericRecordBuilder = org . apache . parquet . avro . AvroParquetReader . builder ( parquetFile ) ; org . apache . parquet . hadoop . ParquetReader < org . apache . avro . generic . GenericRecord > reader = genericRecordBuilder . build ( ) ; org . apache . avro . generic . GenericRecord record = reader . read ( ) ; while ( record != null ) { contents . put ( record . get ( "id" ) . toString ( ) , ( ( java . lang . Integer ) ( record . get ( "price" ) ) ) ) ; record = reader . read ( ) ; } } } return contents ; }
|
org . junit . Assert . assertTrue ( io . cdap . cdap . etl . mock . batch . MockSink . readOutput ( outputManager ) . isEmpty ( ) )
|
checkSuperAdminAccessToTenant ( ) { final org . sentilo . web . catalog . domain . Tenant resource = new org . sentilo . web . catalog . domain . Tenant ( "1" ) ; when ( userDetails . isSuperAdminUser ( ) ) . thenReturn ( true ) ; final boolean allowedCRUDL = ( ( ( ( checkAccess ( resource , ActionType . LIST ) ) | ( checkAccess ( resource , ActionType . READ ) ) ) | ( checkAccess ( resource , ActionType . CREATE ) ) ) | ( checkAccess ( resource , ActionType . SAVE ) ) ) | ( checkAccess ( resource , ActionType . DELETE ) ) ; "<AssertPlaceHolder>" ; } checkAccess ( org . sentilo . web . catalog . domain . CatalogDocument , org . sentilo . web . catalog . security . enums . ActionType ) { boolean allowed = true ; try { accessControlService . checkAccess ( new org . sentilo . web . catalog . security . access . AccessControlContext ( resource , action , service ) ) ; } catch ( final org . sentilo . web . catalog . exception . NotAllowedActionException naae ) { allowed = false ; } return allowed ; }
|
org . junit . Assert . assertTrue ( allowedCRUDL )
|
serialize ( ) { com . google . gson . Gson gson = com . github . seratch . jslack . common . json . GsonFactory . createSnakeCase ( ) ; com . github . seratch . jslack . api . model . event . TeamMigrationStartedEvent event = new com . github . seratch . jslack . api . model . event . TeamMigrationStartedEvent ( ) ; java . lang . String generatedJson = gson . toJson ( event ) ; java . lang . String expectedJson = "{\"type\":\"team_migration_started\"}" ; "<AssertPlaceHolder>" ; } createSnakeCase ( ) { return new com . google . gson . GsonBuilder ( ) . setFieldNamingPolicy ( FieldNamingPolicy . LOWER_CASE_WITH_UNDERSCORES ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . LayoutBlock . class , new com . github . seratch . jslack . common . json . GsonLayoutBlockFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . composition . TextObject . class , new com . github . seratch . jslack . common . json . GsonTextObjectFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . ContextBlockElement . class , new com . github . seratch . jslack . common . json . GsonContextBlockElementFactory ( ) ) . registerTypeAdapter ( com . github . seratch . jslack . api . model . block . element . BlockElement . class , new com . github . seratch . jslack . common . json . GsonBlockElementFactory ( ) ) . create ( ) ; }
|
org . junit . Assert . assertThat ( generatedJson , org . hamcrest . CoreMatchers . is ( expectedJson ) )
|
givenHeadOperationOKThenOK ( ) { javax . ws . rs . core . Response . ResponseBuilder builder = javax . ws . rs . core . Response . status ( Status . ACCEPTED ) . header ( GlobalDataRest . X_GLOBAL_EXECUTION_STATE , ProcessState . COMPLETED ) . header ( GlobalDataRest . X_GLOBAL_EXECUTION_STATUS , StatusCode . OK ) . header ( GlobalDataRest . X_CONTEXT_ID , LogbookTypeProcess . INGEST . toString ( ) ) ; when ( fr . gouv . vitam . ingest . internal . client . IngestInternalClientRestTest . mock . head ( ) ) . thenReturn ( builder . build ( ) ) ; fr . gouv . vitam . common . model . ItemStatus status = fr . gouv . vitam . ingest . internal . client . IngestInternalClientRestTest . client . getOperationProcessStatus ( fr . gouv . vitam . ingest . internal . client . IngestInternalClientRestTest . ID ) ; "<AssertPlaceHolder>" ; } getGlobalStatus ( ) { return globalStatus ; }
|
org . junit . Assert . assertEquals ( status . getGlobalStatus ( ) , StatusCode . OK )
|
assertMonthsDaysInvariant_T1UntilT2_Eq_T2UntilT1Inv ( ) { net . time4j . Duration < net . time4j . CalendarUnit > p1 = this . start . until ( this . end , net . time4j . Duration . in ( net . time4j . CalendarUnit . MONTHS , net . time4j . CalendarUnit . DAYS ) ) ; net . time4j . Duration < net . time4j . CalendarUnit > p2 = this . end . until ( this . start , net . time4j . Duration . in ( net . time4j . CalendarUnit . MONTHS , net . time4j . CalendarUnit . DAYS ) ) ; "<AssertPlaceHolder>" ; } inverse ( ) { return net . time4j . engine . CalendarDays . of ( java . lang . Math . negateExact ( this . days ) ) ; }
|
org . junit . Assert . assertThat ( p1 , org . hamcrest . CoreMatchers . is ( p2 . inverse ( ) ) )
|
testGetLongWithKeyWithDefaultWithValidProperty ( ) { final edu . illinois . library . cantaloupe . config . Configuration instance = getInstance ( ) ; instance . setProperty ( Key . MAX_PIXELS , 5 ) ; "<AssertPlaceHolder>" ; } getLong ( java . lang . String , long ) { try { return getLong ( key ) ; } catch ( java . util . NoSuchElementException | java . lang . NumberFormatException e ) { return defaultValue ; } }
|
org . junit . Assert . assertEquals ( 5 , instance . getLong ( Key . MAX_PIXELS , 6 ) )
|
testRemoveClusterNodeLabelsWithCentralizedConfigurationDisabled ( ) { org . apache . hadoop . yarn . server . resourcemanager . MockRM rm = new org . apache . hadoop . yarn . server . resourcemanager . MockRM ( ) ; ( ( org . apache . hadoop . yarn . server . resourcemanager . RMContextImpl ) ( rm . getRMContext ( ) ) ) . setHAServiceState ( HAServiceState . ACTIVE ) ; org . apache . hadoop . yarn . server . resourcemanager . nodelabels . RMNodeLabelsManager labelMgr = rm . rmContext . getNodeLabelManager ( ) ; rm . adminService . isCentralizedNodeLabelConfiguration = false ; labelMgr . addToCluserNodeLabelsWithDefaultExclusivity ( com . google . common . collect . ImmutableSet . of ( "x" , "y" ) ) ; rm . adminService . removeFromClusterNodeLabels ( org . apache . hadoop . yarn . server . api . protocolrecords . RemoveFromClusterNodeLabelsRequest . newInstance ( ( ( java . util . Set < java . lang . String > ) ( com . google . common . collect . ImmutableSet . of ( "x" ) ) ) ) ) ; java . util . Set < java . lang . String > clusterNodeLabels = labelMgr . getClusterNodeLabelNames ( ) ; "<AssertPlaceHolder>" ; rm . close ( ) ; } size ( ) { return loggers . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , clusterNodeLabels . size ( ) )
|
testGetId ( ) { System . out . println ( "getId" ) ; com . pearson . docussandra . domain . event . IndexCreatedEvent instance = com . pearson . docussandra . testhelper . Fixtures . createTestIndexCreationStatus ( ) ; com . pearson . docussandra . domain . objects . Identifier expResult = new com . pearson . docussandra . domain . objects . Identifier ( instance . getIndex ( ) . getDatabaseName ( ) , instance . getIndex ( ) . getTableName ( ) , instance . getIndex ( ) . getName ( ) , instance . getUuid ( ) ) ; com . pearson . docussandra . domain . objects . Identifier result = instance . getId ( ) ; "<AssertPlaceHolder>" ; } getId ( ) { return new com . pearson . docussandra . domain . objects . Identifier ( getIndex ( ) . getDatabaseName ( ) , getIndex ( ) . getTableName ( ) , getIndex ( ) . getName ( ) , id ) ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
shouldScheduleToNow ( ) { testRule . deploy ( PROCESS ) ; org . camunda . bpm . engine . impl . util . ClockUtil . setCurrentTime ( org . camunda . bpm . engine . test . api . history . removaltime . cleanup . END_DATE ) ; org . camunda . bpm . engine . runtime . ProcessInstance processInstance = runtimeService . startProcessInstanceByKey ( PROCESS_KEY , org . camunda . bpm . engine . variable . Variables . putValue ( "aVariableName" , org . camunda . bpm . engine . variable . Variables . stringValue ( "aVariableValue" ) ) ) ; for ( int i = 0 ; i < 5 ; i ++ ) { runtimeService . setVariable ( processInstance . getId ( ) , "aVariableName" , org . camunda . bpm . engine . variable . Variables . stringValue ( ( "anotherVariableValue" + i ) ) ) ; } java . lang . String taskId = taskService . createTaskQuery ( ) . singleResult ( ) . getId ( ) ; taskService . complete ( taskId ) ; engineConfiguration . setHistoryCleanupBatchSize ( 5 ) ; engineConfiguration . initHistoryCleanup ( ) ; java . util . Date removalTime = org . apache . commons . lang3 . time . DateUtils . addDays ( org . camunda . bpm . engine . test . api . history . removaltime . cleanup . END_DATE , 5 ) ; org . camunda . bpm . engine . impl . util . ClockUtil . setCurrentTime ( removalTime ) ; runHistoryCleanup ( ) ; org . camunda . bpm . engine . runtime . Job job = historyService . findHistoryCleanupJobs ( ) . get ( 0 ) ; "<AssertPlaceHolder>" ; } getDuedate ( ) { return duedate ; }
|
org . junit . Assert . assertThat ( job . getDuedate ( ) , org . hamcrest . core . Is . is ( removalTime ) )
|
testGetMessageSupplierResultOfSupplier ( ) { final org . apache . logging . log4j . message . Message expected = new org . apache . logging . log4j . message . SimpleMessage ( "hi" ) ; final org . apache . logging . log4j . message . Message actual = org . apache . logging . log4j . util . LambdaUtil . get ( new org . apache . logging . log4j . util . MessageSupplier ( ) { @ org . apache . logging . log4j . util . Override public org . apache . logging . log4j . message . Message get ( ) { return expected ; } } ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return org . apache . log4j . MDC . localMap . get ( ) . get ( key ) ; }
|
org . junit . Assert . assertSame ( expected , actual )
|
configDefaultsToServicename ( ) { final java . lang . String servicename = "servicename" ; java . util . Map < java . lang . String , java . lang . Object > configMap = com . google . common . collect . ImmutableMap . < java . lang . String , java . lang . Object > of ( SlackProvider . CONFIG_PATH_WEBHOOK , "http://example.com" ) ; final com . typesafe . config . Config config = com . typesafe . config . ConfigFactory . parseMap ( configMap ) ; com . spotify . apollo . slack . SlackProvider . SlackConfig slackConfig = SlackProvider . SlackConfig . fromConfig ( config , servicename ) ; "<AssertPlaceHolder>" ; } username ( ) { return username ; }
|
org . junit . Assert . assertEquals ( servicename , slackConfig . username ( ) )
|
shouldNotFailIfAutoDiscoveryIsNotPossible ( ) { com . xebialabs . restito . semantics . Call call = mock ( com . xebialabs . restito . semantics . Call . class ) ; when ( call . getUri ( ) ) . thenReturn ( "/blablabla.xml" ) ; when ( call . getMethod ( ) ) . thenReturn ( Method . GET ) ; com . xebialabs . restito . semantics . ConditionWithApplicables condition = com . xebialabs . restito . semantics . Condition . post ( "/blablabla.xml" ) ; condition . getApplicables ( ) . get ( 0 ) . apply ( response ) ; "<AssertPlaceHolder>" ; } getPredicate ( ) { return predicate ; }
|
org . junit . Assert . assertFalse ( condition . getPredicate ( ) . test ( call ) )
|
shouldReturnContainerTemplateWhenParentIsNull ( ) { org . csanchez . jenkins . plugins . kubernetes . ContainerTemplate result = combine ( null , org . csanchez . jenkins . plugins . kubernetes . PodTemplateUtilsTest . JNLP_2 ) ; "<AssertPlaceHolder>" ; } combine ( org . csanchez . jenkins . plugins . kubernetes . ContainerTemplate$ContainerTemplate , org . csanchez . jenkins . plugins . kubernetes . ContainerTemplate$ContainerTemplate ) { com . google . common . base . Preconditions . checkNotNull ( template , "Container<sp>template<sp>should<sp>not<sp>be<sp>null" ) ; if ( parent == null ) { return template ; } java . lang . String name = template . getName ( ) ; java . lang . String image = ( com . google . common . base . Strings . isNullOrEmpty ( template . getImage ( ) ) ) ? parent . getImage ( ) : template . getImage ( ) ; boolean privileged = ( template . isPrivileged ( ) ) ? template . isPrivileged ( ) : parent . isPrivileged ( ) ? parent . isPrivileged ( ) : false ; boolean alwaysPullImage = ( template . isAlwaysPullImage ( ) ) ? template . isAlwaysPullImage ( ) : parent . isAlwaysPullImage ( ) ? parent . isAlwaysPullImage ( ) : false ; java . lang . String workingDir = ( com . google . common . base . Strings . isNullOrEmpty ( template . getWorkingDir ( ) ) ) ? com . google . common . base . Strings . isNullOrEmpty ( parent . getWorkingDir ( ) ) ? DEFAULT_WORKING_DIR : parent . getWorkingDir ( ) : template . getWorkingDir ( ) ; java . lang . String command = ( com . google . common . base . Strings . isNullOrEmpty ( template . getCommand ( ) ) ) ? parent . getCommand ( ) : template . getCommand ( ) ; java . lang . String args = ( com . google . common . base . Strings . isNullOrEmpty ( template . getArgs ( ) ) ) ? parent . getArgs ( ) : template . getArgs ( ) ; boolean ttyEnabled = ( template . isTtyEnabled ( ) ) ? template . isTtyEnabled ( ) : parent . isTtyEnabled ( ) ? parent . isTtyEnabled ( ) : false ; java . lang . String resourceRequestCpu = ( com . google . common . base . Strings . isNullOrEmpty ( template . getResourceRequestCpu ( ) ) ) ? parent . getResourceRequestCpu ( ) : template . getResourceRequestCpu ( ) ; java . lang . String resourceRequestMemory = ( com . google . common . base . Strings . isNullOrEmpty ( template . getResourceRequestMemory ( ) ) ) ? parent . getResourceRequestMemory ( ) : template . getResourceRequestMemory ( ) ; java . lang . String resourceLimitCpu = ( com . google . common . base . Strings . isNullOrEmpty ( template . getResourceLimitCpu ( ) ) ) ? parent . getResourceLimitCpu ( ) : template . getResourceLimitCpu ( ) ; java . lang . String resourceLimitMemory = ( com . google . common . base . Strings . isNullOrEmpty ( template . getResourceLimitMemory ( ) ) ) ? parent . getResourceLimitMemory ( ) : template . getResourceLimitMemory ( ) ; org . csanchez . jenkins . plugins . kubernetes . ContainerTemplate . ContainerTemplate combined = new org . csanchez . jenkins . plugins . kubernetes . ContainerTemplate . ContainerTemplate ( image ) ; combined . setName ( name ) ; combined . setImage ( image ) ; combined . setAlwaysPullImage ( alwaysPullImage ) ; combined . setCommand ( command ) ; combined . setArgs ( args ) ; combined . setTtyEnabled ( ttyEnabled ) ; combined . setResourceLimitCpu ( resourceLimitCpu ) ; combined . setResourceLimitMemory ( resourceLimitMemory ) ; combined . setResourceRequestCpu ( resourceRequestCpu ) ; combined . setResourceRequestMemory ( resourceRequestMemory ) ; combined . setWorkingDir ( workingDir ) ; combined . setPrivileged ( privileged ) ; combined . setEnvVars ( org . csanchez . jenkins . plugins . kubernetes . PodTemplateUtils . combineEnvVars ( parent , template ) ) ; return combined ; }
|
org . junit . Assert . assertEquals ( result , org . csanchez . jenkins . plugins . kubernetes . PodTemplateUtilsTest . JNLP_2 )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.