mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Removed effectiveText and related test
This commit is contained in:
parent
929bad2cea
commit
302825c494
2 changed files with 2 additions and 38 deletions
|
|
@ -53,7 +53,6 @@ public class Paragraph extends Job implements Serializable, Cloneable {
|
|||
private transient InterpreterFactory factory;
|
||||
private transient Note note;
|
||||
private transient AuthenticationInfo authenticationInfo;
|
||||
private transient String effectiveText;
|
||||
|
||||
String title;
|
||||
String text;
|
||||
|
|
@ -114,14 +113,6 @@ public class Paragraph extends Job implements Serializable, Cloneable {
|
|||
this.dateUpdated = new Date();
|
||||
}
|
||||
|
||||
public void setEffectiveText(String effectiveText) {
|
||||
this.effectiveText = effectiveText;
|
||||
}
|
||||
|
||||
public String getEffectiveText() {
|
||||
return effectiveText;
|
||||
}
|
||||
|
||||
public AuthenticationInfo getAuthenticationInfo() {
|
||||
return authenticationInfo;
|
||||
}
|
||||
|
|
@ -153,7 +144,7 @@ public class Paragraph extends Job implements Serializable, Cloneable {
|
|||
}
|
||||
|
||||
public String getRequiredReplName() {
|
||||
return getRequiredReplName(null != effectiveText ? effectiveText : text);
|
||||
return getRequiredReplName(text);
|
||||
}
|
||||
|
||||
public static String getRequiredReplName(String text) {
|
||||
|
|
@ -182,7 +173,7 @@ public class Paragraph extends Job implements Serializable, Cloneable {
|
|||
}
|
||||
|
||||
public String getScriptBody() {
|
||||
return getScriptBody(null != effectiveText ? effectiveText : text);
|
||||
return getScriptBody(text);
|
||||
}
|
||||
|
||||
public static String getScriptBody(String text) {
|
||||
|
|
@ -359,7 +350,6 @@ public class Paragraph extends Job implements Serializable, Cloneable {
|
|||
}
|
||||
} finally {
|
||||
InterpreterContext.remove();
|
||||
effectiveText = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,32 +73,6 @@ public class ParagraphTest {
|
|||
assertEquals("md", Paragraph.getRequiredReplName(text));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void effectiveTextTest() {
|
||||
InterpreterFactory interpreterFactory = mock(InterpreterFactory.class);
|
||||
Interpreter interpreter = mock(Interpreter.class);
|
||||
Note note = mock(Note.class);
|
||||
|
||||
Paragraph p = new Paragraph("paragraph", note, null, interpreterFactory);
|
||||
p.setText("%h2 show databases");
|
||||
p.setEffectiveText("%jdbc(h2) show databases");
|
||||
assertEquals("Get right replName", "jdbc", p.getRequiredReplName());
|
||||
assertEquals("Get right scriptBody", "(h2) show databases", p.getScriptBody());
|
||||
|
||||
when(interpreterFactory.getInterpreter(anyString(), eq("jdbc"))).thenReturn(interpreter);
|
||||
when(interpreter.getFormType()).thenReturn(Interpreter.FormType.NATIVE);
|
||||
when(note.getId()).thenReturn("noteId");
|
||||
|
||||
try {
|
||||
p.jobRun();
|
||||
} catch (Throwable throwable) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
assertEquals("Erase effective Text", "h2", p.getRequiredReplName());
|
||||
assertEquals("Erase effective Text", "show databases", p.getScriptBody());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_extract_variable_from_angular_object_registry() throws Exception {
|
||||
//Given
|
||||
|
|
|
|||
Loading…
Reference in a new issue