input stringlengths 28 18.7k | output stringlengths 39 1.69k |
|---|---|
testCopyConstructor ( ) { edu . illinois . library . cantaloupe . image . Rectangle other = new edu . illinois . library . cantaloupe . image . Rectangle ( instance ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertEquals ( other , instance ) |
testSerialization ( ) { org . jfree . chart . title . DateTitle t1 = new org . jfree . chart . title . DateTitle ( ) ; org . jfree . chart . title . DateTitle t2 = ( ( org . jfree . chart . title . DateTitle ) ( org . jfree . chart . TestUtils . serialised ( t1 ) ) ) ; "<AssertPlaceHolder>" ; } serialised ( java . lang . Object ) { java . lang . Object result = null ; java . io . ByteArrayOutputStream buffer = new java . io . ByteArrayOutputStream ( ) ; java . io . ObjectOutput out ; try { out = new java . io . ObjectOutputStream ( buffer ) ; out . writeObject ( original ) ; out . close ( ) ; java . io . ObjectInput in = new java . io . ObjectInputStream ( new java . io . ByteArrayInputStream ( buffer . toByteArray ( ) ) ) ; result = in . readObject ( ) ; in . close ( ) ; } catch ( java . io . IOException e ) { throw new java . lang . RuntimeException ( e ) ; } catch ( java . lang . ClassNotFoundException e ) { throw new java . lang . RuntimeException ( e ) ; } return result ; } | org . junit . Assert . assertEquals ( t1 , t2 ) |
testIsRegularFileOnRegularFile_shouldReturnTrue ( ) { writeToCache ( "/test_file.txt" ) ; org . eclipse . jgit . lib . AnyObjectId rootTree = commitToMaster ( ) . getTree ( ) ; "<AssertPlaceHolder>" ; } isFile ( java . lang . String , com . beijunyi . parallelgit . utils . AnyObjectId , com . beijunyi . parallelgit . utils . ObjectReader ) { try ( org . eclipse . jgit . treewalk . TreeWalk tw = com . beijunyi . parallelgit . utils . TreeUtils . forPath ( path , tree , reader ) ) { return ( tw != null ) && ( com . beijunyi . parallelgit . utils . TreeUtils . isFile ( tw ) ) ; } } | org . junit . Assert . assertTrue ( com . beijunyi . parallelgit . utils . TreeUtils . isFile ( "/test_file.txt" , rootTree , repo ) ) |
testTypeRefHolderWrapsTYpeRefAfterSettingTypeRefHolder ( ) { final org . kie . workbench . common . dmn . api . property . dmn . QName typeRef = informationItem . getTypeRef ( ) ; informationItem . setTypeRefHolder ( new org . kie . workbench . common . dmn . api . property . dmn . QNameHolder ( ) ) ; "<AssertPlaceHolder>" ; } getTypeRefHolder ( ) { return typeRefHolder ; } | org . junit . Assert . assertEquals ( typeRef , informationItem . getTypeRefHolder ( ) . getValue ( ) ) |
testSaveAddURI ( ) { readConfig ( ( "[remote<sp>\"spearce\"]\n" + ( "url<sp>=<sp>http://www.spearce.org/egit.git\n" + "fetch<sp>=<sp>+refs/heads/*:refs/remotes/spearce/*\n" ) ) ) ; final org . eclipse . jgit . transport . RemoteConfig rc = new org . eclipse . jgit . transport . RemoteConfig ( config , "spearce" ) ; rc . addURI ( new org . eclipse . jgit . transport . URIish ( "/some/dir" ) ) ; "<AssertPlaceHolder>" ; rc . update ( config ) ; checkConfig ( ( "[remote<sp>\"spearce\"]\n" + ( ( "\turl<sp>=<sp>http://www.spearce.org/egit.git\n" + "\turl<sp>=<sp>/some/dir\n" ) + "\tfetch<sp>=<sp>+refs/heads/*:refs/remotes/spearce/*\n" ) ) ) ; } getURIs ( ) { return java . util . Collections . unmodifiableList ( uris ) ; } | org . junit . Assert . assertEquals ( 2 , rc . getURIs ( ) . size ( ) ) |
testFirstHandlerEmptyPipeline ( ) { io . netty . channel . ChannelPipeline pipeline = new io . netty . channel . local . LocalChannel ( ) . pipeline ( ) ; "<AssertPlaceHolder>" ; } first ( ) { io . netty . channel . ChannelHandlerContext first = firstContext ( ) ; if ( first == null ) { return null ; } return first . handler ( ) ; } | org . junit . Assert . assertNull ( pipeline . first ( ) ) |
testSetVariableMapper ( ) { javax . el . VariableMapper variableMapper = createMock ( javax . el . VariableMapper . class ) ; replay ( resolver , variableMapper ) ; context . setVariableMapper ( variableMapper ) ; "<AssertPlaceHolder>" ; verify ( resolver , variableMapper ) ; } getVariableMapper ( ) { if ( ( this . variableMapper ) == null ) { this . variableMapper = new org . apache . tiles . el . ELContextImpl . VariableMapperImpl ( ) ; } return this . variableMapper ; } | org . junit . Assert . assertEquals ( variableMapper , context . getVariableMapper ( ) ) |
testRegisterObjUserInfoFieldAttribute ( ) { com . j256 . simplejmx . server . JmxServerTest . RandomObject obj = new com . j256 . simplejmx . server . JmxServerTest . RandomObject ( ) ; javax . management . ObjectName objectName = com . j256 . simplejmx . common . ObjectNameUtil . makeObjectName ( com . j256 . simplejmx . server . JmxServerTest . DOMAIN_NAME , com . j256 . simplejmx . server . JmxServerTest . OBJECT_NAME ) ; com . j256 . simplejmx . client . JmxClient client = null ; try { com . j256 . simplejmx . server . JmxServerTest . server . register ( obj , objectName , new com . j256 . simplejmx . common . JmxAttributeFieldInfo [ ] { new com . j256 . simplejmx . common . JmxAttributeFieldInfo ( "foo" , true , false , "description" ) } , null , null ) ; client = new com . j256 . simplejmx . client . JmxClient ( com . j256 . simplejmx . server . JmxServerTest . serverAddress , com . j256 . simplejmx . server . JmxServerTest . DEFAULT_PORT ) ; int val = 4232431 ; obj . setFoo ( val ) ; "<AssertPlaceHolder>" ; try { client . setAttribute ( com . j256 . simplejmx . server . JmxServerTest . DOMAIN_NAME , com . j256 . simplejmx . server . JmxServerTest . OBJECT_NAME , "foo" , 1 ) ; org . junit . Assert . fail ( "Expected<sp>this<sp>to<sp>throw" ) ; } catch ( javax . management . JMException e ) { } } finally { com . j256 . simplejmx . common . IoUtils . closeQuietly ( client ) ; com . j256 . simplejmx . server . JmxServerTest . server . unregister ( objectName ) ; } } getAttribute ( java . lang . String , java . lang . String , java . lang . String ) { return getAttribute ( com . j256 . simplejmx . common . ObjectNameUtil . makeObjectName ( domain , beanName ) , attributeName ) ; } | org . junit . Assert . assertEquals ( val , client . getAttribute ( com . j256 . simplejmx . server . JmxServerTest . DOMAIN_NAME , com . j256 . simplejmx . server . JmxServerTest . OBJECT_NAME , "foo" ) ) |
file_is_regular_file_nio ( ) { java . nio . file . attribute . BasicFileAttributes attr = java . nio . file . Files . readAttributes ( source , java . nio . file . attribute . BasicFileAttributes . class ) ; boolean isRegularFileWithOpaqueContent = attr . isRegularFile ( ) ; "<AssertPlaceHolder>" ; } | org . junit . Assert . assertTrue ( isRegularFileWithOpaqueContent ) |
test ( ) { java . lang . String testString = "siouefiuhghd<sp>rghdriguh" ; rice . environment . Environment envA = new rice . environment . Environment ( ) ; rice . p2p . commonapi . IdFactory idfA = new rice . pastry . commonapi . PastryIdFactory ( envA ) ; rice . p2p . commonapi . Id a = idfA . buildId ( testString ) ; System . out . println ( ( "ID:<sp>" + a ) ) ; for ( int i = 0 ; i < 50 ; i ++ ) { rice . environment . Environment envB = new rice . environment . Environment ( ) ; rice . p2p . commonapi . IdFactory idfB = new rice . pastry . commonapi . PastryIdFactory ( envB ) ; rice . p2p . commonapi . Id b = idfB . buildId ( testString ) ; "<AssertPlaceHolder>" ; } } | org . junit . Assert . assertEquals ( a , b ) |
testRead ( ) { @ org . jetbrains . annotations . NotNull net . openhft . chronicle . wire . Wire wire = createWire ( ) ; wire . write ( ) ; wire . write ( net . openhft . chronicle . wire . TextWireTest . BWKey . field1 ) ; wire . write ( ( ) -> "Test" ) ; wire . read ( ) ; wire . read ( ) ; wire . read ( ) ; "<AssertPlaceHolder>" ; wire . read ( ) ; } read ( ) { readField ( acquireStringBuilder ( ) , null , net . openhft . chronicle . wire . BinaryWire . AnyCodeMatch . ANY_CODE_MATCH . code ( ) ) ; return ( bytes . readRemaining ( ) ) <= 0 ? acquireDefaultValueIn ( ) : valueIn ; } | org . junit . Assert . assertEquals ( 1 , bytes . readRemaining ( ) ) |
shouldValidateContractorEmail ( ) { when ( contractorService . getContractorByCode ( org . mockito . Matchers . anyString ( ) ) ) . thenReturn ( null ) ; contractorHelper . setEmail ( "Ritesh@gmail<sp>!#$%^&" ) ; errors = externalContractorService . validateContactorToCreate ( contractorHelper ) ; "<AssertPlaceHolder>" ; } size ( ) { return messages . size ( ) ; } | org . junit . Assert . assertEquals ( 1 , errors . size ( ) ) |
testComputeSuccessorHierarchy ( ) { com . google . devtools . depan . model . GraphNode [ ] nodeArray = com . google . devtools . depan . test . TestUtils . buildNodes ( 1 ) ; com . google . devtools . depan . model . GraphNode node = nodeArray [ 0 ] ; com . google . devtools . depan . model . GraphEdge edge = new com . google . devtools . depan . model . GraphEdge ( node , node , com . google . devtools . depan . test . TestUtils . RELATION ) ; java . util . Set < com . google . devtools . depan . graph . basic . BasicEdge < ? extends java . lang . String > > edges = com . google . common . collect . Sets . newHashSet ( ) ; edges . add ( ( ( com . google . devtools . depan . graph . basic . BasicEdge < ? extends java . lang . String > ) ( edge ) ) ) ; com . google . devtools . depan . model . GraphModel test = com . google . devtools . depan . test . TestUtils . buildGraphModel ( nodeArray , edges ) ; java . util . Map < com . google . devtools . depan . model . GraphNode , ? extends com . google . devtools . depan . nodes . trees . SuccessorEdges > result = com . google . devtools . depan . nodes . trees . Trees . computeSpanningHierarchy ( test , TestUtils . FORWARD ) ; "<AssertPlaceHolder>" ; } computeSpanningHierarchy ( com . google . devtools . depan . model . GraphModel , com . google . devtools . depan . graph . api . EdgeMatcher ) { com . google . devtools . depan . nodes . trees . SuccessorsMap builder = new com . google . devtools . depan . nodes . trees . SuccessorsMap ( ) ; java . util . Set < com . google . devtools . depan . model . GraphNode > visited = com . google . common . collect . Sets . newHashSet ( ) ; for ( com . google . devtools . depan . model . GraphEdge edge : model . getEdges ( ) ) { if ( ( edge . getHead ( ) ) == ( edge . getTail ( ) ) ) { continue ; } if ( edgeMatcher . edgeForward ( edge ) ) { if ( false == ( visited . contains ( edge . getTail ( ) ) ) ) { builder . addForwardEdge ( edge ) ; visited . add ( edge . getTail ( ) ) ; } continue ; } if ( edgeMatcher . edgeReverse ( edge ) ) { if ( false == ( visited . contains ( edge . getHead ( ) ) ) ) { builder . addReverseEdge ( edge ) ; visited . add ( edge . getHead ( ) ) ; } continue ; } } return builder . getSuccessorMap ( ) ; } | org . junit . Assert . assertEquals ( 0 , result . size ( ) ) |
testMemoryStateBackendDefaultsToAsync ( ) { org . apache . flink . runtime . state . memory . MemoryStateBackend backend = new org . apache . flink . runtime . state . memory . MemoryStateBackend ( ) ; "<AssertPlaceHolder>" ; validateSupportForAsyncSnapshots ( backend ) ; } isUsingAsynchronousSnapshots ( ) { return asynchronousSnapshots . getOrDefault ( CheckpointingOptions . ASYNC_SNAPSHOTS . defaultValue ( ) ) ; } | org . junit . Assert . assertTrue ( backend . isUsingAsynchronousSnapshots ( ) ) |
testSendMessagesIncludeMethods ( ) { target . field = "value" ; info . novatec . testit . livingdoc . reflect . Message send = fixture . send ( "methodReturningField" ) ; "<AssertPlaceHolder>" ; } send ( java . lang . String [ ] ) { return answerFrom ( answer ) ; } | org . junit . Assert . assertEquals ( target . field , send . send ( ) ) |
convertSimpleMakeTripFromYAWLToEPML ( ) { org . apromore . service . model . CanonisedProcess oFCanonised = canoniseYAWLModel ( "YAWL_models/SimpleMakeTripProcess.yawl" , null ) ; org . apromore . service . model . DecanonisedProcess decanonisedEPML = cSrv . deCanonise ( "EPML<sp>2.0" , oFCanonised . getCpt ( ) , null , new java . util . HashSet < org . apromore . plugin . property . RequestParameterType < ? > > ( ) ) ; "<AssertPlaceHolder>" ; if ( org . apromore . service . impl . CanoniserServiceImplIntgTest . LOGGER . isDebugEnabled ( ) ) { saveDecanonisedProcess ( decanonisedEPML , "SimpleMakeTrip.epml" ) ; } } getCpt ( ) { return cpt ; } | org . junit . Assert . assertNotNull ( decanonisedEPML ) |
test_getParentItem ( ) { org . eclipse . swt . widgets . TreeItem tItem = new org . eclipse . swt . widgets . TreeItem ( treeItem , org . eclipse . swt . SWT . NULL ) ; "<AssertPlaceHolder>" ; } getParentItem ( ) { return parentItem ; } | org . junit . Assert . assertEquals ( treeItem , tItem . getParentItem ( ) ) |
setStateOrProvince ( ) { org . digidoc4j . SignatureProductionPlace signatureProductionPlace = new org . digidoc4j . SignatureProductionPlace ( ) ; signatureProductionPlace . setStateOrProvince ( "StateOrProvince" ) ; "<AssertPlaceHolder>" ; } getStateOrProvince ( ) { return m_state ; } | org . junit . Assert . assertEquals ( "StateOrProvince" , signatureProductionPlace . getStateOrProvince ( ) ) |
testUpdateVtapNetworkWithoutModifyOperation ( ) { expect ( mockVtapService . updateVtapNetwork ( anyObject ( ) ) ) . andReturn ( vtapNetwork ) . once ( ) ; replay ( mockVtapService ) ; final javax . ws . rs . client . WebTarget wt = target ( ) ; java . io . InputStream jsonStream = org . onosproject . openstackvtap . web . OpenstackVtapNetworkWebResourceTest . class . getResourceAsStream ( "openstack-vtap-config.json" ) ; javax . ws . rs . core . Response response = wt . path ( org . onosproject . openstackvtap . web . OpenstackVtapNetworkWebResourceTest . PATH ) . request ( MediaType . APPLICATION_JSON_TYPE ) . put ( javax . ws . rs . client . Entity . json ( jsonStream ) ) ; final int status = response . getStatus ( ) ; "<AssertPlaceHolder>" ; verify ( mockVtapService ) ; } is ( java . lang . Class ) { return true ; } | org . junit . Assert . assertThat ( status , org . hamcrest . Matchers . is ( 200 ) ) |
testParseScriptCfcCrazy ( ) { java . lang . String path = "" ; try { path = new java . net . URL ( "file:src/test/resources/cfml/ScriptComponentCrazy.cfc" ) . getPath ( ) ; } catch ( java . net . MalformedURLException e ) { e . printStackTrace ( ) ; } cfml . parsing . cfscript . script . CFScriptStatement scriptStatement = null ; try { scriptStatement = fCfmlParser . parseScriptFile ( path ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( ( "whoops!<sp>" + ( e . getMessage ( ) ) ) ) ; } if ( ( fCfmlParser . getMessages ( ) . size ( ) ) > 0 ) { org . junit . Assert . fail ( ( "whoops!<sp>" + ( fCfmlParser . getMessages ( ) ) ) ) ; } System . out . println ( scriptStatement . toString ( ) ) ; "<AssertPlaceHolder>" ; } toString ( ) { return "" ; } | org . junit . Assert . assertNotNull ( scriptStatement ) |
testDMNbasic ( ) { org . kie . dmn . api . core . DMNRuntime runtime = createKieDMNRuntime ( org . kie . karaf . itest . KieDMNKarafIntegrationTest . SIMPLE_DMN_FILE ) ; "<AssertPlaceHolder>" ; } getModels ( ) { org . kie . server . remote . rest . prometheus . MetricsResource . logger . trace ( "Prometheus<sp>is<sp>scraping" ) ; java . util . Enumeration < io . prometheus . client . Collector . MetricFamilySamples > mfs = org . kie . server . remote . rest . prometheus . MetricsResource . prometheusRegistry . metricFamilySamples ( ) ; javax . ws . rs . core . StreamingOutput stream = ( os ) -> { java . io . Writer writer = new java . io . BufferedWriter ( new java . io . OutputStreamWriter ( os ) ) ; io . prometheus . client . exporter . common . TextFormat . write004 ( writer , mfs ) ; writer . flush ( ) ; } ; return javax . ws . rs . core . Response . ok ( stream ) . build ( ) ; } | org . junit . Assert . assertTrue ( ( ( runtime . getModels ( ) . size ( ) ) > 0 ) ) |
testDescriptorIdentifierExistsInOntology ( ) { org . openscience . cdk . dict . Entry ontologyEntry = org . openscience . cdk . qsar . descriptors . molecular . MolecularDescriptorTest . dict . getEntry ( descriptor . getSpecification ( ) . getSpecificationReference ( ) . substring ( org . openscience . cdk . qsar . descriptors . molecular . MolecularDescriptorTest . dict . getNS ( ) . length ( ) ) . toLowerCase ( ) ) ; "<AssertPlaceHolder>" ; } length ( ) { double value = 0 ; for ( int i = 0 ; i < ( size ) ; i ++ ) value += ( vector [ i ] ) * ( vector [ i ] ) ; return java . lang . Math . sqrt ( value ) ; } | org . junit . Assert . assertNotNull ( ontologyEntry ) |
testProcessUrlNoProcessors ( ) { compositeRequestDataValueProcessor = new org . terasoluna . gfw . web . mvc . support . CompositeRequestDataValueProcessor ( ) ; java . lang . String result = compositeRequestDataValueProcessor . processUrl ( request , "http://localhost:8080/test" ) ; "<AssertPlaceHolder>" ; } processUrl ( javax . servlet . http . HttpServletRequest , java . lang . String ) { return url ; } | org . junit . Assert . assertThat ( result , org . hamcrest . core . Is . is ( "http://localhost:8080/test" ) ) |
testBooleanObj ( ) { java . lang . Class < com . j256 . ormlite . field . types . BooleanObjectTypeTest . LocalBooleanObj > clazz = com . j256 . ormlite . field . types . BooleanObjectTypeTest . LocalBooleanObj . class ; com . j256 . ormlite . dao . Dao < com . j256 . ormlite . field . types . BooleanObjectTypeTest . LocalBooleanObj , java . lang . Object > dao = createDao ( clazz , true ) ; java . lang . Boolean val = true ; java . lang . String valStr = val . toString ( ) ; com . j256 . ormlite . field . types . BooleanObjectTypeTest . LocalBooleanObj foo = new com . j256 . ormlite . field . types . BooleanObjectTypeTest . LocalBooleanObj ( ) ; foo . bool = val ; "<AssertPlaceHolder>" ; testType ( dao , foo , clazz , val , val , val , valStr , DataType . BOOLEAN_OBJ , com . j256 . ormlite . field . types . BooleanObjectTypeTest . BOOLEAN_COLUMN , false , false , false , false , 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 ) ) |
condition4Test ( ) { java . lang . String expression = "(true<sp>and<sp>false)<sp>or<sp>true" ; analyze . condition . Condition condition = new analyze . condition . Condition ( expression ) ; "<AssertPlaceHolder>" ; } evaluateWithRecord ( model . Record ) { try { model . datafield . DataField result = expression . evaluate ( record ) ; try { return result . getBooleanValue ( ) ; } catch ( model . UnsupportedFormatException e ) { throw new analyze . condition . ConditionParseException ( "Expression<sp>does<sp>not<sp>result<sp>in<sp>a<sp>boolean" ) ; } } catch ( model . UnsupportedFormatException e ) { return false ; } } | org . junit . Assert . assertEquals ( true , condition . evaluateWithRecord ( null ) ) |
testMongoMatchQuery ( ) { org . eclipse . rdf4j . query . parser . sparql . SPARQLParser parser = new org . eclipse . rdf4j . query . parser . sparql . SPARQLParser ( ) ; org . eclipse . rdf4j . query . parser . ParsedQuery pq = parser . parseQuery ( query , null ) ; org . eclipse . rdf4j . query . algebra . TupleExpr te = pq . getTupleExpr ( ) ; System . out . println ( ( "Parametrized<sp>query<sp>is<sp>:<sp>" + te ) ) ; mongoOptimizer . optimize ( te , null , null ) ; System . out . println ( ( "Result<sp>of<sp>optimization<sp>is<sp>:<sp>" + te ) ) ; "<AssertPlaceHolder>" ; } getMetadataNodes ( org . eclipse . rdf4j . query . algebra . TupleExpr ) { org . apache . rya . indexing . statement . metadata . StatementMetadataTestUtils . MetadataNodeCollector collector = new org . apache . rya . indexing . statement . metadata . StatementMetadataTestUtils . MetadataNodeCollector ( ) ; query . visit ( collector ) ; return collector . getNodes ( ) ; } | org . junit . Assert . assertEquals ( expected , org . apache . rya . indexing . statement . metadata . StatementMetadataTestUtils . getMetadataNodes ( te ) ) |
testProtocolFactory ( ) { org . apache . thrift . protocol . TProtocolFactory tProtocolFactory = mock ( org . apache . thrift . protocol . TProtocolFactory . class ) ; org . apache . thrift . transport . TTransport transport = mock ( org . apache . thrift . transport . TTransport . class ) ; org . apache . thrift . protocol . TProtocol protocol = mock ( org . apache . thrift . protocol . TProtocol . class ) ; when ( tProtocolFactory . getProtocol ( transport ) ) . thenReturn ( protocol ) ; com . workiva . frugal . protocol . FProtocolFactory fProtocolFactory = new com . workiva . frugal . protocol . FProtocolFactory ( tProtocolFactory ) ; com . workiva . frugal . protocol . FProtocol fProtocol = fProtocolFactory . getProtocol ( transport ) ; "<AssertPlaceHolder>" ; } getTransport ( ) { return transport ; } | org . junit . Assert . assertEquals ( protocol . getTransport ( ) , fProtocol . getTransport ( ) ) |
basicToArray ( ) { cowaList . add ( 1 ) ; java . lang . Object [ ] result = cowaList . toArray ( ) ; "<AssertPlaceHolder>" ; } toArray ( ) { refreshCopyIfNecessary ( ) ; return ourCopy ; } | org . junit . Assert . assertArrayEquals ( new java . lang . Integer [ ] { 1 } , result ) |
testNullIfNoMatch ( ) { "<AssertPlaceHolder>" ; } getDetermineVersionFromString ( java . lang . String ) { for ( org . asteriskjava . AsteriskVersion version : org . asteriskjava . AsteriskVersion . knownVersions ) { for ( java . util . regex . Pattern pattern : version . patterns ) { if ( pattern . matcher ( coreLine ) . matches ( ) ) { return version ; } } } return null ; } | org . junit . Assert . assertNull ( org . asteriskjava . AsteriskVersion . getDetermineVersionFromString ( "" ) ) |
correctnessOfRecursiveBoundedWildcardTypeVariable ( ) { java . lang . reflect . Field field = nl . jqno . equalsverifier . internal . prefabvalues . TypeTagTest . RecursiveBoundedWildcardTypeVariable . class . getDeclaredField ( "fieldWithBoundedTypeVariable" ) ; nl . jqno . equalsverifier . internal . prefabvalues . TypeTag expected = new nl . jqno . equalsverifier . internal . prefabvalues . TypeTag ( nl . jqno . equalsverifier . internal . prefabvalues . Comparable . class , new nl . jqno . equalsverifier . internal . prefabvalues . TypeTag ( java . lang . Object . class ) ) ; nl . jqno . equalsverifier . internal . prefabvalues . TypeTag actual = nl . jqno . equalsverifier . internal . prefabvalues . TypeTag . of ( field , TypeTag . NULL ) ; "<AssertPlaceHolder>" ; } of ( nl . jqno . equalsverifier . internal . prefabvalues . Field , nl . jqno . equalsverifier . internal . prefabvalues . TypeTag ) { return nl . jqno . equalsverifier . internal . prefabvalues . TypeTag . resolve ( field . getGenericType ( ) , enclosingType , false ) ; } | org . junit . Assert . assertEquals ( expected , actual ) |
testIsEnhancedAlwaysTrueAsTiered ( ) { "<AssertPlaceHolder>" ; } isEnhanced ( ) { return true ; } | org . junit . Assert . assertTrue ( service . isEnhanced ( ) ) |
listIndex ( ) { org . springframework . data . rest . webmvc . json . patch . SpelPath . UntypedSpelPath expr = org . springframework . data . rest . webmvc . json . patch . SpelPath . untyped ( "/1/description" ) ; java . util . List < org . springframework . data . rest . webmvc . json . patch . Todo > todos = new java . util . ArrayList < org . springframework . data . rest . webmvc . json . patch . Todo > ( ) ; todos . add ( new org . springframework . data . rest . webmvc . json . patch . Todo ( 1L , "A" , false ) ) ; todos . add ( new org . springframework . data . rest . webmvc . json . patch . Todo ( 2L , "B" , false ) ) ; todos . add ( new org . springframework . data . rest . webmvc . json . patch . Todo ( 3L , "C" , false ) ) ; "<AssertPlaceHolder>" ; } bindTo ( java . lang . Class ) { org . springframework . util . Assert . notNull ( type , "Type<sp>must<sp>not<sp>be<sp>null!" ) ; return org . springframework . data . rest . webmvc . json . patch . SpelPath . TypedSpelPath . of ( this , type ) ; } | org . junit . Assert . assertEquals ( "B" , expr . bindTo ( org . springframework . data . rest . webmvc . json . patch . Todo . class ) . getValue ( todos ) ) |
whenGetMonth_thenCorrectMonth ( ) { int actualMonth = localDateExtractYearMonthDayIntegerValues . getMonth ( localDate ) ; "<AssertPlaceHolder>" ; } getMonth ( java . time . LocalDate ) { return localDate . getMonthValue ( ) ; } | org . junit . Assert . assertThat ( actualMonth , org . hamcrest . CoreMatchers . is ( 12 ) ) |
testHello ( ) { hello . HelloWorld hello = new hello . HelloWorld ( ) ; "<AssertPlaceHolder>" ; } sayHello ( ) { return "Hello,<sp>World!" ; } | org . junit . Assert . assertEquals ( "Hello,<sp>World!" , hello . sayHello ( ) ) |
testJmsSessionIdFromJmsConnectionId ( ) { org . apache . qpid . jms . meta . JmsSessionId id1 = new org . apache . qpid . jms . meta . JmsSessionId ( firstId , 1 ) ; org . apache . qpid . jms . meta . JmsSessionId id2 = new org . apache . qpid . jms . meta . JmsSessionId ( secondId , 1 ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; } | org . junit . Assert . assertSame ( id1 . getValue ( ) , id2 . getValue ( ) ) |
testEquals_differentLow ( ) { com . sumzerotrading . data . BarData [ ] bars = getEqualBars ( ) ; bars [ 0 ] . setLow ( BigDecimal . ZERO ) ; "<AssertPlaceHolder>" ; } getEqualBars ( ) { java . time . LocalDateTime cal = java . time . LocalDateTime . now ( ) ; java . math . BigDecimal open = new java . math . BigDecimal ( 1 ) ; java . math . BigDecimal high = new java . math . BigDecimal ( 2 ) ; java . math . BigDecimal low = new java . math . BigDecimal ( 3 ) ; java . math . BigDecimal close = new java . math . BigDecimal ( 4 ) ; java . math . BigDecimal volume = new java . math . BigDecimal ( 5 ) ; long openInterest = 6 ; com . sumzerotrading . data . BarData [ ] bars = new com . sumzerotrading . data . BarData [ 2 ] ; bars [ 0 ] = new com . sumzerotrading . data . BarData ( cal , open , high , low , close , volume , openInterest ) ; bars [ 1 ] = new com . sumzerotrading . data . BarData ( cal , open , high , low , close , volume , openInterest ) ; return bars ; } | org . junit . Assert . assertFalse ( bars [ 0 ] . equals ( bars [ 1 ] ) ) |
canSeedWithCurrentDateTime ( ) { long currentSeed = java . lang . System . currentTimeMillis ( ) ; System . out . println ( ( "seed<sp>used:<sp>" + currentSeed ) ) ; com . javafortesters . chap016random . examples . Random generate = new com . javafortesters . chap016random . examples . Random ( currentSeed ) ; int prevInt = generate . nextInt ( ) ; System . out . println ( generate . nextInt ( ) ) ; com . javafortesters . chap016random . examples . Random generateAgain = new com . javafortesters . chap016random . examples . Random ( currentSeed ) ; "<AssertPlaceHolder>" ; } currentTimeMillis ( ) { long startTime = java . lang . System . currentTimeMillis ( ) ; for ( int x = 0 ; x < 10 ; x ++ ) { System . out . println ( ( "Current<sp>Time<sp>" + ( java . lang . System . currentTimeMillis ( ) ) ) ) ; } long endTime = java . lang . System . currentTimeMillis ( ) ; System . out . println ( ( "Total<sp>Time<sp>" + ( endTime - startTime ) ) ) ; } | org . junit . Assert . assertThat ( generateAgain . nextInt ( ) , org . hamcrest . CoreMatchers . is ( prevInt ) ) |
shouldNotFindUpdatedNodeInIndexSeek ( ) { boolean needsValues = false ; int label = token . nodeLabel ( "Node" ) ; int prop = token . propertyKey ( "prop" ) ; org . neo4j . internal . kernel . api . IndexReference index = schemaRead . index ( label , prop ) ; try ( org . neo4j . graphdb . org . neo4j . internal . kernel . api . Transaction tx = org . neo4j . internal . kernel . api . NodeValueIndexCursorTestBase . beginTransaction ( ) ; org . neo4j . internal . kernel . api . NodeValueIndexCursor node = cursors . allocateNodeValueIndexCursor ( ) ) { tx . dataWrite ( ) . nodeSetProperty ( org . neo4j . internal . kernel . api . NodeValueIndexCursorTestBase . strOne , prop , org . neo4j . internal . kernel . api . NodeValueIndexCursorTestBase . stringValue ( "ett" ) ) ; tx . dataRead ( ) . nodeIndexSeek ( index , node , IndexOrder . NONE , needsValues , org . neo4j . internal . kernel . api . IndexQuery . exact ( prop , "one" ) ) ; "<AssertPlaceHolder>" ; } } next ( ) { return entries . next ( ) ; } | org . junit . Assert . assertFalse ( node . next ( ) ) |
isBlazeDSInLCDSEnvironment ( ) { "<AssertPlaceHolder>" ; } isBlazeDS ( ) { return ! ( org . springframework . flex . config . RuntimeEnvironment . IS_LCDS_ENVIRONMENT ) ; } | org . junit . Assert . assertFalse ( org . springframework . flex . config . RuntimeEnvironment . isBlazeDS ( ) ) |
testFromJSONWithString ( ) { java . lang . String json = instance . toJSON ( ) ; edu . illinois . library . cantaloupe . image . Info info = edu . illinois . library . cantaloupe . image . Info . fromJSON ( json ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( getVerb ( ) ) + "<sp>" ) + ( edu . illinois . library . cantaloupe . resource . api . APITask . getUUID ( ) ) ; } | org . junit . Assert . assertEquals ( info . toString ( ) , instance . toString ( ) ) |
testGenerateBusinessObjectDataDdlLatestAfterPartitionValue ( ) { businessObjectDataServiceTestHelper . createDatabaseEntitiesForBusinessObjectDataDdlTesting ( org . finra . herd . service . PARTITION_VALUE_2 ) ; for ( java . lang . String lowerBoundPartitionValue : java . util . Arrays . asList ( org . finra . herd . service . PARTITION_VALUE , org . finra . herd . service . PARTITION_VALUE_2 ) ) { org . finra . herd . model . api . xml . BusinessObjectDataDdl resultBusinessObjectDataDdl = businessObjectDataService . generateBusinessObjectDataDdl ( new org . finra . herd . model . api . xml . BusinessObjectDataDdlRequest ( NAMESPACE , BDEF_NAME , FORMAT_USAGE_CODE , org . finra . herd . model . jpa . FileTypeEntity . TXT_FILE_TYPE , FORMAT_VERSION , java . util . Arrays . asList ( new org . finra . herd . model . api . xml . PartitionValueFilter ( FIRST_PARTITION_COLUMN_NAME , NO_PARTITION_VALUES , NO_PARTITION_VALUE_RANGE , NO_LATEST_BEFORE_PARTITION_VALUE , new org . finra . herd . model . api . xml . LatestAfterPartitionValue ( lowerBoundPartitionValue ) ) ) , NO_STANDALONE_PARTITION_VALUE_FILTER , DATA_VERSION , NO_STORAGE_NAMES , STORAGE_NAME , org . finra . herd . model . api . xml . BusinessObjectDataDdlOutputFormatEnum . HIVE_13_DDL , TABLE_NAME , NO_CUSTOM_DDL_NAME , INCLUDE_DROP_TABLE_STATEMENT , INCLUDE_IF_NOT_EXISTS_OPTION , INCLUDE_DROP_PARTITIONS , NO_ALLOW_MISSING_DATA , NO_INCLUDE_ALL_REGISTERED_SUBPARTITIONS , NO_SUPPRESS_SCAN_FOR_UNREGISTERED_SUBPARTITIONS ) ) ; "<AssertPlaceHolder>" ; } } getExpectedBusinessObjectDataDdl ( java . lang . String ) { return getExpectedBusinessObjectDataDdl ( partitionValue , partitionValue ) ; } | org . junit . Assert . assertEquals ( new org . finra . herd . model . api . xml . BusinessObjectDataDdl ( NAMESPACE , BDEF_NAME , FORMAT_USAGE_CODE , org . finra . herd . model . jpa . FileTypeEntity . TXT_FILE_TYPE , FORMAT_VERSION , java . util . Arrays . asList ( new org . finra . herd . model . api . xml . PartitionValueFilter ( FIRST_PARTITION_COLUMN_NAME , NO_PARTITION_VALUES , NO_PARTITION_VALUE_RANGE , NO_LATEST_BEFORE_PARTITION_VALUE , new org . finra . herd . model . api . xml . LatestAfterPartitionValue ( lowerBoundPartitionValue ) ) ) , NO_STANDALONE_PARTITION_VALUE_FILTER , DATA_VERSION , NO_STORAGE_NAMES , STORAGE_NAME , org . finra . herd . model . api . xml . BusinessObjectDataDdlOutputFormatEnum . HIVE_13_DDL , TABLE_NAME , NO_CUSTOM_DDL_NAME , businessObjectDataServiceTestHelper . getExpectedBusinessObjectDataDdl ( org . finra . herd . service . PARTITION_VALUE_2 ) ) , resultBusinessObjectDataDdl ) |
testReplaceIndex0 ( ) { org . antlr . v4 . tool . LexerGrammar g = new org . antlr . v4 . tool . LexerGrammar ( ( "lexer<sp>grammar<sp>T;\n" + ( ( "A<sp>:<sp>\'a\';\n" + "B<sp>:<sp>\'b\';\n" ) + "C<sp>:<sp>\'c\';\n" ) ) ) ; java . lang . String input = "abc" ; org . antlr . v4 . runtime . LexerInterpreter lexEngine = g . createLexerInterpreter ( new org . antlr . v4 . runtime . ANTLRInputStream ( input ) ) ; org . antlr . v4 . runtime . CommonTokenStream stream = new org . antlr . v4 . runtime . CommonTokenStream ( lexEngine ) ; stream . fill ( ) ; org . antlr . v4 . runtime . TokenStreamRewriter tokens = new org . antlr . v4 . runtime . TokenStreamRewriter ( stream ) ; tokens . replace ( 0 , "x" ) ; java . lang . String result = tokens . getText ( ) ; java . lang . String expecting = "xbc" ; "<AssertPlaceHolder>" ; } getText ( ) { return delegate . getText ( ) ; } | org . junit . Assert . assertEquals ( expecting , result ) |
testRemoveSchema2 ( ) { java . lang . String sql = "update<sp>testx.test<sp>set<sp>name=\'abcd<sp>\\\'<sp>testx.aa\'<sp>where<sp>id=1" ; java . lang . String sqltrue = "update<sp>test<sp>set<sp>name=\'abcd<sp>\\\'<sp>testx.aa\'<sp>where<sp>id=1" ; java . lang . String sqlnew = io . mycat . route . util . RouterUtil . removeSchema ( sql , "testx" ) ; "<AssertPlaceHolder>" ; } removeSchema ( java . lang . String , java . lang . String ) { final java . lang . String upStmt = stmt . toUpperCase ( ) ; final java . lang . String upSchema = ( schema . toUpperCase ( ) ) + "." ; int strtPos = 0 ; int indx = 0 ; boolean flag = false ; indx = upStmt . indexOf ( upSchema , strtPos ) ; if ( indx < 0 ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( "`" ) . append ( schema . toUpperCase ( ) ) . append ( "`." ) ; indx = upStmt . indexOf ( sb . toString ( ) , strtPos ) ; flag = true ; if ( indx < 0 ) { return stmt ; } } int firstE = upStmt . indexOf ( "'" ) ; int endE = upStmt . lastIndexOf ( "'" ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; while ( indx > 0 ) { sb . append ( stmt . substring ( strtPos , indx ) ) ; strtPos = indx + ( upSchema . length ( ) ) ; if ( flag ) { strtPos += 2 ; } if ( ( ( indx > firstE ) && ( indx < endE ) ) && ( ( ( io . mycat . route . util . RouterUtil . countChar ( stmt , indx ) ) % 2 ) == 1 ) ) { sb . append ( stmt . substring ( indx , ( ( indx + ( schema . length ( ) ) ) + 1 ) ) ) ; } indx = upStmt . indexOf ( upSchema , strtPos ) ; } sb . append ( stmt . substring ( strtPos ) ) ; return sb . toString ( ) ; } | org . junit . Assert . assertEquals ( "" , sqltrue , sqlnew ) |
testReadPemPrivateKeyAsFile ( ) { java . security . PrivateKey readPemPrivateKey = manager . readPlainPKCS8PrivateKey ( new java . io . File ( this . getClass ( ) . getResource ( "privatekey.key" ) . getFile ( ) ) ) ; "<AssertPlaceHolder>" ; } getFile ( ) { return outputFile ; } | org . junit . Assert . assertNotNull ( readPemPrivateKey ) |
testCanAddSingleNodeConfigurationValue ( ) { dbTester . loadData ( "node_1" ) ; java . lang . String key = "custom-key" ; java . lang . String value = "custom-value" ; store . setNodeConfValue ( org . buddycloud . channelserver . db . jdbc . TEST_SERVER1_NODE1_ID , key , value ) ; "<AssertPlaceHolder>" ; } getNodeConfValue ( java . lang . String , java . lang . String ) { java . sql . PreparedStatement stmt = null ; try { stmt = conn . prepareStatement ( dialect . selectSingleNodeConfValue ( ) ) ; stmt . setString ( 1 , nodeId ) ; stmt . setString ( 2 , key ) ; java . sql . ResultSet rs = stmt . executeQuery ( ) ; java . lang . String result = null ; if ( rs . next ( ) ) { result = rs . getString ( 1 ) ; } return result ; } catch ( java . sql . SQLException e ) { throw new org . buddycloud . channelserver . db . exception . NodeStoreException ( e ) ; } finally { close ( stmt ) ; } } | org . junit . Assert . assertEquals ( value , store . getNodeConfValue ( org . buddycloud . channelserver . db . jdbc . TEST_SERVER1_NODE1_ID , key ) ) |
testAssetReportPdfGetSuccess ( ) { com . plaid . client . PlaidClient client = client ( ) ; java . util . List < java . lang . String > accessTokens = java . util . Arrays . asList ( getItemPublicTokenExchangeResponse ( ) . getAccessToken ( ) ) ; retrofit2 . Response < com . plaid . client . response . AssetReportCreateResponse > createResponse = com . plaid . client . integration . AssetReportCreateTest . createAssetReport ( client , accessTokens ) ; java . lang . String assetReportToken = createResponse . body ( ) . getAssetReportToken ( ) ; com . plaid . client . integration . AssetReportGetTest . waitTillReady ( client , assetReportToken ) ; com . plaid . client . request . AssetReportPdfGetRequest assetReportPdfGet = new com . plaid . client . request . AssetReportPdfGetRequest ( assetReportToken ) ; retrofit2 . Response < okhttp3 . ResponseBody > response = client . service ( ) . assetReportPdfGet ( assetReportPdfGet ) . execute ( ) ; "<AssertPlaceHolder>" ; } service ( ) { return plaidApiService ; } | org . junit . Assert . assertTrue ( ( ( response . body ( ) . bytes ( ) . length ) > 0 ) ) |
testTrace ( ) { org . nd4j . OpValidationSuite . ignoreFailing ( ) ; org . nd4j . linalg . factory . Nd4j . getRandom ( ) . setSeed ( 12345 ) ; for ( int [ ] inShape : new int [ ] [ ] { new int [ ] { 3 , 3 } } ) { org . nd4j . linalg . api . ndarray . INDArray in = org . nd4j . linalg . factory . Nd4j . rand ( inShape ) ; org . nd4j . autodiff . samediff . SameDiff sd = org . nd4j . autodiff . samediff . SameDiff . create ( ) ; org . nd4j . autodiff . samediff . SDVariable i = sd . var ( "in" , in ) ; org . nd4j . autodiff . samediff . SDVariable trace = sd . math ( ) . trace ( i ) ; double exp = org . nd4j . linalg . factory . Nd4j . diag ( in ) . sumNumber ( ) . doubleValue ( ) ; org . nd4j . autodiff . validation . TestCase tc = new org . nd4j . autodiff . validation . TestCase ( sd ) . expected ( trace , org . nd4j . linalg . factory . Nd4j . trueScalar ( exp ) ) . testName ( org . nd4j . autodiff . opvalidation . Arrays . toString ( inShape ) ) ; java . lang . String err = org . nd4j . autodiff . validation . OpValidation . validate ( tc ) ; "<AssertPlaceHolder>" ; } } validate ( org . nd4j . autodiff . validation . TestCase ) { return org . nd4j . autodiff . validation . OpValidation . validate ( testCase , false ) ; } | org . junit . Assert . assertNull ( err ) |
testHashCode ( ) { "<AssertPlaceHolder>" ; } hashCode ( ) { return toString ( ) . hashCode ( ) ; } | org . junit . Assert . assertEquals ( java . lang . Integer . hashCode ( 200 ) , instance . hashCode ( ) ) |
AccessStaticVariableIndirect_MethodVar ( ) { java . lang . String fromClass = "domain.indirect.violatingfrom.AccessStaticVariableIndirect_MethodVar" ; java . lang . String toClass = "domain.indirect.indirectto.ServiceOne" ; java . util . ArrayList < java . lang . String > typesToFind = new java . util . ArrayList < java . lang . String > ( ) ; typesToFind . add ( "Access" ) ; "<AssertPlaceHolder>" ; } areDependencyTypesDetected ( java . lang . String , java . lang . String , java . util . ArrayList , boolean ) { return areDependencyTypesDetected ( classFrom , classTo , dependencyTypes , "" , isIndirect ) ; } | org . junit . Assert . assertTrue ( areDependencyTypesDetected ( fromClass , toClass , typesToFind , true ) ) |
getMethodNameGets ( ) { com . microsoft . azure . sdk . iot . device . transport . IotHubTransportMessage testDMMessage = new com . microsoft . azure . sdk . iot . device . transport . IotHubTransportMessage ( new byte [ 0 ] , com . microsoft . azure . sdk . iot . device . MessageType . DEVICE_METHODS ) ; testDMMessage . setMethodName ( "TestName" ) ; java . lang . String actualMethodName = testDMMessage . getMethodName ( ) ; "<AssertPlaceHolder>" ; } getMethodName ( ) { return java . lang . Thread . currentThread ( ) . getStackTrace ( ) [ com . microsoft . azure . sdk . iot . device . CustomLogger . CALLING_METHOD_NAME_DEPTH ] . getMethodName ( ) ; } | org . junit . Assert . assertEquals ( actualMethodName , "TestName" ) |
testDataRetrievalEnum ( ) { java . time . Instant end = java . time . Instant . now ( ) ; java . time . Instant start = end . minus ( org . diirt . util . time . TimeDuration . ofHours ( 24.0 ) ) ; try { getValuesEnumArray ( "test_pv_wave_enum" , true , 5 , start , end ) ; org . junit . Assert . fail ( ) ; } catch ( java . lang . UnsupportedOperationException e ) { "<AssertPlaceHolder>" ; } } now ( ) { return org . csstudio . data . values . TimestampFactory . fromMillisecs ( new java . util . Date ( ) . getTime ( ) ) ; } | org . junit . Assert . assertNotNull ( e ) |
testBooleanObjNull ( ) { java . lang . Class < com . j256 . ormlite . field . types . BooleanObjectTypeTest . LocalBooleanObj > clazz = com . j256 . ormlite . field . types . BooleanObjectTypeTest . LocalBooleanObj . class ; com . j256 . ormlite . dao . Dao < com . j256 . ormlite . field . types . BooleanObjectTypeTest . LocalBooleanObj , java . lang . Object > dao = createDao ( clazz , true ) ; com . j256 . ormlite . field . types . BooleanObjectTypeTest . LocalBooleanObj foo = new com . j256 . ormlite . field . types . BooleanObjectTypeTest . LocalBooleanObj ( ) ; "<AssertPlaceHolder>" ; testType ( dao , foo , clazz , null , null , null , null , DataType . BOOLEAN_OBJ , com . j256 . ormlite . field . types . BooleanObjectTypeTest . BOOLEAN_COLUMN , false , false , false , false , 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 ) ) |
createUserTest ( ) { int res = io . lavagna . service . Helper . createUser ( userRepository , "test" , io . lavagna . service . UserRepositoryTest . TEST_USER_NAME ) ; "<AssertPlaceHolder>" ; } createUser ( io . lavagna . service . UserRepository , java . lang . String , java . lang . String ) { return ur . createUser ( provider , userName , null , null , null , true ) ; } | org . junit . Assert . assertEquals ( 1 , res ) |
testCompletedDuration ( ) { org . hawkular . apm . api . model . trace . Consumer node1 = new org . hawkular . apm . api . model . trace . Consumer ( ) ; node1 . setTimestamp ( 1000 ) ; node1 . setDuration ( 500 ) ; org . hawkular . apm . api . model . trace . Producer node2 = new org . hawkular . apm . api . model . trace . Producer ( ) ; node2 . setTimestamp ( 1200 ) ; node2 . setDuration ( 800 ) ; node1 . getNodes ( ) . add ( node2 ) ; "<AssertPlaceHolder>" ; } completedDuration ( ) { return ( overallEndTime ( ) ) - ( timestamp ) ; } | org . junit . Assert . assertEquals ( 1000 , node1 . completedDuration ( ) ) |
testWSDLLocatorWithoutCatalog ( ) { java . net . URL wsdl = getClass ( ) . getResource ( "/wsdl/catalog/hello_world_services.wsdl" ) ; "<AssertPlaceHolder>" ; javax . wsdl . factory . WSDLFactory wsdlFactory = javax . wsdl . factory . WSDLFactory . newInstance ( ) ; javax . wsdl . xml . WSDLReader wsdlReader = wsdlFactory . newWSDLReader ( ) ; wsdlReader . setFeature ( "javax.wsdl.verbose" , false ) ; org . apache . cxf . catalog . OASISCatalogManager catalog = new org . apache . cxf . catalog . OASISCatalogManager ( ) ; org . apache . cxf . wsdl11 . CatalogWSDLLocator wsdlLocator = new org . apache . cxf . wsdl11 . CatalogWSDLLocator ( wsdl . toString ( ) , catalog ) ; try { wsdlReader . readWSDL ( wsdlLocator ) ; org . junit . Assert . fail ( "Test<sp>did<sp>not<sp>fail<sp>as<sp>expected" ) ; } catch ( javax . wsdl . WSDLException e ) { } } getResource ( java . lang . String ) { return new java . io . File ( getClass ( ) . getResource ( wsdlFile ) . toURI ( ) ) ; } | org . junit . Assert . assertNotNull ( wsdl ) |
multiParamFactorySetsStringRepresentation ( ) { java . lang . String expected = ( tenant ) + ".a.b.c" ; com . rackspacecloud . blueflood . types . Locator locator = com . rackspacecloud . blueflood . types . Locator . createLocatorFromPathComponents ( tenant , "a" , "b" , "c" ) ; "<AssertPlaceHolder>" ; } toString ( ) { return java . lang . String . format ( "%s<sp>(%d)" , tenantId , timestamp ) ; } | org . junit . Assert . assertEquals ( expected , locator . toString ( ) ) |
testOnePutExceedLimit ( ) { com . alibaba . otter . canal . store . memory . MemoryEventStoreWithBuffer eventStore = new com . alibaba . otter . canal . store . memory . MemoryEventStoreWithBuffer ( ) ; eventStore . setBufferSize ( 1 ) ; eventStore . setBatchMode ( BatchMode . MEMSIZE ) ; eventStore . start ( ) ; try { boolean result = eventStore . tryPut ( buildEvent ( "1" , 1L , 1L , 1025 ) ) ; "<AssertPlaceHolder>" ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( e . getMessage ( ) ) ; } eventStore . stop ( ) ; } buildEvent ( java . lang . String , long , long , long ) { com . alibaba . otter . canal . protocol . CanalEntry . Header . Builder headerBuilder = com . alibaba . otter . canal . protocol . CanalEntry . Header . newBuilder ( ) ; headerBuilder . setLogfileName ( binlogFile ) ; headerBuilder . setLogfileOffset ( offset ) ; headerBuilder . setExecuteTime ( timestamp ) ; headerBuilder . setEventLength ( eventLenght ) ; com . alibaba . otter . canal . protocol . CanalEntry . Entry . Builder entryBuilder = com . alibaba . otter . canal . protocol . CanalEntry . Entry . newBuilder ( ) ; entryBuilder . setHeader ( headerBuilder . build ( ) ) ; com . alibaba . otter . canal . protocol . CanalEntry . Entry entry = entryBuilder . build ( ) ; return new com . alibaba . otter . canal . store . model . Event ( new com . alibaba . otter . canal . protocol . position . LogIdentity ( new java . net . InetSocketAddress ( com . alibaba . otter . cancel . store . memory . buffer . MemoryEventStoreBase . MYSQL_ADDRESS , 3306 ) , 1234L ) , entry ) ; } | org . junit . Assert . assertTrue ( result ) |
testDetectionSplitter ( ) { final long testId = 12345 ; final java . lang . String testExternalId = "detectionAlgo" 1 ; final org . mitre . mpf . wfm . data . entities . transients . TransientPipeline testPipe = new org . mitre . mpf . wfm . data . entities . transients . TransientPipeline ( "detectionAlgo" 2 , "testDescr" ) ; final int testStage = 0 ; final int testPriority = 4 ; final boolean testOutputEnabled = true ; org . mitre . mpf . wfm . data . entities . transients . TransientDetectionSystemProperties transientDetectionSystemProperties = propertiesUtil . createDetectionSystemPropertiesSnapshot ( ) ; org . mitre . mpf . wfm . data . entities . transients . TransientJob testJob = new org . mitre . mpf . wfm . data . entities . transients . TransientJob ( testId , testExternalId , transientDetectionSystemProperties , testPipe , testStage , testPriority , testOutputEnabled , false ) ; org . mitre . mpf . wfm . data . entities . transients . TransientMedia testMedia = new org . mitre . mpf . wfm . data . entities . transients . TransientMedia ( nextId ( ) , ioUtils . findFile ( "/samples/new_face_video.avi" ) . toString ( ) ) ; testMedia . setType ( "video/avi" ) ; testMedia . addMetadata ( "FPS" , "30" ) ; java . util . List < org . mitre . mpf . wfm . data . entities . transients . TransientMedia > listMedia = com . google . common . collect . Lists . newArrayList ( testMedia ) ; testJob . setMedia ( listMedia ) ; org . mitre . mpf . wfm . data . entities . transients . TransientStage testTransientStage = new org . mitre . mpf . wfm . data . entities . transients . TransientStage ( "detectionAlgo" 0 , "stageDescr" , org . mitre . mpf . wfm . enums . ActionType . DETECTION ) ; testPipe . setStages ( java . util . Collections . singletonList ( testTransientStage ) ) ; java . util . Map < java . lang . String , java . lang . String > mergeProp = new java . util . HashMap ( ) ; mergeProp . put ( MpfConstants . MEDIA_SAMPLING_INTERVAL_PROPERTY , "detectionAlgo" 3 ) ; mergeProp . put ( MpfConstants . MIN_GAP_BETWEEN_TRACKS , "detectionAlgo" 3 ) ; mergeProp . put ( MpfConstants . MINIMUM_SEGMENT_LENGTH_PROPERTY , "detectionAlgo" 4 ) ; mergeProp . put ( MpfConstants . TARGET_SEGMENT_LENGTH_PROPERTY , "25" ) ; org . mitre . mpf . wfm . data . entities . transients . TransientAction detectionAction = new org . mitre . mpf . wfm . data . entities . transients . TransientAction ( "detectionAction" , "detectionDescription" , "detectionAlgo" ) ; detectionAction . setProperties ( mergeProp ) ; testTransientStage . getActions ( ) . add ( detectionAction ) ; java . util . List < org . apache . camel . Message > responseList = detectionStageSplitter . performSplit ( testJob , testTransientStage ) ; "<AssertPlaceHolder>" ; } performSplit ( org . mitre . mpf . wfm . data . entities . transients . TransientJob , org . mitre . mpf . wfm . data . entities . transients . TransientStage ) { org . mitre . mpf . wfm . camel . DefaultStageSplitter . log . warn ( "[Job<sp>{}|{}|*]<sp>Stage<sp>{}<sp>calls<sp>an<sp>unsupported<sp>operation<sp>'{}'.<sp>No<sp>work<sp>will<sp>be<sp>performed<sp>in<sp>this<sp>stage." , transientJob . getId ( ) , transientJob . getCurrentStage ( ) , transientJob . getCurrentStage ( ) , transientStage . getName ( ) ) ; return new java . util . ArrayList ( ) ; } | org . junit . Assert . assertTrue ( ( ( responseList . size ( ) ) == 0 ) ) |
loadFederationNoFederations ( ) { java . io . File f = dataFolder . getFile ( "no-federations.yml" ) ; com . hotels . bdp . waggledance . mapping . service . impl . YamlFederatedMetaStoreStorage storage = new com . hotels . bdp . waggledance . mapping . service . impl . YamlFederatedMetaStoreStorage ( f . toURI ( ) . toString ( ) , configuration ) ; storage . loadFederation ( ) ; "<AssertPlaceHolder>" ; } getAll ( ) { return com . google . common . collect . ImmutableList . copyOf ( federationsMap . values ( ) ) ; } | org . junit . Assert . assertThat ( storage . getAll ( ) . size ( ) , org . hamcrest . CoreMatchers . is ( 0 ) ) |
mustReturnEmptyListWhenDequeueOutOnIdThatDoesntExist ( ) { java . util . List < com . offbynull . actors . shuttle . Message > actual = fixture . dequeueOut ( "id" , 0 ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return items . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( actual . isEmpty ( ) ) |
testLoopExample2 ( ) { resetState ( ) ; java . lang . String imei = edu . columbia . cs . psl . test . phosphor . DroidBenchImplicitITCase . taintedString ( "abcdex2" ) ; java . lang . String obfuscated = "" ; for ( int i = 0 ; i < 10 ; i ++ ) if ( i == 9 ) for ( char c : imei . toCharArray ( ) ) obfuscated += c + "_" ; "<AssertPlaceHolder>" ; } getTaint ( java . lang . String ) { edu . columbia . cs . psl . phosphor . runtime . Taint taint = edu . columbia . cs . psl . phosphor . runtime . MultiTainter . getTaint ( description . toCharArray ( ) [ 0 ] ) ; return ( taint == null ) || ( ( ( taint . lbl ) == null ) && ( taint . hasNoDependencies ( ) ) ) ? 0 : 1 ; } | org . junit . Assert . assertTrue ( ( ( edu . columbia . cs . psl . test . phosphor . DroidBenchImplicitITCase . getTaint ( obfuscated ) ) != 0 ) ) |
testRegisterService_EmptySR ( ) { java . lang . Object service = mock ( java . lang . Object . class ) ; java . util . Properties props = mock ( java . util . Properties . class ) ; java . util . Map < java . lang . Class , java . util . Map < java . lang . Object , org . osgi . framework . ServiceRegistration > > sr = new java . util . HashMap < java . lang . Class , java . util . Map < java . lang . Object , org . osgi . framework . ServiceRegistration > > ( ) ; org . osgi . framework . ServiceRegistration s = mock ( org . osgi . framework . ServiceRegistration . class ) ; when ( bc . registerService ( eq ( java . lang . Object . class . getName ( ) ) , same ( service ) , any ( java . util . Dictionary . class ) ) ) . thenReturn ( s ) ; org . cytoscape . service . util . internal . utils . ServiceUtil . registerService ( bc , service , java . lang . Object . class , props , sr ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( other instanceof org . cytoscape . util . swing . FileChooserFilter ) ) return false ; final org . cytoscape . util . swing . FileChooserFilter otherFilter = ( ( org . cytoscape . util . swing . FileChooserFilter ) ( other ) ) ; if ( ! ( otherFilter . description . equals ( description ) ) ) return false ; if ( ( otherFilter . extensions . length ) != ( extensions . length ) ) return false ; java . util . Arrays . sort ( otherFilter . extensions ) ; java . util . Arrays . sort ( extensions ) ; for ( int i = 0 ; i < ( extensions . length ) ; ++ i ) { if ( ! ( extensions [ i ] . equals ( otherFilter . extensions [ i ] ) ) ) return false ; } return true ; } | org . junit . Assert . assertTrue ( sr . get ( java . lang . Object . class ) . get ( service ) . equals ( s ) ) |
testGetStacktrace ( ) { java . lang . String stacktrace = "aStacktrace" ; when ( mockHistoryService . getHistoricJobLogExceptionStacktrace ( MockProvider . EXAMPLE_HISTORIC_JOB_LOG_ID ) ) . thenReturn ( stacktrace ) ; io . restassured . response . Response response = io . restassured . RestAssured . given ( ) . pathParam ( "id" , MockProvider . EXAMPLE_HISTORIC_JOB_LOG_ID ) . then ( ) . expect ( ) . statusCode ( Status . OK . getStatusCode ( ) ) . contentType ( ContentType . TEXT ) . when ( ) . get ( org . camunda . bpm . engine . rest . history . HistoricJobLogRestServiceInteractionTest . HISTORIC_JOB_LOG_RESOURCE_GET_STACKTRACE_URL ) ; java . lang . String content = response . asString ( ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { org . camunda . bpm . engine . rest . hal . cache . HalResourceCacheEntry cacheEntry = cache . get ( id ) ; if ( cacheEntry != null ) { if ( expired ( cacheEntry ) ) { remove ( cacheEntry . getId ( ) ) ; return null ; } else { return cacheEntry . getResource ( ) ; } } else { return null ; } } | org . junit . Assert . assertEquals ( stacktrace , content ) |
testGetServiceAccountKeyPath ( ) { tab . initializeFrom ( launchConfig ) ; accountSelector . selectAccount ( "account1@example.com" ) ; projectSelector . selectProjectId ( "project-A" ) ; java . nio . file . Path expected = java . nio . file . Paths . get ( org . eclipse . core . runtime . Platform . getConfigurationLocation ( ) . getURL ( ) . toURI ( ) ) . resolve ( "com.google.cloud.tools.eclipse" ) . resolve ( "app-engine-default-service-account-key-project-A.json" ) ; "<AssertPlaceHolder>" ; } getServiceAccountKeyPath ( ) { com . google . common . base . Preconditions . checkState ( ( ! ( projectSelector . getSelection ( ) . isEmpty ( ) ) ) ) ; java . lang . String projectId = projectSelector . getSelectedProjectId ( ) ; java . lang . String filename = ( "app-engine-default-service-account-key-" + projectId ) + ".json" ; filename = filename . replace ( ':' , '.' ) ; try { java . nio . file . Path configurationLocation = java . nio . file . Paths . get ( org . eclipse . core . runtime . Platform . getConfigurationLocation ( ) . getURL ( ) . toURI ( ) ) ; return configurationLocation . resolve ( "com.google.cloud.tools.eclipse" ) . resolve ( filename ) ; } catch ( java . net . URISyntaxException e ) { com . google . cloud . tools . eclipse . appengine . localserver . ui . GcpLocalRunTab . logger . log ( Level . SEVERE , "Cannot<sp>convert<sp>configuration<sp>location<sp>into<sp>URI" , e ) ; return null ; } } | org . junit . Assert . assertEquals ( expected , tab . getServiceAccountKeyPath ( ) ) |
paramClassesMatchObjectVarArgsAssignable ( ) { java . util . List < java . lang . Class < ? > > memberClassList = new java . util . ArrayList ( ) ; java . util . List < java . lang . Class < ? > > sigclassList = new java . util . ArrayList ( ) ; memberClassList . add ( java . lang . Class . forName ( "[Ljava.lang.Object;" ) ) ; sigclassList . add ( java . lang . String . class ) ; sigclassList . add ( java . lang . Float . class ) ; sigclassList . add ( java . lang . Integer . class ) ; "<AssertPlaceHolder>" ; } paramClassesMatch ( boolean , java . util . List , java . util . List , boolean ) { boolean result = true ; final int memberParamCount = memberParamClasses . size ( ) ; final int signatureParamCount = signatureParamClasses . size ( ) ; if ( DEBUG_LOGGING_SIG_MATCH ) { org . adoptopenjdk . jitwatch . util . ParseUtil . logger . debug ( "MemberParamCount:{}<sp>SignatureParamCount:{}<sp>varArgs:{}" , memberParamCount , signatureParamCount , memberHasVarArgs ) ; } if ( ( memberParamCount == 0 ) && ( signatureParamCount == 0 ) ) { if ( DEBUG_LOGGING_SIG_MATCH ) { org . adoptopenjdk . jitwatch . util . ParseUtil . logger . debug ( "both<sp>have<sp>zero<sp>params" ) ; } result = true ; } else if ( signatureParamCount < memberParamCount ) { if ( DEBUG_LOGGING_SIG_MATCH ) { org . adoptopenjdk . jitwatch . util . ParseUtil . logger . debug ( "signature<sp>has<sp>less<sp>params<sp>than<sp>method" ) ; } result = false ; } else if ( ( signatureParamCount > memberParamCount ) && ( ! memberHasVarArgs ) ) { if ( DEBUG_LOGGING_SIG_MATCH ) { org . adoptopenjdk . jitwatch . util . ParseUtil . logger . debug ( "signature<sp>has<sp>more<sp>params<sp>than<sp>non-varargs<sp>method" ) ; } result = false ; } else { int memPos = 0 ; for ( int sigPos = 0 ; sigPos < signatureParamCount ; sigPos ++ ) { java . lang . Class < ? > sigParamClass = signatureParamClasses . get ( sigPos ) ; java . lang . Class < ? > memParamClass = memberParamClasses . get ( memPos ) ; if ( DEBUG_LOGGING_SIG_MATCH ) { org . adoptopenjdk . jitwatch . util . ParseUtil . logger . debug ( "Comparing<sp>member<sp>param[{}]<sp>{}<sp>to<sp>sig<sp>param[{}]<sp>{}" , memPos , memParamClass , sigPos , sigParamClass ) ; } boolean classMatch = false ; if ( matchTypesExactly ) { classMatch = memParamClass . equals ( sigParamClass ) ; } else { classMatch = memParamClass . isAssignableFrom ( sigParamClass ) ; } if ( classMatch ) { if ( DEBUG_LOGGING_SIG_MATCH ) { org . adoptopenjdk . jitwatch . util . ParseUtil . logger . debug ( "{}<sp>equals/isAssignableFrom<sp>{}" , memParamClass , sigParamClass ) ; } } else { boolean memberParamCouldBeVarArgs = false ; boolean isLastParameter = memPos == ( memberParamCount - 1 ) ; if ( memberHasVarArgs && isLastParameter ) { memberParamCouldBeVarArgs = true ; } if ( memberParamCouldBeVarArgs ) { java . lang . Class < ? > componentType = memParamClass . getComponentType ( ) ; if ( componentType . isAssignableFrom ( sigParamClass ) ) { if ( DEBUG_LOGGING_SIG_MATCH ) { org . adoptopenjdk . jitwatch . util . ParseUtil . logger . debug ( "vararg<sp>member<sp>param<sp>{}<sp>equals/isAssignableFrom<sp>{}" , memParamClass , sigParamClass ) ; } } else { result = false ; break ; } } else { result = false ; break ; } } memPos ++ ; if ( memPos >= memberParamCount ) { memPos = memberParamCount - 1 ; } } } return result ; } | org . junit . Assert . assertTrue ( org . adoptopenjdk . jitwatch . util . ParseUtil . paramClassesMatch ( true , memberClassList , sigclassList , true ) ) |
clientShouldNotBeNull ( ) { "<AssertPlaceHolder>" ; } | org . junit . Assert . assertNotNull ( client ) |
testOnderhoudenVoorAnderePartij_zendendePartijGelijkAanAfnIndPartij_dummyAfnCodeNull ( ) { final nl . bzk . brp . service . afnemerindicatie . AfnemerindicatieVerzoek afnemerindicatieVerzoek = maakAfnemerIndicatieVerzoek ( SoortDienst . PLAATSING_AFNEMERINDICATIE ) ; final java . lang . String zendendePartijCode = "000789" ; afnemerindicatieVerzoek . getStuurgegevens ( ) . setZendendePartijCode ( java . lang . String . valueOf ( zendendePartijCode ) ) ; afnemerindicatieVerzoek . setDummyAfnemerCode ( null ) ; final nl . bzk . brp . service . afnemerindicatie . OnderhoudResultaat verzoekResultaat = service . verwerkVerzoek ( afnemerindicatieVerzoek ) ; org . mockito . Mockito . verify ( leveringsautorisatieService ) . controleerAutorisatie ( any ( nl . bzk . brp . service . algemeen . autorisatie . AutorisatieParams . class ) ) ; "<AssertPlaceHolder>" ; } getMeldingList ( ) { return meldingList ; } | org . junit . Assert . assertTrue ( verzoekResultaat . getMeldingList ( ) . isEmpty ( ) ) |
testCaseInsensitive6 ( ) { org . apache . cayenne . query . Ordering ord = new org . apache . cayenne . query . Ordering ( "N" , SortOrder . DESCENDING ) ; "<AssertPlaceHolder>" ; } isCaseInsensitive ( ) { return ! ( isCaseSensitive ( ) ) ; } | org . junit . Assert . assertFalse ( ord . isCaseInsensitive ( ) ) |
testIteratorOnOneEntryCallNext ( ) { org . cache2k . Cache < java . lang . Integer , java . lang . Integer > c = freshCache ( org . cache2k . test . core . Integer . class , org . cache2k . test . core . Integer . class , null , 100 , ( - 1 ) ) ; c . put ( 47 , 11 ) ; "<AssertPlaceHolder>" ; } entries ( ) { throw new java . lang . UnsupportedOperationException ( ) ; } | org . junit . Assert . assertEquals ( ( ( java . lang . Integer ) ( 11 ) ) , c . entries ( ) . iterator ( ) . next ( ) . getValue ( ) ) |
testSetEnvFromInputPropertyNull ( ) { org . apache . hadoop . conf . Configuration conf = new org . apache . hadoop . conf . Configuration ( false ) ; java . util . Map < java . lang . String , java . lang . String > env = new java . util . HashMap ( ) ; java . lang . String propName = "new_env2_val" 0 ; java . lang . String defaultPropName = "mapreduce.child.env" ; conf . set ( propName , "env1=env1_val,env2=env2_val,env3=env3_val" ) ; conf . set ( ( propName + ".env4" ) , "env4_val" ) ; conf . set ( ( propName + ".env2" ) , "new_env2_val" ) ; conf . set ( defaultPropName , "env1=def1_val,env2=def2_val,env3=def3_val" ) ; java . lang . String defaultPropValue = conf . get ( defaultPropName ) ; conf . set ( ( defaultPropName + ".env4" ) , "def4_val" ) ; conf . set ( ( defaultPropName + ".env2" ) , "new_def2_val" ) ; org . apache . hadoop . yarn . util . Apps . setEnvFromInputProperty ( env , "bogus1" , null , conf , File . pathSeparator ) ; "<AssertPlaceHolder>" ; } isEmpty ( ) { return addrs . isEmpty ( ) ; } | org . junit . Assert . assertTrue ( env . isEmpty ( ) ) |
testUnionAdjentIntersection1 ( ) { java . lang . String query = "Compute[@fqdns=\"slc4-0003.ebay.com\"]{*}." + ( ( "(<sp><VPool>parentCluster[@_oid=\"CLguf6sdle-invalid\"]<sp>" + "&&<sp>activeManifestRef[@_oid=\"B-N-D-1.20111108154904.0\"]" ) + "||<sp>activeManifestCur[@_oid=\"Black-Pearl-1.20111103221326.0\"])" ) ; com . ebay . cloud . cms . query . service . IQueryResult result = queryService . query ( query , stratusContext ) ; "<AssertPlaceHolder>" ; } getEntities ( ) { return entities ; } | org . junit . Assert . assertEquals ( 1 , result . getEntities ( ) . size ( ) ) |
testNoDuplicates ( ) { org . apache . tools . ant . types . Resource r = new org . apache . tools . ant . types . Resource ( "samual<sp>vimes" , true , 1 , false ) ; org . apache . tools . ant . types . Resource [ ] toNew = org . apache . tools . ant . util . ResourceUtils . selectOutOfDateSources ( taskINeedForLogging , new org . apache . tools . ant . types . Resource [ ] { r } , this , this ) ; "<AssertPlaceHolder>" ; } selectOutOfDateSources ( org . apache . tools . ant . ProjectComponent , org . apache . tools . ant . types . Resource [ ] , org . apache . tools . ant . util . FileNameMapper , org . apache . tools . ant . types . ResourceFactory ) { return org . apache . tools . ant . util . ResourceUtils . selectOutOfDateSources ( logTo , source , mapper , targets , org . apache . tools . ant . util . ResourceUtils . FILE_UTILS . getFileTimestampGranularity ( ) ) ; } | org . junit . Assert . assertEquals ( 1 , toNew . length ) |
testFactoryJPANotPresent ( ) { final java . lang . ClassLoader original = java . lang . Thread . currentThread ( ) . getContextClassLoader ( ) ; java . lang . ClassLoader cl = new java . lang . ClassLoader ( java . lang . ClassLoader . getSystemClassLoader ( ) . getParent ( ) ) { @ org . simpleflatmapper . jdbc . test . Override protected java . lang . Class < ? > findClass ( java . lang . String name ) throws org . simpleflatmapper . jdbc . test . ClassNotFoundException { if ( ! ( name . startsWith ( "javax.persistence" ) ) ) { java . io . InputStream resourceAsStream = original . getResourceAsStream ( ( ( name . replace ( "." , "/" ) ) + ".class" ) ) ; if ( resourceAsStream == null ) { throw new java . lang . ClassNotFoundException ( name ) ; } java . io . ByteArrayOutputStream bos = new java . io . ByteArrayOutputStream ( ) ; try { int i ; while ( ( i = resourceAsStream . read ( ) ) != ( - 1 ) ) { bos . write ( i ) ; } byte [ ] bytes = bos . toByteArray ( ) ; return defineClass ( name , bytes , 0 , bytes . length ) ; } catch ( java . io . IOException e ) { throw new java . lang . ClassNotFoundException ( e . getMessage ( ) , e ) ; } finally { try { resourceAsStream . close ( ) ; } catch ( java . io . IOException e ) { } } } else { throw new java . lang . ClassNotFoundException ( name ) ; } } } ; java . lang . Thread . currentThread ( ) . setContextClassLoader ( cl ) ; try { java . lang . Class < ? > jpa = cl . loadClass ( org . simpleflatmapper . jdbc . impl . JpaAliasProviderFactory . class . getName ( ) ) ; java . lang . Class < ? > consumerClass = cl . loadClass ( org . simpleflatmapper . util . Consumer . class . getName ( ) ) ; java . lang . Object consumer = cl . loadClass ( org . simpleflatmapper . util . ListCollector . class . getName ( ) ) . newInstance ( ) ; jpa . getMethod ( "produce" , consumerClass ) . invoke ( jpa . getConstructor ( ) . newInstance ( ) , consumer ) ; java . util . List < java . lang . String > list = ( ( java . util . List < java . lang . String > ) ( consumer . getClass ( ) . getMethod ( "getList" ) . invoke ( consumer ) ) ) ; "<AssertPlaceHolder>" ; } finally { java . lang . Thread . currentThread ( ) . setContextClassLoader ( original ) ; } } isEmpty ( ) { return false ; } | org . junit . Assert . assertTrue ( list . isEmpty ( ) ) |
testMsgSendDistWeekly ( ) { java . util . List < me . hao0 . wechat . model . data . msg . MsgSendDist > dists = wechat . data ( ) . msgSendDistWeekly ( accessToken , "2015-09-01" , "2015-09-30" ) ; "<AssertPlaceHolder>" ; for ( me . hao0 . wechat . model . data . msg . MsgSendDist dist : dists ) { System . out . println ( dist ) ; } } msgSendDistWeekly ( java . lang . String , java . lang . String , me . hao0 . wechat . core . Callback ) { msgSendDistWeekly ( loadAccessToken ( ) , startDate , endDate , cb ) ; } | org . junit . Assert . assertNotNull ( dists ) |
testGetSetCreated ( ) { java . util . Date expectedCreated = new java . util . Date ( ) ; com . microsoft . windowsazure . services . media . models . JobInfo JobInfo = new com . microsoft . windowsazure . services . media . models . JobInfo ( null , new com . microsoft . windowsazure . services . media . implementation . content . JobType ( ) . setCreated ( expectedCreated ) ) ; java . util . Date actualCreated = JobInfo . getCreated ( ) ; "<AssertPlaceHolder>" ; } getCreated ( ) { return getContent ( ) . getCreated ( ) ; } | org . junit . Assert . assertEquals ( expectedCreated , actualCreated ) |
testRetriesRequests ( ) { final int retries = 3 ; com . findwise . utils . http . HttpFetchConfiguration settings = new com . findwise . utils . http . HttpFetchConfigurationBuilder ( ) . setRetries ( retries ) . build ( ) ; com . findwise . utils . http . HttpFetcher httpFetcher = new com . findwise . utils . http . HttpFetcher ( settings ) ; stubFor ( get ( urlEqualTo ( "/1" ) ) . willReturn ( aResponse ( ) . withStatus ( HttpStatus . SC_INTERNAL_SERVER_ERROR ) ) ) ; stubFor ( get ( urlEqualTo ( "/2" ) ) . willReturn ( aResponse ( ) . withStatus ( HttpStatus . SC_INTERNAL_SERVER_ERROR ) ) ) ; stubFor ( get ( urlEqualTo ( "/3" ) ) . willReturn ( aResponse ( ) . withStatus ( HttpStatus . SC_OK ) . withBody ( "body" ) ) ) ; org . apache . http . HttpEntity responseEntity = httpFetcher . fetch ( "http://localhost:37777" , "*/*" , new com . findwise . utils . http . HttpFetcherTest . IncrementingUriProvider ( ) , new com . findwise . utils . http . PlainGetRequestProvider ( ) ) ; java . lang . String bodyContent = readStream ( responseEntity . getContent ( ) ) ; org . apache . http . util . EntityUtils . consume ( responseEntity ) ; "<AssertPlaceHolder>" ; } getContent ( ) { return textSanitizer . filterInvalidChars ( content ) ; } | org . junit . Assert . assertThat ( bodyContent , org . hamcrest . CoreMatchers . equalTo ( "body" ) ) |
manageCreationProcess_VSERVER_CREATED_VServerIsRunning ( ) { doReturn ( VServerStatus . RUNNING ) . when ( vServerProcessor . vserverComm ) . getVServerStatus ( any ( org . oscm . app . iaas . PropertyHandler . class ) ) ; org . oscm . app . iaas . data . FlowState newState = vServerProcessor . manageCreationProcess ( null , null , paramHandler , FlowState . VSERVER_CREATED , null ) ; "<AssertPlaceHolder>" ; } manageCreationProcess ( java . lang . String , java . lang . String , org . oscm . app . iaas . PropertyHandler , org . oscm . app . iaas . data . FlowState , org . oscm . app . iaas . data . FlowState ) { boolean vSysInNormalState = VSystemStatus . NORMAL . equals ( paramHandler . getIaasContext ( ) . getVSystemStatus ( ) ) ; org . oscm . app . iaas . data . FlowState newState = newStateParam ; java . lang . String fwStatus = fwComm . getFirewallStatus ( paramHandler ) ; switch ( flowState ) { case VSERVER_CREATION_REQUESTED : if ( FWStatus . RUNNING . equals ( fwStatus ) ) { if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_CREATING , paramHandler ) ) ) { vserverComm . createVServer ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSERVER_CREATING ; } } else { if ( checkNextStatus ( controllerId , instanceId , FlowState . FW_STARTING_FOR_VSERVER_CREATION , paramHandler ) ) { fwComm . startFirewall ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . FW_STARTING_FOR_VSERVER_CREATION ; } } break ; case FW_STARTING_FOR_VSERVER_CREATION : if ( FWStatus . RUNNING . equals ( fwStatus ) ) { if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . FW_STARTED_FOR_VSERVER_CREATION , paramHandler ) ) ) { vserverComm . createVServer ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSERVER_CREATING ; } } break ; case VSERVER_CREATING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_CREATED , paramHandler ) ) { java . lang . String vServerStatus = vserverComm . getVServerStatus ( paramHandler ) ; if ( ( ( VServerStatus . STOPPED . equals ( vServerStatus ) ) || ( VServerStatus . RUNNING . equals ( vServerStatus ) ) ) || ( VServerStatus . STARTING . equals ( vServerStatus ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_CREATED ; } } break ; case VSERVER_CREATED : if ( vdiskInfo . isAdditionalDiskSelected ( paramHandler ) ) { if ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_CREATION_REQUESTED , paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSDISK_CREATION_REQUESTED ; } } else { java . lang . String vServerStatus = vserverComm . getVServerStatus ( paramHandler ) ; if ( VServerStatus . STOPPED . equals ( vServerStatus ) ) { if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTING , paramHandler ) ) { vserverComm . startVServer ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTING ; } } else if ( VServerStatus . STARTING . equals ( vServerStatus ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTING ; } else if ( VServerStatus . RUNNING . equals ( vServerStatus ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTED ; } } break ; case VSERVER_STARTING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSERVER_STARTED , paramHandler ) ) { if ( VServerStatus . RUNNING . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_STARTED ; } } break ; case VSERVER_STARTED : if ( checkNextStatus ( controllerId , instanceId , FlowState . FINISHED , paramHandler ) ) { if ( VServerStatus . RUNNING . equals ( vserverComm . getVServerStatus ( paramHandler ) ) ) { newState = org . oscm . app . iaas . data . FlowState . VSERVER_RETRIEVEGUEST ; } } break ; case VSERVER_RETRIEVEGUEST : java . lang . String mail = paramHandler . getMailForCompletion ( ) ; if ( mail != null ) { newState = dispatchVServerManualOperation ( controllerId , instanceId , paramHandler , mail ) ; } else if ( checkNextStatus ( controllerId , instanceId , FlowState . FINISHED , paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . FINISHED ; } break ; case VSDISK_CREATION_REQUESTED : if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_CREATING , paramHandler ) ) ) { vdiskInfo . createVDisk ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSDISK_CREATING ; } break ; case VSDISK_CREATING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_CREATED , paramHandler ) ) { if ( vdiskInfo . isVDiskDeployed ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSDISK_CREATED ; } } break ; case VSDISK_CREATED : if ( vSysInNormalState && ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_ATTACHING , paramHandler ) ) ) { vdiskInfo . attachVDisk ( paramHandler ) ; newState = org . oscm . app . iaas . data . FlowState . VSDISK_ATTACHING ; } break ; case VSDISK_ATTACHING : if ( checkNextStatus ( controllerId , instanceId , FlowState . VSDISK_ATTACHED , paramHandler ) ) { if ( vdiskInfo . isVDiskAttached ( paramHandler ) ) { newState = org . oscm . app . iaas . data . FlowState . VSDISK_ATTACHED ; } } break ; case VSDISK_ATTACHED : if ( checkNextStatus ( controllerId , instanceId | org . junit . Assert . assertEquals ( FlowState . VSERVER_STARTED , newState ) |
testSize ( ) { K key = keyFactory . instance ( ) ; V value = valueFactory . instance ( ) ; valueOps . set ( key , value ) ; "<AssertPlaceHolder>" ; } size ( K ) { byte [ ] rawKey = org . springframework . data . redis . core . DefaultSetOperations . rawKey ( key ) ; return org . springframework . data . redis . core . DefaultSetOperations . execute ( ( connection ) -> connection . sCard ( rawKey ) , true ) ; } | org . junit . Assert . assertTrue ( ( ( valueOps . size ( key ) ) > 0 ) ) |
testEquals2 ( ) { org . jfree . data . time . TimeSeries s1 = new org . jfree . data . time . TimeSeries ( "Series" , null , null , org . jfree . data . time . Day . class ) ; org . jfree . data . time . TimeSeries s2 = new org . jfree . data . time . TimeSeries ( "Series" , null , null , org . jfree . data . time . Day . class ) ; "<AssertPlaceHolder>" ; } equals ( java . lang . Object ) { if ( ! ( o instanceof com . mysql . fabric . Server ) ) { return false ; } com . mysql . fabric . Server s = ( ( com . mysql . fabric . Server ) ( o ) ) ; return s . getUuid ( ) . equals ( getUuid ( ) ) ; } | org . junit . Assert . assertTrue ( s1 . equals ( s2 ) ) |
testStartBillingRun_withUnsuccesfullSupplierSharesCalculation ( ) { doReturn ( Boolean . TRUE ) . when ( sharesCalculator ) . performBrokerSharesCalculationRun ( anyLong ( ) , anyLong ( ) ) ; doReturn ( Boolean . TRUE ) . when ( sharesCalculator ) . performMarketplacesSharesCalculationRun ( anyLong ( ) , anyLong ( ) ) ; doReturn ( Boolean . TRUE ) . when ( sharesCalculator ) . performResellerSharesCalculationRun ( anyLong ( ) , anyLong ( ) ) ; doReturn ( Boolean . FALSE ) . when ( sharesCalculator ) . performSupplierSharesCalculationRun ( anyLong ( ) , anyLong ( ) ) ; doReturn ( validBillingData ) . when ( bdr ) . getSubscriptionsForBilling ( anyLong ( ) , anyLong ( ) , anyLong ( ) ) ; boolean billingRun = billingServiceBean . startBillingRun ( currentTime ) ; "<AssertPlaceHolder>" ; } startBillingRun ( long ) { throw new java . lang . UnsupportedOperationException ( ) ; } | org . junit . Assert . assertFalse ( billingRun ) |
testBatchInitAndLearnStatistics ( ) { org . hawkular . datamining . forecast . ModelData rModel = org . hawkular . datamining . forecast . ModelReader . read ( "sineLowVarLong" ) ; org . hawkular . datamining . forecast . models . TripleExponentialSmoothing . TripleExOptimizer optimizer = org . hawkular . datamining . forecast . models . TripleExponentialSmoothing . optimizer ( rModel . getPeriods ( ) ) ; org . hawkular . datamining . forecast . models . TimeSeriesModel modelInit = optimizer . minimizedMSE ( rModel . getData ( ) ) ; org . hawkular . datamining . forecast . models . TripleExponentialSmoothing . TripleExState state = new org . hawkular . datamining . forecast . models . TripleExponentialSmoothing . TripleExState ( optimizer . result ( ) [ 3 ] , optimizer . result ( ) [ 4 ] , java . util . Arrays . copyOfRange ( optimizer . result ( ) , 5 , optimizer . result ( ) . length ) , rModel . getData ( ) . get ( 0 ) . getTimestamp ( ) ) ; org . hawkular . datamining . forecast . models . TimeSeriesModel modelLearn = org . hawkular . datamining . forecast . models . TripleExponentialSmoothing . createWithState ( state , optimizer . result ( ) [ 0 ] , optimizer . result ( ) [ 1 ] , optimizer . result ( ) [ 2 ] , org . hawkular . datamining . forecast . ImmutableMetricContext . getDefault ( ) ) ; modelLearn . learn ( rModel . getData ( ) ) ; org . hawkular . datamining . forecast . stats . AccuracyStatistics batchInitStatistics = modelInit . initStatistics ( ) ; org . hawkular . datamining . forecast . stats . AccuracyStatistics batchLearnStatistics = modelLearn . runStatistics ( ) ; "<AssertPlaceHolder>" ; } runStatistics ( ) { if ( ! ( initialized ) ) { return null ; } return model . runStatistics ( ) ; } | org . junit . Assert . assertEquals ( batchInitStatistics , batchLearnStatistics ) |
checkResourceIsCloseable ( ) { org . apache . commons . pool2 . impl . GenericObjectPoolConfig config = new org . apache . commons . pool2 . impl . GenericObjectPoolConfig ( ) ; config . setMaxTotal ( 1 ) ; config . setBlockWhenExhausted ( false ) ; redis . clients . jedis . JedisPool pool = new redis . clients . jedis . JedisPool ( config , redis . clients . jedis . tests . JedisPoolTest . hnp . getHost ( ) , redis . clients . jedis . tests . JedisPoolTest . hnp . getPort ( ) , 2000 , "foobared" ) ; redis . clients . jedis . Jedis jedis = pool . getResource ( ) ; try { jedis . set ( "hello" , "jedis" ) ; } finally { jedis . close ( ) ; } redis . clients . jedis . Jedis jedis2 = pool . getResource ( ) ; try { "<AssertPlaceHolder>" ; } finally { jedis2 . close ( ) ; } } getResource ( ) { while ( true ) { redis . clients . jedis . Jedis jedis = super . getResource ( ) ; jedis . setDataSource ( this ) ; final redis . clients . jedis . HostAndPort master = currentHostMaster ; final redis . clients . jedis . HostAndPort connection = new redis . clients . jedis . HostAndPort ( jedis . getClient ( ) . getHost ( ) , jedis . getClient ( ) . getPort ( ) ) ; if ( master . equals ( connection ) ) { return jedis ; } else { returnBrokenResource ( jedis ) ; } } } | org . junit . Assert . assertEquals ( jedis , jedis2 ) |
test_withAmount_BigDecimalRoundingMode_same ( ) { org . joda . money . Money test = org . joda . money . TestMoney . GBP_2_34 . withAmount ( org . joda . money . TestMoney . BIGDEC_2_34 , RoundingMode . UNNECESSARY ) ; "<AssertPlaceHolder>" ; } withAmount ( double , java . math . RoundingMode ) { return with ( money . withAmount ( amount ) . withCurrencyScale ( roundingMode ) ) ; } | org . junit . Assert . assertSame ( org . joda . money . TestMoney . GBP_2_34 , test ) |
open_empty_dir ( ) { java . util . Optional < com . groupon . lex . metrics . history . xdr . TSDataFileChain > opened = com . groupon . lex . metrics . history . xdr . TSDataFileChain . openDirExisting ( emptydir ) ; "<AssertPlaceHolder>" ; } empty ( ) { com . groupon . lex . metrics . resolver . SimpleBoundNameResolver bnr = new com . groupon . lex . metrics . resolver . SimpleBoundNameResolver ( new com . groupon . lex . metrics . resolver . SimpleBoundNameResolver . Names ( ) , new com . groupon . lex . metrics . resolver . ConstResolver ( new com . groupon . lex . metrics . resolver . ResolverTuple ( ) ) ) ; org . junit . Assert . assertEquals ( ( "()<sp>=<sp>" + ( bnr . getResolver ( ) . configString ( ) ) ) , bnr . configString ( ) ) ; org . junit . Assert . assertTrue ( bnr . isEmpty ( ) ) ; org . junit . Assert . assertEquals ( com . groupon . lex . metrics . resolver . EMPTY_LIST , bnr . getKeys ( ) . collect ( java . util . stream . Collectors . toList ( ) ) ) ; org . junit . Assert . assertEquals ( singletonList ( NamedResolverMap . EMPTY ) , bnr . resolve ( ) . collect ( java . util . stream . Collectors . toList ( ) ) ) ; } | org . junit . Assert . assertEquals ( java . util . Optional . empty ( ) , opened ) |
testNationaliteitenNull ( ) { final java . util . List < nl . bzk . brp . model . basis . BerichtEntiteit > overtreders = brby0158 . voerRegelUit ( null , bouwNieuweSituatie ( null ) , null , null ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; } | org . junit . Assert . assertEquals ( 0 , overtreders . size ( ) ) |
shouldAcceptValidTicket ( ) { org . openstack . atlas . api . validation . results . ValidatorResult result = validator . validate ( tickets , org . openstack . atlas . api . mgmt . validation . validators . POST ) ; "<AssertPlaceHolder>" ; } resultMessage ( org . openstack . atlas . api . validation . results . ValidatorResult , java . lang . Enum ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; if ( ! ( result . passedValidation ( ) ) ) { java . util . List < org . openstack . atlas . api . validation . results . ExpectationResult > ers = result . getValidationResults ( ) ; sb . append ( java . lang . String . format ( "ON<sp>%s<sp>result.withMessage([" , ctx . toString ( ) ) ) ; for ( org . openstack . atlas . api . validation . results . ExpectationResult er : ers ) { sb . append ( java . lang . String . format ( "%s" , er . getMessage ( ) ) ) ; sb . append ( "])" ) ; } } else { sb . append ( java . lang . String . format ( "On<sp>%s<sp>All<sp>Expectations<sp>PASSED\n" , ctx . toString ( ) ) ) ; } return sb . toString ( ) ; } | org . junit . Assert . assertTrue ( resultMessage ( result , org . openstack . atlas . api . mgmt . validation . validators . POST ) , result . passedValidation ( ) ) |
testAddDynamicFunction ( ) { org . bridj . NativeLibrary lib = org . bridj . BridJ . getNativeLibrary ( "test" ) ; org . bridj . DynamicFunction < ? > i = lib . getSymbolPointer ( "testAddDyncall" ) . asDynamicFunction ( null , int . class , int . class , int . class ) ; int res = ( ( java . lang . Integer ) ( i . apply ( 1 , 2 ) ) ) ; "<AssertPlaceHolder>" ; } getSymbolPointer ( java . lang . String ) { return org . bridj . Pointer . pointerToAddress ( getSymbolAddress ( name ) ) ; } | org . junit . Assert . assertEquals ( 3 , res ) |
testDiscardOperation ( ) { final org . jboss . dmr . ModelNode operation = new org . jboss . dmr . ModelNode ( ) ; operation . get ( ModelDescriptionConstants . OP ) . set ( "discard" ) ; operation . get ( ModelDescriptionConstants . OP_ADDR ) . set ( org . jboss . as . controller . test . OperationTransformationTestCase . TEST_DISCARD . toModelNode ( ) ) ; "<AssertPlaceHolder>" ; } transform ( org . jboss . as . controller . transform . TransformationContext , org . jboss . as . controller . PathAddress , org . jboss . dmr . ModelNode ) { return operation ; } | org . junit . Assert . assertNull ( transform ( operation , 1 , 1 ) ) |
testSetRead ( ) { java . lang . String testFileName = "testSetRead" ; java . lang . String targetIrodsCollection = org . irods . jargon . core . pub . CollectionAOImplTest . testingPropertiesHelper . buildIRODSCollectionAbsolutePathFromTestProperties ( org . irods . jargon . core . pub . CollectionAOImplTest . testingProperties , ( ( ( org . irods . jargon . core . pub . CollectionAOImplTest . IRODS_TEST_SUBDIR_PATH ) + "/" ) + testFileName ) ) ; org . irods . jargon . core . connection . IRODSAccount irodsAccount = org . irods . jargon . core . pub . CollectionAOImplTest . testingPropertiesHelper . buildIRODSAccountFromTestProperties ( org . irods . jargon . core . pub . CollectionAOImplTest . testingProperties ) ; org . irods . jargon . core . pub . CollectionAO collectionAO = org . irods . jargon . core . pub . CollectionAOImplTest . irodsFileSystem . getIRODSAccessObjectFactory ( ) . getCollectionAO ( irodsAccount ) ; org . irods . jargon . core . pub . io . IRODSFile irodsFile = org . irods . jargon . core . pub . CollectionAOImplTest . irodsFileSystem . getIRODSFileFactory ( irodsAccount ) . instanceIRODSFile ( targetIrodsCollection ) ; irodsFile . mkdirs ( ) ; collectionAO . setAccessPermissionRead ( "" , targetIrodsCollection , org . irods . jargon . core . pub . CollectionAOImplTest . testingProperties . getProperty ( TestingPropertiesHelper . IRODS_SECONDARY_USER_KEY ) , true ) ; org . irods . jargon . core . connection . IRODSAccount secondaryAccount = org . irods . jargon . core . pub . CollectionAOImplTest . testingPropertiesHelper . buildIRODSAccountFromSecondaryTestProperties ( org . irods . jargon . core . pub . CollectionAOImplTest . testingProperties ) ; org . irods . jargon . core . pub . io . IRODSFile irodsFileForSecondaryUser = org . irods . jargon . core . pub . CollectionAOImplTest . irodsFileSystem . getIRODSFileFactory ( secondaryAccount ) . instanceIRODSFile ( targetIrodsCollection ) ; "<AssertPlaceHolder>" ; } canRead ( ) { boolean canRead = false ; try { canRead = irodsFileSystemAO . isFileReadable ( this ) ; } catch ( org . irods . jargon . core . exception . FileNotFoundException e ) { org . irods . jargon . core . pub . io . IRODSFileImpl . log . warn ( "file<sp>not<sp>found<sp>exception,<sp>return<sp>false" , e ) ; } catch ( org . irods . jargon . core . exception . JargonException e ) { org . irods . jargon . core . pub . io . IRODSFileImpl . log . error ( "jargon<sp>exception,<sp>rethrow<sp>as<sp>unchecked" , e ) ; throw new org . irods . jargon . core . exception . JargonRuntimeException ( e ) ; } return canRead ; } | org . junit . Assert . assertTrue ( irodsFileForSecondaryUser . canRead ( ) ) |
listWithLimit ( ) { java . util . List < fm . last . moji . MojiFile > list = moji . list ( ( ( keyPrefix ) + "list" ) , 1 ) ; "<AssertPlaceHolder>" ; } list ( java . lang . String , int ) { fm . last . moji . impl . MojiImpl . log . debug ( "list()<sp>:<sp>{},<sp>{}" , keyPrefix , limit ) ; java . util . List < fm . last . moji . MojiFile > list = null ; fm . last . moji . impl . ListFilesCommand command = new fm . last . moji . impl . ListFilesCommand ( this , keyPrefix , domain , limit ) ; executor . executeCommand ( command ) ; list = command . getFileList ( ) ; fm . last . moji . impl . MojiImpl . log . debug ( "list()<sp>-><sp>{}" , list ) ; return list ; } | org . junit . Assert . assertThat ( list . size ( ) , org . hamcrest . CoreMatchers . is ( 1 ) ) |
testAddProjection ( ) { org . springframework . data . solr . core . query . Query query = new org . springframework . data . solr . core . query . SimpleQuery ( ) . addProjectionOnField ( new org . springframework . data . solr . core . query . SimpleField ( "field_1" ) ) . addProjectionOnField ( new org . springframework . data . solr . core . query . SimpleField ( "field_2" ) ) ; "<AssertPlaceHolder>" ; } getProjectionOnFields ( ) { return this . query . getProjectionOnFields ( ) ; } | org . junit . Assert . assertEquals ( 2 , ( ( java . util . List ) ( query . getProjectionOnFields ( ) ) ) . size ( ) ) |
stripTEHeadersCsvSeparatedExcludingTrailers ( ) { io . netty . handler . codec . http . HttpHeaders inHeaders = new io . netty . handler . codec . http . DefaultHttpHeaders ( ) ; inHeaders . add ( io . netty . handler . codec . http2 . TE , ( ( ( GZIP ) + "," ) + ( TRAILERS ) ) ) ; io . netty . handler . codec . http2 . Http2Headers out = new io . netty . handler . codec . http2 . DefaultHttp2Headers ( ) ; io . netty . handler . codec . http2 . HttpConversionUtil . toHttp2Headers ( inHeaders , out ) ; "<AssertPlaceHolder>" ; } get ( java . lang . CharSequence ) { return get0 ( name ) ; } | org . junit . Assert . assertSame ( io . netty . handler . codec . http2 . TRAILERS , out . get ( io . netty . handler . codec . http2 . TE ) ) |
testGetDeploymentTifResourceData ( ) { org . camunda . bpm . engine . rest . Resource resource = org . camunda . bpm . engine . rest . helper . MockProvider . createMockDeploymentTifResource ( ) ; org . camunda . bpm . engine . rest . List < org . camunda . bpm . engine . rest . Resource > resources = new org . camunda . bpm . engine . rest . ArrayList < org . camunda . bpm . engine . rest . Resource > ( ) ; resources . add ( resource ) ; java . io . InputStream input = new java . io . ByteArrayInputStream ( createMockDeploymentResourceByteData ( ) ) ; when ( mockRepositoryService . getDeploymentResources ( eq ( org . camunda . bpm . engine . rest . EXAMPLE_DEPLOYMENT_ID ) ) ) . thenReturn ( resources ) ; when ( mockRepositoryService . getResourceAsStreamById ( eq ( org . camunda . bpm . engine . rest . EXAMPLE_DEPLOYMENT_ID ) , eq ( org . camunda . bpm . engine . rest . EXAMPLE_DEPLOYMENT_TIF_RESOURCE_ID ) ) ) . thenReturn ( input ) ; io . restassured . response . Response response = io . restassured . RestAssured . given ( ) . pathParam ( "id" , org . camunda . bpm . engine . rest . EXAMPLE_DEPLOYMENT_ID ) . pathParam ( "resourceId" , org . camunda . bpm . engine . rest . EXAMPLE_DEPLOYMENT_TIF_RESOURCE_ID ) . then ( ) . expect ( ) . statusCode ( Status . OK . getStatusCode ( ) ) . contentType ( "image/tiff" ) . header ( "Content-Disposition" , ( "attachment;<sp>filename=" + ( org . camunda . bpm . engine . rest . helper . MockProvider . EXAMPLE_DEPLOYMENT_TIF_RESOURCE_NAME ) ) ) . when ( ) . get ( org . camunda . bpm . engine . rest . DeploymentRestServiceInteractionTest . SINGLE_RESOURCE_DATA_URL ) ; java . lang . String responseContent = response . asString ( ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { org . camunda . bpm . engine . rest . hal . cache . HalResourceCacheEntry cacheEntry = cache . get ( id ) ; if ( cacheEntry != null ) { if ( expired ( cacheEntry ) ) { remove ( cacheEntry . getId ( ) ) ; return null ; } else { return cacheEntry . getResource ( ) ; } } else { return null ; } } | org . junit . Assert . assertNotNull ( responseContent ) |
testAccessUpdateServiceWithRights ( ) { net . maritimecloud . identityregistry . model . database . entities . Service service = new net . maritimecloud . identityregistry . model . database . entities . Service ( ) ; service . setMrn ( "urn:mrn:mcl:service:instance:dma:nw-nm" ) ; service . setName ( "urn:mrn:mcl:service:instance:dma:nw-nm" 7 ) ; service . setInstanceVersion ( "0.3.4" ) ; service . setIdOrganization ( 1L ) ; service . setOidcAccessType ( "bearer-only" ) ; service . setOidcRedirectUri ( "urn:mrn:mcl:service:instance:dma:nw-nm" 5 ) ; java . lang . String serviceJson = serialize ( service ) ; net . maritimecloud . identityregistry . model . database . Organization org = spy ( net . maritimecloud . identityregistry . model . database . Organization . class ) ; org . setMrn ( "urn:mrn:mcl:service:instance:dma:nw-nm" 0 ) ; org . setAddress ( "Carl<sp>Jakobsensvej<sp>31,<sp>2500<sp>Valby" ) ; org . setCountry ( "Denmark" ) ; org . setUrl ( "http://dma.dk" ) ; org . setEmail ( "urn:mrn:mcl:service:instance:dma:nw-nm" 2 ) ; org . setName ( "urn:mrn:mcl:service:instance:dma:nw-nm" 3 ) ; java . util . Set < net . maritimecloud . identityregistry . model . database . IdentityProviderAttribute > identityProviderAttributes = new java . util . HashSet ( ) ; org . setIdentityProviderAttributes ( identityProviderAttributes ) ; org . keycloak . adapters . springsecurity . token . KeycloakAuthenticationToken auth = net . maritimecloud . identityregistry . controllers . TokenGenerator . generateKeycloakToken ( "urn:mrn:mcl:service:instance:dma:nw-nm" 0 , "ROLE_SERVICE_ADMIN" , "urn:mrn:mcl:service:instance:dma:nw-nm" 4 ) ; given ( this . organizationService . getOrganizationByMrn ( "urn:mrn:mcl:service:instance:dma:nw-nm" 0 ) ) . willReturn ( org ) ; given ( ( ( net . maritimecloud . identityregistry . services . ServiceService ) ( this . entityService ) ) . getServiceByMrnAndVersion ( "urn:mrn:mcl:service:instance:dma:nw-nm" , "0.3.4" ) ) . willReturn ( service ) ; when ( org . getId ( ) ) . thenReturn ( 1L ) ; try { mvc . perform ( put ( "/oidc/api/org/urn:mrn:mcl:org:dma/service/urn:mrn:mcl:service:instance:dma:nw-nm/0.3.4" ) . with ( authentication ( auth ) ) . header ( "urn:mrn:mcl:service:instance:dma:nw-nm" 6 , "bla" ) . content ( serviceJson ) . contentType ( "urn:mrn:mcl:service:instance:dma:nw-nm" 1 ) ) . andExpect ( status ( ) . isOk ( ) ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; "<AssertPlaceHolder>" ; } try { verify ( this . keycloakAU , times ( 1 ) ) . createClient ( "0.3.4-urn:mrn:mcl:service:instance:dma:nw-nm" , "bearer-only" , "urn:mrn:mcl:service:instance:dma:nw-nm" 5 ) ; } catch ( java . io . IOException | net . maritimecloud . identityregistry . exception . DuplicatedKeycloakEntry e ) { e . printStackTrace ( ) ; org . junit . Assert . fail ( ) ; } } getId ( ) { return id ; } | org . junit . Assert . assertTrue ( false ) |
testConvertToRuleActionIn ( ) { org . hawkular . apm . api . model . config . instrumentation . jvm . InstrumentComponent im = new org . hawkular . apm . api . model . config . instrumentation . jvm . InstrumentComponent ( ) ; im . setComponentTypeExpression ( "\"MyComponent\"" ) ; im . setOperationExpression ( "\"MyOperation\"" ) ; im . setUriExpression ( "\"MyUri\"" ) ; org . hawkular . apm . instrumenter . rules . InstrumentComponentTransformer transformer = new org . hawkular . apm . instrumenter . rules . InstrumentComponentTransformer ( ) ; java . lang . String transformed = transformer . convertToRuleAction ( im ) ; java . lang . String expected = ( org . hawkular . apm . instrumenter . rules . InstrumentComponentTransformerTest . ACTION_PREFIX ) + "componentStart(getRuleName(),\"MyUri\",\"MyComponent\",\"MyOperation\")" ; "<AssertPlaceHolder>" ; } convertToRuleAction ( org . hawkular . apm . api . model . config . instrumentation . jvm . InstrumentAction ) { return "unlink()" ; } | org . junit . Assert . assertEquals ( expected , transformed ) |
testImportedSmallImageAfterUpdate ( ) { initExport ( ) ; com . liferay . blogs . model . BlogsEntry entry = addBlogsEntryWithSmallImage ( ) ; com . liferay . exportimport . kernel . lar . StagedModelDataHandlerUtil . exportStagedModel ( portletDataContext , entry ) ; initImport ( ) ; com . liferay . blogs . model . BlogsEntry exportedEntry = ( ( com . liferay . blogs . model . BlogsEntry ) ( readExportedStagedModel ( entry ) ) ) ; com . liferay . exportimport . kernel . lar . StagedModelDataHandlerUtil . importStagedModel ( portletDataContext , exportedEntry ) ; com . liferay . blogs . model . BlogsEntry importedEntry = ( ( com . liferay . blogs . model . BlogsEntry ) ( getStagedModel ( entry . getUuid ( ) , liveGroup ) ) ) ; long smallImageFileEntryId = importedEntry . getSmallImageFileEntryId ( ) ; initExport ( ) ; com . liferay . blogs . model . BlogsEntry updatedEntry = _updateBlogsEntry ( entry ) ; com . liferay . exportimport . kernel . lar . StagedModelDataHandlerUtil . exportStagedModel ( portletDataContext , updatedEntry ) ; initImport ( ) ; com . liferay . blogs . model . BlogsEntry exportedUpdatedEntry = ( ( com . liferay . blogs . model . BlogsEntry ) ( readExportedStagedModel ( updatedEntry ) ) ) ; com . liferay . exportimport . kernel . lar . StagedModelDataHandlerUtil . importStagedModel ( portletDataContext , exportedUpdatedEntry ) ; com . liferay . blogs . model . BlogsEntry importedUpdatedEntry = ( ( com . liferay . blogs . model . BlogsEntry ) ( getStagedModel ( updatedEntry . getUuid ( ) , liveGroup ) ) ) ; "<AssertPlaceHolder>" ; } getSmallImageFileEntryId ( ) { return _smallImageFileEntryId ; } | org . junit . Assert . assertEquals ( smallImageFileEntryId , importedUpdatedEntry . getSmallImageFileEntryId ( ) ) |
testGetParametersWithDefaultEntityAndDisabledSecurity ( ) { unit . setSecurity ( false ) ; org . lnu . is . domain . specoffer . SpecOfferWave entity = new org . lnu . is . domain . specoffer . SpecOfferWave ( ) ; java . util . Map < java . lang . String , java . lang . Object > expected = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; expected . put ( "status" , RowStatus . ACTIVE ) ; java . util . Map < java . lang . String , java . lang . Object > actual = unit . getParameters ( entity ) ; "<AssertPlaceHolder>" ; } getParameters ( org . springframework . web . context . request . NativeWebRequest ) { java . util . Map < java . lang . String , java . lang . Object > resultMap = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; java . util . Map < java . lang . String , java . lang . String > pathVariables = ( ( java . util . Map < java . lang . String , java . lang . String > ) ( webRequest . getAttribute ( HandlerMapping . URI_TEMPLATE_VARIABLES_ATTRIBUTE , RequestAttributes . SCOPE_REQUEST ) ) ) ; java . util . Map < java . lang . String , java . lang . Object > requestParams = getRequestParameterMap ( webRequest ) ; for ( Map . Entry < java . lang . String , java . lang . Object > entry : requestParams . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } resultMap . putAll ( pathVariables ) ; return resultMap ; } | org . junit . Assert . assertEquals ( expected , actual ) |
shouldSetAndGetProperties ( ) { org . apache . ibatis . reflection . MetaObject object = org . apache . ibatis . reflection . SystemMetaObject . forObject ( new org . apache . ibatis . domain . blog . Author ( ) ) ; object . setValue ( "email" , "test" ) ; "<AssertPlaceHolder>" ; } getValue ( java . lang . String ) { org . apache . ibatis . reflection . property . PropertyTokenizer prop = new org . apache . ibatis . reflection . property . PropertyTokenizer ( name ) ; if ( prop . hasNext ( ) ) { org . apache . ibatis . reflection . MetaObject metaValue = metaObjectForProperty ( prop . getIndexedName ( ) ) ; if ( metaValue == ( SystemMetaObject . NULL_META_OBJECT ) ) { return null ; } else { return metaValue . getValue ( prop . getChildren ( ) ) ; } } else { return objectWrapper . get ( prop ) ; } } | org . junit . Assert . assertEquals ( "test" , object . getValue ( "email" ) ) |
zonedTimeFormatLegacy ( ) { java . util . Date time = new java . util . Date ( ) ; java . text . DateFormat dfDate = new java . text . SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss'Z'Z" ) ; java . lang . String str = dfDate . format ( time ) ; java . util . Date dtParsed = com . cloud . utils . DateUtil . parseTZDateString ( str ) ; "<AssertPlaceHolder>" ; } toString ( ) { return ( ( ( ( ( ( "ClipboardDataFormat<sp>[id=" + ( id ) ) + ",<sp>name=\"" ) + ( name ) ) + "\"" ) + ( ( id ) == ( rdpclient . clip . ClipboardDataFormat . CB_FORMAT_UNICODETEXT ) ? "<sp>(Unicode<sp>text)" : "" ) ) + ( ( id ) == ( rdpclient . clip . ClipboardDataFormat . CB_FORMAT_TEXT ) ? "<sp>(text)" : "" ) ) + "]" ; } | org . junit . Assert . assertEquals ( str , time . toString ( ) , dtParsed . toString ( ) ) |
storageTest2 ( ) { com . navercorp . pinpoint . profiler . sender . StandbySpanStreamDataStorage storage = new com . navercorp . pinpoint . profiler . sender . StandbySpanStreamDataStorage ( ) ; com . navercorp . pinpoint . profiler . sender . SpanStreamSendData oldValue = createSpanStreamSendData ( ) ; com . navercorp . pinpoint . profiler . sender . SpanStreamSendData newValue = createSpanStreamSendData ( "a" . getBytes ( ) ) ; oldValue . addBuffer ( "test" . getBytes ( ) ) ; storage . addStandbySpanStreamData ( oldValue ) ; storage . addStandbySpanStreamData ( newValue ) ; "<AssertPlaceHolder>" ; } getStandbySpanStreamSendData ( ) { synchronized ( lock ) { return standbySpanStreamDataStorage . getStandbySpanStreamSendData ( ) ; } } | org . junit . Assert . assertEquals ( newValue , storage . getStandbySpanStreamSendData ( ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.