File tree Expand file tree Collapse file tree 5 files changed +54
-0
lines changed
main/java/org/apache/dubbo/config
test/java/org/apache/dubbo/config
test/java/org/apache/dubbo/config/spring Expand file tree Collapse file tree 5 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,19 @@ public abstract class AbstractMethodConfig extends AbstractConfig {
6464 // customized parameters
6565 protected Map <String , String > parameters ;
6666
67+ /**
68+ * forks for forking cluster
69+ */
70+ protected Integer forks ;
71+
72+ public Integer getForks () {
73+ return forks ;
74+ }
75+
76+ public void setForks (Integer forks ) {
77+ this .forks = forks ;
78+ }
79+
6780 public Integer getTimeout () {
6881 return timeout ;
6982 }
Original file line number Diff line number Diff line change @@ -35,6 +35,13 @@ public void testTimeout() throws Exception {
3535 assertThat (methodConfig .getTimeout (), equalTo (10 ));
3636 }
3737
38+ @ Test
39+ public void testForks () throws Exception {
40+ MethodConfig methodConfig = new MethodConfig ();
41+ methodConfig .setForks (10 );
42+ assertThat (methodConfig .getForks (), equalTo (10 ));
43+ }
44+
3845 @ Test
3946 public void testRetries () throws Exception {
4047 MethodConfig methodConfig = new MethodConfig ();
Original file line number Diff line number Diff line change 101101 <xsd : documentation ><![CDATA[ Use cluster strategy. ]]> </xsd : documentation >
102102 </xsd : annotation >
103103 </xsd : attribute >
104+ <xsd : attribute name =" forks" type =" xsd:string" >
105+ <xsd : annotation >
106+ <xsd : documentation ><![CDATA[ ForkingCluster forks. ]]> </xsd : documentation >
107+ </xsd : annotation >
108+ </xsd : attribute >
104109 <xsd : attribute name =" filter" type =" xsd:string" >
105110 <xsd : annotation >
106111 <xsd : documentation ><![CDATA[ The filter. ]]> </xsd : documentation >
492497 <xsd : documentation ><![CDATA[ The registry cluster type. ]]> </xsd : documentation >
493498 </xsd : annotation >
494499 </xsd : attribute >
500+ <xsd : attribute name =" forks" type =" xsd:string" >
501+ <xsd : annotation >
502+ <xsd : documentation ><![CDATA[ ForkingCluster forks. ]]> </xsd : documentation >
503+ </xsd : annotation >
504+ </xsd : attribute >
495505 <xsd : attribute name =" group" type =" xsd:string" >
496506 <xsd : annotation >
497507 <xsd : documentation ><![CDATA[ The registry group. ]]> </xsd : documentation >
Original file line number Diff line number Diff line change 101101 <xsd : documentation ><![CDATA[ Use cluster strategy. ]]> </xsd : documentation >
102102 </xsd : annotation >
103103 </xsd : attribute >
104+ <xsd : attribute name =" forks" type =" xsd:string" >
105+ <xsd : annotation >
106+ <xsd : documentation ><![CDATA[ ForkingCluster forks. ]]> </xsd : documentation >
107+ </xsd : annotation >
108+ </xsd : attribute >
104109 <xsd : attribute name =" filter" type =" xsd:string" >
105110 <xsd : annotation >
106111 <xsd : documentation ><![CDATA[ The filter. ]]> </xsd : documentation >
486491 <xsd : documentation ><![CDATA[ The registry cluster type. ]]> </xsd : documentation >
487492 </xsd : annotation >
488493 </xsd : attribute >
494+ <xsd : attribute name =" forks" type =" xsd:string" >
495+ <xsd : annotation >
496+ <xsd : documentation ><![CDATA[ ForkingCluster forks. ]]> </xsd : documentation >
497+ </xsd : annotation >
498+ </xsd : attribute >
489499 <xsd : attribute name =" group" type =" xsd:string" >
490500 <xsd : annotation >
491501 <xsd : documentation ><![CDATA[ The registry group. ]]> </xsd : documentation >
Original file line number Diff line number Diff line change @@ -147,6 +147,20 @@ public void testToString() {
147147 assertTrue (str .endsWith (" />" ));
148148 }
149149
150+ @ Test
151+ public void testForks () {
152+ ReferenceConfig <DemoService > reference = new ReferenceConfig <DemoService >();
153+ reference .setApplication (new ApplicationConfig ("consumer" ));
154+ reference .setRegistry (new RegistryConfig (RegistryConfig .NO_AVAILABLE ));
155+ reference .setInterface (DemoService .class );
156+ reference .setUrl ("dubbo://127.0.0.1:20881" );
157+
158+ int forks = 10 ;
159+ reference .setForks (forks );
160+ String str = reference .toString ();
161+ assertTrue (str .contains ("forks=\" " + forks + "\" " ));
162+ }
163+
150164 @ Test
151165 public void testMultiProtocol () {
152166 ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext (ConfigTest .class .getPackage ().getName ().replace ('.' , '/' ) + "/multi-protocol.xml" );
You can’t perform that action at this time.
0 commit comments