Jmeter - Error " Empty Test Plan " thrown while trying to open Jmeter script copied from another machine - apache

when I'm trying to open the JMeter script which was copied from another server, im getting below error with a dialog box - Empty Test Plan.
My Machine :
Java Version:1.8.0_72
and apache-jmeter-2.11
Another server from where scripts are copied:
Java version is : 1.8.0_45
and apache-jmeter-2.13
2016/03/14 07:35:47 INFO - jmeter.gui.action.Load: Loading file: C:\XXX Perf Tests\jmeter\apache-jmeter-2.13\tests\stressICXXX.jmx
2016/03/14 07:35:47 INFO - jmeter.services.FileServer: Set new base='C:\XXX Perf Tests\jmeter\apache-jmeter-2.13\tests'
2016/03/14 07:35:49 ERROR - jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException: -1 : -1
---- Debugging information ----
message : -1
cause-exception : java.lang.ArrayIndexOutOfBoundsException
cause-message : -1
class : org.apache.jmeter.testelement.property.FloatProperty
required-type : org.apache.jmeter.testelement.property.FloatProperty
converter-type : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree[5]/hashTree[3]/ThroughputController/FloatProperty/name
line number : 120481
class[1] : org.apache.jmeter.control.ThroughputController
converter-type[1] : org.apache.jmeter.save.converters.TestElementConverter
class[2] : org.apache.jorphan.collections.ListedHashTree
converter-type[2] : org.apache.jmeter.save.converters.HashTreeConverter
------------------------------- : -1 : -1
---- Debugging information ----
message : -1
cause-exception : java.lang.ArrayIndexOutOfBoundsException
cause-message : -1
class : org.apache.jmeter.testelement.property.FloatProperty
required-type : org.apache.jmeter.testelement.property.FloatProperty
converter-type : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree[5]/hashTree[3]/ThroughputController/FloatProperty/name
line number : 120481
class[1] : org.apache.jmeter.control.ThroughputController
converter-type[1] : org.apache.jmeter.save.converters.TestElementConverter
class[2] : org.apache.jorphan.collections.ListedHashTree
converter-type[2] : org.apache.jmeter.save.converters.HashTreeConverter
-------------------------------
message : -1 : -1
---- Debugging information ----
message : -1
cause-exception : java.lang.ArrayIndexOutOfBoundsException
cause-message : -1
class : org.apache.jmeter.testelement.property.FloatProperty
required-type : org.apache.jmeter.testelement.property.FloatProperty
converter-type : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree[5]/hashTree[3]/ThroughputController/FloatProperty/name
line number : 120481
class[1] : org.apache.jmeter.control.ThroughputController
converter-type[1] : org.apache.jmeter.save.converters.TestElementConverter
class[2] : org.apache.jorphan.collections.ListedHashTree
converter-type[2] : org.apache.jmeter.save.converters.HashTreeConverter
-------------------------------
cause-exception : com.thoughtworks.xstream.converters.ConversionException
cause-message : -1 : -1
first-jmeter-class : org.apache.jmeter.save.converters.TestElementConverter.unmarshal(TestElementConverter.java:107)
class : org.apache.jmeter.save.ScriptWrapper
required-type : org.apache.jmeter.testelement.property.FloatProperty
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree[5]/hashTree[3]/ThroughputController/FloatProperty/name
line number : 120481
version : 2.11 r1554548
-------------------------------
2016/03/14 07:35:49 WARN - jmeter.gui.action.Load: Unexpected error org.apache.jmeter.exceptions.IllegalUserActionException: Empty TestPlan - see log file
at org.apache.jmeter.gui.action.Load.insertLoadedTree(Load.java:174)
at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:136)
at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:105)
at org.apache.jmeter.gui.action.Load.doAction(Load.java:92)
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:81)
at org.apache.jmeter.gui.action.ActionRouter.access$000(ActionRouter.java:40)
at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:63)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Related

Creating a function that changes row values in a specific column

