input
stringlengths 28
18.7k
| output
stringlengths 39
1.69k
|
|---|---|
doWebSocketConnectWithInvalidSubprotocl ( ) { org . apache . vysper . xmpp . extension . websockets . JettyXmppWebSocketServlet servlet = new org . apache . vysper . xmpp . extension . websockets . JettyXmppWebSocketServlet ( serverRuntimeContext ) ; org . eclipse . jetty . websocket . WebSocket webSocket = servlet . doWebSocketConnect ( null , "dummy" ) ; "<AssertPlaceHolder>" ; } doWebSocketConnect ( javax . servlet . http . HttpServletRequest , java . lang . String ) { if ( org . apache . vysper . xmpp . extension . websockets . JettyXmppWebSocketServlet . SUB_PROTOCOL . equals ( protocol ) ) { org . apache . vysper . xmpp . extension . websockets . JettyXmppWebSocket sessionContext = new org . apache . vysper . xmpp . extension . websockets . JettyXmppWebSocket ( serverRuntimeContext ) ; return sessionContext ; } else { org . apache . vysper . xmpp . extension . websockets . JettyXmppWebSocketServlet . LOG . warn ( "Unsupported<sp>WebSocket<sp>sub<sp>protocol,<sp>must<sp>be<sp>\"xmpp\"" ) ; return null ; } }
|
org . junit . Assert . assertNull ( webSocket )
|
testM4Strings2 ( ) { java . lang . String text = "myword(!!boundary==)\n" ; org . eclipse . jface . text . IDocument document = createDocument ( text ) ; org . eclipse . cdt . autotools . ui . editors . parser . AutoconfTokenizer tokenizer = createTokenizer ( document ) ; tokenizer . setM4Context ( true ) ; tokenizer . setM4Quote ( "!!" , "==" ) ; java . util . List < org . eclipse . cdt . autotools . ui . editors . parser . Token > tokens = tokenize ( tokenizer ) ; "<AssertPlaceHolder>" ; checkToken ( tokens . get ( 0 ) , document , ITokenConstants . WORD , "myword" ) ; checkToken ( tokens . get ( 1 ) , document , ITokenConstants . LPAREN , "(" ) ; checkToken ( tokens . get ( 2 ) , document , ITokenConstants . M4_STRING , "boundary" , ( ( 8 + 2 ) + 2 ) ) ; checkToken ( tokens . get ( 3 ) , document , ITokenConstants . RPAREN , ")" ) ; checkToken ( tokens . get ( 4 ) , document , ITokenConstants . EOL , "\n" ) ; } size ( ) { return fSize ; }
|
org . junit . Assert . assertEquals ( 5 , tokens . size ( ) )
|
testSetId ( ) { org . gradoop . common . model . impl . pojo . Element elementMock = mock ( org . gradoop . common . model . impl . pojo . Element . class , org . gradoop . common . model . impl . pojo . CALLS_REAL_METHODS ) ; org . gradoop . common . model . impl . id . GradoopId id = org . gradoop . common . model . impl . id . GradoopId . get ( ) ; elementMock . setId ( id ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
|
org . junit . Assert . assertSame ( id , elementMock . getId ( ) )
|
voidedSuccess ( ) { io . trane . future . Promise < java . lang . Integer > p = io . trane . future . Promise . apply ( ) ; io . trane . future . Future < java . lang . Void > future = p . voided ( ) ; p . setValue ( 1 ) ; "<AssertPlaceHolder>" ; } get ( io . trane . future . Future ) { return future . get ( Duration . ZERO ) ; }
|
org . junit . Assert . assertNull ( get ( future ) )
|
testInsertFinalClassInstance ( ) { final org . kie . api . KieBase kbase = org . drools . compiler . integrationtests . SerializationHelper . serializeObject ( loadKnowledgeBase ( "test_FinalClass.drl" ) ) ; final org . kie . api . runtime . KieSession ksession = createKnowledgeSession ( kbase ) ; final java . util . List list = new java . util . ArrayList ( ) ; ksession . setGlobal ( "results" , list ) ; final org . drools . compiler . PersonFinal bob = new org . drools . compiler . PersonFinal ( ) ; bob . setName ( "bob" ) ; bob . setStatus ( null ) ; ksession . insert ( bob ) ; ksession . fireAllRules ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return rulesFired . size ( ) ; }
|
org . junit . Assert . assertEquals ( 1 , list . size ( ) )
|
testPersistMerge ( ) { this . persist ( this . createParent ( 1 ) ) ; this . commit ( ) ; org . batoo . jpa . core . test . merge . Parent parent = this . createParent ( 1 ) ; parent = this . merge ( parent ) ; "<AssertPlaceHolder>" ; } getCounts2 ( ) { final int [ ] counts = new int [ 4 ] ; try { for ( int i = 0 ; i < 4 ; i ++ ) { counts [ i ] = new org . batoo . jpa . jdbc . dbutils . QueryRunner ( this . em ( ) . unwrap ( javax . sql . DataSource . class ) ) . query ( ( "SELECT<sp>COUNT(*)<sp>FROM<sp>Child" + ( i + 1 ) ) , new org . batoo . jpa . jdbc . dbutils . SingleValueHandler < java . lang . Number > ( ) ) . intValue ( ) ; } org . batoo . jpa . core . test . merge . MergeTest . LOG . debug ( "Remaining<sp>children<sp>are:<sp>{0},<sp>{1},<sp>{2},<sp>{3}" , counts [ 0 ] , counts [ 1 ] , counts [ 2 ] , counts [ 3 ] ) ; } catch ( final java . sql . SQLException e ) { throw new java . lang . RuntimeException ( e ) ; } return counts ; }
|
org . junit . Assert . assertTrue ( java . util . Arrays . equals ( new int [ ] { 2 , 2 , 2 , 2 } , this . getCounts2 ( ) ) )
|
testInvokeJavascriptReturnValue_Null ( ) { java . lang . String arg = "myArg" ; java . lang . Object [ ] argArray = new java . lang . Object [ ] { arg } ; java . lang . String function = "myFunction" ; when ( mockJsObject . call ( function , argArray ) ) . thenReturn ( null ) ; java . lang . String returnValue = testJavascriptObject . invokeJavascriptReturnValue ( function , java . lang . String . class , arg ) ; "<AssertPlaceHolder>" ; } invokeJavascriptReturnValue ( java . lang . String , java . lang . Class , java . lang . Object [ ] ) { java . lang . Object returnObject = invokeJavascript ( function , args ) ; if ( returnObject != null ) { return ( ( T ) ( returnObject ) ) ; } else { return null ; } }
|
org . junit . Assert . assertNull ( returnValue )
|
testHasJsps_jspInSub ( ) { org . eclipse . wst . common . componentcore . resources . IVirtualFolder root = mock ( org . eclipse . wst . common . componentcore . resources . IVirtualFolder . class , "/" ) ; org . eclipse . wst . common . componentcore . resources . IVirtualFolder folder = mock ( org . eclipse . wst . common . componentcore . resources . IVirtualFolder . class , "/a" ) ; org . eclipse . wst . common . componentcore . resources . IVirtualFile jsp = mock ( org . eclipse . wst . common . componentcore . resources . IVirtualFile . class , "/a/a.jsp" ) ; when ( jsp . getFileExtension ( ) ) . thenReturn ( "jsp" ) ; when ( root . members ( ) ) . thenReturn ( new org . eclipse . wst . common . componentcore . resources . IVirtualResource [ ] { folder } ) ; when ( folder . members ( ) ) . thenReturn ( new org . eclipse . wst . common . componentcore . resources . IVirtualResource [ ] { jsp } ) ; "<AssertPlaceHolder>" ; verify ( root , times ( 2 ) ) . members ( ) ; verify ( folder ) . members ( ) ; verify ( jsp ) . getFileExtension ( ) ; verifyNoMoreInteractions ( root , folder , jsp ) ; } hasJsps ( org . eclipse . core . resources . IProject ) { org . eclipse . wst . common . componentcore . resources . IVirtualComponent component = org . eclipse . wst . common . componentcore . ComponentCore . createComponent ( project ) ; if ( ( component == null ) || ( ! ( component . exists ( ) ) ) ) { return false ; } return com . google . cloud . tools . eclipse . appengine . facets . WebProjectUtil . hasJsps ( component . getRootFolder ( ) ) ; }
|
org . junit . Assert . assertTrue ( com . google . cloud . tools . eclipse . appengine . facets . WebProjectUtil . hasJsps ( root ) )
|
testGeenDocumentInBron ( ) { final nl . bzk . brp . model . bericht . kern . HuwelijkGeregistreerdPartnerschapBericht nieuwSituatie = maakNieuwSituatie ( nl . bzk . brp . bijhouding . business . regels . impl . gegevenset . verbintenis . BRAL2110Test . GEMEENTE_AMSTERDAM ) ; final nl . bzk . brp . model . bericht . kern . ActieBericht actieBericht = maakActieBericht ( ) ; actieBericht . getBronnen ( ) . add ( new nl . bzk . brp . model . bericht . kern . ActieBronBericht ( ) ) ; final java . util . List < nl . bzk . brp . model . basis . BerichtEntiteit > berichtEntiteits = bral2110 . voerRegelUit ( null , nieuwSituatie , actieBericht , null ) ; "<AssertPlaceHolder>" ; } size ( ) { return elementen . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , berichtEntiteits . size ( ) )
|
checkImportJavaRDDOfElements ( ) { final uk . gov . gchq . gaffer . graph . Graph graph1 = new uk . gov . gchq . gaffer . graph . Graph . Builder ( ) . config ( new uk . gov . gchq . gaffer . graph . GraphConfig . Builder ( ) . graphId ( "graphId" ) . build ( ) ) . addSchema ( getClass ( ) . getResourceAsStream ( "/schema/elements.json" ) ) . addSchema ( getClass ( ) . getResourceAsStream ( "/schema/types.json" ) ) . addSchema ( getClass ( ) . getResourceAsStream ( "B" 2 ) ) . storeProperties ( getClass ( ) . getResourceAsStream ( "/store.properties" ) ) . build ( ) ; final java . util . List < uk . gov . gchq . gaffer . data . element . Element > elements = new java . util . ArrayList ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) { final uk . gov . gchq . gaffer . data . element . Entity entity = new uk . gov . gchq . gaffer . data . element . Entity . Builder ( ) . group ( TestGroups . ENTITY ) . vertex ( ( "" + i ) ) . build ( ) ; final uk . gov . gchq . gaffer . data . element . Edge edge1 = new uk . gov . gchq . gaffer . data . element . Edge . Builder ( ) . group ( TestGroups . EDGE ) . source ( ( "" + i ) ) . dest ( "B" ) . directed ( false ) . property ( TestPropertyNames . COUNT , 2 ) . build ( ) ; final uk . gov . gchq . gaffer . data . element . Edge edge2 = new uk . gov . gchq . gaffer . data . element . Edge . Builder ( ) . group ( TestGroups . EDGE ) . source ( ( "" + i ) ) . dest ( "B" 1 ) . directed ( false ) . property ( TestPropertyNames . COUNT , 4 ) . build ( ) ; elements . add ( edge1 ) ; elements . add ( edge2 ) ; elements . add ( entity ) ; } final uk . gov . gchq . gaffer . user . User user = new uk . gov . gchq . gaffer . user . User ( ) ; final org . apache . spark . sql . SparkSession sparkSession = uk . gov . gchq . gaffer . spark . SparkSessionProvider . getSparkSession ( ) ; final org . apache . hadoop . conf . Configuration configuration = new org . apache . hadoop . conf . Configuration ( ) ; final java . lang . String configurationString = uk . gov . gchq . gaffer . sparkaccumulo . operation . handler . AbstractGetRDDHandler . convertConfigurationToString ( configuration ) ; final java . lang . String outputPath = ( testFolder . getRoot ( ) . getAbsolutePath ( ) ) + "/output" ; final java . lang . String failurePath = ( testFolder . getRoot ( ) . getAbsolutePath ( ) ) + "/failure" ; final org . apache . spark . api . java . JavaRDD < uk . gov . gchq . gaffer . data . element . Element > elementJavaRDD = org . apache . spark . api . java . JavaSparkContext . fromSparkContext ( sparkSession . sparkContext ( ) ) . parallelize ( elements ) ; final uk . gov . gchq . gaffer . spark . operation . javardd . ImportJavaRDDOfElements addRdd = new uk . gov . gchq . gaffer . spark . operation . javardd . ImportJavaRDDOfElements . Builder ( ) . input ( elementJavaRDD ) . option ( "outputPath" , outputPath ) . option ( "B" 0 , failurePath ) . build ( ) ; graph1 . execute ( addRdd , user ) ; final uk . gov . gchq . gaffer . spark . operation . javardd . GetJavaRDDOfAllElements rddQuery = new uk . gov . gchq . gaffer . spark . operation . javardd . GetJavaRDDOfAllElements . Builder ( ) . option ( AbstractGetRDDHandler . HADOOP_CONFIGURATION_KEY , configurationString ) . build ( ) ; final org . apache . spark . api . java . JavaRDD < uk . gov . gchq . gaffer . data . element . Element > rdd = graph1 . execute ( rddQuery , user ) ; if ( rdd == null ) { org . junit . Assert . fail ( "No<sp>RDD<sp>returned" ) ; } final java . util . Set < uk . gov . gchq . gaffer . data . element . Element > results = new java . util . HashSet ( rdd . collect ( ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return map . size ( ) ; }
|
org . junit . Assert . assertEquals ( elements . size ( ) , results . size ( ) )
|
deveObterEventosComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe400 . classes . evento . cancelamento . NFEnviaEventoCancelamento eventoCancelamento = new com . fincatto . documentofiscal . nfe400 . classes . evento . cancelamento . NFEnviaEventoCancelamento ( ) ; final java . util . ArrayList < com . fincatto . documentofiscal . nfe400 . classes . evento . cancelamento . NFEventoCancelamento > eventosCancelamento = new java . util . ArrayList ( ) ; eventoCancelamento . setEvento ( eventosCancelamento ) ; "<AssertPlaceHolder>" ; } getEvento ( ) { return this . evento ; }
|
org . junit . Assert . assertEquals ( eventosCancelamento , eventoCancelamento . getEvento ( ) )
|
testReadFromWithMessageNum3 ( ) { org . o3project . odenos . core . component . network . flow . FlowChanged target = new org . o3project . odenos . core . component . network . flow . FlowChanged ( paramPrev , paramCurr , org . o3project . odenos . core . component . network . flow . FlowChanged . Action . add ) ; org . msgpack . MessagePack msg = new org . msgpack . MessagePack ( ) ; java . io . ByteArrayOutputStream out = new java . io . ByteArrayOutputStream ( ) ; org . msgpack . packer . Packer pk = msg . createPacker ( out ) ; byte [ ] bytes ; java . io . ByteArrayInputStream in ; org . msgpack . unpacker . Unpacker upk = null ; try { pk . writeMapBegin ( 3 ) ; pk . write ( "id" ) ; pk . write ( "TestId" ) ; pk . write ( "version" ) ; pk . write ( "VERSION" ) ; pk . write ( "action" ) ; pk . write ( "update" ) ; pk . write ( "prev" ) ; pk . write ( target . prev ) ; pk . write ( "curr" ) ; pk . write ( ( ( java . lang . String ) ( null ) ) ) ; pk . writeMapEnd ( ) ; bytes = out . toByteArray ( ) ; in = new java . io . ByteArrayInputStream ( bytes ) ; upk = msg . createUnpacker ( in ) ; } catch ( java . lang . Exception e ) { org . junit . Assert . fail ( "Exception<sp>in<sp>test<sp>setup" ) ; } target = org . mockito . Mockito . spy ( new org . o3project . odenos . core . component . network . flow . FlowChanged ( ) ) ; try { target . readFrom ( upk ) ; } catch ( java . lang . Exception e ) { "<AssertPlaceHolder>" ; return ; } org . junit . Assert . fail ( "could<sp>not<sp>catch<sp>an<sp>exception" ) ; } readFrom ( org . msgpack . unpacker . Unpacker ) { int size = upk . readMapBegin ( ) ; if ( size != ( org . o3project . odenos . remoteobject . event . BaseObjectChanged . MSG_NUM ) ) { throw new java . io . IOException ( ) ; } while ( ( size -- ) > 0 ) { java . lang . String field = upk . readString ( ) ; switch ( field ) { case "action" : action = upk . readString ( ) ; break ; case "prev" : if ( ! ( upk . trySkipNil ( ) ) ) { prev = upk . read ( this . msgClass ) ; } break ; case "curr" : if ( ! ( upk . trySkipNil ( ) ) ) { curr = upk . read ( this . msgClass ) ; } break ; default : throw new java . io . IOException ( ) ; } } upk . readMapEnd ( ) ; }
|
org . junit . Assert . assertTrue ( ( e instanceof java . io . IOException ) )
|
testInteger3 ( ) { org . eclipse . birt . data . engine . olap . data . document . BlockRandomAccessObject documentObject = new org . eclipse . birt . data . engine . olap . data . document . BlockRandomAccessObject ( new org . eclipse . birt . data . engine . olap . data . util . BufferedRandomAccessFile ( new java . io . File ( ( ( ( org . eclipse . birt . data . engine . olap . data . document . BufferedRandomAccessObjectTest . tmpPath ) + ( java . io . File . separatorChar ) ) + "testInteger1" ) ) , "rw" , 1024 ) , "testInteger2" , 0 , 0 , new org . eclipse . birt . data . engine . olap . data . document . DocumentObjectAllocatedTable ( ) ) ; byte [ ] bytes = new byte [ 1024 ] ; bytes [ 0 ] = 1 ; bytes [ 1 ] = 2 ; documentObject . seek ( 0 ) ; documentObject . write ( bytes , 0 , bytes . length ) ; documentObject . write ( bytes , 0 , bytes . length ) ; documentObject . write ( bytes , 0 , bytes . length ) ; bytes = new byte [ 932 ] ; documentObject . write ( bytes , 0 , bytes . length ) ; "<AssertPlaceHolder>" ; documentObject . close ( ) ; } read ( byte [ ] , int , int ) { if ( ( in ) != null ) { return in . read ( a , offset , num ) ; } dataIn . readFully ( a , offset , num ) ; return num ; }
|
org . junit . Assert . assertEquals ( documentObject . read ( bytes , 0 , bytes . length ) , ( - 1 ) )
|
testGet_workflow_run_accession ( ) { logger . info ( "get_workflow_run_accession" ) ; int workflowRunId = 23 ; int expResult = 863 ; int result = net . sourceforge . seqware . common . metadata . MetadataWSTest . instance . get_workflow_run_accession ( workflowRunId ) ; "<AssertPlaceHolder>" ; } get_workflow_run_accession ( int ) { return workflowRunId ; }
|
org . junit . Assert . assertEquals ( expResult , result )
|
testGetChunkTooHighIndex ( ) { java . io . File file = new java . io . File ( org . hive2hive . core . file . FileChunkUtilTest . parent , randomString ( ) ) ; org . apache . commons . io . FileUtils . write ( file , "test" ) ; org . hive2hive . core . model . Chunk chunk = org . hive2hive . core . file . FileChunkUtil . getChunk ( file , TestFileConfiguration . CHUNK_SIZE , 100 , randomString ( ) ) ; "<AssertPlaceHolder>" ; } randomString ( ) { return java . util . UUID . randomUUID ( ) . toString ( ) ; }
|
org . junit . Assert . assertNull ( chunk )
|
shouldReturnAllTransientNodeKeys ( ) { org . modeshape . jcr . cache . NodeKey rootKey = session1 . getRootKey ( ) ; org . modeshape . jcr . cache . MutableCachedNode root = session1 . mutable ( rootKey ) ; org . modeshape . jcr . cache . NodeKey childAKey = root . createChild ( session ( ) , newKey ( "x-childA" ) , name ( "childA" ) , property ( "p1" , "value<sp>A" ) ) . getKey ( ) ; org . modeshape . jcr . cache . NodeKey childBKey = root . createChild ( session ( ) , newKey ( "x-childB" ) , name ( "childB" ) , property ( "p1" , "value<sp>B" ) ) . getKey ( ) ; java . util . Set < org . modeshape . jcr . cache . NodeKey > transientNodeKeys = session1 . getChangedNodeKeys ( ) ; "<AssertPlaceHolder>" ; } getChangedNodeKeys ( ) { return delegate . getChangedNodeKeys ( ) ; }
|
org . junit . Assert . assertEquals ( new java . util . HashSet < org . modeshape . jcr . cache . NodeKey > ( java . util . Arrays . asList ( rootKey , childAKey , childBKey ) ) , transientNodeKeys )
|
testStandardize ( ) { final org . nd4j . linalg . api . ndarray . INDArray random = org . nd4j . linalg . factory . Nd4j . rand ( new int [ ] { 10 , 4 } ) ; final int [ ] axis = new int [ ] { 1 } ; final org . nd4j . linalg . api . ndarray . INDArray means = random . mean ( axis ) ; final org . nd4j . linalg . api . ndarray . INDArray std = random . std ( false , axis ) ; final org . nd4j . linalg . api . ndarray . INDArray res = random . subColumnVector ( means ) . divColumnVector ( std ) ; final org . nd4j . linalg . api . ndarray . INDArray expOut = res . norm1 ( ) ; org . nd4j . autodiff . samediff . SameDiff sd = org . nd4j . autodiff . samediff . SameDiff . create ( ) ; org . nd4j . autodiff . samediff . SDVariable sdA = sd . var ( "a" , random ) ; org . nd4j . autodiff . samediff . SDVariable t = sd . math . standardize ( sdA , axis ) ; t . norm1 ( "out" ) ; java . lang . String err = org . nd4j . autodiff . validation . OpValidation . validate ( new org . nd4j . autodiff . validation . TestCase ( sd ) . expectedOutput ( "out" , expOut ) . gradientCheck ( true ) ) ; "<AssertPlaceHolder>" ; } gradientCheck ( boolean ) { this . setGradientCheck ( isGradientCheck ) ; return this ; }
|
org . junit . Assert . assertNull ( err , err )
|
testStyleNamePropertyRetrieved ( ) { com . vaadin . v7 . data . util . IndexedContainer ic = ( ( com . vaadin . v7 . data . util . IndexedContainer ) ( com . vaadin . v7 . tests . server . component . calendar . ContainerDataSourceTest . createTestIndexedContainer ( ) ) ) ; ic . addContainerProperty ( "testStyleName" , java . lang . String . class , "" ) ; for ( int i = 0 ; i < 10 ; i ++ ) { com . vaadin . v7 . data . Item item = ic . getItem ( ic . getIdByIndex ( i ) ) ; @ com . vaadin . v7 . tests . server . component . calendar . SuppressWarnings ( "unchecked" ) com . vaadin . v7 . data . Property < java . lang . String > itemProperty = item . getItemProperty ( "testStyleName" ) ; itemProperty . setValue ( "testStyle" ) ; } com . vaadin . v7 . ui . components . calendar . ContainerEventProvider provider = new com . vaadin . v7 . ui . components . calendar . ContainerEventProvider ( ic ) ; provider . setCaptionProperty ( "testCaption" ) ; provider . setDescriptionProperty ( "testDescription" ) ; provider . setStartDateProperty ( "testStartDate" ) ; provider . setEndDateProperty ( "testEndDate" ) ; provider . setStyleNameProperty ( "testStyleName" ) ; calendar . setEventProvider ( provider ) ; java . util . Calendar cal = com . vaadin . v7 . ui . java . util . Calendar . getInstance ( ) ; java . util . Date now = cal . getTime ( ) ; cal . add ( com . vaadin . v7 . ui . java . util . Calendar , 20 ) ; java . util . Date then = cal . getTime ( ) ; java . util . List < com . vaadin . v7 . ui . components . calendar . event . CalendarEvent > events = calendar . getEventProvider ( ) . getEvents ( now , then ) ; for ( com . vaadin . v7 . ui . components . calendar . event . CalendarEvent ce : events ) { "<AssertPlaceHolder>" ; } } getStyleName ( ) { return styleName ; }
|
org . junit . Assert . assertEquals ( "testStyle" , ce . getStyleName ( ) )
|
testCreateTenantVDCEdgeDeviceRoutePolicy ( ) { boolean response = com . cloud . network . cisco . CiscoVnmcConnectionTest . connection . createTenantVDCEdgeStaticRoutePolicy ( com . cloud . network . cisco . CiscoVnmcConnectionTest . tenantName ) ; "<AssertPlaceHolder>" ; } createTenantVDCEdgeStaticRoutePolicy ( java . lang . String ) { java . lang . String xml = com . cloud . network . cisco . CiscoVnmcConnectionImpl . VnmcXml . CREATE_EDGE_ROUTE_POLICY . getXml ( ) ; java . lang . String service = com . cloud . network . cisco . CiscoVnmcConnectionImpl . VnmcXml . CREATE_EDGE_ROUTE_POLICY . getService ( ) ; xml = replaceXmlValue ( xml , "cookie" , _cookie ) ; xml = replaceXmlValue ( xml , "name" , getNameForEdgeDeviceRoutePolicy ( tenantName ) ) ; xml = replaceXmlValue ( xml , "routepolicydn" , getDnForEdgeDeviceRoutingPolicy ( tenantName ) ) ; xml = replaceXmlValue ( xml , "descr" , ( "Routing<sp>Policy<sp>for<sp>Edge<sp>Device<sp>for<sp>Tenant<sp>" + tenantName ) ) ; java . lang . String response = sendRequest ( service , xml ) ; return verifySuccess ( response ) ; }
|
org . junit . Assert . assertTrue ( response )
|
deepUpdateExistingUpdates ( ) { com . google . firebase . database . core . CompoundWrite compoundWrite = com . google . firebase . database . core . CompoundWrite . emptyWrite ( ) ; java . util . Map < java . lang . String , java . lang . Object > base = new com . google . firebase . database . MapBuilder ( ) . put ( "child-1" , "value-1" ) . put ( "bar" 0 , "bar" 2 ) . build ( ) ; final com . google . firebase . database . snapshot . Node baseNode = com . google . firebase . database . snapshot . NodeUtilities . NodeFromJSON ( base ) ; com . google . firebase . database . snapshot . Node updateOne = com . google . firebase . database . snapshot . NodeUtilities . NodeFromJSON ( new com . google . firebase . database . MapBuilder ( ) . put ( "foo" , "foo-value" ) . put ( "bar" , "bar" 1 ) . build ( ) ) ; com . google . firebase . database . snapshot . Node updateTwo = com . google . firebase . database . snapshot . NodeUtilities . NodeFromJSON ( "baz-value" ) ; com . google . firebase . database . snapshot . Node updateThree = com . google . firebase . database . snapshot . NodeUtilities . NodeFromJSON ( "new-foo-value" ) ; compoundWrite = compoundWrite . addWrite ( new com . google . firebase . database . core . Path ( "child-1" ) , updateOne ) ; compoundWrite = compoundWrite . addWrite ( new com . google . firebase . database . core . Path ( "child-1/baz" ) , updateTwo ) ; compoundWrite = compoundWrite . addWrite ( new com . google . firebase . database . core . Path ( "child-1/foo" ) , updateThree ) ; java . util . Map < java . lang . String , java . lang . Object > expectedChildOne = new com . google . firebase . database . MapBuilder ( ) . put ( "foo" , "new-foo-value" ) . put ( "bar" , "bar" 1 ) . put ( "baz" , "baz-value" ) . build ( ) ; com . google . firebase . database . snapshot . Node expected = baseNode . updateImmediateChild ( com . google . firebase . database . snapshot . ChildKey . fromString ( "child-1" ) , com . google . firebase . database . snapshot . NodeUtilities . NodeFromJSON ( expectedChildOne ) ) ; "<AssertPlaceHolder>" ; } apply ( com . google . firebase . database . snapshot . Node ) { return applySubtreeWrite ( com . google . firebase . database . core . Path . getEmptyPath ( ) , this . writeTree , node ) ; }
|
org . junit . Assert . assertEquals ( expected , compoundWrite . apply ( baseNode ) )
|
shouldRemoveNodeWithNoRelationsFromDBOnDelete ( ) { long nodeId ; try ( org . neo4j . graphdb . Transaction tx = org . neo4j . server . rest . web . DatabaseActionsTest . database . getGraph ( ) . beginTx ( ) ) { org . neo4j . graphdb . Node node = org . neo4j . server . rest . web . DatabaseActionsTest . database . getGraph ( ) . createNode ( ) ; nodeId = node . getId ( ) ; tx . success ( ) ; } int nodeCount = org . neo4j . server . rest . web . DatabaseActionsTest . graphdbHelper . getNumberOfNodes ( ) ; org . neo4j . server . rest . web . DatabaseActionsTest . actions . deleteNode ( nodeId ) ; "<AssertPlaceHolder>" ; } getNumberOfNodes ( ) { org . neo4j . internal . kernel . api . Kernel kernel = database . getGraph ( ) . getDependencyResolver ( ) . resolveDependency ( org . neo4j . internal . kernel . api . Kernel . class ) ; try ( org . neo4j . internal . kernel . api . Transaction tx = kernel . beginTransaction ( Type . implicit , org . neo4j . kernel . api . security . AnonymousContext . read ( ) ) ) { return java . lang . Math . toIntExact ( tx . dataRead ( ) . nodesGetCount ( ) ) ; } catch ( org . neo4j . internal . kernel . api . exceptions . TransactionFailureException e ) { throw new java . lang . RuntimeException ( e ) ; } }
|
org . junit . Assert . assertEquals ( ( nodeCount - 1 ) , org . neo4j . server . rest . web . DatabaseActionsTest . graphdbHelper . getNumberOfNodes ( ) )
|
testIdentityShuffleProofGenerator2 ( ) { final ch . bfh . unicrypt . math . algebra . multiplicative . classes . GStarMod G_q = ch . bfh . unicrypt . math . algebra . multiplicative . classes . GStarModSafePrime . getInstance ( new java . math . BigInteger ( ch . bfh . unicrypt . crypto . proofsystem . IdentityShuffleProofSystemTest . P2 , 10 ) ) ; final ch . bfh . unicrypt . math . algebra . dualistic . classes . ZMod Z_q = G_q . getZModOrder ( ) ; final ch . bfh . unicrypt . helper . random . deterministic . DeterministicRandomByteSequence deterministicRandomByteSequence = ch . bfh . unicrypt . helper . random . deterministic . DeterministicRandomByteSequence . getInstance ( ) ; final ch . bfh . unicrypt . helper . random . RandomByteSequence randomByteSequence = ch . bfh . unicrypt . helper . random . hybrid . HybridRandomByteSequence . getInstance ( ) ; final int size = 10 ; final ch . bfh . unicrypt . math . algebra . general . interfaces . Element alpha = Z_q . getElement ( 4 ) ; final ch . bfh . unicrypt . math . algebra . general . interfaces . Element gK_1 = G_q . getIndependentGenerators ( deterministicRandomByteSequence ) . get ( 0 ) ; final ch . bfh . unicrypt . math . algebra . general . interfaces . Element gK = gK_1 . selfApply ( alpha ) ; ch . bfh . unicrypt . math . algebra . general . classes . PermutationElement pi = ch . bfh . unicrypt . math . algebra . general . classes . PermutationGroup . getInstance ( size ) . getRandomElement ( ) ; ch . bfh . unicrypt . crypto . schemes . commitment . classes . PermutationCommitmentScheme pcs = ch . bfh . unicrypt . crypto . schemes . commitment . classes . PermutationCommitmentScheme . getInstance ( G_q , size , deterministicRandomByteSequence ) ; ch . bfh . unicrypt . math . algebra . general . classes . Tuple sV = pcs . getRandomizationSpace ( ) . getRandomElement ( ) ; ch . bfh . unicrypt . math . algebra . general . classes . Tuple cPiV = pcs . commit ( pi , sV ) ; ch . bfh . unicrypt . math . algebra . general . classes . ProductGroup uVSpace = ch . bfh . unicrypt . math . algebra . general . classes . ProductGroup . getInstance ( G_q , size ) ; ch . bfh . unicrypt . math . algebra . general . classes . Tuple uV = uVSpace . getRandomElement ( randomByteSequence ) ; ch . bfh . unicrypt . math . algebra . general . classes . Tuple uPrimeV = ch . bfh . unicrypt . math . function . classes . PermutationFunction . getInstance ( G_q , size ) . apply ( uV . selfApply ( alpha ) , pi ) ; ch . bfh . unicrypt . crypto . proofsystem . classes . IdentityShuffleProofSystem spg = ch . bfh . unicrypt . crypto . proofsystem . classes . IdentityShuffleProofSystem . getInstance ( size , G_q , ch . bfh . unicrypt . crypto . proofsystem . IdentityShuffleProofSystemTest . proverId , 60 , 60 , 20 , deterministicRandomByteSequence ) ; ch . bfh . unicrypt . math . algebra . general . classes . Tuple privateInput = ch . bfh . unicrypt . math . algebra . general . classes . Tuple . getInstance ( pi , sV , alpha ) ; ch . bfh . unicrypt . math . algebra . general . classes . Tuple publicInput = ch . bfh . unicrypt . math . algebra . general . classes . Tuple . getInstance ( cPiV , uV , uPrimeV , gK_1 , gK ) ; ch . bfh . unicrypt . math . algebra . general . classes . Tuple proof = spg . generate ( privateInput , publicInput , randomByteSequence ) ; boolean v = spg . verify ( proof , publicInput ) ; "<AssertPlaceHolder>" ; } verify ( ch . bfh . unicrypt . math . algebra . general . interfaces . Element , ch . bfh . unicrypt . math . algebra . general . interfaces . Element ) { if ( ( ! ( this . getProofSpace ( ) . contains ( proof ) ) ) || ( ! ( this . getPublicInputSpace ( ) . contains ( publicInput ) ) ) ) { throw new java . lang . IllegalArgumentException ( ) ; } return this . abstractVerify ( ( ( PE ) ( proof ) ) , ( ( PUE ) ( publicInput ) ) ) ; }
|
org . junit . Assert . assertTrue ( v )
|
testGetAggregatedPrivilegeNames ( ) { com . google . common . collect . ImmutableSet < java . lang . String > expected = com . google . common . collect . ImmutableSet . of ( org . apache . jackrabbit . oak . spi . security . privilege . JCR_LOCK_MANAGEMENT , org . apache . jackrabbit . oak . spi . security . privilege . JCR_READ_ACCESS_CONTROL ) ; when ( pTree . getProperty ( org . apache . jackrabbit . oak . spi . security . privilege . REP_AGGREGATES ) ) . thenReturn ( org . apache . jackrabbit . oak . plugins . memory . PropertyStates . createProperty ( org . apache . jackrabbit . oak . spi . security . privilege . REP_AGGREGATES , expected , Type . NAMES ) ) ; when ( pTree . exists ( ) ) . thenReturn ( true ) ; when ( privTree . getChild ( org . apache . jackrabbit . oak . spi . security . privilege . PrivilegeBitsProviderTest . KNOWN_PRIV_NAME ) ) . thenReturn ( pTree ) ; java . lang . Iterable < java . lang . String > result = bitsProvider . getAggregatedPrivilegeNames ( org . apache . jackrabbit . oak . spi . security . privilege . PrivilegeBitsProviderTest . KNOWN_PRIV_NAME ) ; "<AssertPlaceHolder>" ; } getAggregatedPrivilegeNames ( java . lang . String [ ] ) { if ( ( privilegeNames . length ) == 0 ) { return java . util . Collections . emptySet ( ) ; } else if ( ( privilegeNames . length ) == 1 ) { java . lang . String privName = privilegeNames [ 0 ] ; if ( org . apache . jackrabbit . oak . spi . security . privilege . NON_AGGREGATE_PRIVILEGES . contains ( privName ) ) { return com . google . common . collect . ImmutableSet . of ( privName ) ; } else if ( aggregation . containsKey ( privName ) ) { return aggregation . get ( privName ) ; } else if ( org . apache . jackrabbit . oak . spi . security . privilege . AGGREGATE_PRIVILEGES . keySet ( ) . contains ( privName ) ) { java . util . Set < java . lang . String > aggregates = resolveBuiltInAggregation ( privName ) ; aggregation . put ( privName , aggregates ) ; return aggregates ; } else { return extractAggregatedPrivileges ( java . util . Collections . singleton ( privName ) ) ; } } else { java . util . Set < java . lang . String > pNames = com . google . common . collect . ImmutableSet . copyOf ( privilegeNames ) ; if ( org . apache . jackrabbit . oak . spi . security . privilege . NON_AGGREGATE_PRIVILEGES . containsAll ( pNames ) ) { return pNames ; } else { return extractAggregatedPrivileges ( pNames ) ; } } }
|
org . junit . Assert . assertEquals ( expected , com . google . common . collect . ImmutableSet . copyOf ( result ) )
|
connectedToInstance ( ) { final org . apache . rya . shell . SharedShellState state = new org . apache . rya . shell . SharedShellState ( ) ; final org . apache . rya . api . client . accumulo . AccumuloConnectionDetails connectionDetails = mock ( org . apache . rya . api . client . accumulo . AccumuloConnectionDetails . class ) ; final org . apache . rya . api . client . RyaClient connectedCommands = mock ( org . apache . rya . api . client . RyaClient . class ) ; state . connectedToAccumulo ( connectionDetails , connectedCommands ) ; state . connectedToInstance ( "instance" ) ; final org . apache . rya . shell . SharedShellState . ShellState expected = org . apache . rya . shell . SharedShellState . ShellState . builder ( ) . setConnectionState ( ConnectionState . CONNECTED_TO_INSTANCE ) . setAccumuloDetails ( connectionDetails ) . setConnectedCommands ( connectedCommands ) . setRyaInstanceName ( "instance" ) . build ( ) ; "<AssertPlaceHolder>" ; } getShellState ( ) { lock . lock ( ) ; try { return shellState ; } finally { lock . unlock ( ) ; } }
|
org . junit . Assert . assertEquals ( expected , state . getShellState ( ) )
|
deveGerarXMLDeAcordoComOPadraoEstabelecido ( ) { final java . lang . String xmlEsperado = "<NFNotaInfoPagamento><detPag><indPag>1</indPag><tPag>03</tPag><vPag>999999999999.99</vPag><card><tpIntegra>1</tpIntegra><CNPJ>12345678901234</CNPJ><tBand>02</tBand><cAut>9ItpS1hBk3TyhjUB3I90</cAut></card></detPag></NFNotaInfoPagamento>" ; "<AssertPlaceHolder>" ; } getNFNotaInfoPagamento ( ) { final com . fincatto . documentofiscal . nfe400 . NFNotaInfoPagamento pagamento = new com . fincatto . documentofiscal . nfe400 . NFNotaInfoPagamento ( ) ; pagamento . setDetalhamentoFormasPagamento ( java . util . Collections . singletonList ( com . fincatto . documentofiscal . nfe400 . FabricaDeObjetosFake . getNFNotaInfoFormaPagamento ( ) ) ) ; return pagamento ; }
|
org . junit . Assert . assertEquals ( xmlEsperado , com . fincatto . documentofiscal . nfe400 . FabricaDeObjetosFake . getNFNotaInfoPagamento ( ) . toString ( ) )
|
testTrash ( ) { final com . cloud . network . dao . NetworkVO network = mock ( com . cloud . network . dao . NetworkVO . class ) ; when ( network . getName ( ) ) . thenReturn ( "testnetwork" ) ; when ( network . getState ( ) ) . thenReturn ( State . Implementing ) ; when ( network . getId ( ) ) . thenReturn ( com . cloud . network . guru . BrocadeVcsGuestNetworkGuruTest . NETWORK_ID ) ; when ( network . getDataCenterId ( ) ) . thenReturn ( com . cloud . network . guru . BrocadeVcsGuestNetworkGuruTest . NETWORK_ID ) ; final com . cloud . offering . NetworkOffering offering = mock ( com . cloud . offering . NetworkOffering . class ) ; when ( offering . getId ( ) ) . thenReturn ( com . cloud . network . guru . BrocadeVcsGuestNetworkGuruTest . NETWORK_ID ) ; when ( offering . getTrafficType ( ) ) . thenReturn ( TrafficType . Guest ) ; when ( offering . getGuestType ( ) ) . thenReturn ( GuestType . Isolated ) ; final com . cloud . host . HostVO brocadeHost = mock ( com . cloud . host . HostVO . class ) ; when ( hostdao . findById ( anyLong ( ) ) ) . thenReturn ( brocadeHost ) ; when ( brocadeHost . getId ( ) ) . thenReturn ( com . cloud . network . guru . BrocadeVcsGuestNetworkGuruTest . NETWORK_ID ) ; when ( netmodel . findPhysicalNetworkId ( anyLong ( ) , ( ( java . lang . String ) ( any ( ) ) ) , ( ( com . cloud . network . Networks . TrafficType ) ( any ( ) ) ) ) ) . thenReturn ( com . cloud . network . guru . BrocadeVcsGuestNetworkGuruTest . NETWORK_ID ) ; final com . cloud . network . BrocadeVcsNetworkVlanMappingVO mapping = mock ( com . cloud . network . BrocadeVcsNetworkVlanMappingVO . class ) ; when ( mapping . getVlanId ( ) ) . thenReturn ( 14 ) ; when ( vcsmapdao . findByNetworkId ( anyLong ( ) ) ) . thenReturn ( mapping ) ; final com . cloud . network . BrocadeVcsDeviceVO brocadeDevice = mock ( com . cloud . network . BrocadeVcsDeviceVO . class ) ; when ( brocadeDevice . getHostId ( ) ) . thenReturn ( com . cloud . network . guru . BrocadeVcsGuestNetworkGuruTest . NETWORK_ID ) ; final java . util . List < com . cloud . network . BrocadeVcsDeviceVO > devices = new java . util . ArrayList ( ) ; devices . add ( brocadeDevice ) ; when ( vcsdao . listByPhysicalNetwork ( anyLong ( ) ) ) . thenReturn ( devices ) ; final com . cloud . agent . api . DeleteNetworkAnswer answer = mock ( com . cloud . agent . api . DeleteNetworkAnswer . class ) ; when ( answer . getResult ( ) ) . thenReturn ( true ) ; when ( agentmgr . easySend ( eq ( com . cloud . network . guru . BrocadeVcsGuestNetworkGuruTest . NETWORK_ID ) , ( ( com . cloud . agent . api . Command ) ( any ( ) ) ) ) ) . thenReturn ( answer ) ; when ( vcsdao . remove ( ( ( long ) ( anyInt ( ) ) ) ) ) . thenReturn ( true ) ; final boolean result = guru . trash ( network , offering ) ; "<AssertPlaceHolder>" ; verify ( agentmgr , times ( 1 ) ) . easySend ( eq ( com . cloud . network . guru . BrocadeVcsGuestNetworkGuruTest . NETWORK_ID ) , ( ( com . cloud . agent . api . Command ) ( any ( ) ) ) ) ; } trash ( com . cloud . network . Network , com . cloud . offering . NetworkOffering ) { return super . trash ( network , offering ) ; }
|
org . junit . Assert . assertTrue ( ( result == true ) )
|
xmlInput ( ) { java . lang . Object payload = flowRunner ( "input" ) . withPayload ( org . mule . test . module . extension . XML_VALUE ) . run ( ) . getMessage ( ) . getPayload ( ) . getValue ( ) ; "<AssertPlaceHolder>" ; } getValue ( ) { return value ; }
|
org . junit . Assert . assertThat ( payload , org . hamcrest . CoreMatchers . is ( org . mule . test . module . extension . XML_VALUE ) )
|
testDeclareVariablesLine32 ( ) { java . util . List < java . lang . Integer > result = forComp ( i , range ) . forCompInt ( j , ( ) -> java . util . stream . IntStream . rangeClosed ( 1 , i . val ( ) ) ) . letComp ( k , ( ) -> ( i . val ( ) ) - ( j . val ( ) ) ) . yield ( ( ) -> k . val ( ) ) ; "<AssertPlaceHolder>" ; } val ( ) { if ( ( value ) == null ) { throw new java . lang . IllegalArgumentException ( ( "No<sp>value<sp>set<sp>for:<sp>" + ( this ) ) ) ; } return value ; }
|
org . junit . Assert . assertEquals ( List ( 0 , 1 , 0 , 2 , 1 , 0 , 3 , 2 , 1 , 0 , 4 , 3 , 2 , 1 , 0 ) , result )
|
testRemoveLineBreaks_whenBootstrapActionStringIsSpaces ( ) { java . lang . String bootstrapStringWithBreaks = "<sp>" ; java . lang . String expectedString = "" ; java . lang . String resultBootstrapString = emrClient . removeLineBreaks ( bootstrapStringWithBreaks ) ; "<AssertPlaceHolder>" ; } removeLineBreaks ( java . lang . String ) { if ( org . pentaho . di . core . util . StringUtil . isEmpty ( multiLineFieldValue ) ) { return multiLineFieldValue ; } return multiLineFieldValue . replaceAll ( "\\s+" , "<sp>" ) . trim ( ) ; }
|
org . junit . Assert . assertEquals ( expectedString , resultBootstrapString )
|
testGetItemPadding_onLast ( ) { org . eclipse . rap . rwt . theme . BoxDimensions actual = org . eclipse . rap . rwt . internal . theme . TabFolderThemeAdapter_Test . getThemeAdapter ( folder ) . getItemPadding ( lastItem ) ; "<AssertPlaceHolder>" ; } getItemPadding ( boolean ) { org . eclipse . rap . rwt . internal . theme . SimpleSelector selector = ( selected ) ? org . eclipse . rap . rwt . internal . theme . SimpleSelector . SELECTED : org . eclipse . rap . rwt . internal . theme . SimpleSelector . DEFAULT ; org . eclipse . rap . rwt . internal . theme . CssValue cssValue = org . eclipse . rap . rwt . internal . theme . ThemeUtil . getCssValue ( "CTabItem" , "padding" , selector ) ; return ( ( org . eclipse . rap . rwt . internal . theme . CssBoxDimensions ) ( cssValue ) ) . dimensions ; }
|
org . junit . Assert . assertEquals ( new org . eclipse . rap . rwt . theme . BoxDimensions ( 3 , 3 , 3 , 3 ) , actual )
|
testDeafultConsistent ( ) { org . sagebionetworks . table . cluster . SqlQuery query = new org . sagebionetworks . table . cluster . SqlQueryBuilder ( sql ) . tableSchema ( schema ) . isConsistent ( null ) . build ( ) ; "<AssertPlaceHolder>" ; } isConsistent ( ) { return this . isConsistent ; }
|
org . junit . Assert . assertTrue ( query . isConsistent ( ) )
|
testConvert ( ) { java . lang . String content = "content" ; boolean isHtml = true ; java . lang . String email = "ivanon2@gmail.com" ; java . lang . String sender = "sender" ; java . lang . String topic = "topic" ; org . lnu . is . mailing . model . Recipient recipient1 = new org . lnu . is . mailing . model . Recipient ( email ) ; java . util . List < org . lnu . is . mailing . model . Recipient > recipients = java . util . Arrays . asList ( recipient1 ) ; org . lnu . is . mailing . model . Email source = new org . lnu . is . mailing . model . Email ( ) ; source . setContent ( content ) ; source . setHtml ( isHtml ) ; source . setRecipients ( recipients ) ; source . setSender ( sender ) ; source . setTopic ( topic ) ; java . util . List < java . lang . String > recpts = java . util . Arrays . asList ( email ) ; org . lnu . is . resource . broadcasting . BroadcastingMessageResource expected = new org . lnu . is . resource . broadcasting . BroadcastingMessageResource ( ) ; expected . setContent ( source . getContent ( ) ) ; expected . setIsHtml ( source . isHtml ( ) ) ; expected . setRecipients ( recpts ) ; expected . setTopic ( source . getTopic ( ) ) ; org . lnu . is . resource . broadcasting . BroadcastingMessageResource actual = unit . convert ( source ) ; "<AssertPlaceHolder>" ; } convert ( org . lnu . is . domain . admin . unit . AdminUnit ) { return convert ( source , new org . lnu . is . resource . adminunit . AdminUnitResource ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testVariableNameWithDot ( ) { try { java . lang . String filename = "/hdf5/grid_1_3d_xyz_aug.h5" ; java . lang . String remoteFile = thredds . TestOnLocalServer . withHttpPath ( ( ( thredds . server . cdmr . TestCdmRemoteMisc . urlPath ) + filename ) ) ; ucar . nc2 . stream . CdmRemote ncfileRemote = new ucar . nc2 . stream . CdmRemote ( remoteFile ) ; java . lang . String localFile = ( thredds . server . cdmr . TestCdmRemoteMisc . contentRoot ) + filename ; ucar . nc2 . NetcdfFile ncfileLocal = ucar . nc2 . NetcdfFile . open ( localFile ) ; java . util . Formatter f = new java . util . Formatter ( ) ; ucar . nc2 . util . CompareNetcdf2 mind = new ucar . nc2 . util . CompareNetcdf2 ( f , true , true , true ) ; boolean ok = mind . compare ( ncfileLocal , ncfileRemote , new thredds . server . cdmr . TestCdmRemoteCompareHeadersP . NcstreamObjFilter ( ) , false , false , true ) ; System . out . printf ( "--Compare<sp>%s<sp>to<sp>%s%n" , localFile , remoteFile ) ; System . out . printf ( "<sp>%s%n" , f ) ; "<AssertPlaceHolder>" ; ncfileLocal . close ( ) ; ncfileRemote . close ( ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; assert false ; } } open ( java . lang . String ) { return ucar . nc2 . NetcdfFile . open ( location , null ) ; }
|
org . junit . Assert . assertTrue ( ok )
|
xmlRoundrip ( ) { org . mycore . datamodel . metadata . MCRMetaXML mXml = new org . mycore . datamodel . metadata . MCRMetaXML ( "def.heading" , "complete" , 0 ) ; org . jdom2 . Element imported = new org . jdom2 . Element ( "heading" ) ; imported . setAttribute ( "0" 1 , MCRMetaDefault . DEFAULT_LANGUAGE , Namespace . XML_NAMESPACE ) ; imported . setAttribute ( "inherited" , "0" ) ; imported . setAttribute ( "type" , "complete" ) ; imported . addContent ( new org . jdom2 . Text ( "This<sp>is<sp>a<sp>" ) ) ; imported . addContent ( new org . jdom2 . Element ( "0" 0 ) . setText ( "JUnit" ) ) ; imported . addContent ( new org . jdom2 . Text ( "test" ) ) ; mXml . setFromDOM ( imported ) ; org . jdom2 . Element exported = mXml . createXML ( ) ; if ( org . mycore . datamodel . metadata . MCRMetaXMLTest . LOGGER . isDebugEnabled ( ) ) { org . jdom2 . output . XMLOutputter xout = new org . jdom2 . output . XMLOutputter ( org . jdom2 . output . Format . getPrettyFormat ( ) ) ; java . io . StringWriter sw = new java . io . StringWriter ( ) ; java . io . StringWriter sw2 = new java . io . StringWriter ( ) ; try { xout . output ( imported , sw ) ; org . mycore . datamodel . metadata . MCRMetaXMLTest . LOGGER . info ( sw . toString ( ) ) ; xout . output ( exported , sw2 ) ; org . mycore . datamodel . metadata . MCRMetaXMLTest . LOGGER . info ( sw2 . toString ( ) ) ; } catch ( java . io . IOException e ) { org . mycore . datamodel . metadata . MCRMetaXMLTest . LOGGER . warn ( "Failure<sp>printing<sp>xml<sp>result" , e ) ; } } try { "<AssertPlaceHolder>" ; } catch ( java . lang . AssertionError e ) { org . jdom2 . output . XMLOutputter out = new org . jdom2 . output . XMLOutputter ( org . jdom2 . output . Format . getPrettyFormat ( ) ) ; out . output ( imported , System . err ) ; out . output ( exported , System . err ) ; throw e ; } } deepEqual ( org . jdom2 . Document , org . jdom2 . Document ) { try { return org . mycore . common . xml . MCRXMLHelper . JDOMEquivalent . equivalent ( org . mycore . common . xml . MCRXMLHelper . canonicalElement ( d1 ) , org . mycore . common . xml . MCRXMLHelper . canonicalElement ( d2 ) ) ; } catch ( java . lang . Exception e ) { org . mycore . common . xml . MCRXMLHelper . LOGGER . warn ( "Could<sp>not<sp>compare<sp>documents." , e ) ; return false ; } }
|
org . junit . Assert . assertTrue ( org . mycore . common . xml . MCRXMLHelper . deepEqual ( new org . jdom2 . Document ( imported ) , new org . jdom2 . Document ( exported ) ) )
|
testOnVariableChangeWhenVariableSelected ( ) { when ( variableSearchSelectionHandler . getSelectedKey ( ) ) . thenReturn ( org . kie . workbench . common . stunner . bpmn . client . forms . fields . conditionEditor . SimpleConditionEditorPresenterTest . VARIABLE ) ; when ( variableSearchService . getOptionType ( org . kie . workbench . common . stunner . bpmn . client . forms . fields . conditionEditor . SimpleConditionEditorPresenterTest . VARIABLE ) ) . thenReturn ( org . kie . workbench . common . stunner . bpmn . client . forms . fields . conditionEditor . SimpleConditionEditorPresenterTest . TYPE ) ; when ( translationService . getValue ( org . kie . workbench . common . stunner . bpmn . client . forms . fields . conditionEditor . SimpleConditionEditorPresenter . FUNCTION_NOT_SELECTED_ERROR ) ) . thenReturn ( org . kie . workbench . common . stunner . bpmn . client . forms . fields . conditionEditor . SimpleConditionEditorPresenterTest . TRANSLATED_MESSAGE ) ; presenter . onVariableChange ( ) ; verify ( functionSearchService ) . reload ( eq ( org . kie . workbench . common . stunner . bpmn . client . forms . fields . conditionEditor . SimpleConditionEditorPresenterTest . TYPE ) , commandCaptor . capture ( ) ) ; verifyClearError ( ) ; commandCaptor . getValue ( ) . execute ( ) ; verify ( functionSearchSelectionHandler ) . clearSelection ( ) ; verify ( conditionSelectorDropDown ) . clear ( ) ; "<AssertPlaceHolder>" ; verify ( paramInstance , never ( ) ) . get ( ) ; view . setConditionError ( translationService . getValue ( org . kie . workbench . common . stunner . bpmn . client . forms . fields . conditionEditor . SimpleConditionEditorPresenter . FUNCTION_NOT_SELECTED_ERROR ) ) ; } isValid ( ) { return getRecordEngine ( ) . isValid ( getRecord ( ) ) ; }
|
org . junit . Assert . assertFalse ( presenter . isValid ( ) )
|
testCacheResponseWithInvalidationPUT ( ) { org . codehaus . httpcache4j . cache . Headers responseHeaders = new org . codehaus . httpcache4j . cache . Headers ( ) ; responseHeaders . add ( new org . codehaus . httpcache4j . cache . Header ( HeaderConstants . CACHE_CONTROL , "private,<sp>max-age=60" ) ) ; doGet ( responseHeaders , Status . OK , 1 ) ; org . codehaus . httpcache4j . cache . HTTPRequest request = new org . codehaus . httpcache4j . cache . HTTPRequest ( org . codehaus . httpcache4j . cache . HTTPCacheTest . REQUEST_URI , HTTPMethod . PUT ) ; cache . execute ( request ) ; when ( cacheStorage . size ( ) ) . thenReturn ( 0 ) ; "<AssertPlaceHolder>" ; } size ( ) { return varyHeaders . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , cacheStorage . size ( ) )
|
canBeSerializedAndDeserialized ( ) { array . add ( true ) . add ( 3.14 ) . add ( 23 ) . add ( "foo" ) . add ( new com . restfb . json . JsonArray ( ) . add ( false ) ) ; "<AssertPlaceHolder>" ; } serializeAndDeserialize ( T ) { return ( ( T ) ( com . restfb . json . TestUtil . deserialize ( com . restfb . json . TestUtil . serialize ( instance ) ) ) ) ; }
|
org . junit . Assert . assertEquals ( array , com . restfb . json . TestUtil . serializeAndDeserialize ( array ) )
|
testBinding ( ) { FIELD newFieldDefinition = getEmptyFieldDefinition ( ) ; newFieldDefinition . setBinding ( org . kie . workbench . common . forms . fields . shared . fieldTypes . AbstractFieldDefinitionTest . BINDING ) ; "<AssertPlaceHolder>" ; } getBinding ( ) { if ( ( binding ) == null ) { binding = new java . util . ArrayList ( ) ; } return this . binding ; }
|
org . junit . Assert . assertEquals ( org . kie . workbench . common . forms . fields . shared . fieldTypes . AbstractFieldDefinitionTest . BINDING , newFieldDefinition . getBinding ( ) )
|
testGetPreferredMergeStrategyWhenInvalidPreference ( ) { org . eclipse . core . runtime . preferences . InstanceScope . INSTANCE . getNode ( org . eclipse . egit . core . Activator . getPluginId ( ) ) . put ( GitCorePreferences . core_preferredMergeStrategy , "invalid<sp>value" ) ; "<AssertPlaceHolder>" ; } getPreferredMergeStrategy ( ) { final org . eclipse . core . runtime . preferences . IEclipsePreferences prefs = org . eclipse . core . runtime . preferences . InstanceScope . INSTANCE . getNode ( org . eclipse . egit . core . Activator . getPluginId ( ) ) ; java . lang . String preferredMergeStrategyKey = prefs . get ( GitCorePreferences . core_preferredMergeStrategy , null ) ; if ( ( preferredMergeStrategyKey == null ) || ( preferredMergeStrategyKey . isEmpty ( ) ) ) { final org . eclipse . core . runtime . preferences . IEclipsePreferences defaultPrefs = org . eclipse . core . runtime . preferences . DefaultScope . INSTANCE . getNode ( org . eclipse . egit . core . Activator . getPluginId ( ) ) ; preferredMergeStrategyKey = defaultPrefs . get ( GitCorePreferences . core_preferredMergeStrategy , null ) ; } if ( ( ( preferredMergeStrategyKey != null ) && ( ! ( preferredMergeStrategyKey . isEmpty ( ) ) ) ) && ( ! ( GitCorePreferences . core_preferredMergeStrategy_Default . equals ( preferredMergeStrategyKey ) ) ) ) { org . eclipse . jgit . merge . MergeStrategy result = org . eclipse . jgit . merge . MergeStrategy . get ( preferredMergeStrategyKey ) ; if ( result != null ) { return result ; } org . eclipse . egit . core . Activator . logError ( org . eclipse . osgi . util . NLS . bind ( CoreText . Activator_invalidPreferredMergeStrategy , preferredMergeStrategyKey ) , null ) ; } return null ; }
|
org . junit . Assert . assertNull ( a . getPreferredMergeStrategy ( ) )
|
testAttributeGroupSorting ( ) { com . b2international . snowowl . snomed . ecl . ecl . ExpressionConstraint expression = com . b2international . snowowl . semanticengine . simpleast . test . utils . TestUtils . parseExpression ( com . b2international . snowowl . semanticengine . simpleast . normalform . test . ExpressionCanonicalRepresentationTest . EXPRESSION_2 ) ; com . b2international . snowowl . snomed . ecl . ecl . ExpressionConstraint expressionShuffled = com . b2international . snowowl . semanticengine . simpleast . test . utils . TestUtils . parseExpression ( com . b2international . snowowl . semanticengine . simpleast . normalform . test . ExpressionCanonicalRepresentationTest . EXPRESSION_2_SHUFFLED ) ; "<AssertPlaceHolder>" ; } toString ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( ) ; sb . append ( "[" ) ; for ( java . util . Map . Entry < java . lang . String , java . lang . String > entry : attributeConceptIdMap . entrySet ( ) ) { sb . append ( ( ( ( ( entry . getKey ( ) ) + ":" ) + ( entry . getValue ( ) ) ) + "<sp>" ) ) ; } sb . append ( ( "]<sp>=<sp>" + ( groupId ) ) ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expression . toString ( ) , expressionShuffled . toString ( ) )
|
testEmptyXMPSchemas ( ) { initValues ( ) ; metadata . createAndAddDublinCoreSchema ( ) ; metadata . createAndAddAdobePDFSchema ( ) ; metadata . createAndAddXMPBasicSchema ( ) ; dico . setTitle ( title ) ; dico . setAuthor ( author ) ; dico . setSubject ( subject ) ; dico . setKeywords ( keywords ) ; dico . setCreator ( creator ) ; dico . setProducer ( producer ) ; dico . setCreationDate ( creationDate ) ; dico . setModificationDate ( modifyDate ) ; try { ve = org . apache . pdfbox . preflight . metadata . TestSynchronizedMetadataValidation . sync . validateMetadataSynchronization ( doc , metadata ) ; "<AssertPlaceHolder>" ; } catch ( org . apache . pdfbox . preflight . exception . ValidationException e ) { throw new java . lang . Exception ( e . getMessage ( ) ) ; } } size ( ) { return this . objectPath . size ( ) ; }
|
org . junit . Assert . assertEquals ( 8 , ve . size ( ) )
|
_4_A$ ( ) { java . lang . String _1 = "foo" ; java . lang . Integer _2 = 123 ; java . lang . Long _3 = 456L ; java . lang . Boolean _4 = true ; com . m3 . scalaflavor4j . Tuple4 < java . lang . String , java . lang . Integer , java . lang . Long , java . lang . Boolean > target = com . m3 . scalaflavor4j . Tuple4 . apply ( _1 , _2 , _3 , _4 ) ; java . lang . Boolean actual = target . _4 ( ) ; java . lang . Boolean expected = true ; "<AssertPlaceHolder>" ; } _4 ( ) { return _4 ; }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . CoreMatchers . is ( org . hamcrest . CoreMatchers . equalTo ( expected ) ) )
|
testList8 ( ) { java . util . List in = new java . util . ArrayList ( ) ; in . add ( new org . fusesource . amqp . codec . AMQPByte ( ( ( byte ) ( 3 ) ) ) ) ; in . add ( new org . fusesource . amqp . codec . AMQPShort ( ( ( short ) ( 5 ) ) ) ) ; in . add ( new org . fusesource . amqp . codec . AMQPInt ( 10 ) ) ; in . add ( new org . fusesource . amqp . codec . AMQPString ( "hi" ) ) ; java . util . List out = org . fusesource . amqp . codec . TestSupport . writeRead ( new org . fusesource . amqp . codec . AMQPList ( in ) ) . getValue ( ) ; "<AssertPlaceHolder>" ; } writeRead ( T extends org . fusesource . amqp . codec . AMQPType ) { return org . fusesource . amqp . codec . TestSupport . writeRead ( value , true ) ; }
|
org . junit . Assert . assertEquals ( in , out )
|
testUpdate_OptimisticLock1 ( ) { com . jmethods . catatumbo . entities . OptimisticLock1 entity = new com . jmethods . catatumbo . entities . OptimisticLock1 ( ) ; entity . setName ( "Before<sp>Update!" ) ; com . jmethods . catatumbo . entities . OptimisticLock1 entity2 = com . jmethods . catatumbo . EntityManagerTest . em . insert ( entity ) ; com . jmethods . catatumbo . entities . OptimisticLock1 entity3 = com . jmethods . catatumbo . EntityManagerTest . em . load ( com . jmethods . catatumbo . entities . OptimisticLock1 . class , entity2 . getId ( ) ) ; entity3 . setName ( "After<sp>Update" ) ; com . jmethods . catatumbo . entities . OptimisticLock1 entity4 = com . jmethods . catatumbo . EntityManagerTest . em . update ( entity3 ) ; com . jmethods . catatumbo . entities . OptimisticLock1 entity5 = com . jmethods . catatumbo . EntityManagerTest . em . load ( com . jmethods . catatumbo . entities . OptimisticLock1 . class , entity4 . getId ( ) ) ; "<AssertPlaceHolder>" ; } getVersion ( ) { return version ; }
|
org . junit . Assert . assertTrue ( ( ( ( ( ( entity2 . getVersion ( ) ) == 1 ) && ( ( entity3 . getVersion ( ) ) == 1 ) ) && ( ( entity4 . getVersion ( ) ) == 2 ) ) && ( ( entity5 . getVersion ( ) ) == 2 ) ) )
|
deletedNodesShouldNotBeRecreated ( ) { org . apache . jackrabbit . oak . spi . state . NodeState root = org . apache . jackrabbit . oak . plugins . memory . EmptyNodeState . EMPTY_NODE ; org . apache . jackrabbit . oak . spi . state . NodeState withProperty ; { org . apache . jackrabbit . oak . spi . state . NodeBuilder builder = root . builder ( ) ; builder . child ( "c" ) . setProperty ( "foo" , "bar" ) ; withProperty = builder . getNodeState ( ) ; } org . apache . jackrabbit . oak . spi . state . NodeState withUpdatedProperty ; { org . apache . jackrabbit . oak . spi . state . NodeBuilder builder = withProperty . builder ( ) ; builder . child ( "c" ) . setProperty ( "foo" , "baz" ) ; withUpdatedProperty = builder . getNodeState ( ) ; } org . apache . jackrabbit . oak . spi . state . NodeState withRemovedChild ; { org . apache . jackrabbit . oak . spi . state . NodeBuilder builder = withProperty . builder ( ) ; builder . child ( "c" ) . remove ( ) ; withRemovedChild = builder . getNodeState ( ) ; } org . apache . jackrabbit . oak . spi . state . NodeBuilder mergedBuilder = withUpdatedProperty . builder ( ) ; withRemovedChild . compareAgainstBaseState ( withProperty , new org . apache . jackrabbit . oak . spi . state . ConflictAnnotatingRebaseDiff ( mergedBuilder ) ) ; org . apache . jackrabbit . oak . spi . state . NodeState merged = org . apache . jackrabbit . oak . plugins . commit . ConflictHook . of ( DefaultThreeWayConflictHandler . OURS ) . processCommit ( mergedBuilder . getBaseState ( ) , mergedBuilder . getNodeState ( ) , CommitInfo . EMPTY ) ; "<AssertPlaceHolder>" ; } hasChildNode ( java . lang . String ) { return childProvider . hasChildNode ( name ) ; }
|
org . junit . Assert . assertFalse ( merged . hasChildNode ( "c" ) )
|
shouldValidateUnchangedTocBelongingToAlreadyAcceptedTechnology ( ) { given ( technology . getId ( ) ) . willReturn ( 101L ) ; given ( techDataDefinition . get ( 101L ) ) . willReturn ( existingTechnology ) ; given ( technology . getStringField ( TechnologyFields . STATE ) ) . willReturn ( TechnologyState . ACCEPTED . getStringValue ( ) ) ; given ( existingTechnology . getStringField ( TechnologyFields . STATE ) ) . willReturn ( TechnologyState . ACCEPTED . getStringValue ( ) ) ; given ( toc . getId ( ) ) . willReturn ( 202L ) ; given ( tocDataDefinition . get ( 202L ) ) . willReturn ( toc ) ; final boolean isValid = technologyTreeValidators . invalidateIfBelongsToAcceptedTechnology ( tocDataDefinition , toc ) ; "<AssertPlaceHolder>" ; } invalidateIfBelongsToAcceptedTechnology ( com . qcadoo . model . api . DataDefinition , com . qcadoo . model . api . Entity ) { com . qcadoo . model . api . Entity technology = null ; java . lang . String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology" ; if ( TechnologiesConstants . MODEL_TECHNOLOGY . equals ( dataDefinition . getName ( ) ) ) { technology = entity ; errorMessageKey = "technologies.technology.state.error.modifyAcceptedTechnology" ; } else if ( TechnologiesConstants . MODEL_TECHNOLOGY_OPERATION_COMPONENT . equals ( dataDefinition . getName ( ) ) ) { technology = entity . getBelongsToField ( TechnologyOperationComponentFields . TECHNOLOGY ) ; } else if ( ( TechnologiesConstants . MODEL_OPERATION_PRODUCT_IN_COMPONENT . equals ( dataDefinition . getName ( ) ) ) || ( TechnologiesConstants . MODEL_OPERATION_PRODUCT_OUT_COMPONENT . equals ( dataDefinition . getName ( ) ) ) ) { final com . qcadoo . model . api . Entity operationComponent = entity . getBelongsToField ( com . qcadoo . mes . technologies . validators . TechnologyTreeValidators . L_OPERATION_COMPONENT ) ; if ( operationComponent == null ) { return true ; } technology = operationComponent . getBelongsToField ( TechnologyOperationComponentFields . TECHNOLOGY ) ; } if ( technologyIsAcceptedAndNotDeactivated ( dataDefinition , entity , technology ) ) { entity . addGlobalError ( errorMessageKey , technology . getStringField ( TechnologyFields . NAME ) ) ; return false ; } return true ; }
|
org . junit . Assert . assertTrue ( isValid )
|
testRemoveNonStringValue ( ) { final java . lang . String key = "Key" ; final org . apache . logging . log4j . message . ObjectMapMessage msg = new org . apache . logging . log4j . message . ObjectMapMessage ( ) . with ( key , 1L ) ; "<AssertPlaceHolder>" ; } remove ( java . lang . String ) { boolean success ; do { success = true ; final org . apache . logging . log4j . core . config . AppenderControl [ ] original = appenderArray . get ( ) ; for ( int i = 0 ; i < ( original . length ) ; i ++ ) { final org . apache . logging . log4j . core . config . AppenderControl appenderControl = original [ i ] ; if ( java . util . Objects . equals ( name , appenderControl . getAppenderName ( ) ) ) { final org . apache . logging . log4j . core . config . AppenderControl [ ] copy = removeElementAt ( i , original ) ; if ( appenderArray . compareAndSet ( original , copy ) ) { return appenderControl ; } success = false ; break ; } } } while ( ! success ) ; return null ; }
|
org . junit . Assert . assertEquals ( "1" , msg . remove ( key ) )
|
testSearchForExtensionTwoDeepReferenceWithoutType ( ) { ca . uhn . fhir . jpa . dao . dstu2 . SearchParameter siblingSp = new ca . uhn . fhir . jpa . dao . dstu2 . SearchParameter ( ) ; siblingSp . setBase ( ResourceTypeEnum . PATIENT ) ; siblingSp . setCode ( "foobar" ) ; siblingSp . setType ( SearchParamTypeEnum . REFERENCE ) ; siblingSp . setXpath ( "Patient.extension('http://acme.org/foo').extension('http://acme.org/bar')" ) ; siblingSp . setXpathUsage ( XPathUsageTypeEnum . NORMAL ) ; siblingSp . setStatus ( ConformanceResourceStatusEnum . ACTIVE ) ; mySearchParameterDao . create ( siblingSp , mySrd ) ; mySearchParamRegistry . forceRefresh ( ) ; ca . uhn . fhir . jpa . dao . dstu2 . Appointment apt = new ca . uhn . fhir . jpa . dao . dstu2 . Appointment ( ) ; apt . setStatus ( AppointmentStatusEnum . ARRIVED ) ; org . hl7 . fhir . instance . model . api . IIdType aptId = myAppointmentDao . create ( apt ) . getId ( ) . toUnqualifiedVersionless ( ) ; ca . uhn . fhir . jpa . dao . dstu2 . Patient patient = new ca . uhn . fhir . jpa . dao . dstu2 . Patient ( ) ; patient . addName ( ) . addFamily ( "P2" ) ; ca . uhn . fhir . model . api . ExtensionDt extParent = patient . addUndeclaredExtension ( false , "http://acme.org/foo" ) ; extParent . addUndeclaredExtension ( false , "http://acme.org/bar" ) . setValue ( new ca . uhn . fhir . model . dstu2 . composite . ResourceReferenceDt ( aptId . getValue ( ) ) ) ; org . hl7 . fhir . instance . model . api . IIdType p2id = myPatientDao . create ( patient ) . getId ( ) . toUnqualifiedVersionless ( ) ; ca . uhn . fhir . jpa . searchparam . SearchParameterMap map ; ca . uhn . fhir . rest . api . server . IBundleProvider results ; java . util . List < java . lang . String > foundResources ; map = new ca . uhn . fhir . jpa . searchparam . SearchParameterMap ( ) ; map . add ( "foobar" , new ca . uhn . fhir . jpa . dao . dstu2 . ReferenceParam ( aptId . getValue ( ) ) ) ; results = myPatientDao . search ( map ) ; foundResources = toUnqualifiedVersionlessIdValues ( results ) ; "<AssertPlaceHolder>" ; } contains ( java . lang . Object ) { return data . contains ( o ) ; }
|
org . junit . Assert . assertThat ( foundResources , contains ( p2id . getValue ( ) ) )
|
test_ulong_disc_union_manual ( ) { org . jacorb . test . orb . ULongDiscUnion testValue = new org . jacorb . test . orb . ULongDiscUnion ( ) ; testValue . s ( "foo" ) ; org . omg . CORBA . Any outAny = setup . getClientOrb ( ) . create_any ( ) ; outAny . type ( org . jacorb . test . orb . ULongDiscUnionHelper . type ( ) ) ; org . jacorb . test . orb . ULongDiscUnionHelper . write ( outAny . create_output_stream ( ) , testValue ) ; org . omg . CORBA . Any inAny = server . bounce_any ( outAny ) ; "<AssertPlaceHolder>" ; } equal ( java . lang . Object ) { if ( ( obj1 == null ) || ( ( current ) == null ) ) { throw new org . jacorb . collection . util . ObjectInvalid ( ) ; } check_object ( obj1 ) ; return ops . equal ( current , ( ( org . omg . CORBA . Any ) ( obj1 ) ) ) ; }
|
org . junit . Assert . assertTrue ( outAny . equal ( inAny ) )
|
testGetMostRecentResult ( ) { org . junit . Assume . assumeTrue ( ( ( TestIntegrationSuite . testInstance ) != null ) ) ; com . rmn . testrail . entity . TestResult testResult = com . rmn . testrail . service . TestIntegrationSuite . getService ( ) . getTestResult ( TestIntegrationSuite . testInstance . getId ( ) ) ; "<AssertPlaceHolder>" ; } getId ( ) { return id ; }
|
org . junit . Assert . assertNotNull ( testResult )
|
setUpdateLimit ( ) { java . util . Map < java . lang . String , java . lang . Object > config = newConfig ( repoHome ) ; config . put ( DocumentNodeStoreServiceConfiguration . PROP_UPDATE_LIMIT , 17 ) ; org . apache . sling . testing . mock . osgi . MockOsgi . setConfigForPid ( context . bundleContext ( ) , org . apache . jackrabbit . oak . plugins . document . Configuration . PID , config ) ; org . apache . sling . testing . mock . osgi . MockOsgi . activate ( service , context . bundleContext ( ) ) ; org . apache . jackrabbit . oak . plugins . document . DocumentNodeStore store = context . getService ( org . apache . jackrabbit . oak . plugins . document . DocumentNodeStore . class ) ; "<AssertPlaceHolder>" ; } getUpdateLimit ( ) { return updateLimit ; }
|
org . junit . Assert . assertEquals ( 17 , store . getUpdateLimit ( ) )
|
testExtractRuleSections_invalidRule ( ) { java . lang . String fileContent = ( MonitoringRunnable . RULE_BEGINNING ) + "<sp>file<sp>event<sp>id<sp>with<sp>spaces]" ; net . roboconf . agent . monitoring . internal . MonitoringRunnable task = new net . roboconf . agent . monitoring . internal . MonitoringRunnable ( this . agentInterface , net . roboconf . agent . monitoring . internal . MonitoringRunnableTest . HANDLERS ) ; this . agentInterface . setScopedInstance ( new net . roboconf . core . model . beans . Instance ( "root" ) ) ; java . util . List < net . roboconf . agent . monitoring . internal . MonitoringRunnable . MonitoringHandlerRun > handlers = task . extractRuleSections ( new java . io . File ( "test" ) , fileContent , null ) ; "<AssertPlaceHolder>" ; } size ( ) { return this . map . size ( ) ; }
|
org . junit . Assert . assertEquals ( 0 , handlers . size ( ) )
|
testGetActions ( ) { int requestId = 500 ; org . apache . ambari . server . actionmanager . ActionDBAccessor db = createStrictMock ( org . apache . ambari . server . actionmanager . ActionDBAccessor . class ) ; org . apache . ambari . server . state . Clusters clusters = createNiceMock ( org . apache . ambari . server . state . Clusters . class ) ; org . apache . ambari . server . actionmanager . Stage stage1 = createNiceMock ( org . apache . ambari . server . actionmanager . Stage . class ) ; org . apache . ambari . server . actionmanager . Stage stage2 = createNiceMock ( org . apache . ambari . server . actionmanager . Stage . class ) ; java . util . List < org . apache . ambari . server . actionmanager . Stage > listStages = new java . util . ArrayList ( ) ; listStages . add ( stage1 ) ; listStages . add ( stage2 ) ; expect ( db . getLastPersistedRequestIdWhenInitialized ( ) ) . andReturn ( java . lang . Long . valueOf ( 1000 ) ) ; expect ( db . getAllStages ( requestId ) ) . andReturn ( listStages ) ; replay ( db , clusters ) ; org . apache . ambari . server . actionmanager . ActionScheduler actionScheduler = new org . apache . ambari . server . actionmanager . ActionScheduler ( 0 , 0 , db , createNiceMock ( org . apache . ambari . server . events . publishers . JPAEventPublisher . class ) ) ; org . apache . ambari . server . actionmanager . ActionManager manager = new org . apache . ambari . server . actionmanager . ActionManager ( db , injector . getInstance ( org . apache . ambari . server . actionmanager . RequestFactory . class ) , actionScheduler ) ; "<AssertPlaceHolder>" ; verify ( db , clusters ) ; } getActions ( long ) { return db . getAllStages ( requestId ) ; }
|
org . junit . Assert . assertSame ( listStages , manager . getActions ( requestId ) )
|
testBuildWithParameters ( ) { java . lang . String name = "name" ; org . lnu . is . domain . asset . state . AssetState context = new org . lnu . is . domain . asset . state . AssetState ( ) ; context . setName ( name ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>AssetState<sp>e<sp>WHERE<sp>(<sp>e.name<sp>LIKE<sp>CONCAT('%',:name,'%')<sp>)<sp>AND<sp>e.status=:status<sp>AND<sp>e.crtUserGroup<sp>IN<sp>(:userGroups)<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . asset . state . AssetState > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expected , actualQuery )
|
intial_noop ( ) { org . cache2k . Cache < java . lang . Integer , java . lang . Integer > c = target . cache ( ) ; org . cache2k . processor . EntryProcessor p = new org . cache2k . processor . EntryProcessor ( ) { @ org . cache2k . test . core . Override public java . lang . Object process ( org . cache2k . processor . MutableCacheEntry e ) throws org . cache2k . test . core . Exception { return null ; } } ; java . lang . Object _result = c . invoke ( 123 , p ) ; "<AssertPlaceHolder>" ; } invoke ( K , org . cache2k . processor . EntryProcessor ) { return execute ( key , SPEC . invoke ( key , ( ( loader ) != null ) , entryProcessor ) ) ; }
|
org . junit . Assert . assertNull ( _result )
|
testSupplierGetByID ( ) { int code = 0 ; try { code = _setupTestSupplier ( false ) ; org . isf . supplier . model . Supplier foundSupplier = supplierIoOperation . getByID ( code ) ; _checkSupplierIntoDb ( foundSupplier . getSupId ( ) ) ; } catch ( java . lang . Exception e ) { e . printStackTrace ( ) ; "<AssertPlaceHolder>" ; } return ; } getSupId ( ) { return this . supId ; }
|
org . junit . Assert . assertEquals ( true , false )
|
deleteFile ( ) { try { java . io . OutputStream outStream ; outStream = getFileStore ( ) . write ( eu . fbk . knowledgestore . filestore . AbstractFileStoreTest . FILENAME_1 ) ; "<AssertPlaceHolder>" ; outStream . write ( eu . fbk . knowledgestore . filestore . AbstractFileStoreTest . CONTENT_1 ) ; outStream . close ( ) ; getFileStore ( ) . delete ( eu . fbk . knowledgestore . filestore . AbstractFileStoreTest . FILENAME_1 ) ; } catch ( final eu . fbk . knowledgestore . filestore . FileExistsException e ) { e . printStackTrace ( ) ; } catch ( final java . io . IOException e ) { e . printStackTrace ( ) ; } } write ( java . lang . String ) { final org . apache . hadoop . fs . Path path = getFullPath ( fileName ) ; try { final java . io . OutputStream stream = this . fileSystem . create ( path , false ) ; if ( eu . fbk . knowledgestore . filestore . HadoopFileStore . LOGGER . isDebugEnabled ( ) ) { eu . fbk . knowledgestore . filestore . HadoopFileStore . LOGGER . debug ( ( "Creating<sp>file<sp>" + ( getRelativePath ( path ) ) ) ) ; } return stream ; } catch ( final java . io . IOException ex ) { if ( this . fileSystem . exists ( path ) ) { throw new eu . fbk . knowledgestore . filestore . FileExistsException ( fileName , "Cannot<sp>overwrite<sp>file" ) ; } throw ex ; } }
|
org . junit . Assert . assertNotNull ( outStream )
|
testSetSubKeyNullEmptyString ( ) { pool . getSourceSubscription ( ) . setSubscriptionId ( null ) ; pool . setSubscriptionSubKey ( "" ) ; "<AssertPlaceHolder>" ; } getSourceSubscription ( ) { return sourceSubscription ; }
|
org . junit . Assert . assertNull ( pool . getSourceSubscription ( ) )
|
testResolveTemplatesSlash ( ) { javax . ws . rs . client . WebTarget base = org . jboss . resteasy . test . client . WebTargetTest . client . target ( ( ( generateURL ( "/" ) ) + "users/{username}" ) ) ; javax . ws . rs . client . WebTarget created = base . path ( "{id}/{question}/{question}" ) ; java . util . Map < java . lang . String , java . lang . Object > values = new java . util . HashMap < java . lang . String , java . lang . Object > ( ) ; values . put ( "question" , "/WHY/" ) ; values . put ( "id" , "1" ) ; values . put ( "username" , "//test" ) ; values . put ( "username" 0 , "none" ) ; java . lang . String result = created . resolveTemplates ( values , true ) . request ( ) . get ( java . lang . String . class ) ; "<AssertPlaceHolder>" ; } get ( java . lang . String ) { return val ; }
|
org . junit . Assert . assertEquals ( "username" 1 , result )
|
testIsDone_False ( ) { initializeExpectedJob ( 2 ) ; com . google . cloud . bigquery . BigQuery [ ] expectedOptions = new BigQuery . JobOption [ ] { BigQuery . JobOption . fields ( BigQuery . JobField . STATUS ) } ; com . google . cloud . bigquery . JobStatus status = createStrictMock ( com . google . cloud . bigquery . JobStatus . class ) ; expect ( status . getState ( ) ) . andReturn ( JobStatus . State . RUNNING ) ; expect ( bigquery . getOptions ( ) ) . andReturn ( mockOptions ) ; expect ( bigquery . getJob ( com . google . cloud . bigquery . JobTest . JOB_INFO . getJobId ( ) , expectedOptions ) ) . andReturn ( expectedJob . toBuilder ( ) . setStatus ( status ) . build ( ) ) ; replay ( status , bigquery ) ; initializeJob ( ) ; "<AssertPlaceHolder>" ; verify ( status ) ; } isDone ( ) { while ( ! ( job . isDone ( ) ) ) { java . lang . Thread . sleep ( 1000L ) ; }
|
org . junit . Assert . assertFalse ( job . isDone ( ) )
|
testPostDocumentFolderDocument ( ) { "<AssertPlaceHolder>" ; }
|
org . junit . Assert . assertTrue ( true )
|
testToDMNModelExpressionKindJavaAndPMML ( ) { cellValueSupplier = ( ) -> java . util . Optional . of ( new org . kie . workbench . common . dmn . client . editors . expressions . types . context . ExpressionCellValue ( java . util . Optional . of ( supplementaryEditor ) ) ) ; mapper . toDMNModel ( 0 , 0 , cellValueSupplier ) ; "<AssertPlaceHolder>" ; } getExpression ( ) { return expression ; }
|
org . junit . Assert . assertEquals ( context , function . getExpression ( ) )
|
testNegativeX ( ) { org . apache . commons . math . geometry . Vector3D c = new org . apache . commons . math . geometry . Vector3D ( ( - 1.2323 ) , 1.4343 , 1.6333 ) ; java . lang . String expected = ( ( ( ( ( "{-1" + ( getDecimalCharacter ( ) ) ) + "23;<sp>1" ) + ( getDecimalCharacter ( ) ) ) + "43;<sp>1" ) + ( getDecimalCharacter ( ) ) ) + "63}" ; java . lang . String actual = vector3DFormat . format ( c ) ; "<AssertPlaceHolder>" ; } format ( java . lang . Object [ ] ) { return format . format ( arguments ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testNewPseudoAtom_String ( ) { org . openscience . cdk . interfaces . IChemObjectBuilder builder = org . openscience . cdk . AbstractChemObjectBuilderTest . rootObject . getBuilder ( ) ; org . openscience . cdk . interfaces . IPseudoAtom atom = builder . newInstance ( org . openscience . cdk . interfaces . IPseudoAtom . class , "Foo" ) ; "<AssertPlaceHolder>" ; } newInstance ( java . lang . Class , java . lang . Object [ ] ) { return factory . ofClass ( clazz , params ) ; }
|
org . junit . Assert . assertNotNull ( atom )
|
testDoesntCallMethodIfAbsent ( ) { final org . apache . flink . yarn . RegisterApplicationMasterResponseReflector registerApplicationMasterResponseReflector = new org . apache . flink . yarn . RegisterApplicationMasterResponseReflector ( org . apache . flink . yarn . RegisterApplicationMasterResponseReflectorTest . LOG , org . apache . flink . yarn . RegisterApplicationMasterResponseReflectorTest . HasMethod . class ) ; final java . util . List < org . apache . hadoop . yarn . api . records . Container > containersFromPreviousAttemptsUnsafe = registerApplicationMasterResponseReflector . getContainersFromPreviousAttemptsUnsafe ( new java . lang . Object ( ) ) ; "<AssertPlaceHolder>" ; } empty ( ) { return new org . apache . flink . runtime . rest . messages . taskmanager . TaskManagerMetricsInfo ( 0L , 0L , 0L , 0L , 0L , 0L , 0L , 0L , 0L , 0L , 0L , 0L , 0L , 0L , java . util . Collections . emptyList ( ) ) ; }
|
org . junit . Assert . assertThat ( containersFromPreviousAttemptsUnsafe , org . hamcrest . Matchers . empty ( ) )
|
testScanBeforeGet ( ) { uk . ac . bbsrc . tgac . miso . integration . BoxScanner scanner = getScanner ( ) ; prePrepare ( ) ; scanner . prepareScan ( 2 , 2 ) ; simulateScan ( getSampleScan ( "11111" ) ) ; preGet ( ) ; uk . ac . bbsrc . tgac . miso . integration . BoxScan scan = scanner . getScan ( ) ; "<AssertPlaceHolder>" ; } getBarcode ( int , int ) { return scan . getBarcode ( row , column ) ; }
|
org . junit . Assert . assertEquals ( "11111" , scan . getBarcode ( 1 , 1 ) )
|
testIsScrumTeam ( ) { org . apache . olingo . odata2 . ref . model . Team team1 = new org . apache . olingo . odata2 . ref . model . Team ( 1 , null ) ; team1 . setScrumTeam ( true ) ; "<AssertPlaceHolder>" ; } isScrumTeam ( ) { return isScrumTeam ; }
|
org . junit . Assert . assertTrue ( team1 . isScrumTeam ( ) )
|
deveObterStatusComoFoiSetado ( ) { final com . fincatto . documentofiscal . nfe400 . classes . evento . inutilizacao . NFRetornoEventoInutilizacaoDados dados = new com . fincatto . documentofiscal . nfe400 . classes . evento . inutilizacao . NFRetornoEventoInutilizacaoDados ( ) ; final java . lang . String status = "Em<sp>andamento" ; dados . setStatus ( status ) ; "<AssertPlaceHolder>" ; } getStatus ( ) { return this . status ; }
|
org . junit . Assert . assertEquals ( status , dados . getStatus ( ) )
|
shouldResolveSecurityPolicy1 ( ) { io . gravitee . gateway . api . Request request = mock ( io . gravitee . gateway . api . Request . class ) ; io . gravitee . gateway . security . core . AuthenticationHandler securityProvider1 = mock ( io . gravitee . gateway . security . core . AuthenticationHandler . class ) ; when ( securityProvider1 . name ( ) ) . thenReturn ( "keyless" ) ; when ( securityProvider1 . canHandle ( request ) ) . thenReturn ( true ) ; when ( securityProvider1 . order ( ) ) . thenReturn ( 1000 ) ; io . gravitee . gateway . security . core . AuthenticationHandler securityProvider2 = mock ( io . gravitee . gateway . security . core . AuthenticationHandler . class ) ; when ( securityProvider2 . name ( ) ) . thenReturn ( "apikey" ) ; when ( securityProvider2 . order ( ) ) . thenReturn ( 500 ) ; when ( securityProviderLoader . getSecurityProviders ( ) ) . thenReturn ( java . util . Arrays . asList ( securityProvider1 , securityProvider2 ) ) ; securityManager . afterPropertiesSet ( ) ; io . gravitee . gateway . security . core . AuthenticationHandler securityProvider = securityManager . resolve ( request ) ; "<AssertPlaceHolder>" ; } resolve ( io . gravitee . gateway . api . Request ) { for ( io . gravitee . gateway . security . core . AuthenticationHandler securityProvider : securityProviders ) { if ( securityProvider . canHandle ( request ) ) { return securityProvider ; } } return null ; }
|
org . junit . Assert . assertEquals ( securityProvider1 , securityProvider )
|
testFailFirst ( ) { org . apache . hadoop . fs . shell . find . And and = new org . apache . hadoop . fs . shell . find . And ( ) ; org . apache . hadoop . fs . shell . PathData pathData = mock ( org . apache . hadoop . fs . shell . PathData . class ) ; org . apache . hadoop . fs . shell . find . Expression first = mock ( org . apache . hadoop . fs . shell . find . Expression . class ) ; when ( first . apply ( pathData ) ) . thenReturn ( Result . FAIL ) ; org . apache . hadoop . fs . shell . find . Expression second = mock ( org . apache . hadoop . fs . shell . find . Expression . class ) ; when ( second . apply ( pathData ) ) . thenReturn ( Result . PASS ) ; java . util . Deque < org . apache . hadoop . fs . shell . find . Expression > children = new java . util . LinkedList < org . apache . hadoop . fs . shell . find . Expression > ( ) ; children . add ( second ) ; children . add ( first ) ; and . addChildren ( children ) ; "<AssertPlaceHolder>" ; verify ( first ) . apply ( pathData ) ; verifyNoMoreInteractions ( first ) ; verifyNoMoreInteractions ( second ) ; } apply ( org . apache . hadoop . fs . shell . PathData ) { for ( org . apache . hadoop . fs . shell . find . Expression child : getChildren ( ) ) { org . apache . hadoop . fs . shell . find . Result result = child . apply ( item ) ; if ( result . isPass ( ) ) { return result ; } } return Result . FAIL ; }
|
org . junit . Assert . assertEquals ( Result . FAIL , and . apply ( pathData ) )
|
test_return_value ( ) { com . cloudbees . syslog . util . CachingReference < java . lang . String > cachingReference = new com . cloudbees . syslog . util . CachingReference < java . lang . String > ( 5 , java . util . concurrent . TimeUnit . SECONDS ) { @ javax . annotation . Nullable @ com . cloudbees . syslog . util . Override protected java . lang . String newObject ( ) { return "value" ; } } ; java . lang . String actual = cachingReference . get ( ) ; "<AssertPlaceHolder>" ; } newObject ( ) { try { return java . net . InetAddress . getLocalHost ( ) . getHostName ( ) ; } catch ( java . net . UnknownHostException e ) { return java . lang . String . valueOf ( com . cloudbees . syslog . SyslogMessage . NILVALUE ) ; } }
|
org . junit . Assert . assertThat ( actual , org . hamcrest . Matchers . equalTo ( "value" ) )
|
testCreateKerberosSecurityTypeNone ( ) { java . util . Map < java . lang . String , java . lang . Object > reuqestMap = new java . util . HashMap ( ) ; java . util . Map < java . lang . String , java . lang . Object > security = new java . util . HashMap ( ) ; security . put ( SecurityConfigurationFactory . TYPE_PROPERTY_ID , SecurityType . NONE . toString ( ) ) ; reuqestMap . put ( SecurityConfigurationFactory . SECURITY_PROPERTY_ID , security ) ; org . apache . ambari . server . topology . SecurityConfiguration securityConfiguration = testSubject . createSecurityConfigurationFromRequest ( reuqestMap , false ) ; "<AssertPlaceHolder>" ; } getType ( ) { return TargetType . ALERT_SCRIPT . name ( ) ; }
|
org . junit . Assert . assertTrue ( ( ( securityConfiguration . getType ( ) ) == ( org . apache . ambari . server . state . SecurityType . NONE ) ) )
|
getType ( ) { "<AssertPlaceHolder>" ; } getType ( ) { org . junit . Assert . assertEquals ( java . util . Map . class , nl . jqno . equalsverifier . internal . prefabvalues . TypeTagTest . SOME_LONG_TYPETAG . getType ( ) ) ; }
|
org . junit . Assert . assertEquals ( java . util . Map . class , nl . jqno . equalsverifier . internal . prefabvalues . TypeTagTest . SOME_LONG_TYPETAG . getType ( ) )
|
testBuildWithSecurityCOnstraint ( ) { unit . setSecurity ( false ) ; org . lnu . is . domain . order . type . OrderType context = new org . lnu . is . domain . order . type . OrderType ( ) ; java . lang . String expected = "SELECT<sp>e<sp>FROM<sp>OrderType<sp>e<sp>WHERE<sp>e.status=:status<sp>" ; org . lnu . is . pagination . MultiplePagedSearch < org . lnu . is . domain . order . type . OrderType > pagedSearch = new org . lnu . is . pagination . MultiplePagedSearch ( ) ; pagedSearch . setEntity ( context ) ; java . lang . String actualQuery = unit . build ( pagedSearch ) ; "<AssertPlaceHolder>" ; } setEntity ( T ) { this . entity = entity ; }
|
org . junit . Assert . assertEquals ( expected , actualQuery )
|
testRename ( ) { final org . uberfire . backend . vfs . Path expectedPath = mock ( org . uberfire . backend . vfs . Path . class ) ; doReturn ( expectedPath ) . when ( renameService ) . rename ( path , newFileName , comment ) ; final org . uberfire . backend . vfs . Path actualPath = htmlEditorService . rename ( path , newFileName , comment ) ; verify ( renameService ) . rename ( path , newFileName , comment ) ; "<AssertPlaceHolder>" ; } rename ( org . uberfire . backend . vfs . Path , java . lang . String , java . lang . String ) { try { return renameService . rename ( path , newName , comment ) ; } catch ( java . lang . Exception e ) { throw org . uberfire . ext . wires . bpmn . backend . todo . ExceptionUtilities . handleException ( e ) ; } }
|
org . junit . Assert . assertEquals ( expectedPath , actualPath )
|
testLinkSourceIpAddress ( ) { linkInformation . setLinkSourceIpAddress ( org . onlab . packet . Ip4Address . valueOf ( "1.1.1.1" ) ) ; "<AssertPlaceHolder>" ; } linkSourceIpAddress ( ) { return linkSourceIpAddress ; }
|
org . junit . Assert . assertThat ( linkInformation . linkSourceIpAddress ( ) , org . hamcrest . CoreMatchers . is ( org . onlab . packet . Ip4Address . valueOf ( "1.1.1.1" ) ) )
|
testDynamicQueryByProjectionMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . portal . tools . service . builder . test . model . LVEntry . class , _dynamicQueryClassLoader ) ; dynamicQuery . setProjection ( com . liferay . portal . kernel . dao . orm . ProjectionFactoryUtil . property ( "lvEntryId" ) ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . in ( "lvEntryId" , new java . lang . Object [ ] { com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) } ) ) ; java . util . List < java . lang . Object > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
|
testAbstractInternalMethodNoErrors_withAllowAbstractClassesEnabled ( ) { java . lang . String [ ] imports = new java . lang . String [ ] { } ; java . lang . String [ ] declarations = new java . lang . String [ ] { } ; java . lang . String [ ] testCode = new java . lang . String [ ] { } ; java . lang . String [ ] extra = new java . lang . String [ ] { "abstract<sp>class<sp>A<sp>{" , "internal<sp>abstract<sp>function<sp>a():void;" , "}" } ; java . lang . String source = getAS ( imports , declarations , testCode , extra ) ; java . lang . String [ ] options = new java . lang . String [ ] { "-allow-abstract-classes=true" } ; java . io . File tempASFile = generateTempFile ( source ) ; java . lang . String result = compile ( tempASFile , source , false , false , false , options , true ) ; "<AssertPlaceHolder>" ; } compile ( java . io . File , java . lang . String , boolean , boolean , boolean , java . lang . String [ ] , boolean ) { System . out . println ( "Generating<sp>test:" ) ; as . ITestAdapter testAdapter = as . TestAdapterFactory . getTestAdapter ( ) ; java . util . List < java . lang . String > swcs = new java . util . ArrayList < java . lang . String > ( ) ; if ( withFramework ) { swcs . add ( testAdapter . getFlexArtifact ( "framework" ) . getPath ( ) ) ; swcs . add ( testAdapter . getFlexArtifactResourceBundle ( "framework" ) . getPath ( ) ) ; } if ( withRPC ) { swcs . add ( testAdapter . getFlexArtifact ( "spark" 5 ) . getPath ( ) ) ; swcs . add ( testAdapter . getFlexArtifactResourceBundle ( "spark" 5 ) . getPath ( ) ) ; } if ( withSpark ) { swcs . add ( testAdapter . getFlexArtifact ( "spark" ) . getPath ( ) ) ; swcs . add ( testAdapter . getFlexArtifactResourceBundle ( "spark" ) . getPath ( ) ) ; } java . util . List < java . lang . String > args = new java . util . ArrayList < java . lang . String > ( ) ; if ( hasFlashPlayerGlobal ) args . add ( ( "-external-library-path=" + ( testAdapter . getPlayerglobal ( ) . getPath ( ) ) ) ) ; else { java . lang . String jsSwcPath = as . FilenameNormalization . normalize ( "spark" 1 ) ; args . add ( ( "-external-library-path=" + jsSwcPath ) ) ; } if ( ( swcs . size ( ) ) > 0 ) { java . lang . String libraryPath = "-library-path=" + ( as . StringUtils . join ( swcs . toArray ( new java . lang . String [ swcs . size ( ) ] ) , "spark" 4 ) ) ; args . add ( libraryPath ) ; } if ( ( withFramework || withRPC ) || withSpark ) args . add ( ( ( ( "-namespace=" + ( as . ASFeatureTestsBase . NAMESPACE_2009 ) ) + "spark" 4 ) + ( testAdapter . getFlexManifestPath ( "spark" 2 ) ) ) ) ; if ( otherOptions != null ) { java . util . Collections . addAll ( args , otherOptions ) ; } args . add ( tempASFile . getAbsolutePath ( ) ) ; org . apache . royale . compiler . clients . MXMLC mxmlc = new org . apache . royale . compiler . clients . MXMLC ( ) ; java . lang . StringBuffer cmdLine = new java . lang . StringBuffer ( ) ; for ( java . lang . String arg : args ) { cmdLine . append ( arg ) . append ( "<sp>" ) ; } System . out . println ( ( "Compiling<sp>test:\n" + ( cmdLine . toString ( ) ) ) ) ; int exitCode = mxmlc . mainNoExit ( args . toArray ( new java . lang . String [ args . size ( ) ] ) ) ; java . util . List < org . apache . royale . compiler . problems . ICompilerProblem > problems = mxmlc . getProblems ( ) . getProblems ( ) ; java . lang . StringBuilder sb = new java . lang . StringBuilder ( ( checkExitCode && ( ( problems . size ( ) ) > 0 ) ? "Unexpected<sp>compilation<sp>problems:\n" : "spark" 0 ) ) ; for ( org . apache . royale . compiler . problems . ICompilerProblem problem : problems ) { sb . append ( problem . toString ( ) ) ; sb . append ( '\n' ) ; } System . out . println ( ( "spark" 3 + ( sb . toString ( ) ) ) ) ; if ( checkExitCode ) org . junit . Assert . assertThat ( sb . toString ( ) , exitCode , org . hamcrest . core . Is . is ( 0 ) ) ; return sb . toString ( ) ; }
|
org . junit . Assert . assertEquals ( "" , result )
|
testPermute ( ) { org . nd4j . autodiff . samediff . SameDiff sd = org . nd4j . autodiff . samediff . SameDiff . create ( ) ; org . nd4j . linalg . api . ndarray . INDArray arr = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 } , new int [ ] { 2 , 3 , 4 } ) ; org . nd4j . linalg . api . ndarray . INDArray expOut = org . nd4j . linalg . factory . Nd4j . create ( new double [ ] { 1 , 2 , 3 , 4 , 13 , 14 , 15 , 16 , 5 , 6 , 7 , 8 , 17 , 18 , 19 , 20 , 9 , 10 , 11 , 12 , 21 , 22 , 23 , 24 } , new int [ ] { 3 , 2 , 4 } ) ; org . nd4j . autodiff . samediff . SDVariable x = sd . var ( arr ) ; org . nd4j . autodiff . samediff . SDVariable result = sd . permute ( x , 1 , 0 , 2 ) ; "<AssertPlaceHolder>" ; } eval ( ) { sameDiff . exec ( null , getVarName ( ) ) ; return getArr ( ) ; }
|
org . junit . Assert . assertEquals ( expOut , result . eval ( ) )
|
testPositiveInfinity ( ) { org . apache . commons . math4 . linear . RealMatrix m = org . apache . commons . math4 . linear . MatrixUtils . createRealMatrix ( new double [ ] [ ] { new double [ ] { Double . POSITIVE_INFINITY , Double . POSITIVE_INFINITY , Double . POSITIVE_INFINITY } } ) ; java . lang . String expected = "{{(Infinity),(Infinity),(Infinity)}}" ; java . lang . String actual = realMatrixFormat . format ( m ) ; "<AssertPlaceHolder>" ; } format ( org . apache . commons . math4 . geometry . Vector ) { return format ( vector , new java . lang . StringBuffer ( ) , new java . text . FieldPosition ( 0 ) ) . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testWriteLines_OutputStream ( ) { final java . lang . Object [ ] data = new java . lang . Object [ ] { "hello" , new java . lang . StringBuffer ( "world" ) , "" , "this<sp>is" , null , "some<sp>text" } ; final java . util . List < java . lang . Object > list = java . util . Arrays . asList ( data ) ; final org . apache . commons . io . output . ByteArrayOutputStream baout = new org . apache . commons . io . output . ByteArrayOutputStream ( ) ; final org . apache . commons . io . testtools . YellOnFlushAndCloseOutputStream out = new org . apache . commons . io . testtools . YellOnFlushAndCloseOutputStream ( baout , false , true ) ; org . apache . commons . io . IOUtils . writeLines ( list , "*" , out ) ; out . off ( ) ; out . flush ( ) ; final java . lang . String expected = "hello*world**this<sp>is**some<sp>text*" ; final java . lang . String actual = baout . toString ( ) ; "<AssertPlaceHolder>" ; } toString ( ) { final java . lang . StringBuilder builder = new java . lang . StringBuilder ( ) ; builder . append ( getClass ( ) . getSimpleName ( ) ) ; builder . append ( '[' ) ; builder . append ( charsetName ) ; builder . append ( ":<sp>" ) ; for ( int i = 0 ; i < ( bytes . length ) ; i ++ ) { if ( i > 0 ) { builder . append ( "," ) ; } builder . append ( "0x" ) ; builder . append ( java . lang . Integer . toHexString ( ( 255 & ( bytes [ i ] ) ) ) . toUpperCase ( Locale . ROOT ) ) ; } builder . append ( ']' ) ; return builder . toString ( ) ; }
|
org . junit . Assert . assertEquals ( expected , actual )
|
testSchemaValidation ( ) { io . cdap . cdap . etl . api . Transform < io . cdap . cdap . api . data . format . StructuredRecord , io . cdap . cdap . api . data . format . StructuredRecord > transform = new io . cdap . plugin . Compressor ( new io . cdap . plugin . Compressor . Config ( "a:GZIP" , io . cdap . plugin . CompressorTest . OUTPUT . toString ( ) ) ) ; io . cdap . cdap . etl . mock . common . MockPipelineConfigurer mockPipelineConfigurer = new io . cdap . cdap . etl . mock . common . MockPipelineConfigurer ( io . cdap . plugin . CompressorTest . INPUT ) ; transform . configurePipeline ( mockPipelineConfigurer ) ; "<AssertPlaceHolder>" ; } getOutputSchema ( ) { java . util . List < io . cdap . cdap . api . data . schema . Schema . Field > fields = new java . util . ArrayList ( ) ; java . lang . String [ ] mappings = fieldTypeMapping . split ( "," ) ; for ( java . lang . String mapping : mappings ) { java . lang . String [ ] params = mapping . split ( ":" ) ; java . lang . String fieldName = params [ 0 ] . trim ( ) ; if ( com . google . common . base . Strings . isNullOrEmpty ( fieldName ) ) { throw new java . lang . IllegalArgumentException ( "Field<sp>name<sp>cannot<sp>be<sp>null<sp>or<sp>empty." ) ; } else if ( ( ( params . length ) < 2 ) || ( com . google . common . base . Strings . isNullOrEmpty ( params [ 1 ] ) ) ) { throw new java . lang . IllegalArgumentException ( ( "Type<sp>cannot<sp>be<sp>null.<sp>Please<sp>specify<sp>type<sp>for<sp>" + fieldName ) ) ; } io . cdap . cdap . api . data . schema . Schema . Field field = Schema . Field . of ( fieldName , io . cdap . cdap . api . data . schema . Schema . nullableOf ( io . cdap . cdap . api . data . schema . Schema . of ( Schema . Type . valueOf ( params [ 1 ] . trim ( ) . toUpperCase ( ) ) ) ) ) ; if ( fields . contains ( field ) ) { throw new java . lang . IllegalArgumentException ( java . lang . String . format ( "Field<sp>%s<sp>already<sp>has<sp>type<sp>specified.<sp>Duplicate<sp>field<sp>%s" , fieldName , fieldName ) ) ; } else { fields . add ( field ) ; } } return io . cdap . cdap . api . data . schema . Schema . recordOf ( "record" , fields ) ; }
|
org . junit . Assert . assertEquals ( io . cdap . plugin . CompressorTest . OUTPUT , mockPipelineConfigurer . getOutputSchema ( ) )
|
testSerializeUnsignedPossibleLongToString ( ) { @ discord4j . common . jackson . PossibleJson class Pojo { @ discord4j . common . jackson . UnsignedJson discord4j . common . jackson . PossibleLong unsignedLong = discord4j . common . jackson . PossibleLong . of ( java . lang . Long . parseUnsignedLong ( "9223372036854775808" ) ) ; } java . lang . String expected = "{\"unsignedLong\":\"9223372036854775808\"}" ; java . lang . String result = getMapper ( ) . writeValueAsString ( new Pojo ( ) ) ; "<AssertPlaceHolder>" ; } getMapper ( ) { return new com . fasterxml . jackson . databind . ObjectMapper ( ) . setVisibility ( com . fasterxml . jackson . annotation . PropertyAccessor . FIELD , com . fasterxml . jackson . annotation . JsonAutoDetect . Visibility . ANY ) . configure ( com . fasterxml . jackson . databind . DeserializationFeature . FAIL_ON_UNKNOWN_PROPERTIES , true ) . registerModules ( new discord4j . common . jackson . PossibleModule ( ) , new com . fasterxml . jackson . datatype . jdk8 . Jdk8Module ( ) ) ; }
|
org . junit . Assert . assertEquals ( expected , result )
|
shouldNotCrashOnBrokenSymlink ( ) { com . facebook . buck . testutil . integration . ProjectWorkspace workspace = com . facebook . buck . testutil . integration . TestDataHelper . createProjectWorkspaceForScenario ( this , "sdk-discovery-symlink" , temp ) ; workspace . setUp ( ) ; java . nio . file . Path root = workspace . getPath ( "" ) ; java . nio . file . FileSystem fileSystem = root . getFileSystem ( ) ; java . nio . file . Path sdksDir = root . resolve ( "Platforms/MacOSX.platform/Developer/SDKs" ) ; java . nio . file . Files . createDirectories ( sdksDir ) ; com . facebook . buck . util . CreateSymlinksForTests . createSymLink ( sdksDir . resolve ( "MacOSX.sdk" ) , fileSystem . getPath ( "does_not_exist" ) ) ; com . google . common . collect . ImmutableMap < java . lang . String , com . facebook . buck . apple . toolchain . AppleToolchain > toolchains = com . google . common . collect . ImmutableMap . of ( "com.apple.dt.toolchain.XcodeDefault" , getDefaultToolchain ( root ) ) ; com . google . common . collect . ImmutableMap < com . facebook . buck . apple . toolchain . AppleSdk , com . facebook . buck . apple . toolchain . AppleSdkPaths > actual = com . facebook . buck . apple . toolchain . impl . AppleSdkDiscovery . discoverAppleSdkPaths ( java . util . Optional . of ( root ) , com . google . common . collect . ImmutableList . of ( root ) , toolchains , com . facebook . buck . core . config . FakeBuckConfig . builder ( ) . build ( ) . getView ( com . facebook . buck . apple . AppleConfig . class ) ) ; "<AssertPlaceHolder>" ; } size ( ) { return allNodes . size ( ) ; }
|
org . junit . Assert . assertThat ( actual . size ( ) , org . hamcrest . Matchers . is ( 0 ) )
|
testPrettyPrint_2 ( ) { org . audit4j . core . util . StopWatch fixture = new org . audit4j . core . util . StopWatch ( "" ) ; fixture . setKeepTaskList ( true ) ; fixture . start ( "" ) ; halt ( ) ; fixture . stop ( ) ; java . lang . String result = fixture . prettyPrint ( ) ; "<AssertPlaceHolder>" ; } prettyPrint ( ) { java . lang . StringBuilder sb = new java . lang . StringBuilder ( shortSummary ( ) ) ; sb . append ( '\n' ) ; if ( ! ( this . keepTaskList ) ) { sb . append ( "No<sp>task<sp>info<sp>kept" ) ; } else { sb . append ( "-----------------------------------------\n" ) ; sb . append ( "ms<sp>%<sp>Task<sp>name\n" ) ; sb . append ( "-----------------------------------------\n" ) ; java . text . NumberFormat nf = java . text . NumberFormat . getNumberInstance ( ) ; nf . setMinimumIntegerDigits ( 5 ) ; nf . setGroupingUsed ( false ) ; java . text . NumberFormat pf = java . text . NumberFormat . getPercentInstance ( ) ; pf . setMinimumIntegerDigits ( 3 ) ; pf . setGroupingUsed ( false ) ; for ( org . audit4j . core . util . StopWatch . TaskInfo task : getTaskInfo ( ) ) { sb . append ( nf . format ( task . getTimeMillis ( ) ) ) . append ( "<sp>" ) ; sb . append ( pf . format ( ( ( task . getTimeSeconds ( ) ) / ( getTotalTimeSeconds ( ) ) ) ) ) . append ( "<sp>" ) ; sb . append ( task . getTaskName ( ) ) . append ( "\n" ) ; } } return sb . toString ( ) ; }
|
org . junit . Assert . assertNotNull ( result )
|
testStr2Pinyin ( ) { java . util . List < java . lang . String > parseStr = org . nlpcn . commons . lang . pinyin . Pinyin . unicodePinyin ( str ) ; System . out . println ( parseStr ) ; "<AssertPlaceHolder>" ; } size ( ) { return hm . size ( ) ; }
|
org . junit . Assert . assertEquals ( parseStr . size ( ) , str . length ( ) )
|
testGetName ( ) { org . pb . x12 . Loop loop = new org . pb . x12 . Loop ( new org . pb . x12 . Context ( '~' , '*' , ':' ) , "ST" ) ; "<AssertPlaceHolder>" ; } getName ( ) { return name ; }
|
org . junit . Assert . assertEquals ( "ST" , loop . getName ( ) )
|
testGetAdHocDataProviderForWriteAfterRead ( ) { org . apache . hadoop . fs . Path testPath = org . mrgeo . hdfs . utils . HadoopFileUtils . createUniqueTmp ( ) ; try { org . mrgeo . data . adhoc . AdHocDataProvider dp = org . mrgeo . data . DataProviderFactory . getAdHocDataProvider ( testPath . toString ( ) , AccessMode . READ , providerProperties ) ; try { dp = org . mrgeo . data . DataProviderFactory . getAdHocDataProvider ( testPath . toString ( ) , AccessMode . WRITE , providerProperties ) ; "<AssertPlaceHolder>" ; } catch ( org . mrgeo . data . DataProviderNotFound e ) { org . junit . Assert . fail ( "Should<sp>be<sp>able<sp>to<sp>perform<sp>a<sp>WRITE<sp>even<sp>if<sp>the<sp>ad<sp>hoc<sp>resource<sp>exists" ) ; } } finally { org . mrgeo . hdfs . utils . HadoopFileUtils . delete ( testPath ) ; } } toString ( ) { java . lang . StringBuilder result = new java . lang . StringBuilder ( ) ; result . append ( "[<sp>" ) ; java . util . Map < java . lang . String , java . lang . String > attr = geometry . getAllAttributes ( ) ; for ( java . lang . String key : geometry . getAllAttributes ( ) . keySet ( ) ) { result . append ( key ) . append ( ":<sp>" ) . append ( attr . get ( key ) ) ; result . append ( ",<sp>" ) ; } result . append ( "geom:<sp>" ) . append ( org . mrgeo . mapreduce . WktConverter . toWkt ( geometry ) ) ; result . append ( "<sp>]" ) ; return result . toString ( ) ; }
|
org . junit . Assert . assertNotNull ( dp )
|
testGCmoreCommits ( ) { writeTrashFile ( "a.txt" , "a<sp>couple<sp>of<sp>words<sp>for<sp>gc<sp>to<sp>pack" ) ; writeTrashFile ( "a<sp>couple<sp>of<sp>words<sp>for<sp>gc<sp>to<sp>pack<sp>more<sp>2" 1 , "a<sp>couple<sp>of<sp>words<sp>for<sp>gc<sp>to<sp>pack<sp>2" ) ; writeTrashFile ( "c.txt" , "a<sp>couple<sp>of<sp>words<sp>for<sp>gc<sp>to<sp>pack<sp>3" ) ; git . commit ( ) . setAll ( true ) . setMessage ( "commit2" ) . call ( ) ; writeTrashFile ( "a.txt" , "a<sp>couple<sp>of<sp>words<sp>for<sp>gc<sp>to<sp>pack<sp>more" ) ; writeTrashFile ( "a<sp>couple<sp>of<sp>words<sp>for<sp>gc<sp>to<sp>pack<sp>more<sp>2" 1 , "a<sp>couple<sp>of<sp>words<sp>for<sp>gc<sp>to<sp>pack<sp>more<sp>2" ) ; writeTrashFile ( "c.txt" , "a<sp>couple<sp>of<sp>words<sp>for<sp>gc<sp>to<sp>pack<sp>more<sp>3" ) ; git . commit ( ) . setAll ( true ) . setMessage ( "commit3" ) . call ( ) ; java . util . Properties res = git . gc ( ) . setExpire ( org . eclipse . jgit . util . GitDateParser . parse ( "a<sp>couple<sp>of<sp>words<sp>for<sp>gc<sp>to<sp>pack<sp>more<sp>2" 0 , null , org . eclipse . jgit . util . SystemReader . getInstance ( ) . getLocale ( ) ) ) . call ( ) ; "<AssertPlaceHolder>" ; } size ( ) { return size ; }
|
org . junit . Assert . assertTrue ( ( ( res . size ( ) ) == 7 ) )
|
testMapUserTaskInEventSubProcess ( ) { org . camunda . bpm . model . bpmn . BpmnModelInstance testProcess = org . camunda . bpm . engine . test . api . runtime . migration . ModifiableBpmnModelInstance . modify ( ProcessModels . SUBPROCESS_PROCESS ) . addSubProcessTo ( "subProcess" ) . triggerByEvent ( ) . embeddedSubProcess ( ) . startEvent ( ) . message ( org . camunda . bpm . engine . test . api . runtime . migration . MigrationPlanCreationTest . MESSAGE_NAME ) . userTask ( "innerTask" ) . endEvent ( ) . subProcessDone ( ) . done ( ) ; org . camunda . bpm . engine . repository . ProcessDefinition sourceProcessDefinition = testHelper . deployAndGetDefinition ( testProcess ) ; org . camunda . bpm . engine . repository . ProcessDefinition targetProcessDefinition = testHelper . deployAndGetDefinition ( testProcess ) ; org . camunda . bpm . engine . migration . MigrationPlan migrationPlan = runtimeService . createMigrationPlan ( sourceProcessDefinition . getId ( ) , targetProcessDefinition . getId ( ) ) . mapActivities ( "userTask" , "userTask" ) . mapActivities ( "innerTask" , "innerTask" ) . build ( ) ; "<AssertPlaceHolder>" . hasSourceProcessDefinition ( sourceProcessDefinition ) . hasTargetProcessDefinition ( targetProcessDefinition ) . hasInstructions ( migrate ( "userTask" ) . to ( "userTask" ) , migrate ( "innerTask" ) . to ( "innerTask" ) ) ; } build ( ) { return migrationPlan ; }
|
org . junit . Assert . assertThat ( migrationPlan )
|
testReverseInsertNormalizationNecessaryMoreBasesSecond ( ) { de . charite . compbio . jannovar . reference . TranscriptPosition txPos = new de . charite . compbio . jannovar . reference . TranscriptPosition ( infoReverse , 17 , PositionType . ZERO_BASED ) ; de . charite . compbio . jannovar . reference . GenomePosition gPos = projectorReverse . transcriptToGenomePos ( txPos ) . withStrand ( Strand . FWD ) ; de . charite . compbio . jannovar . reference . GenomeVariant change = new de . charite . compbio . jannovar . reference . GenomeVariant ( gPos , "" , "AA" , Strand . FWD ) ; de . charite . compbio . jannovar . reference . GenomeVariant updatedChange = de . charite . compbio . jannovar . reference . GenomeVariantNormalizer . normalizeInsertion ( this . infoReverse , change , txPos ) ; de . charite . compbio . jannovar . reference . GenomeVariant expectedChange = new de . charite . compbio . jannovar . reference . GenomeVariant ( gPos . shifted ( ( - 4 ) ) , "" , "AA" , Strand . REV ) ; "<AssertPlaceHolder>" ; } shifted ( int ) { return new de . charite . compbio . jannovar . reference . CDSPosition ( transcript , ( ( pos ) + delta ) , PositionType . ZERO_BASED ) ; }
|
org . junit . Assert . assertEquals ( expectedChange , updatedChange )
|
testSimpleBulkImporterDirect ( ) { final org . kiji . mapreduce . KijiMapReduceJob mrjob = org . kiji . mapreduce . bulkimport . KijiBulkImportJobBuilder . create ( ) . withConf ( mConf ) . withBulkImporter ( org . kiji . mapreduce . testlib . SimpleBulkImporter . class ) . withInput ( org . kiji . mapreduce . input . MapReduceJobInputs . newTextMapReduceJobInput ( mBulkImportInputPath ) ) . withOutput ( org . kiji . mapreduce . output . MapReduceJobOutputs . newDirectKijiTableMapReduceJobOutput ( mOutputTable . getURI ( ) ) ) . build ( ) ; "<AssertPlaceHolder>" ; validateOutputTable ( ) ; } run ( ) { try { mapper . run ( subcontext ) ; } catch ( java . lang . Throwable ie ) { throwable = ie ; } }
|
org . junit . Assert . assertTrue ( mrjob . run ( ) )
|
testGetMapping ( ) { org . mockito . Mockito . when ( eu . europeana . repox . rest . client . accessors . MappingsAccessorTest . response . getStatus ( ) ) . thenReturn ( 200 ) ; org . mockito . Mockito . when ( eu . europeana . repox . rest . client . accessors . MappingsAccessorTest . response . readEntity ( pt . utl . ist . metadataTransformation . MetadataTransformation . class ) ) . thenReturn ( new pt . utl . ist . metadataTransformation . MetadataTransformation ( ) ) ; pt . utl . ist . metadataTransformation . MetadataTransformation mapping = eu . europeana . repox . rest . client . accessors . MappingsAccessorTest . ma . getMapping ( "map0" ) ; "<AssertPlaceHolder>" ; } getMapping ( java . lang . String ) { javax . ws . rs . client . WebTarget target = client . target ( ( ( ( ( ( restUrl ) + "/" ) + ( org . theeuropeanlibrary . repox . rest . pathOptions . MappingOptionListContainer . MAPPINGS ) ) + "/" ) + id ) ) ; javax . ws . rs . core . Response response = target . request ( MediaType . APPLICATION_JSON ) . get ( ) ; if ( ( response . getStatus ( ) ) == 404 ) { org . theeuropeanlibrary . repox . rest . pathOptions . Result errorMessage = response . readEntity ( org . theeuropeanlibrary . repox . rest . pathOptions . Result . class ) ; eu . europeana . repox . rest . client . accessors . MappingsAccessor . LOGGER . warn ( ( "getMapping(..)<sp>failure!<sp>:<sp>" + ( errorMessage . getResult ( ) ) ) ) ; throw new pt . utl . ist . util . exceptions . DoesNotExistException ( errorMessage . getResult ( ) ) ; } pt . utl . ist . metadataTransformation . MetadataTransformation metadataTransformation = response . readEntity ( pt . utl . ist . metadataTransformation . MetadataTransformation . class ) ; eu . europeana . repox . rest . client . accessors . MappingsAccessor . LOGGER . info ( "getMapping(..)<sp>success!" ) ; return metadataTransformation ; }
|
org . junit . Assert . assertNotNull ( mapping )
|
testDynamicQueryByProjectionMissing ( ) { com . liferay . portal . kernel . dao . orm . DynamicQuery dynamicQuery = com . liferay . portal . kernel . dao . orm . DynamicQueryFactoryUtil . forClass ( com . liferay . portal . kernel . model . RecentLayoutRevision . class , _dynamicQueryClassLoader ) ; dynamicQuery . setProjection ( com . liferay . portal . kernel . dao . orm . ProjectionFactoryUtil . property ( "recentLayoutRevisionId" ) ) ; dynamicQuery . add ( com . liferay . portal . kernel . dao . orm . RestrictionsFactoryUtil . in ( "recentLayoutRevisionId" , new java . lang . Object [ ] { com . liferay . portal . kernel . test . util . RandomTestUtil . nextLong ( ) } ) ) ; java . util . List < java . lang . Object > result = _persistence . findWithDynamicQuery ( dynamicQuery ) ; "<AssertPlaceHolder>" ; } size ( ) { if ( ( _workflowTaskAssignees ) != null ) { return _workflowTaskAssignees . size ( ) ; } return _kaleoTaskAssignmentInstanceLocalService . getKaleoTaskAssignmentInstancesCount ( _kaleoTaskInstanceToken . getKaleoTaskInstanceTokenId ( ) ) ; }
|
org . junit . Assert . assertEquals ( 0 , result . size ( ) )
|
getHeaderFieldMatchesCaseInsensitive ( ) { final int status = 200 ; final byte [ ] body = new byte [ ] { 1 } ; final byte [ ] errorReason = new byte [ ] { } ; final java . util . Map < java . lang . String , java . util . List < java . lang . String > > headerFields = new java . util . HashMap ( ) ; final java . lang . String field = "test-field" ; final java . util . List < java . lang . String > values = new java . util . LinkedList ( ) ; final java . lang . String value0 = "test-field-value0" ; final java . lang . String value1 = "test-field-value1" ; values . add ( value0 ) ; values . add ( value1 ) ; headerFields . put ( field , values ) ; com . microsoft . azure . sdk . iot . device . transport . https . HttpsResponse response = new com . microsoft . azure . sdk . iot . device . transport . https . HttpsResponse ( status , body , headerFields , errorReason ) ; java . lang . String differentCaseField = "Test-Field" ; java . lang . String testValues = response . getHeaderField ( differentCaseField ) ; final java . lang . String expectedValues = ( value0 + "," ) + value1 ; "<AssertPlaceHolder>" ; } getHeaderField ( java . lang . String ) { java . lang . String canonicalizedField = com . microsoft . azure . sdk . iot . service . transport . http . HttpResponse . canonicalizeFieldName ( field ) ; java . lang . String values = this . headerFields . get ( canonicalizedField ) ; if ( values == null ) { java . lang . String errMsg = java . lang . String . format ( ( "Could<sp>not<sp>find<sp>a<sp>value<sp>" + "associated<sp>with<sp>the<sp>header<sp>field<sp>name<sp>\'%s\'.\n" ) , field ) ; throw new java . lang . IllegalArgumentException ( errMsg ) ; } return values ; }
|
org . junit . Assert . assertThat ( testValues , org . hamcrest . CoreMatchers . is ( expectedValues ) )
|
testAttributeFailRepeatedArgs ( ) { java . util . logging . Logger logger = fLogger ; "<AssertPlaceHolder>" ; try ( org . eclipse . tracecompass . common . core . log . TraceCompassLogUtils . ScopeLog log = new org . eclipse . tracecompass . common . core . log . TraceCompassLogUtils . ScopeLog ( logger , java . util . logging . Level . WARNING , "foo" , "badger" , "badger" , "badger" , "badger" ) ) { new java . lang . Object ( ) ; } }
|
org . junit . Assert . assertNotNull ( logger )
|
testSkipImporterHttp ( ) { io . bit3 . jsass . importer . Importer importer = spy ( new com . github . mickleroy . aem . sass . impl . FileImporter ( mockCompilerContext , com . github . mickleroy . aem . sass . impl . FileImporterTest . ROOT_SASS_FILE ) ) ; java . util . Collection < io . bit3 . jsass . importer . Import > imports = importer . apply ( "http://foo.bar" , mockPreviousImport ) ; "<AssertPlaceHolder>" ; } apply ( java . lang . String , io . bit3 . jsass . importer . Import ) { if ( shouldSkipImporter ( url ) ) { return null ; } com . adobe . granite . ui . clientlibs . script . ScriptResource resource = null ; java . lang . String resourcePath = null ; java . lang . String currentDir = getCurrentDirectory ( previous ) ; java . lang . String pathToFile = getPathToFile ( url ) ; java . lang . String getFileName = getFileName ( url ) ; if ( url . startsWith ( "/" ) ) { currentDir = "" ; } for ( java . lang . String matcher : com . github . mickleroy . aem . sass . impl . FileImporter . PATH_MATCHERS ) { java . lang . String pathToImport = java . lang . String . format ( matcher , currentDir , pathToFile , getFileName ) ; resource = getResource ( pathToImport ) ; if ( resource != null ) { resourcePath = pathToImport ; break ; } } if ( resource == null ) { throw new com . github . mickleroy . aem . sass . exceptions . ImportFileNotFoundException ( url ) ; } try { context . getDependencies ( ) . add ( resourcePath ) ; return java . util . Collections . singletonList ( new io . bit3 . jsass . importer . Import ( new java . net . URI ( resource . getName ( ) ) , new java . net . URI ( resource . getName ( ) ) , com . github . mickleroy . aem . sass . util . ScriptResourceUtil . retrieveContents ( resource ) ) ) ; } catch ( java . net . URISyntaxException | java . io . IOException ex ) { com . github . mickleroy . aem . sass . impl . FileImporter . log . error ( "Could<sp>not<sp>process<sp>import" , ex ) ; } return null ; }
|
org . junit . Assert . assertNull ( imports )
|
nary_nin_string_array_returns_false_when_field_value_does_not_match_expression ( ) { com . redhat . lightblue . query . QueryExpression q = com . redhat . lightblue . eval . EvalTestContext . queryExpressionFromJson ( "{'field':'field6.nf1','op':'$in','values':['blah','yada','nothere']}" ) ; com . redhat . lightblue . eval . QueryEvaluator qe = com . redhat . lightblue . eval . QueryEvaluator . getInstance ( q , md ) ; com . redhat . lightblue . eval . QueryEvaluationContext ctx = qe . evaluate ( jsonDoc ) ; "<AssertPlaceHolder>" ; } getResult ( ) { return result ; }
|
org . junit . Assert . assertFalse ( ctx . getResult ( ) )
|
testCacheGet ( ) { final java . lang . String key = "foo" ; final org . apache . hc . client5 . http . cache . HttpCacheEntry value = org . apache . hc . client5 . http . impl . cache . HttpTestUtils . makeCacheEntry ( ) ; org . mockito . Mockito . when ( impl . digestToStorageKey ( key ) ) . thenReturn ( "bar" ) ; org . mockito . Mockito . when ( impl . restore ( org . mockito . ArgumentMatchers . eq ( "bar" ) , org . mockito . ArgumentMatchers . < org . apache . hc . core5 . concurrent . FutureCallback < byte [ ] > > any ( ) ) ) . thenAnswer ( new org . mockito . stubbing . Answer < org . apache . hc . core5 . concurrent . Cancellable > ( ) { @ org . apache . hc . client5 . http . impl . cache . Override public org . apache . hc . core5 . concurrent . Cancellable answer ( final org . mockito . invocation . InvocationOnMock invocation ) throws java . lang . Throwable { final org . apache . hc . core5 . concurrent . FutureCallback < byte [ ] > callback = invocation . getArgument ( 1 ) ; callback . completed ( org . apache . hc . client5 . http . impl . cache . TestAbstractSerializingAsyncCacheStorage . serialize ( key , value ) ) ; return cancellable ; } } ) ; impl . getEntry ( key , cacheEntryCallback ) ; final org . mockito . ArgumentCaptor < org . apache . hc . client5 . http . cache . HttpCacheEntry > argumentCaptor = org . mockito . ArgumentCaptor . forClass ( org . apache . hc . client5 . http . cache . HttpCacheEntry . class ) ; org . mockito . Mockito . verify ( cacheEntryCallback ) . completed ( argumentCaptor . capture ( ) ) ; final org . apache . hc . client5 . http . cache . HttpCacheEntry resultingEntry = argumentCaptor . getValue ( ) ; "<AssertPlaceHolder>" ; org . mockito . Mockito . verify ( impl ) . restore ( org . mockito . ArgumentMatchers . eq ( "bar" ) , org . mockito . ArgumentMatchers . < org . apache . hc . core5 . concurrent . FutureCallback < byte [ ] > > any ( ) ) ; } equivalent ( org . apache . hc . client5 . http . cache . HttpCacheEntry ) { return new org . apache . hc . client5 . http . impl . cache . HttpCacheEntryMatcher ( target ) ; }
|
org . junit . Assert . assertThat ( resultingEntry , org . apache . hc . client5 . http . impl . cache . HttpCacheEntryMatcher . equivalent ( value ) )
|
testBuildSuccessResponse ( ) { com . google . gson . JsonObject response = com . cognizant . devops . platformservice . rest . util . PlatformServiceUtil . buildSuccessResponse ( ) ; java . lang . String responseStatus = response . get ( PlatformServiceConstants . STATUS ) . getAsString ( ) ; "<AssertPlaceHolder>" ; } buildSuccessResponse ( ) { com . google . gson . JsonObject jsonResponse = new com . google . gson . JsonObject ( ) ; jsonResponse . addProperty ( PlatformServiceConstants . STATUS , PlatformServiceConstants . SUCCESS ) ; return jsonResponse ; }
|
org . junit . Assert . assertEquals ( PlatformServiceConstants . SUCCESS , responseStatus )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.