Skip to content

Commit 4df24b2

Browse files
author
Lloyd Watkin
committed
Put code through eclipse default formatter
1 parent 968a9b7 commit 4df24b2

1 file changed

Lines changed: 133 additions & 80 deletions

File tree

src/test/java/org/buddycloud/channelserver/channel/ConfTest.java

Lines changed: 133 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -8,163 +8,216 @@
88
import org.xmpp.packet.JID;
99

1010
/**
11-
* Simples regression test to assure refactoring changes will not break something
11+
* Simples regression test to assure refactoring changes will not break
12+
* something
1213
*/
1314
public class ConfTest {
1415

1516
private JID testChannelJID = new JID("testchannel@domain.com");
1617
private JID testOwnerJID = new JID("testuser@domain.com");
1718

18-
//@Test
19+
// @Test
1920
public void testGetPostChannelNodename() {
2021
fail("The test case is a prototype.");
2122
}
2223

23-
//@Test
24+
// @Test
2425
public void testParseDate() {
2526
fail("The test case is a prototype.");
2627
}
2728

28-
//@Test
29+
// @Test
2930
public void testFormatDate() {
3031
fail("The test case is a prototype.");
3132
}
3233

3334
@Test
3435
public void testGetDefaultChannelConf() {
35-
HashMap<String,String> result = Conf.getDefaultChannelConf(testChannelJID, testOwnerJID);
36+
HashMap<String, String> result = Conf.getDefaultChannelConf(
37+
testChannelJID, testOwnerJID);
3638
assertEquals(10, result.size());
37-
assertEquals(this.testChannelJID.toBareJID()+"'s title", result.get(Conf.TITLE));
38-
assertEquals(this.testChannelJID.toBareJID()+"'s description", result.get(Conf.DESCRIPTION));
39+
assertEquals(this.testChannelJID.toBareJID() + "'s title",
40+
result.get(Conf.TITLE));
41+
assertEquals(this.testChannelJID.toBareJID() + "'s description",
42+
result.get(Conf.DESCRIPTION));
3943
assertEquals("http://www.w3.org/2005/Atom", result.get(Conf.TYPE));
40-
assertEquals("publishers",result.get(Conf.PUBLISH_MODEL));
41-
assertEquals(AccessModels.open.toString(),result.get(Conf.ACCESS_MODEL));
42-
//ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new Date()),result.get(Conf.CREATION_DATE));
43-
assertEquals(testOwnerJID.toBareJID(),result.get(Conf.OWNER));
44-
assertEquals(Affiliations.member.toString(),result.get(Conf.DEFAULT_AFFILIATION));
45-
assertEquals("1",result.get(Conf.NUM_SUBSCRIBERS));
46-
assertEquals("1",result.get(Conf.NOTIFY_CONFIG));
44+
assertEquals("publishers", result.get(Conf.PUBLISH_MODEL));
45+
assertEquals(AccessModels.open.toString(),
46+
result.get(Conf.ACCESS_MODEL));
47+
// ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new
48+
// Date()),result.get(Conf.CREATION_DATE));
49+
assertEquals(testOwnerJID.toBareJID(), result.get(Conf.OWNER));
50+
assertEquals(Affiliations.member.toString(),
51+
result.get(Conf.DEFAULT_AFFILIATION));
52+
assertEquals("1", result.get(Conf.NUM_SUBSCRIBERS));
53+
assertEquals("1", result.get(Conf.NOTIFY_CONFIG));
4754
}
4855

4956
@Test
5057
public void testGetDefaultPostChannelConf() {
51-
HashMap<String,String> result = Conf.getDefaultPostChannelConf(testChannelJID);
58+
HashMap<String, String> result = Conf
59+
.getDefaultPostChannelConf(testChannelJID);
5260
assertEquals(11, result.size());
53-
assertEquals(this.testChannelJID.toBareJID()+"'s very own buddycloud channel!", result.get(Conf.TITLE));
54-
assertEquals("This channel belongs to " + this.testChannelJID.toBareJID() + ". To nobody else!", result.get(Conf.DESCRIPTION));
61+
assertEquals(this.testChannelJID.toBareJID()
62+
+ "'s very own buddycloud channel!", result.get(Conf.TITLE));
63+
assertEquals(
64+
"This channel belongs to " + this.testChannelJID.toBareJID()
65+
+ ". To nobody else!", result.get(Conf.DESCRIPTION));
5566
assertEquals("http://www.w3.org/2005/Atom", result.get(Conf.TYPE));
56-
assertEquals("publishers",result.get(Conf.PUBLISH_MODEL));
57-
assertEquals(AccessModels.open.toString(),result.get(Conf.ACCESS_MODEL));
58-
//ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new Date()),result.get(Conf.CREATION_DATE));
59-
assertEquals(testChannelJID.toBareJID(),result.get(Conf.OWNER));
60-
assertEquals(Affiliations.member.toString(),result.get(Conf.DEFAULT_AFFILIATION));
61-
assertEquals("1",result.get(Conf.NUM_SUBSCRIBERS));
62-
assertEquals("1",result.get(Conf.NOTIFY_CONFIG));
63-
assertEquals("personal",result.get(Conf.CHANNEL_TYPE));
67+
assertEquals("publishers", result.get(Conf.PUBLISH_MODEL));
68+
assertEquals(AccessModels.open.toString(),
69+
result.get(Conf.ACCESS_MODEL));
70+
// ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new
71+
// Date()),result.get(Conf.CREATION_DATE));
72+
assertEquals(testChannelJID.toBareJID(), result.get(Conf.OWNER));
73+
assertEquals(Affiliations.member.toString(),
74+
result.get(Conf.DEFAULT_AFFILIATION));
75+
assertEquals("1", result.get(Conf.NUM_SUBSCRIBERS));
76+
assertEquals("1", result.get(Conf.NOTIFY_CONFIG));
77+
assertEquals("personal", result.get(Conf.CHANNEL_TYPE));
6478
}
6579

6680
@Test
6781
public void testGetStatusChannelNodename() {
68-
assertEquals("/user/" + this.testChannelJID.toBareJID() + "/status", Conf.getStatusChannelNodename(testChannelJID));
82+
assertEquals("/user/" + this.testChannelJID.toBareJID() + "/status",
83+
Conf.getStatusChannelNodename(testChannelJID));
6984
}
7085

7186
@Test
7287
public void testGetDefaultStatusChannelConf() {
73-
HashMap<String,String> result = Conf.getDefaultStatusChannelConf(testChannelJID);
88+
HashMap<String, String> result = Conf
89+
.getDefaultStatusChannelConf(testChannelJID);
7490
assertEquals(10, result.size());
75-
assertEquals(this.testChannelJID.toBareJID()+"'s very own buddycloud status!", result.get(Conf.TITLE));
76-
assertEquals("This is " + this.testChannelJID.toBareJID() + "'s mood a.k.a status -channel. Depends how geek you are.", result.get(Conf.DESCRIPTION));
91+
assertEquals(this.testChannelJID.toBareJID()
92+
+ "'s very own buddycloud status!", result.get(Conf.TITLE));
93+
assertEquals("This is " + this.testChannelJID.toBareJID()
94+
+ "'s mood a.k.a status -channel. Depends how geek you are.",
95+
result.get(Conf.DESCRIPTION));
7796
assertEquals("http://www.w3.org/2005/Atom", result.get(Conf.TYPE));
78-
assertEquals("publishers",result.get(Conf.PUBLISH_MODEL));
79-
assertEquals(AccessModels.open.toString(),result.get(Conf.ACCESS_MODEL));
80-
//ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new Date()),result.get(Conf.CREATION_DATE));
81-
assertEquals(testChannelJID.toBareJID(),result.get(Conf.OWNER));
82-
assertEquals(Affiliations.member.toString(),result.get(Conf.DEFAULT_AFFILIATION));
83-
assertEquals("1",result.get(Conf.NUM_SUBSCRIBERS));
84-
assertEquals("1",result.get(Conf.NOTIFY_CONFIG));
97+
assertEquals("publishers", result.get(Conf.PUBLISH_MODEL));
98+
assertEquals(AccessModels.open.toString(),
99+
result.get(Conf.ACCESS_MODEL));
100+
// ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new
101+
// Date()),result.get(Conf.CREATION_DATE));
102+
assertEquals(testChannelJID.toBareJID(), result.get(Conf.OWNER));
103+
assertEquals(Affiliations.member.toString(),
104+
result.get(Conf.DEFAULT_AFFILIATION));
105+
assertEquals("1", result.get(Conf.NUM_SUBSCRIBERS));
106+
assertEquals("1", result.get(Conf.NOTIFY_CONFIG));
85107
}
86108

87109
@Test
88110
public void testGetGeoPreviousChannelNodename() {
89-
assertEquals("/user/" + this.testChannelJID.toBareJID() + "/geo/previous", Conf.getGeoPreviousChannelNodename(testChannelJID));
111+
assertEquals("/user/" + this.testChannelJID.toBareJID()
112+
+ "/geo/previous",
113+
Conf.getGeoPreviousChannelNodename(testChannelJID));
90114
}
91115

92116
@Test
93117
public void testGetDefaultGeoPreviousChannelConf() {
94-
HashMap<String,String> result = Conf.getDefaultGeoPreviousChannelConf(testChannelJID);
118+
HashMap<String, String> result = Conf
119+
.getDefaultGeoPreviousChannelConf(testChannelJID);
95120
assertEquals(10, result.size());
96-
assertEquals(this.testChannelJID.toBareJID()+"'s previous location.", result.get(Conf.TITLE));
97-
assertEquals("Where " + this.testChannelJID.toBareJID() + " has been before.", result.get(Conf.DESCRIPTION));
121+
assertEquals(this.testChannelJID.toBareJID() + "'s previous location.",
122+
result.get(Conf.TITLE));
123+
assertEquals("Where " + this.testChannelJID.toBareJID()
124+
+ " has been before.", result.get(Conf.DESCRIPTION));
98125
assertEquals("http://www.w3.org/2005/Atom", result.get(Conf.TYPE));
99-
assertEquals("publishers",result.get(Conf.PUBLISH_MODEL));
100-
assertEquals(AccessModels.open.toString(),result.get(Conf.ACCESS_MODEL));
101-
//ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new Date()),result.get(Conf.CREATION_DATE));
102-
assertEquals(testChannelJID.toBareJID(),result.get(Conf.OWNER));
103-
assertEquals(Affiliations.member.toString(),result.get(Conf.DEFAULT_AFFILIATION));
104-
assertEquals("1",result.get(Conf.NUM_SUBSCRIBERS));
105-
assertEquals("1",result.get(Conf.NOTIFY_CONFIG));
126+
assertEquals("publishers", result.get(Conf.PUBLISH_MODEL));
127+
assertEquals(AccessModels.open.toString(),
128+
result.get(Conf.ACCESS_MODEL));
129+
// ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new
130+
// Date()),result.get(Conf.CREATION_DATE));
131+
assertEquals(testChannelJID.toBareJID(), result.get(Conf.OWNER));
132+
assertEquals(Affiliations.member.toString(),
133+
result.get(Conf.DEFAULT_AFFILIATION));
134+
assertEquals("1", result.get(Conf.NUM_SUBSCRIBERS));
135+
assertEquals("1", result.get(Conf.NOTIFY_CONFIG));
106136
}
107137

108138
@Test
109139
public void testGetGeoCurrentChannelNodename() {
110-
assertEquals("/user/" + this.testChannelJID.toBareJID() + "/geo/current", Conf.getGeoCurrentChannelNodename(testChannelJID));
140+
assertEquals("/user/" + this.testChannelJID.toBareJID()
141+
+ "/geo/current",
142+
Conf.getGeoCurrentChannelNodename(testChannelJID));
111143
}
112144

113145
@Test
114146
public void testGetDefaultGeoCurrentChannelConf() {
115-
HashMap<String,String> result = Conf.getDefaultGeoCurrentChannelConf(testChannelJID);
147+
HashMap<String, String> result = Conf
148+
.getDefaultGeoCurrentChannelConf(testChannelJID);
116149
assertEquals(10, result.size());
117-
assertEquals(this.testChannelJID.toBareJID()+"'s current location.", result.get(Conf.TITLE));
118-
assertEquals("Where " + this.testChannelJID.toBareJID() + " is now.", result.get(Conf.DESCRIPTION));
150+
assertEquals(this.testChannelJID.toBareJID() + "'s current location.",
151+
result.get(Conf.TITLE));
152+
assertEquals("Where " + this.testChannelJID.toBareJID() + " is now.",
153+
result.get(Conf.DESCRIPTION));
119154
assertEquals("http://www.w3.org/2005/Atom", result.get(Conf.TYPE));
120-
assertEquals("publishers",result.get(Conf.PUBLISH_MODEL));
121-
assertEquals(AccessModels.open.toString(),result.get(Conf.ACCESS_MODEL));
122-
//ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new Date()),result.get(Conf.CREATION_DATE));
123-
assertEquals(testChannelJID.toBareJID(),result.get(Conf.OWNER));
124-
assertEquals(Affiliations.member.toString(),result.get(Conf.DEFAULT_AFFILIATION));
125-
assertEquals("1",result.get(Conf.NUM_SUBSCRIBERS));
126-
assertEquals("1",result.get(Conf.NOTIFY_CONFIG));
155+
assertEquals("publishers", result.get(Conf.PUBLISH_MODEL));
156+
assertEquals(AccessModels.open.toString(),
157+
result.get(Conf.ACCESS_MODEL));
158+
// ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new
159+
// Date()),result.get(Conf.CREATION_DATE));
160+
assertEquals(testChannelJID.toBareJID(), result.get(Conf.OWNER));
161+
assertEquals(Affiliations.member.toString(),
162+
result.get(Conf.DEFAULT_AFFILIATION));
163+
assertEquals("1", result.get(Conf.NUM_SUBSCRIBERS));
164+
assertEquals("1", result.get(Conf.NOTIFY_CONFIG));
127165
}
128166

129167
@Test
130168
public void testGetGeoNextChannelNodename() {
131-
assertEquals("/user/" + this.testChannelJID.toBareJID() + "/geo/next", Conf.getGeoNextChannelNodename(testChannelJID));
169+
assertEquals("/user/" + this.testChannelJID.toBareJID() + "/geo/next",
170+
Conf.getGeoNextChannelNodename(testChannelJID));
132171
}
133172

134173
@Test
135174
public void testGetDefaultGeoNextChannelConf() {
136-
HashMap<String,String> result = Conf.getDefaultGeoNextChannelConf(testChannelJID);
175+
HashMap<String, String> result = Conf
176+
.getDefaultGeoNextChannelConf(testChannelJID);
137177
assertEquals(10, result.size());
138-
assertEquals(this.testChannelJID.toBareJID()+"'s next location.", result.get(Conf.TITLE));
139-
assertEquals("Where " + this.testChannelJID.toBareJID() + " is going to go.", result.get(Conf.DESCRIPTION));
178+
assertEquals(this.testChannelJID.toBareJID() + "'s next location.",
179+
result.get(Conf.TITLE));
180+
assertEquals("Where " + this.testChannelJID.toBareJID()
181+
+ " is going to go.", result.get(Conf.DESCRIPTION));
140182
assertEquals("http://www.w3.org/2005/Atom", result.get(Conf.TYPE));
141-
assertEquals("publishers",result.get(Conf.PUBLISH_MODEL));
142-
assertEquals(AccessModels.open.toString(),result.get(Conf.ACCESS_MODEL));
143-
//ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new Date()),result.get(Conf.CREATION_DATE));
144-
assertEquals(testChannelJID.toBareJID(),result.get(Conf.OWNER));
145-
assertEquals(Affiliations.member.toString(),result.get(Conf.DEFAULT_AFFILIATION));
146-
assertEquals("1",result.get(Conf.NUM_SUBSCRIBERS));
147-
assertEquals("1",result.get(Conf.NOTIFY_CONFIG));
183+
assertEquals("publishers", result.get(Conf.PUBLISH_MODEL));
184+
assertEquals(AccessModels.open.toString(),
185+
result.get(Conf.ACCESS_MODEL));
186+
// ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new
187+
// Date()),result.get(Conf.CREATION_DATE));
188+
assertEquals(testChannelJID.toBareJID(), result.get(Conf.OWNER));
189+
assertEquals(Affiliations.member.toString(),
190+
result.get(Conf.DEFAULT_AFFILIATION));
191+
assertEquals("1", result.get(Conf.NUM_SUBSCRIBERS));
192+
assertEquals("1", result.get(Conf.NOTIFY_CONFIG));
148193
}
149194

150195
@Test
151196
public void testGetSubscriptionsChannelNodename() {
152-
assertEquals("/user/" + this.testChannelJID.toBareJID() + "/subscriptions", Conf.getSubscriptionsChannelNodename(testChannelJID));
197+
assertEquals("/user/" + this.testChannelJID.toBareJID()
198+
+ "/subscriptions",
199+
Conf.getSubscriptionsChannelNodename(testChannelJID));
153200
}
154201

155202
@Test
156203
public void testGetDefaultSubscriptionsChannelConf() {
157-
HashMap<String,String> result = Conf.getDefaultSubscriptionsChannelConf(testChannelJID);
204+
HashMap<String, String> result = Conf
205+
.getDefaultSubscriptionsChannelConf(testChannelJID);
158206
assertEquals(10, result.size());
159-
assertEquals(this.testChannelJID.toBareJID()+"'s susbcriptions.", result.get(Conf.TITLE));
160-
assertEquals(this.testChannelJID.toBareJID() + "'s subscriptions. ", result.get(Conf.DESCRIPTION));
207+
assertEquals(this.testChannelJID.toBareJID() + "'s susbcriptions.",
208+
result.get(Conf.TITLE));
209+
assertEquals(this.testChannelJID.toBareJID() + "'s subscriptions. ",
210+
result.get(Conf.DESCRIPTION));
161211
assertEquals("http://www.w3.org/2005/Atom", result.get(Conf.TYPE));
162-
assertEquals("publishers",result.get(Conf.PUBLISH_MODEL));
163-
assertEquals(AccessModels.open.toString(),result.get(Conf.ACCESS_MODEL));
164-
//ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new Date()),result.get(Conf.CREATION_DATE));
165-
assertEquals(testChannelJID.toBareJID(),result.get(Conf.OWNER));
166-
assertEquals(Affiliations.member.toString(),result.get(Conf.DEFAULT_AFFILIATION));
167-
assertEquals("1",result.get(Conf.NUM_SUBSCRIBERS));
168-
assertEquals("1",result.get(Conf.NOTIFY_CONFIG));
212+
assertEquals("publishers", result.get(Conf.PUBLISH_MODEL));
213+
assertEquals(AccessModels.open.toString(),
214+
result.get(Conf.ACCESS_MODEL));
215+
// ToDo: Find a way to test the Date: assertEquals(Conf.formatDate(new
216+
// Date()),result.get(Conf.CREATION_DATE));
217+
assertEquals(testChannelJID.toBareJID(), result.get(Conf.OWNER));
218+
assertEquals(Affiliations.member.toString(),
219+
result.get(Conf.DEFAULT_AFFILIATION));
220+
assertEquals("1", result.get(Conf.NUM_SUBSCRIBERS));
221+
assertEquals("1", result.get(Conf.NOTIFY_CONFIG));
169222
}
170223
}

0 commit comments

Comments
 (0)