So I have multiple different dataframes, all with varying team names under the same column name, 'Team'. I've created a function to run through these all at once, but for some reason it doesn't execute.
def rename(df):
df = df.replace({'Team':
{'NewEngland' : 'Patriots',
'GreenBay' : 'Packers',
'Pittsburgh' : 'Steelers',
'KansasCity' : 'Chiefs',
'Denver' : 'Broncos',
'Seattle' : 'Seahawks',
'Indianapolis' : 'Colts',
'New Orleans' : 'Saints',
'NewOrleans' : 'Saints',
'Dallas' : 'Cowboys',
'Baltimore' : 'Ravens',
'Philadelphia' : 'Eagles',
'Cincinnati' : 'Bengals',
'Carolina' : 'Panthers',
'Tennessee' : 'Titans',
'Arizona' : 'Cardinals',
'Buffalo' : 'Bills',
'SanFrancisco' : '49ers',
'Minnesota' : 'Vikings',
'Washington' : 'Redskins',
'Chicago' : 'Bears',
'Atlanta' : 'Falcons',
'NYGiants' : 'Giants',
'NYJets' : 'Jets',
'Cleveland' : 'Browns',
'Detroit' : 'Lions',
'Miami' : 'Dolphins',
'TampaBay' : 'Buccaneers',
'Jacksonville' : 'Jaguars',
'Houston' : 'Texans',
'HoustonTexans' : 'Texans',
'Oakland' : 'Raiders',
'SanDiego' : 'Chargers',
'St.Louis' : 'Rams',
'LARams' : 'Rams',
'LAChargers' : 'Chargers',
'LasVegas' : 'Raiders',
'LosAngeles' : 'Rams',
'NewYork' : 'Giants',
'KCChiefs' : 'Chiefs',
'Kansas' : 'Chiefs',
'Tampa' : 'Buccaneers'
}})
When I run this code, as seen in the picture, the code does not work - Image
As seen, I ran the function on a bunch of different dataframes, but when I sample one of them, there are no changes to the 'Team' column.
I know my code is correct because when I run the code outside of the function, such as below:
nfl_07 = nfl_07.replace({'Team':
{'NewEngland' : 'Patriots',
'GreenBay' : 'Packers',
'Pittsburgh' : 'Steelers'
etc.
This code works for some reason; my nfl_07 dataframe has the correct Team names... Is there something wrong with my function?
replace does not act in place by default.
In your function you fail to return the renamed DataFrame, when you call the function you fail to assign the output. So nothing happens.
The assignment to df within the function is local. It does not impact the outer scope.
Either modify in place:
def rename(df):
df.replace({'Team':
{'NewEngland' : 'Patriots',
'GreenBay' : 'Packers',
# ...
}}, inplace=True)
rename(nfl_07)
Or return and reassign the output:
def rename(df):
return df.replace({'Team':
{'NewEngland' : 'Patriots',
'GreenBay' : 'Packers',
# ...
}})
nfl_07 = rename(nfl_07)

ANTLR v4 operator precedence problem using parentesis

I have to parse this definition of var agenda (it's Z language):
agenda : \nat \cross \nat \pfun \nat
I want \cross have precedence over \pfun, so if i code:
typeNorm returns [TreeNode node]
: a=typeNorm '\\cross' b=typeNorm
| a=typeNorm \pfun b=typeNorm
it works, produces agenda AST:
\pfun
\cross \nat
\nat \nat
but, if i code:
typeNorm returns [TreeNode node]
: a=typeNorm ('\\cross' b=typeNorm)
| a=typeNorm \pfun b=typeNorm
produces:
\cross
\nat \pfun
\nat \nat
I need to understand why parentesis change precedence
I cannot reproduce this.
For the input a \pfun b \pcross c, both:
typeNorm
: typeNorm '\\pcross' typeNorm
| typeNorm '\\pfun' typeNorm
| ID
;
ID : [a-zA-Z]+;
SPACES : [ \t\r\n]+ -> skip;
and:
typeNorm
: typeNorm ('\\pcross' typeNorm)
| typeNorm '\\pfun' typeNorm
| ID
;
ID : [a-zA-Z]+;
SPACES : [ \t\r\n]+ -> skip;
the following parse tree is produced:
Tested with ANTLR 4.9.2 and 4.9.3.

Get-SBNamespace truncates ManageUsers list when its long

Get-SBNamespace
When I run this, and I have a list of ManageUsers, it truncates the list.
PS C:\Program Files\Service Bus\1.1> Get-SBNamespace
SubscriptionId : 00000000000000000000000000000000
State : Active
Name : NameSpaceOne
AddressingScheme : Path
CreatedTime : 9/14/2017 8:39:34 PM
IssuerName : NameSpaceOne
IssuerUri : NameSpaceOne
ManageUsers : {Me#mycompany.com,You#mycompany.com,Others#mycomp
DnsEntry :
PrimarySymmetricKey : No No No
SecondarySymmetricKey :
SubscriptionId : 00000000000000000000000000000000
State : Active
Name : NameSpaceTwo
AddressingScheme : Path
CreatedTime : 2/14/2017 7:32:39 PM
IssuerName : NameSpaceTwo
IssuerUri : NameSpaceTwo
ManageUsers : {Me#mycompany.com,You#mycompany.com,Others#mycomp
DnsEntry :
PrimarySymmetricKey : No No No
SecondarySymmetricKey :
Is there a way to get the ManagerUsers values, when there is many of them?
#stopTruncatingMe
(Get-SBNamespace).ManageUsers
will access to the ManagerUsers property and display the full list of users.

ANTLR3 Resolving Grammar With non-LL(*) decisions

As a homework I should create a parser for VC language V10.1 using ANTLR.
Here is my work:
grammar MyVCgrm2;
program : ( funcDecl | varDecl )*
;
funcDecl :
type identifier paraList compoundStmt
;
varDecl
: type initDeclaratorList ';'
;
initDeclaratorList
:  initDeclarator ( ',' initDeclarator )*
;
initDeclarator
: declarator ( '=' initialiser )?
;
declarator
: identifier identifier2 
;
identifier2
: |'[' INTLITERAL? ']'
;
initialiser
: expr
                |  '{' expr ( ',' expr ) *  '}'
;
// primitive types
type
: 'void' | 'boolean' | 'int' | 'float'
;
// identifiers
identifier
: ID
;
// statements
compoundStmt
: '{' varDecl*  stmt* '}'
;
stmt
:
compoundStmt
        |  ifStmt
        |  forStmt
        |  whileStmt
        |  breakStmt
        |  continueStmt
        |  returnStmt
|  exprStmt
;
ifStmt
: 'if' '(' expr ')' stmt ( 'else' stmt )?
;
forStmt
: 'for' '(' expr? ';' expr? ';' expr? ')' stmt
;
whileStmt
: 'while' '(' expr ')' stmt
;
breakStmt
: 'break' ';'
;
continueStmt
: 'continue' ';'
;
returnStmt
: 'return' expr? ';'
;
exprStmt
: expr? ';'
;
// expressions
expr
: assignmentExpr
;
assignmentExpr
: ( condOrExpr '=' )*  condOrExpr
;
condOrExpr
: condAndExpr condOrExpr2
;
condOrExpr2
: '||' condAndExpr condOrExpr
|
;
condAndExpr
: equalityExpr condAndExpr2
;
condAndExpr2
: '&&' equalityExpr condAndExpr2|
;
equalityExpr
: relExpr equalityExpr2
;
equalityExpr2
: '==' relExpr equalityExpr2 | '!=' relExpr equalityExpr2|
;
relExpr
:       additiveExpr relExpr2 
;
relExpr2
: '<' additiveExpr relExpr | '<=' additiveExpr relExpr | '>' additiveExpr relExpr|  '>=' additiveExpr relExpr|
;
additiveExpr
:
multiplicativeExpr additiveExpr2
;
additiveExpr2
:
'+' multiplicativeExpr additiveExpr2
| '-' multiplicativeExpr additiveExpr2
|
;
multiplicativeExpr
:
unaryExpr multiplicativeExpr2
;
multiplicativeExpr2
:
'*' unaryExpr multiplicativeExpr2
| '/' unaryExpr multiplicativeExpr2
|
;
unaryExpr
: '+' unaryExpr
                |  '-' unaryExpr
                |  '!' unaryExpr
                |  primaryExpr
;
primaryExpr
: identifier primaryExpr2
        | '(' expr ')'
                | INTLITERAL
                | FLOATLITERAL
                | BOOLLITERAL
                | STRINGLITERAL
;
primaryExpr2
: argList?
                | '[' expr ']'
;
// parameters
paraList
: '(' properParaList? ')'
;
properParaList
: paraDecl ( ',' paraDecl ) *
;
paraDecl
: type declarator
;
argList
:'(' properArgList? ')'
;
properArgList
: arg ( ',' arg ) *
;
arg
: expr
;
BOOLLITERAL
: 'true'|'false'
;
ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|'?')*
;
INTLITERAL : '0'..'9'+
;
FLOATLITERAL
: ('0'..'9')+ '.' ('0'..'9')* EXPONENT?
| '.' ('0'..'9')+ EXPONENT?
| ('0'..'9')+ EXPONENT
;
COMMENT
: '//' ~('\n'|'\r')* '\r'? '\n' {$channel=HIDDEN;}
| '/*' ( options {greedy=false;} : . )* '*/' {$channel=HIDDEN;}
;
WS : ( ' '
| '\t'
| '\r'
| '\n'
) {$channel=HIDDEN;}
;
STRINGLITERAL
: '"' ( ESC_SEQ | ~('\\'|'"') )* '"'
;
CHAR: '\'' ( ESC_SEQ | ~('\''|'\\') ) '\''
;
fragment
EXPONENT : ('e'|'E') ('+'|'-')? ('0'..'9')+ ;
fragment
HEX_DIGIT : ('0'..'9'|'a'..'f'|'A'..'F') ;
fragment
ESC_SEQ
: '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')
| UNICODE_ESC
| OCTAL_ESC
;
fragment
OCTAL_ESC
: '\\' ('0'..'3') ('0'..'7') ('0'..'7')
| '\\' ('0'..'7') ('0'..'7')
| '\\' ('0'..'7')
;
fragment
UNICODE_ESC
: '\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT
;
But when by trying generate code I got these errors in console:
[13:48:38] Checking Grammar MyVCgrm2.g...
[13:48:38] warning(200): MyVCgrm2.g:53:27:
Decision can match input such as "'else'" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
[13:48:38] error(211): MyVCgrm2.g:78:21: [fatal] rule assignmentExpr has non-LL(*) decision due to recursive rule invocations reachable from alts 1,2. Resolve by left-factoring or using syntactic predicates or using backtrack=true option.
[13:48:38] error(211): MyVCgrm2.g:111:2: [fatal] rule additiveExpr2 has non-LL(*) decision due to recursive rule invocations reachable from alts 1,3. Resolve by left-factoring or using syntactic predicates or using backtrack=true option.
[13:48:38] warning(200): MyVCgrm2.g:111:2:
Decision can match input such as "'+' ID" using multiple alternatives: 1, 3
As a result, alternative(s) 3 were disabled for that input
[13:48:38] error(211): MyVCgrm2.g:142:5: [fatal] rule primaryExpr2 has non-LL(*) decision due to recursive rule invocations reachable from alts 1,2. Resolve by left-factoring or using syntactic predicates or using backtrack=true option.
Warnings and errors are about these productions (in order): ifStmt, assignmentExpr, additiveExpr2, primaryExpr2.
I've done all left factorings and left recursion eliminations. I don't understand what ANTLR meant by "Resolve by left-factoring".
Why do I get these errors and how do I resolve them?
Thank you

Antlr parsing numbers problem

I have a problem parsing integer & hex numbers. I want to parse C++ enums with the following rules:
grammar enum;
rule_enum
: 'enum' ID '{' enum_values+ '}'';';
enum_values
: enum_value (COMMA enum_value)+;
enum_value
: ID ('=' number)?;
number : hex_number | integer_number;
hex_number
: '0' 'x' HEX_DIGIT+;
integer_number
: DIGIT+;
fragment
HEX_DIGIT : ('0'..'9'|'a'..'f'|'A'..'F') ;
fragment
DIGIT : ('0'..'9');
COMMA : ',';
ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*;
The problem I have is the following - when parsing code like:
enum Enum
{
Option1 = 0,
Option2 = 1
};
it does not recognize the 0 as integer_number but tries to parse it as hex_number. How can I resolve this?
Thank you.
Tobias
First, fragment rules can only be "seen" by lexer rules, not parser rules. So, the following is invalid:
integer_number
: DIGIT+; // can't use DIGIT here!
fragment
DIGIT : ('0'..'9');
To fix your ambiguity with these numbers, it's IMO best to make these integer- and hex numbers lexer rules instead of parser rules.
An example:
grammar enum;
rule_enum
: 'enum' ID '{' enum_values+ '}'';';
enum_values
: enum_value (COMMA enum_value)+;
enum_value
: ID ('=' number)?;
number
: HEX_NUMBER
| INTEGER_NUMBER
;
HEX_NUMBER
: '0' 'x' HEX_DIGIT+;
INTEGER_NUMBER
: DIGIT+;
fragment
HEX_DIGIT : ('0'..'9'|'a'..'f'|'A'..'F') ;
fragment
DIGIT : ('0'..'9');
COMMA : ',';
ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*;
SPACE : (' ' | '\t' | '\r' | '\n') {skip();};
which produces the following parse tree of your example snippet:
The following ANTLR works for just the number bit of the enum.
(editted to include Bart's advice below)
grammar enum;
number :
integer_number | hex_number ;
hex_number
: HEX_NUMBER;
integer_number
: INT_NUMBER;
HEX_NUMBER
: HEX_INTRO HEX_DIGIT+;
INT_NUMBER
: DIGIT+;
HEX_INTRO
: '0x';
DIGIT : ('0'..'9');
HEX_DIGIT
: ('0'..'9'|'a'..'f'|'A'..'F') ;