Skip to content

Commit 2e91cbe

Browse files
author
Daan Hoogland
committed
rats
1 parent cc27a74 commit 2e91cbe

8 files changed

Lines changed: 99 additions & 14 deletions

File tree

usage/test/com/cloud/usage/UsageSanityCheckerIT.java

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,37 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
117
package com.cloud.usage;
218

19+
import static org.junit.Assert.assertEquals;
20+
21+
import java.io.FileNotFoundException;
22+
import java.sql.Connection;
23+
import java.sql.DriverManager;
24+
import java.sql.SQLException;
25+
import java.util.Arrays;
26+
import java.util.Collection;
27+
import java.util.Properties;
28+
329
import org.dbunit.DatabaseUnitException;
430
import org.dbunit.dataset.DataSetException;
531
import org.dbunit.dataset.IDataSet;
632
import org.dbunit.dataset.xml.FlatXmlDataSetBuilder;
733
import org.dbunit.ext.mysql.MySqlConnection;
834
import org.dbunit.operation.DatabaseOperation;
9-
10-
import static org.junit.Assert.assertEquals;
11-
1235
import org.junit.After;
1336
import org.junit.Before;
1437
import org.junit.Test;
@@ -19,14 +42,6 @@
1942

2043
import com.cloud.utils.PropertiesUtil;
2144

22-
import java.io.FileNotFoundException;
23-
import java.sql.Connection;
24-
import java.sql.DriverManager;
25-
import java.sql.SQLException;
26-
import java.util.Arrays;
27-
import java.util.Collection;
28-
import java.util.Properties;
29-
3045
@RunWith(Parameterized.class)
3146
public class UsageSanityCheckerIT{
3247

usage/test/com/cloud/usage/UsageSanityCheckerTest.java

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
117
package com.cloud.usage;
218

3-
import org.junit.Test;
4-
import org.mockito.Mockito;
5-
619
import java.sql.Connection;
720
import java.sql.PreparedStatement;
821
import java.sql.ResultSet;
@@ -12,6 +25,9 @@
1225

1326
import junit.framework.TestCase;
1427

28+
import org.junit.Test;
29+
import org.mockito.Mockito;
30+
1531
public class UsageSanityCheckerTest extends TestCase {
1632

1733
@Test

usage/test/resources/cloud1.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
2+
license agreements. See the NOTICE file distributed with this work for additional
3+
information regarding copyright ownership. The ASF licenses this file to you under
4+
the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
Unless required by applicable law or agreed to in writing, software distributed under
7+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
8+
OF ANY KIND, either express or implied. See the License for the specific language
9+
governing permissions and limitations under the License. -->
110
<!-- cloud -->
211
<dataset>
312
<configuration name="usage.stats.job.aggregation.range" value="600"/>

usage/test/resources/cloud2.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
2+
license agreements. See the NOTICE file distributed with this work for additional
3+
information regarding copyright ownership. The ASF licenses this file to you under
4+
the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
Unless required by applicable law or agreed to in writing, software distributed under
7+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
8+
OF ANY KIND, either express or implied. See the License for the specific language
9+
governing permissions and limitations under the License. -->
110
<!-- cloud -->
211
<dataset>
312
<configuration name="usage.stats.job.aggregation.range" value="600"/>

usage/test/resources/cloud3.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
2+
license agreements. See the NOTICE file distributed with this work for additional
3+
information regarding copyright ownership. The ASF licenses this file to you under
4+
the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
Unless required by applicable law or agreed to in writing, software distributed under
7+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
8+
OF ANY KIND, either express or implied. See the License for the specific language
9+
governing permissions and limitations under the License. -->
110
<!-- cloud -->
211
<dataset>
312
<volumes id="17" removed="0"/>

usage/test/resources/cloud_usage1.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
2+
license agreements. See the NOTICE file distributed with this work for additional
3+
information regarding copyright ownership. The ASF licenses this file to you under
4+
the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
Unless required by applicable law or agreed to in writing, software distributed under
7+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
8+
OF ANY KIND, either express or implied. See the License for the specific language
9+
governing permissions and limitations under the License. -->
110
<!-- cloud_usage -->
211
<dataset>
312
<cloud_usage usage_type="1" raw_usage="11" usage_id="8" id="8" start_date="1" zone_id="1"/>

usage/test/resources/cloud_usage2.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
2+
license agreements. See the NOTICE file distributed with this work for additional
3+
information regarding copyright ownership. The ASF licenses this file to you under
4+
the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
Unless required by applicable law or agreed to in writing, software distributed under
7+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
8+
OF ANY KIND, either express or implied. See the License for the specific language
9+
governing permissions and limitations under the License. -->
110
<!-- cloud_usage -->
211
<dataset>
312
<cloud_usage usage_type="1" raw_usage="11" usage_id="8" id="8" start_date="1" zone_id="1"/>

usage/test/resources/cloud_usage3.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
2+
license agreements. See the NOTICE file distributed with this work for additional
3+
information regarding copyright ownership. The ASF licenses this file to you under
4+
the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
Unless required by applicable law or agreed to in writing, software distributed under
7+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
8+
OF ANY KIND, either express or implied. See the License for the specific language
9+
governing permissions and limitations under the License. -->
110
<!-- cloud_usage -->
211
<dataset>
312
<cloud_usage usage_type="1" raw_usage="11" usage_id="8" id="8" start_date="1" zone_id="1"/>

0 commit comments

Comments
 (0)