@@ -771,20 +771,20 @@ public void run(ComponentInfo copy) throws Exception {
771771 */
772772 @ Test
773773 public void test_getSource_forCreationId () throws Exception {
774- setJavaContentSrc ("test" , "MyButton" , new String []{
775- " public class MyButton extends JButton {" ,
776- " public MyButton(boolean b) {" ,
777- " }" ,
778- "}" }, new String []{
779- " <?xml version=' 1.0' encoding=' UTF-8'?>" ,
780- " <component xmlns=' http://www.eclipse.org/wb/WBPComponent'>" ,
781- " <creation>" ,
782- " <source><![CDATA[new test.MyButton(false)]]></source>" ,
783- " </creation>" ,
784- " <creation id=' true'>" ,
785- " <source><![CDATA[new test.MyButton(true)]]></source>" ,
786- " </creation>" ,
787- " </component>"} );
774+ setJavaContentSrc ("test" , "MyButton" , """
775+ public class MyButton extends JButton {
776+ public MyButton(boolean b) {
777+ }
778+ }""" , """
779+ <?xml version=" 1.0" encoding=" UTF-8"?>
780+ <component xmlns=" http://www.eclipse.org/wb/WBPComponent">
781+ <creation>
782+ <source><![CDATA[new test.MyButton(false)]]></source>
783+ </creation>
784+ <creation id=" true">
785+ <source><![CDATA[new test.MyButton(true)]]></source>
786+ </creation>
787+ </component>""" );
788788 String [] lines = {"public class Test extends JPanel {" , " public Test() {" , " }" , "}" };
789789 // parse
790790 parseContainer (lines );
@@ -809,11 +809,11 @@ public void test_getSource_forCreationId() throws Exception {
809809 */
810810 @ Test
811811 public void test_getSource_forSource () throws Exception {
812- setJavaContentSrc ("test" , "MyButton" , new String []{
813- " public class MyButton extends JButton {" ,
814- " public MyButton(boolean b) {" ,
815- " }" ,
816- "}" } , null );
812+ setJavaContentSrc ("test" , "MyButton" , """
813+ public class MyButton extends JButton {
814+ public MyButton(boolean b) {
815+ }
816+ }""" , null );
817817 String [] lines = {"public class Test extends JPanel {" , " public Test() {" , " }" , "}" };
818818 // parse
819819 parseContainer (lines );
@@ -827,18 +827,18 @@ public void test_getSource_forSource() throws Exception {
827827
828828 @ Test
829829 public void test_CREATE_noInvocations () throws Exception {
830- setJavaContentSrc ("test" , "MyButton" , new String []{
831- " public class MyButton extends JButton {" ,
832- " public MyButton() {" ,
833- " }" ,
834- "}" }, new String []{
835- " <?xml version=' 1.0' encoding=' UTF-8'?>" ,
836- " <component xmlns=' http://www.eclipse.org/wb/WBPComponent'>" ,
837- " <creation>" ,
838- " <source><![CDATA[new test.MyButton()]]></source>" ,
839- " <invocation signature=' setEnabled(boolean)' ><![CDATA[false]]></invocation>" ,
840- " </creation>" ,
841- " </component>"} );
830+ setJavaContentSrc ("test" , "MyButton" , """
831+ public class MyButton extends JButton {
832+ public MyButton() {
833+ }
834+ }""" , """
835+ <?xml version=" 1.0" encoding=" UTF-8"?>
836+ <component xmlns=" http://www.eclipse.org/wb/WBPComponent">
837+ <creation>
838+ <source><![CDATA[new test.MyButton()]]></source>
839+ <invocation signature=" setEnabled(boolean)" ><![CDATA[false]]></invocation>
840+ </creation>
841+ </component>""" );
842842 String [] lines1 = {"public class Test extends JPanel {" , " public Test() {" , " }" , "}" };
843843 // parse
844844 ContainerInfo panel = parseContainer (lines1 );
@@ -879,18 +879,18 @@ public void test_CREATE_noInvocations() throws Exception {
879879
880880 @ Test
881881 public void test_CREATE_addInvocations () throws Exception {
882- setJavaContentSrc ("test" , "MyButton" , new String []{
883- " public class MyButton extends JButton {" ,
884- " public MyButton() {" ,
885- " }" ,
886- "}" }, new String []{
887- " <?xml version=' 1.0' encoding=' UTF-8'?>" ,
888- " <component xmlns=' http://www.eclipse.org/wb/WBPComponent'>" ,
889- " <creation>" ,
890- " <source><![CDATA[new test.MyButton()]]></source>" ,
891- " <invocation signature=' setEnabled(boolean)' ><![CDATA[false]]></invocation>" ,
892- " </creation>" ,
893- " </component>"} );
882+ setJavaContentSrc ("test" , "MyButton" , """
883+ public class MyButton extends JButton {
884+ public MyButton() {
885+ }
886+ }""" , """
887+ <?xml version=" 1.0" encoding=" UTF-8"?>
888+ <component xmlns=" http://www.eclipse.org/wb/WBPComponent">
889+ <creation>
890+ <source><![CDATA[new test.MyButton()]]></source>
891+ <invocation signature=" setEnabled(boolean)" ><![CDATA[false]]></invocation>
892+ </creation>
893+ </component>""" );
894894 String [] lines1 = {"public class Test extends JPanel {" , " public Test() {" , " }" , "}" };
895895 // parse
896896 ContainerInfo panel = parseContainer (lines1 );
@@ -918,19 +918,19 @@ public void test_CREATE_addInvocations() throws Exception {
918918
919919 @ Test
920920 public void test_template_index () throws Exception {
921- setJavaContentSrc ("test" , "MyButton" , new String []{
922- " public class MyButton extends JButton {" ,
923- " public MyButton(String value) {" ,
924- " }" ,
925- " public void setValue(String value) {" ,
926- " }" ,
927- "}" }, new String []{
928- " <?xml version=' 1.0' encoding=' UTF-8'?>" ,
929- " <component xmlns=' http://www.eclipse.org/wb/WBPComponent'>" ,
930- " <creation>" ,
931- " <source><![CDATA[new test.MyButton(\" value_%index%\" )]]></source>" ,
932- " </creation>" ,
933- " </component>"} );
921+ setJavaContentSrc ("test" , "MyButton" , """
922+ public class MyButton extends JButton {
923+ public MyButton(String value) {
924+ }
925+ public void setValue(String value) {
926+ }
927+ }""" , """
928+ <?xml version=" 1.0" encoding=" UTF-8"?>
929+ <component xmlns=" http://www.eclipse.org/wb/WBPComponent">
930+ <creation>
931+ <source><![CDATA[new test.MyButton(\"value_%index%\")]]></source>
932+ </creation>
933+ </component>""" );
934934 String [] lines1 = {"public class Test extends JPanel {" , " public Test() {" , " }" , "}" };
935935 // parse
936936 ContainerInfo panel = parseContainer (lines1 );
@@ -1020,22 +1020,22 @@ public void test_getAssociation_noParent() throws Exception {
10201020 */
10211021 @ Test
10221022 public void test_getAssociation_hasParent () throws Exception {
1023- setJavaContentSrc ("test" , "MyButton" , new String []{
1024- " public class MyButton extends JButton {" ,
1025- " public MyButton(JPanel parent) {" ,
1026- " }" ,
1027- "}" }, new String []{
1028- " <?xml version=' 1.0' encoding=' UTF-8'?>" ,
1029- " <component xmlns=' http://www.eclipse.org/wb/WBPComponent'>" ,
1030- " <creation>" ,
1031- " <source><![CDATA[new test.MyButton(%parent%)]]></source>" ,
1032- " </creation>" ,
1033- " <constructors>" ,
1034- " <constructor>" ,
1035- " <parameter type=' javax.swing.JPanel' parent=' true'/>" ,
1036- " </constructor>" ,
1037- " </constructors>" ,
1038- " </component>"} );
1023+ setJavaContentSrc ("test" , "MyButton" , """
1024+ public class MyButton extends JButton {
1025+ public MyButton(JPanel parent) {
1026+ }
1027+ }""" , """
1028+ <?xml version=" 1.0" encoding=" UTF-8"?>
1029+ <component xmlns=" http://www.eclipse.org/wb/WBPComponent">
1030+ <creation>
1031+ <source><![CDATA[new test.MyButton(%parent%)]]></source>
1032+ </creation>
1033+ <constructors>
1034+ <constructor>
1035+ <parameter type=" javax.swing.JPanel" parent=" true"/>
1036+ </constructor>
1037+ </constructors>
1038+ </component>""" );
10391039 String [] lines = {"public class Test extends JPanel {" , " public Test() {" , " }" , "}" };
10401040 // parse
10411041 parseContainer (lines );
0 commit comments